socratic-loader

Extract textbook pages, transcripts, and related problems for Socratic study sessions.

Updated Jun 15, 2026
One-click install
npx skills add https://github.com/kmjy98-sketch/khulaw --skill socratic-loader-kmjy98-sketch
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: socratic-loader
Source: https://github.com/kmjy98-sketch/khulaw/tree/main/.agent/skills/socratic-loader
Command: npx skills add https://github.com/kmjy98-sketch/khulaw --skill socratic-loader-kmjy98-sketch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pypdf, and includes scripts (resource) components.

What problem does it solve? Preparing a Socratic law study session requires manually locating the right textbook pages, parsing lecture transcripts for page references, and finding related practice problems. This Skill automates that preparation by parsing transcripts, extracting and caching textbook PDF text, and searching a problem index and RAG store. ## Core Features & Use Cases - Transcript Page Parsing: Extracts (페이지 X) page references from lecture transcripts to determine the study page range. - Textbook PDF Extraction with Caching: Pulls the relevant page range from textbook PDFs using pypdf and caches results as Markdown for reuse. - Problem and RAG Search: Queries a problem index JSON and qmd-based BM25/vector search to surface related multiple-choice and case-type exam questions. - Batch Extraction: Chunks entire textbook PDFs into 30-page segments with legal keyword extraction (statutes, case citations) and builds a chunks index for RAG. - Use Case: A law student starts a study session on 동시이행항변권; the loader parses the transcript, extracts textbook pages 120-145, and returns all related practice problems for the session. ## Quick Start Run the socratic loader script with a transcript file, a textbook PDF path, and a cache directory to prepare my study session.

Frequently Asked Questions about socratic-loader

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I extract specific pages from a textbook PDF in Python?▼

Use pypdf's PdfReader to iterate over the desired page range and call extract_text on each page. The socratic_loader script wraps this with caching so repeated extractions of the same page range return the cached Markdown file instead of re-parsing the PDF.

How to parse page references from lecture transcripts?▼

The loader uses a regular expression matching headings like '## N. Title (페이지 X)' to extract section titles and page numbers. It then computes the minimum and maximum page numbers to define the extraction range for the textbook.

Does the script support vector search for study materials?▼

Yes, it integrates qmd-based search supporting BM25 and vector modes through a qmd_search helper module. The --rag flag enables retrieval of relevant textbook chunks and past exam questions based on transcript section keywords.

What dependencies are required to run the PDF extraction scripts?▼

The scripts require pypdf, which is auto-installed via pip if missing. RAG search additionally depends on a local qmd_search helper module in the .agent/lib directory, and batch extraction can delegate to a pdf-ingest ingest module if present.

Why does PDF text extraction return empty or incomplete text?▼

pypdf cannot extract text from scanned image-based PDFs without an OCR layer. Extraction may also produce fragmented output for complex layouts or tables, which the batch script partially addresses by delegating to an ingest module with table detection when available.