by dobachi
Guardrails and a minimal working loop for co-writing a LONG document with an AI — tens of thousands of characters to book length, including academic long-form. Long documents fail by drifting rather than by being written badly, so this skill targets the three measured decay axes (long input, long output, long session) with rules that hold across whatever other skill is running: never single-pass the whole document, carry a spine file (purpose, outline, glossary, style contract, claims) outside the context window, write sections sequentially with the previous section's tail loaded, repair the seams that decomposition provably creates, keep the outline revisable, and gate on a deterministic scan plus a specific human review list rather than AI self-scoring. Every rule traces to a cited finding in references/failure-modes.md, including the disagreements. Ships a stdlib-only drift_scan.py that reads the spine and enforces it, now including an INTENT ledger — the exit condition written before the work, so a silent change of aim becomes visible instead of being noticed three sections later — and CONTENT checks that ask whether the draft does what the spine said it would (claim coverage, unverified claims, terms used before their definition, unsourced assertions), plus references/content-review.md — the per-section procedure that produces the human review list for what needs meaning. Surface checks: declared style-contract and glossary violations, cross-section contradiction of typed facts (numbers, dates, versions, 可否) plus a ledger-driven candidate list that narrows what a human must read side by side, 文体 mixing, over-long sentences, notation drift, cross-section duplication, and section-length collapse — with exit codes suitable as a loop's stop condition, plus an optional SudachiPy backend that lifts terminology-drift recall from 0/8 to 6/8 on unlisted variants. Bilingual JA/EN, with Japanese long-form rules sourced from 文化審議会建議「公用文作成の考え方」and the JTF style guide.
Claude Code1 Skill