Handbooks
Reference

Prompt catalogue

Every prompt the toolchain sends, what it asks for, and how each one degrades when the reply is unusable.

Every LLM touchpoint in the toolchain. All JSON-producing calls run at temperature 0 (dropped automatically for reasoning-style models). Chinese narration (--narrate-lang zh) keeps JSON keys, enum values, ids and file paths in English; only prose values change.

#Prompt (module)PhasePurposeOutput contract
1brief card rules (pipeline/cards.ts)2a1–2 sentence plain-language purpose + role enum + lifecycle hint per batched file{"purposes":[{file,purpose,role,lifecycle}]}
2deep card rules (pipeline/cards.ts)2afull-file walkthrough (120–300 words) + per-function purpose / data_flow / relations keyed by exact qualname; graph facts declared authoritativeadds description, functions[]
3chunk fallback (pipeline/cards.ts)2asame deep rules over one function-chunk of an oversized fileone purposes entry covering the chunk
4skeleton synthesis (pipeline/skeleton.ts)2bordered narrative spine from directory rollups + entry points; lifecycle order mandated; crosscuts after main flow{"metadata":{archetype},"stages":[{id,title,description,parent,crosscut}]}
5file assignment (pipeline/assign.ts)2bone primary stage per file from a fixed menu; also 0–2; unassigned escape for vendored/dead code{"assignments":[{file,stage,also}]}
6doctor actor (pipeline/doctor.ts)2b≤3 structural changes (add_stage / remove_stage / merge_stages / split_stage), prioritized: unassigned → overload → starvation → dead{"changes":[…],"rationale"}
7critic roles (llm/critic.ts)2brole-played review (engineer / architect / reader / editor) of a proposal against ground-truth evidence; APPROVE generously, REJECT only when unfixable{"decision","concerns","suggested_revision","rationale"}
8revise prompt (llm/critic.ts)2bactor revision addressing aggregated [role] concern bulletssame schema as the original proposal
9stage organization (pipeline/organize.ts)2c2–8 ordered sub-groups per stage; every file exactly once; narrative order respecting call hints{"groups":[{title,summary,files}]}
10member classification (pipeline/member.ts)2b (member)assign individual functions/methods to the user-authored stages{"assignments":[{member,stage}]}
11stage rollup (pipeline/narrate.ts)3100–200-word non-expert stage overview from child overviews + file one-linersplain prose only (no JSON, no headers)
12system rollup (pipeline/narrate.ts)3200–350-word system overview threading the top-level stagesplain prose only
13register extraction (pipeline/narrate.ts)3 round 1cross-stage state registers (id + one-line semantics + touched stages) from stage overviews + data_model cards{"registers":[{id,semantics,stages}]}
14register gap pass (pipeline/narrate.ts)3 rounds 2+ONLY the missing registers given the found list; empty array when dry (loop stops after 2 dry rounds)same schema, new entries only
15planner system prompt (planner/prompt.ts)planroute with the handbook → read real source → emit byte-exact EDIT blocks + declarations JSON; executor-trusts-blindly rules (uniqueness, no overlap, smallest span)markdown plan ending in one {"will_modify","will_add","will_remove"} block
16planner tool protocol (planner/prompt.ts)planone JSON action per turn: list_dir / read_file / grep / finish{"tool": …} action block
17resync evolution label (studio/server.ts)studio resyncone ≤40-char sentence naming WHICH capabilities/modules a change touched, from touched-file purposes; guessing intent is forbidden (studio's resync has no diff); falls back to a deterministic file list without a clientplain prose, one line (rendered dimmed + tagged auto)

Design rules the prompts share

  • Facts are injected, never asked for. Function inventories, line ranges and call relations come from the graph and are marked as ground truth; the model writes prose around them and is told not to re-list them.
  • Menus are closed. Assignment and classification prompts enumerate valid stage ids and instruct "never invent"; anything outside the menu is coerced to unassigned on parse, so prompt drift cannot corrupt artifacts.
  • Every JSON contract has a mechanical validator on the consuming side (zod or hand-rolled checks); dropped/malformed entries are backfilled deterministically and counted in coverage artifacts rather than silently patched.
  • Output-only-JSON / output-only-prose endings keep parsing unambiguous; the JSON extractor tolerates fenced blocks and balanced-brace scans but prompts still ask for a single fenced block.
  • Critic prompts push back against rubber-stamping in both directions: approve correct-enough proposals (no vacuous REVISE — those are normalized to APPROVE), but a broken critic call counts as REJECT so infrastructure failures never approve changes.

On this page