| name | book-to-methodology-skill |
| description | Turn a book in your bookfinder-general library into a reusable skill: a study-skill (frameworks, glossary, on-demand chapters) for any book, or a methodology-skill (a runnable calculator grounded in the book's own numbers) for books with a quantitative model. Use when you want to operationalize a book โ not just summarize it โ e.g. turn a logistics or formation treatise into an advisor that computes. |
| allowed-tools | ["Read","Grep","Write","Bash"] |
| argument-hint | <book_id from your library> [skill-name-slug] |
Book โ Methodology Skill
Convert a bookfinder-general library book into a skill. Two tiers:
- Study-skill (any clean book) โ frameworks, glossary, on-demand chapter index. Extract structure, not summaries.
- Methodology-skill (books with a quantitative model) โ everything above plus a calculator (
scripts/advise.py) that carries out the book's method, with every constant provenance-tagged and a selftest that reproduces the book's own worked numbers.
This composes with bookfinder-general: it runs on a library book's content.md. The two skills under ../examples/ (macedonian-logistics-advisor, macedonian-phalanx-advisor) are the canonical templates โ read them before generating.
Step 0 โ Locate and health-check the source
Resolve the book's content.md (from the MCP tool prepare_book_for_skill(book_id), or <LIBRARY_DIR>/<book_id>/content.md). Then always run the health probe:
python3 scripts/extract_health.py "<content.md path>"
rubble โ STOP. It's a scanned-image PDF; tables/formulas didn't survive. Re-acquire as EPUB (bookfinder-general sorts EPUB-first) or re-extract with OCR, then retry. Do not build a calculator from rubble โ this is the one failure mode that produces confident-but-fake numbers.
degraded โ reference skill OK; build a calculator only from prose-verifiable figures.
clean โ proceed to a full methodology-skill.
Step 1 โ Choose the tier
Methodology-skill if the book contains a quantitative model: rates, formulas, coefficient tables, unit hierarchies, geometry โ anything that maps inputs to a computed output (a logistics range, a combat value, a formation frontage). Otherwise a study-skill.
Step 2 โ Mine the book (parallel)
Read the actual text (grep/offset, don't dump a 100k-token file). Produce three things:
- The model โ
data/<model>.json โ every constant the calculator needs, each as a provenance-tagged cell:
book-stated โ a figure the author adopts.
book-derived โ a figure the author calculates/concludes.
external-sourced โ a number you had to bring from elsewhere (cite it).
missing โ needed but not recoverable.
Include a validation block: the book's own worked numbers the selftest will reproduce.
- The frameworks โ
reference/constraints.md โ the load-bearing principles, framed "the limit is X because Y", each with mechanism + a cited quantitative anchor. Designer-usable, not a book report.
- The structure โ
reference/chapters.md (chapter index) + glossary.md (terms). Note if the EPUB scrambled chapter order.
Step 3 โ Write the calculator (methodology-skill only)
scripts/advise.py (stdlib only) that reads data/<model>.json and exposes:
- compute subcommands (the book's method applied to user inputs);
- a
feasibility pass that surfaces the book's hard limits as warnings/blockers;
- a
selftest that reproduces at least one of the book's own worked figures within tolerance.
Hard rules โ these are what keep it honest:
- Never hardcode a coefficient. Every number comes from
data/<model>.json with its provenance.
- Never invent a number. If a cell is
missing, the calculator refuses; if external-sourced, it says so.
- The selftest is the ship gate. If it can't reproduce a book figure, the calculator does not ship โ fall back to a reference skill.
Step 4 โ Write the wrapper files
SKILL.md (front-loaded: frontmatter, how-to-use, the procedure, core principles, index), cheatsheet.md (at-a-glance tables), PROVENANCE.md (book-faithful vs external vs missing; what didn't extract). Match the structure of the two examples exactly โ that shared structure is the point.
Step 5 โ Validate and report
python3 scripts/advise.py selftest
Report what was built, the selftest result, and any external-sourced/missing cells the user should know about.
Quality rules
- Extraction quality decides feasibility. EPUB โ real text โ real calculator. Scanned PDF โ rubble โ reference skill at best. The health probe is not optional.
- Provenance over completeness. A small calculator with every cell cited beats a big one with invented numbers.
- Validate against the source. "Reproduces the book's own worked example" is the difference between a methodology-skill and a plausible fake.
- Two tiers, one structure. Study and methodology skills share the same file layout (
SKILL.md ยท data/ ยท scripts/ ยท reference/ ยท glossary.md ยท cheatsheet.md ยท PROVENANCE.md). Reuse it.