textbook-problem-intake

Scans textbook PDF extracts for embedded case and multiple-choice problems and registers them into a problem index.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Law study materials often hide practice problems inside textbook extracts, making them hard to find and reuse. This Skill scans textbook extract chunks for case-type and multiple-choice problem signals, builds a candidate manifest with scan logs, and optionally registers confirmed problems into a structured problem_index.json database. ## Core Features & Use Cases - Embedded Problem Scanning: Detects case-type and multiple-choice problem signals in textbook extract chunks and writes a candidate manifest plus scan log. - Dry-Run Registration: Reviews registration targets, unmapped topics, and duplicates before any database write, leaving unmapped items as pending_topic_mapping instead of guessing. - End-to-End Pipeline: Chains PDF extraction, scanning, and registration into one command with a step-by-step pipeline log. - Use Case: After adding a new civil law textbook PDF, run the intake pipeline to extract the text, scan for embedded problems, review the dry-run registration log, and then apply the confirmed problems to the problem index for downstream answer review. ## Quick Start Run the textbook intake script with your subject name and --skip-extract to scan existing extracts and produce a candidate manifest and dry-run registration log.

Frequently Asked Questions about textbook-problem-intake

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

FAQPage Schema
How do I scan textbook extracts for embedded practice problems?▼

Run the run_textbook_intake.py script with --subject and --skip-extract to scan existing extract chunks. It produces a candidate manifest and scan log containing detected case-type and multiple-choice problems with source PDF and page hints.

How do I register scanned textbook problems into a problem index database?▼

Registration runs as a dry-run by default, writing only a register log for review. Add the --apply flag to actually extend problem_index.json under the subject and topic problems.textbook entries.

Can I process a new textbook PDF from scratch in one command?▼

Yes, pass --pdf-dir pointing to the textbook PDF folder without --skip-extract. The pipeline runs PDF extraction first, then scanning, then a registration dry-run, logging each step to a pipeline log file.

What happens when a scanned problem cannot be mapped to a topic?▼

Unmapped candidates are marked as pending_topic_mapping instead of being guessed into the index. They remain in the candidate manifest until topic alignment data allows proper registration.

Does the intake pipeline modify my problem database without confirmation?▼

No, the default mode only performs a dry-run registration that updates log files. The problem_index.json file is modified only when you explicitly pass the --apply flag.