Repository navigation
feat(take-notes): user-defined genres, and a router generated from them - #13
Merged
Merged
Conversation
A genre was three things kept in step by hand: a contract file, a row in SKILL.md's Step 3 table, and a label in gallery.py's UI dict — and the offprint's contract was not even a file, it was a section of SKILL.md. That made "add your own genre" impossible without editing the skill. Now a genre is one Markdown file with a flat front-matter block (layout, label-en, label-es, when) followed by the contract. genres.py scans the bundled three plus ~/take-notes/genres/, validates them, and prints Step 3's table from the `when:` lines in precedence order — user genres first, then recipe, fieldguide, offprint as the catch-all. A genre without `when` is on request only; a user file named like a bundled genre replaces it. The layouts stay a closed set of three: a user genre picks one and brings its sections, which is where the value is. The offprint's contract moves to genres/offprint.md in the same shape, so SKILL.md loses 52 lines per note and the three are defined identically. Every template now records data-genre, the offprint's two included, so a user genre on that layout reads back as itself; notes.py accepts slug names. check-drift.py refuses a router row written back into SKILL.md by hand. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Every contract opened with Executive summary and The one takeaway and closed with optional Concepts and Going deeper — three copies of the same four sections, in prose, free to drift; the recipe's had already drifted to a differently-named Description. The spine now lives in SKILL.md Step 4, a contract lists only its own sections and says what its genre puts in the spine's, and check-drift refuses a contract that writes one of those headings out again. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Progressive disclosure, applied by one rule: what fewer than half the invocations use leaves the file that every invocation loads. Settings management (--tags, --theme, --retag: 65 lines, a few percent of runs) moves to references/settings.md behind an eight-line dispatch. Everything about combining several URLs into one note — spread over Steps 1, 3 and 5 — moves to references/combining.md, read once when there is more than one URL. The Related section, cross-references to other skills, is gone. 434 → 327 lines per note; a normal note reads nothing it did not read before. check-drift now scopes its acquisition-guide checks to the guides Step 1's table routes to, and instead requires every file under references/ to be reachable from somewhere in SKILL.md. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Writing a real recipe note showed the study-note sections do not fit: a recipe has no single takeaway, no glossary, and "going deeper" is really the list of things the source never measured. The recipe contract now has Description, Card, Ingredients, Steps, Tips, and optional Gallery and Gaps. The card gets a fixed core on every recipe so they compare across the archive — Category from a closed list, Yield in the source's own words, Active time, Total time, Setup — plus a few fields per category, like Proof for bread. Missing values are written as missing; difficulty and unit conversions are no longer inferred. The shared spine this branch introduced assumed every genre was an offprint. It shrinks to the one rule the gallery depends on — the body opens with a paragraph — and the offprint and field guide declare their own summary, takeaway, concepts and going deeper again. check-drift's spine check goes with it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR: A genre is now one Markdown file with front-matter; users add their own under
~/take-notes/genres/, and Step 3's router table is generated from the installed set instead of written by hand.scripts/genres.py(stdlib,--selftest): scans bundled + user genres, validates front-matter (layout,label-en,label-es,when), prints the router table in precedence order — user genres first,recipe,fieldguide,offprintlast as the catch-all.when:is on request only (--genre <name>); a user file named like a bundled genre replaces it.render.pyresolves--genreby layout and records the genre's name on<html data-genre>— the two offprint templates now carry it too.genres/offprint.md: the offprint's contract moves out ofSKILL.md(−52 lines per note) into the same shape as the other two.gallery.pytakes card labels from the contracts; a note whose contract is gone shows its bare name.check-drift.pyrefuses a hand-written router row inSKILL.md; CI runsgenres --selftest.SKILL.mdStep 4; each contract keeps only its own sections and says what its genre puts in the spine's.check-drift.pyrefuses a contract that re-declares one. The recipe's differently-named Description becomes the summary.SKILL.md434 → 327 lines per note. Settings management →references/settings.md; combining several URLs (was spread over Steps 1, 3, 5) →references/combining.md; Related dropped. Each reference is read only when its case arises.check-drift.pynow requires everyreferences/*.mdto be reachable fromSKILL.md.Verified: 10 selftests + check-drift green; end-to-end with a temp
~/take-notes/genres/meeting.md— routed first, rendered on the offprint layout withdata-genre="meeting", card labelled reunión,genre: meetingin the Markdown export;--genre noperejected. An offprint render diffs againstmainonly in the addeddata-genre="offprint"attribute; the 12 real notes on disk still parse.🤖 Generated with Claude Code