Book to Skill
Extracts a long document into chapter references, a glossary skeleton, and a minimal SKILL.md. The output is a draft. A human writes the procedure and passes the quality gates.
Procedure
What ships
skills/optional/book-to-skill/scripts/book_to_skill.py.
PDF input requires pypdf (pip install pypdf). Markdown, text, and URLs use the standard library. URL input fetches the document once.
Usage
python skills/optional/book-to-skill/scripts/book_to_skill.py \
--input=book.pdf --skill-name=my-book --output-dir=plans/skills/drafts/my-book
python skills/optional/book-to-skill/scripts/book_to_skill.py \
--input=chapter.md --output-dir=plans/skills/drafts/my-chapter
There is no extract subcommand: pass the flags directly. Drafts belong under the gitignored plans/skills/drafts/ tree. The script does not enforce the destination, so choose it deliberately; never point it at skills/.
What it actually produces
- Up to 30 sections, split on Markdown H1/H2 headings or PDF page headings
references/ch-NN-<slug>.mdfor each sectionassets/glossary.jsonwith bolded capitalized terms (definitions empty)assets/summary.jsonwith section and term counts- A minimal
SKILL.mdcontaining an outline, key concepts, and reference links
It does not generate 3-7 instructions per chapter, does not validate the draft, and does not add license, author, status, or source metadata.
Human completion pass
- Add frontmatter:
license,author,status: draft,source: local. - State one trigger sentence, then a procedure with verifiable steps.
- Add at least two anti-patterns and at least two verification checks.
- Run
./.venv/Scripts/python.exe scripts/foundry-eval.py --target <draft>/SKILL.md. - Promote only after the evaluator passes and a human reviews the draft.
Anti-patterns
- Copying chapter text verbatim instead of distilling procedures.
- Shipping the generated shell as a finished skill.
- Converting copyrighted material without checking the license.
- Placing drafts in
skills/, where discovery and packaging will pick them up.
Verification Checklist
- [ ] Every reference chapter is present and non-empty.
- [ ] The glossary is reviewed and definitions are filled in or removed.
- [ ] The draft has a single trigger, procedure, anti-patterns, and checks.
- [ ]
foundry-evalpasses before the draft leavesplans/.