geneseed 3.8.0 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. package/CHANGELOG.md +71 -1
  2. package/DESIGN.md +13 -10
  3. package/QUICKSTART.md +1 -1
  4. package/README.md +31 -32
  5. package/SETUP.md +7 -42
  6. package/SHIPPED.md +4 -4
  7. package/adapters/bob/README.md +17 -1
  8. package/adapters/openclaude/README.md +1 -1
  9. package/adapters/opencode/GLOBAL-HARNESS-SPEC.md +1 -1
  10. package/adapters/opencode/README.md +3 -3
  11. package/adapters/opencode/plugins/geneseed-context.js +78 -8
  12. package/adapters/opencode/plugins/geneseed-guard.js +9 -9
  13. package/adapters/opencode/plugins/geneseed-workflow.js +1 -1
  14. package/adapters/opencode/workflows/_runtime.js +2 -2
  15. package/adapters/opencode/workflows/dispatch.js +1 -1
  16. package/bin/geneseed-hook.mjs +1 -1
  17. package/docs/candidate-hosts.md +12 -5
  18. package/docs/extending.md +72 -40
  19. package/docs/token-footprint.md +26 -21
  20. package/docs/web/claude-hooks.md +1 -1
  21. package/docs/web/collaboration.md +1 -1
  22. package/docs/web/exclusions.md +0 -1
  23. package/docs/web/footprint.md +1 -1
  24. package/docs/web/harnesses.md +14 -14
  25. package/docs/web/install-quick.md +1 -1
  26. package/docs/web/plugin-guard.md +2 -2
  27. package/docs/web/rules.md +1 -1
  28. package/docs/web/themes-author.md +2 -2
  29. package/docs/web-ui.md +2 -2
  30. package/harness.config.json +1 -1
  31. package/js/README.md +8 -7
  32. package/js/build/driver.mjs +26 -95
  33. package/js/build/emit-claude.mjs +76 -81
  34. package/js/build/generate.mjs +0 -1
  35. package/js/build/render.mjs +10 -3
  36. package/js/build/source.mjs +105 -1
  37. package/js/build/stubs.mjs +25 -4
  38. package/js/cli-table.json +8 -8
  39. package/js/hosts/hooks.mjs +91 -59
  40. package/js/hosts/hosts.mjs +5 -21
  41. package/js/hosts/installs.mjs +4 -6
  42. package/js/hosts/mcp.mjs +3 -13
  43. package/js/hosts/native.mjs +28 -51
  44. package/js/hosts/opencode.mjs +1 -1
  45. package/js/hosts/settings.mjs +4 -78
  46. package/js/inspect/checks-authoring.mjs +153 -117
  47. package/js/inspect/checks-repo.mjs +45 -1
  48. package/js/inspect/diff.mjs +11 -3
  49. package/js/inspect/doctor.mjs +3 -3
  50. package/js/inspect/excludes.mjs +0 -4
  51. package/js/inspect/inventory.mjs +1 -2
  52. package/js/inspect/status.mjs +4 -4
  53. package/js/maintain/migrate.mjs +5 -5
  54. package/js/maintain/setup.mjs +3 -5
  55. package/js/maintain/uninstall.mjs +8 -42
  56. package/js/ui/tui.mjs +1 -1
  57. package/js/web/actions.mjs +4 -5
  58. package/js/web/api.mjs +10 -5
  59. package/package.json +1 -2
  60. package/registry.json +7 -0
  61. package/src/AGENT.md.tmpl +86 -65
  62. package/src/agents/_template.md +3 -3
  63. package/src/agents/advocate.md +3 -3
  64. package/src/agents/architect.md +3 -3
  65. package/src/agents/developer.md +4 -4
  66. package/src/agents/docs.md +3 -3
  67. package/src/agents/empiricist.md +4 -4
  68. package/src/agents/explorer.md +4 -4
  69. package/src/agents/framer.md +3 -3
  70. package/src/agents/historian.md +3 -3
  71. package/src/agents/operator.md +3 -3
  72. package/src/agents/pragmatist.md +3 -3
  73. package/src/agents/researcher.md +7 -7
  74. package/src/agents/reviewer.md +3 -3
  75. package/src/agents/security.md +3 -3
  76. package/src/agents/skeptic.md +3 -3
  77. package/src/agents/steward.md +3 -3
  78. package/src/agents/tester.md +3 -3
  79. package/src/agents/user-advocate.md +3 -3
  80. package/src/agents/visionary.md +3 -3
  81. package/src/doctrines/README.md +4 -3
  82. package/src/doctrines/comms.md +4 -4
  83. package/src/doctrines/craft.md +20 -20
  84. package/src/doctrines/ops.md +19 -19
  85. package/src/doctrines/process.md +20 -20
  86. package/src/doctrines/rigor.md +22 -22
  87. package/src/laws/universal.md +26 -44
  88. package/src/memory/README.md +3 -3
  89. package/src/modes/foreman.md +1 -1
  90. package/src/notebook/README.md +1 -1
  91. package/src/ontology/universal.md +8 -10
  92. package/src/postures/artisan.md +2 -2
  93. package/src/skills/_self-improvement.md +4 -4
  94. package/src/skills/_template.md +1 -1
  95. package/src/skills/brainstorm.md +3 -3
  96. package/src/skills/bruno-collection-generator.md +6 -6
  97. package/src/skills/bruno-test-writer.md +5 -5
  98. package/src/skills/ci-fix.md +4 -4
  99. package/src/skills/commit.md +11 -10
  100. package/src/skills/consolidate-memory.md +4 -4
  101. package/src/skills/council.md +2 -2
  102. package/src/skills/daydream/SKILL.md +10 -3
  103. package/src/skills/daydream/VENDOR.md +10 -2
  104. package/src/skills/daydream/instructions.md +2 -2
  105. package/src/skills/debug.md +4 -4
  106. package/src/skills/deps-audit.md +3 -3
  107. package/src/skills/develop.md +7 -7
  108. package/src/skills/document-project.md +6 -6
  109. package/src/skills/explain-changes/SKILL.md +69 -0
  110. package/src/skills/explain-changes/VENDOR.md +20 -0
  111. package/src/skills/explain-changes/scripts/render_changes.mjs +558 -0
  112. package/src/skills/forge-mcp.md +4 -4
  113. package/src/skills/fresh-eyes.md +4 -4
  114. package/src/skills/frontend-design.md +1 -1
  115. package/src/skills/geneseed.md +4 -4
  116. package/src/skills/git-archaeology.md +5 -5
  117. package/src/skills/git-rescue.md +7 -7
  118. package/src/skills/handoff.md +3 -3
  119. package/src/skills/ingest.md +5 -5
  120. package/src/skills/migrate.md +8 -8
  121. package/src/skills/parallel-agents.md +2 -2
  122. package/src/skills/pipeline.md +2 -2
  123. package/src/skills/plan.md +3 -3
  124. package/src/skills/ponytail.md +2 -2
  125. package/src/skills/profile.md +2 -2
  126. package/src/skills/prose.md +1 -1
  127. package/src/skills/prototype.md +1 -1
  128. package/src/skills/react-view-transitions/SKILL.md +1 -1
  129. package/src/skills/react-view-transitions/VENDOR.md +7 -2
  130. package/src/skills/refactor.md +3 -3
  131. package/src/skills/release.md +5 -5
  132. package/src/skills/repo-map.md +4 -4
  133. package/src/skills/research.md +9 -9
  134. package/src/skills/review-response.md +4 -4
  135. package/src/skills/rule.md +3 -3
  136. package/src/skills/security-audit.md +5 -5
  137. package/src/skills/ship.md +5 -5
  138. package/src/skills/skill-forge.md +4 -4
  139. package/src/skills/token-report/SKILL.md +2 -3
  140. package/src/skills/token-report/VENDOR.md +2 -3
  141. package/src/skills/token-report/scripts/token_report.mjs +7 -121
  142. package/src/skills/wiki.md +5 -5
  143. package/src/skills/workflow.md +3 -4
  144. package/src/skills/worktree.md +4 -4
  145. package/themes/_TEMPLATE.json +37 -39
  146. package/themes/biker.json +37 -39
  147. package/themes/commentator.json +37 -39
  148. package/themes/cyberpunk.json +37 -39
  149. package/themes/gamer.json +37 -39
  150. package/themes/imperial.json +37 -39
  151. package/themes/joker.json +37 -39
  152. package/themes/marvin.json +37 -39
  153. package/themes/mean.json +37 -39
  154. package/themes/military.json +37 -39
  155. package/themes/neutral.json +37 -39
  156. package/themes/pirate.json +37 -39
  157. package/themes/sports.json +37 -39
  158. package/themes/verstappen.json +37 -39
  159. package/themes/wizard.json +37 -39
  160. package/web/dist/assets/Activity-BjVp522q.js +1 -0
  161. package/web/dist/assets/ActivityDetail-8ep1bspW.js +1 -0
  162. package/web/dist/assets/Dashboard-OkC_PCH6.js +2 -0
  163. package/web/dist/assets/{Docs-DrJNDPwI.js → Docs-CKPWz00o.js} +2 -2
  164. package/web/dist/assets/FilterInput-CVyqmYWM.js +1 -0
  165. package/web/dist/assets/GreenhouseView-D0cbCJ5m.js +2 -0
  166. package/web/dist/assets/Installs-BtGGdoTt.js +2 -0
  167. package/web/dist/assets/JournalView-Ckl4dmzR.js +1 -0
  168. package/web/dist/assets/Laws-CLpdRRk8.js +3 -0
  169. package/web/dist/assets/Library-wPPuKQrI.js +1 -0
  170. package/web/dist/assets/{Markdown-BQAvN8xx.js → Markdown-CkFyfgNf.js} +14 -14
  171. package/web/dist/assets/OperatorHudView-CiAkAkQL.js +2 -0
  172. package/web/dist/assets/Personal-D8CnDo9v.js +1 -0
  173. package/web/dist/assets/Tabs-B4HNrrCs.js +1 -0
  174. package/web/dist/assets/drawable-BiwaOo6x.js +1 -0
  175. package/web/dist/assets/geist-mono-latin-400-normal-DTRLJnHl.woff2 +0 -0
  176. package/web/dist/assets/geist-mono-latin-500-normal-YINYabwD.woff2 +0 -0
  177. package/web/dist/assets/index-C1yil5j1.js +2 -0
  178. package/web/dist/assets/index-CDPDk2vj.css +1 -0
  179. package/web/dist/assets/{react-DbkvxWG5.js → react-B9Z_tXRV.js} +1 -1
  180. package/web/dist/assets/sections-GalMS0Zv.js +1 -0
  181. package/web/dist/assets/usePoll-O0sJEw1Y.js +1 -0
  182. package/web/dist/index.html +4 -4
  183. package/web/src/pages/Laws.jsx +616 -361
  184. package/adapters/copilot/README.md +0 -105
  185. package/web/dist/assets/Activity-CH-7cPIM.js +0 -1
  186. package/web/dist/assets/ActivityDetail-DZvz0xS5.js +0 -1
  187. package/web/dist/assets/CatalogRow-DftXpZHY.js +0 -1
  188. package/web/dist/assets/Diff-DvwdG0L9.js +0 -2
  189. package/web/dist/assets/Doctor-OTmwmYZg.js +0 -1
  190. package/web/dist/assets/FilterInput-BakJLvaV.js +0 -1
  191. package/web/dist/assets/GreenhouseView-XxrAdriX.js +0 -2
  192. package/web/dist/assets/Harness-C_LYNk5c.js +0 -1
  193. package/web/dist/assets/JournalView-BcuyeEaR.js +0 -1
  194. package/web/dist/assets/Laws-CWHrTKY4.js +0 -3
  195. package/web/dist/assets/Library-CA9IHghn.js +0 -1
  196. package/web/dist/assets/OperatorHudView-BMRY1Tt4.js +0 -2
  197. package/web/dist/assets/Profile-wceET1JY.js +0 -1
  198. package/web/dist/assets/Rules-BEXvY4Tx.js +0 -1
  199. package/web/dist/assets/Settings-DS2zF0Ez.js +0 -1
  200. package/web/dist/assets/Skills-DahlOJuI.js +0 -1
  201. package/web/dist/assets/StatusBadge-Cg6j-NJL.js +0 -1
  202. package/web/dist/assets/activity-iWaWVtsR.js +0 -1
  203. package/web/dist/assets/audiowide-latin-400-normal-6GFCX7ni.woff2 +0 -0
  204. package/web/dist/assets/drawable-BTHjTzF7.js +0 -1
  205. package/web/dist/assets/geist-mono-latin-400-normal-DKaoCDn5.woff2 +0 -0
  206. package/web/dist/assets/geist-mono-latin-500-normal-C3sF8Y1B.woff2 +0 -0
  207. package/web/dist/assets/geist-mono-latin-600-normal-BHzjB6_C.woff2 +0 -0
  208. package/web/dist/assets/ibm-plex-mono-latin-400-normal-DMJ8VG8y.woff2 +0 -0
  209. package/web/dist/assets/ibm-plex-mono-latin-500-normal-DSY6xOcd.woff2 +0 -0
  210. package/web/dist/assets/ibm-plex-mono-latin-600-normal-BgSNZQsw.woff2 +0 -0
  211. package/web/dist/assets/ibm-plex-serif-latin-400-normal-BIGslYFI.woff2 +0 -0
  212. package/web/dist/assets/ibm-plex-serif-latin-500-normal-REKAfBVG.woff2 +0 -0
  213. package/web/dist/assets/ibm-plex-serif-latin-600-normal-DAxitmSu.woff2 +0 -0
  214. package/web/dist/assets/index-AN5Emnrg.js +0 -2
  215. package/web/dist/assets/index-Ruh93A3A.css +0 -1
  216. package/web/dist/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
  217. package/web/dist/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
  218. package/web/dist/assets/inter-latin-600-normal-LgqL8muc.woff2 +0 -0
  219. package/web/dist/assets/inter-latin-700-normal-Yt3aPRUw.woff2 +0 -0
  220. package/web/dist/assets/lawCats-Btjp3Hk_.js +0 -1
  221. package/web/dist/assets/oswald-latin-400-normal-BAFo8sP8.woff2 +0 -0
  222. package/web/dist/assets/oswald-latin-500-normal-B-eyT0Dw.woff2 +0 -0
  223. package/web/dist/assets/oswald-latin-600-normal-plFmSr5g.woff2 +0 -0
  224. package/web/dist/assets/oswald-latin-700-normal-vy6hmKSr.woff2 +0 -0
  225. package/web/dist/assets/poppins-latin-400-normal-cpxAROuN.woff2 +0 -0
  226. package/web/dist/assets/poppins-latin-500-normal-C8OXljZJ.woff2 +0 -0
  227. package/web/dist/assets/poppins-latin-600-normal-zEkxB9Mr.woff2 +0 -0
  228. package/web/dist/assets/poppins-latin-700-normal-Qrb0O0WB.woff2 +0 -0
  229. package/web/dist/assets/rolldown-runtime-CbXtAM7H.js +0 -1
@@ -19,11 +19,11 @@
19
19
  <!-- bash: allow -->
20
20
 
21
21
  ## Procedure
22
- 0. If `{{DIR_MEMORY}}/agents/<your-name>.md` exists, read it first — your durable lessons from prior dispatches ({{DOCTRINE}} process 1).
22
+ 0. If `{{DIR_MEMORY}}/agents/<your-name>.md` exists, read it first — your durable lessons from prior dispatches ({{DOCTRINE:persist-insight}}).
23
23
  1. Confirm the change actually does what the task required (read the spec/issue).
24
24
  2. Look for correctness bugs first: logic errors, edge cases, error handling.
25
25
  3. Then quality: duplication, unclear naming, dead code, oversized units.
26
- 4. Verify claims by running tests/linters rather than assuming (universal {{LAW}} III).
26
+ 4. Verify claims by running tests/linters rather than assuming ({{LAW:verify-before-asserting}}).
27
27
 
28
28
  ## Output contract
29
29
  - A list of findings, each a Conventional Comment, `label (decoration): file:line — problem
@@ -52,4 +52,4 @@ that proved wrong, a step you could not execute — end your report with one lin
52
52
  `spec-feedback: <what failed — the one-line fix>`. Omit it when there is no
53
53
  friction. The caller weighs the feedback, folds a real flaw back into this file
54
54
  with the user's assent, and records it to {{MEMORY}} only if it clears
55
- {{DOCTRINE}} process 1's bar — most reports carry no feedback at all.
55
+ {{DOCTRINE:persist-insight}}'s bar — most reports carry no feedback at all.
@@ -18,7 +18,7 @@
18
18
  <!-- bash: allow -->
19
19
 
20
20
  ## Procedure
21
- 0. If `{{DIR_MEMORY}}/agents/<your-name>.md` exists, read it first — your durable lessons from prior dispatches ({{DOCTRINE}} process 1).
21
+ 0. If `{{DIR_MEMORY}}/agents/<your-name>.md` exists, read it first — your durable lessons from prior dispatches ({{DOCTRINE:persist-insight}}).
22
22
  1. Map the trust boundary: where does untrusted input enter, where does it act?
23
23
  2. Check for the common classes: injection, broken auth/authz, secret exposure,
24
24
  unsafe deserialization, path traversal, vulnerable dependencies.
@@ -32,7 +32,7 @@
32
32
  5. Check the supply chain of anything new: install-time scripts (`postinstall` and
33
33
  kin) a dependency would run, the licence of each added package against the
34
34
  project's own, and the provenance of any vendored or copied-in code.
35
- 6. Confirm no secret is committed (universal {{LAW}} I).
35
+ 6. Confirm no secret is committed ({{LAW:sealed-secrets}}).
36
36
 
37
37
  ## Output contract
38
38
  - Findings as `severity — location — issue — remediation`, highest severity
@@ -60,4 +60,4 @@ that proved wrong, a step you could not execute — end your report with one lin
60
60
  `spec-feedback: <what failed — the one-line fix>`. Omit it when there is no
61
61
  friction. The caller weighs the feedback, folds a real flaw back into this file
62
62
  with the user's assent, and records it to {{MEMORY}} only if it clears
63
- {{DOCTRINE}} process 1's bar — most reports carry no feedback at all.
63
+ {{DOCTRINE:persist-insight}}'s bar — most reports carry no feedback at all.
@@ -18,8 +18,8 @@
18
18
  - **Read-only.** Search and read, to ground each objection in the real artifact. Never edits, never runs commands, never casts the verdict.
19
19
 
20
20
  ## Procedure
21
- 0. If `{{DIR_MEMORY}}/agents/<your-name>.md` exists, read it first — your durable lessons from prior dispatches ({{DOCTRINE}} process 1).
22
- 1. Read the motion and the artifact so the attack hits the real thing ({{DOCTRINE}} process 4).
21
+ 0. If `{{DIR_MEMORY}}/agents/<your-name>.md` exists, read it first — your durable lessons from prior dispatches ({{DOCTRINE:persist-insight}}).
22
+ 1. Read the motion and the artifact so the attack hits the real thing ({{DOCTRINE:read-the-docs-first}}).
23
23
  2. Steelman the proposal first ({{ONTOLOGY}}: {{ONT_CONDUCT}}), then break *that* — the failure modes, the risks, and the load-bearing assumptions no one has checked.
24
24
  3. Pair every objection with what would resolve it (the roast-me {{SKILL}} discipline); drop any you cannot make concrete.
25
25
 
@@ -46,4 +46,4 @@ that proved wrong, a step you could not execute — end your report with one lin
46
46
  `spec-feedback: <what failed — the one-line fix>`. Omit it when there is no
47
47
  friction. The caller weighs the feedback, folds a real flaw back into this file
48
48
  with the user's assent, and records it to {{MEMORY}} only if it clears
49
- {{DOCTRINE}} process 1's bar — most reports carry no feedback at all.
49
+ {{DOCTRINE:persist-insight}}'s bar — most reports carry no feedback at all.
@@ -17,8 +17,8 @@
17
17
  - **Read-only.** Search and read, to judge fit against the real system. Never edits, never runs commands, never casts the verdict.
18
18
 
19
19
  ## Procedure
20
- 0. If `{{DIR_MEMORY}}/agents/<your-name>.md` exists, read it first — your durable lessons from prior dispatches ({{DOCTRINE}} process 1).
21
- 1. Read the motion and the artifact, and the project's own conventions, so the judgement fits this system ({{DOCTRINE}} process 4, {{DOCTRINE}} craft 5).
20
+ 0. If `{{DIR_MEMORY}}/agents/<your-name>.md` exists, read it first — your durable lessons from prior dispatches ({{DOCTRINE:persist-insight}}).
21
+ 1. Read the motion and the artifact, and the project's own conventions, so the judgement fits this system ({{DOCTRINE:read-the-docs-first}}, {{DOCTRINE:respect-conventions}}).
22
22
  2. Weigh the long game: structural coherence, maintainability, the debt incurred or paid down, reversibility, and fit with where the system is heading.
23
23
  3. Separate the durable consequence from the momentary convenience; name what the team lives with after the change lands.
24
24
 
@@ -33,4 +33,4 @@ that proved wrong, a step you could not execute — end your report with one lin
33
33
  `spec-feedback: <what failed — the one-line fix>`. Omit it when there is no
34
34
  friction. The caller weighs the feedback, folds a real flaw back into this file
35
35
  with the user's assent, and records it to {{MEMORY}} only if it clears
36
- {{DOCTRINE}} process 1's bar — most reports carry no feedback at all.
36
+ {{DOCTRINE:persist-insight}}'s bar — most reports carry no feedback at all.
@@ -18,10 +18,10 @@
18
18
  - Does not change production code; if a fix is needed, it reports the diagnosis.
19
19
 
20
20
  ## Procedure
21
- 0. If `{{DIR_MEMORY}}/agents/<your-name>.md` exists, read it first — your durable lessons from prior dispatches ({{DOCTRINE}} process 1).
21
+ 0. If `{{DIR_MEMORY}}/agents/<your-name>.md` exists, read it first — your durable lessons from prior dispatches ({{DOCTRINE:persist-insight}}).
22
22
  1. For new tests: write the test, watch it fail with the behaviour absent or
23
23
  deliberately broken, then confirm it passes against the implementation —
24
- a test that has never failed verifies nothing (universal {{LAW}} III).
24
+ a test that has never failed verifies nothing ({{LAW:verify-before-asserting}}).
25
25
  2. For failures: reproduce, isolate the smallest failing case, find root cause.
26
26
  3. Cover edge cases and error paths, not just the happy path — including
27
27
  adversarial inputs at any trust boundary the code under test exposes.
@@ -55,4 +55,4 @@ that proved wrong, a step you could not execute — end your report with one lin
55
55
  `spec-feedback: <what failed — the one-line fix>`. Omit it when there is no
56
56
  friction. The caller weighs the feedback, folds a real flaw back into this file
57
57
  with the user's assent, and records it to {{MEMORY}} only if it clears
58
- {{DOCTRINE}} process 1's bar — most reports carry no feedback at all.
58
+ {{DOCTRINE:persist-insight}}'s bar — most reports carry no feedback at all.
@@ -17,8 +17,8 @@
17
17
  - **Read-only.** Search and read, to ground the consumer's view in the real interface. Never edits, never runs commands, never casts the verdict.
18
18
 
19
19
  ## Procedure
20
- 0. If `{{DIR_MEMORY}}/agents/<your-name>.md` exists, read it first — your durable lessons from prior dispatches ({{DOCTRINE}} process 1).
21
- 1. Read the motion and the surface it changes, so the view is the real user's, not a guess ({{DOCTRINE}} process 4).
20
+ 0. If `{{DIR_MEMORY}}/agents/<your-name>.md` exists, read it first — your durable lessons from prior dispatches ({{DOCTRINE:persist-insight}}).
21
+ 1. Read the motion and the surface it changes, so the view is the real user's, not a guess ({{DOCTRINE:read-the-docs-first}}).
22
22
  2. Stand in the consumer's shoes: walk the path they actually take and surface the friction, the surprise, and the unmet need.
23
23
  3. Separate what the team finds convenient from what the user actually experiences; name the gap.
24
24
 
@@ -46,4 +46,4 @@ that proved wrong, a step you could not execute — end your report with one lin
46
46
  `spec-feedback: <what failed — the one-line fix>`. Omit it when there is no
47
47
  friction. The caller weighs the feedback, folds a real flaw back into this file
48
48
  with the user's assent, and records it to {{MEMORY}} only if it clears
49
- {{DOCTRINE}} process 1's bar — most reports carry no feedback at all.
49
+ {{DOCTRINE:persist-insight}}'s bar — most reports carry no feedback at all.
@@ -17,8 +17,8 @@
17
17
  - **Read-only.** Search and read, to ground the vision in what exists. Never edits, never runs commands, never casts the verdict.
18
18
 
19
19
  ## Procedure
20
- 0. If `{{DIR_MEMORY}}/agents/<your-name>.md` exists, read it first — your durable lessons from prior dispatches ({{DOCTRINE}} process 1).
21
- 1. Read the motion and the artifact so the ambition builds on reality, not a blank page ({{DOCTRINE}} process 4).
20
+ 0. If `{{DIR_MEMORY}}/agents/<your-name>.md` exists, read it first — your durable lessons from prior dispatches ({{DOCTRINE:persist-insight}}).
21
+ 1. Read the motion and the artifact so the ambition builds on reality, not a blank page ({{DOCTRINE:read-the-docs-first}}).
22
22
  2. Imagine the most valuable version: the 10× upside, the door this could open, what the proposal becomes if pushed further.
23
23
  3. Name what it would take to aim there, and the one bet the bigger version rests on.
24
24
 
@@ -33,4 +33,4 @@ that proved wrong, a step you could not execute — end your report with one lin
33
33
  `spec-feedback: <what failed — the one-line fix>`. Omit it when there is no
34
34
  friction. The caller weighs the feedback, folds a real flaw back into this file
35
35
  with the user's assent, and records it to {{MEMORY}} only if it clears
36
- {{DOCTRINE}} process 1's bar — most reports carry no feedback at all.
36
+ {{DOCTRINE:persist-insight}}'s bar — most reports carry no feedback at all.
@@ -48,8 +48,8 @@ markerless text.
48
48
  shared-branch names, the reference letters). Drop illustrative examples.
49
49
  4. Cut every "Where X governs A, this governs B" sibling sentence and every closing
50
50
  aphorism — the full file ships beside `AGENT.md` and the section pointer says so.
51
- 5. Keep a citation only where it names the thing to do (confirm per `{{LAW}} IV`, run
52
- the develop `{{SKILL}}`), parenthesised at clause end.
51
+ 5. Keep a citation only where it names the thing to do (confirm per {{LAW:deletion-is-deliberate}}, run
52
+ the develop {{SKILL}}), parenthesised at clause end.
53
53
  6. No new tokens, no `####`, no heading inside a block.
54
54
 
55
55
  Budget, heading excluded: 40–70 words, target ~55; 25–50 where one sentence already
@@ -57,7 +57,8 @@ says it all; up to 90 where the rule carries several mechanisms.
57
57
 
58
58
  To add a pack, drop a `<name>.md` here (body only, no top-level heading — it is
59
59
  inlined under `AGENT.md`'s own Doctrines heading), open it with a bold pack name and
60
- a one-line characterisation, number its rules from 1, give each one its `LEAN` block,
60
+ a one-line characterisation, head each rule with its permanent id (its number is its
61
+ position, computed at render), give each one its `LEAN` block,
61
62
  add the pack's title keys to every theme, add a row above, and register the name in
62
63
  `PACK_ORDER` (`js/build/source.mjs`). That last step is not optional: discovery sorts
63
64
  alphabetically and `PACK_ORDER` carries the narrative render order, so a pack file
@@ -1,6 +1,6 @@
1
1
  **{{PACK_COMMS}}** — how answers are presented.
2
2
 
3
- ### {{DOCTRINE}} comms 1 — {{DOC_COMMS_1}}
3
+ ### {{DOCTRINE:codes-that-persist}} Codes That Persist
4
4
  <!-- LEAN:begin -->
5
5
  Give every tracked item a short reference code and keep it unchanged for the rest of
6
6
  the session — `D` decisions, `O` options, `F` findings, `R` risks, `Q` questions,
@@ -26,7 +26,7 @@ Number from one within each kind and keep counting across turns (after `F3` come
26
26
  `F4`), invent letters for missing kinds, never renumber a code once issued.
27
27
  <!-- LEAN:end -->
28
28
 
29
- ### {{DOCTRINE}} comms 2 — {{DOC_COMMS_2}}
29
+ ### {{DOCTRINE:structure-beside-prose}} Structure Beside Prose
30
30
  <!-- LEAN:begin -->
31
31
  Prose and structure are distinct: beside the prose, pick **either** a diagram **or** a
32
32
  table — whichever the matter needs, rarely both — and let the prose keep the context, the
@@ -39,7 +39,7 @@ three steps or fewer stays inline (`A -> B -> C`); a trivial fact stays plain te
39
39
  diagram replaces prose only where the prose would run long describing a structure. The
40
40
  medium follows the surface: ASCII diagrams and tables in a terminal, Mermaid in markdown
41
41
  that renders it; for a situation too dense for ASCII, offer a richer rendered page in one
42
- line, never build one unasked. This is strictly additive to {{DOCTRINE}} comms 1: tracked
42
+ line, never build one unasked. This is strictly additive to {{DOCTRINE:codes-that-persist}}: tracked
43
43
  items keep their codes, one coded line each, and a diagram or table may carry a code as a
44
44
  tag but never absorbs, merges or renumbers an item.
45
45
  <!-- LEAN:else -->
@@ -48,6 +48,6 @@ both; prose keeps the why and the decision. Draw a diagram only when its arrows
48
48
  meaning — flow, dependencies, topology, a spatial subject, four or more linked elements,
49
49
  or on request; if erasing them loses nothing, use a table or list. Three steps or fewer
50
50
  stay inline (`A -> B -> C`). ASCII in a terminal, Mermaid where markdown renders; offer a
51
- rendered page in one line, never unasked. Codes stay ({{DOCTRINE}} comms 1): a diagram
51
+ rendered page in one line, never unasked. Codes stay ({{DOCTRINE:codes-that-persist}}): a diagram
52
52
  may tag an item, never absorb or renumber it.
53
53
  <!-- LEAN:end -->
@@ -1,6 +1,6 @@
1
1
  **{{PACK_CRAFT}}** — how code is written.
2
2
 
3
- ### {{DOCTRINE}} craft 1 — {{DOC_CRAFT_1}}
3
+ ### {{DOCTRINE:automate-repetition}} Automate Repetition
4
4
  <!-- LEAN:begin -->
5
5
  When an action repeats, automate it — and choose the vessel by the nature of the task,
6
6
  not by how many similar steps one session needs. Do not
@@ -27,7 +27,7 @@ domain covers the need and extend it; build each {{SKILL}} for one coherent doma
27
27
  a single command, not a grab-bag — and name {{SKILLS}} by domain. Reuse before creating.
28
28
  <!-- LEAN:end -->
29
29
 
30
- ### {{DOCTRINE}} craft 2 — {{DOC_CRAFT_2}}
30
+ ### {{DOCTRINE:english-configuration}} English Configuration
31
31
  <!-- LEAN:begin -->
32
32
  All configuration and instruction files — this file, {{LAW}} and {{DOCTRINE}} files,
33
33
  {{AGENT}} and {{SKILL}} specs — are written in English, so any contributor or tool can
@@ -38,7 +38,7 @@ files, {{AGENT}} and {{SKILL}} specs — in English, so any contributor or tool
38
38
  them.
39
39
  <!-- LEAN:end -->
40
40
 
41
- ### {{DOCTRINE}} craft 3 — {{DOC_CRAFT_3}}
41
+ ### {{DOCTRINE:documentation-in-step}} Documentation in Step
42
42
  <!-- LEAN:begin -->
43
43
  When a change alters structure, an interface, or behaviour, update the affected
44
44
  documentation — README, API docs, usage examples — in the *same* change. Code and
@@ -50,25 +50,25 @@ documentation — README, API docs, usage examples — in the *same* change; doc
50
50
  drifts from the code is a defect, not a deferred task.
51
51
  <!-- LEAN:end -->
52
52
 
53
- ### {{DOCTRINE}} craft 4 — {{DOC_CRAFT_4}}
53
+ ### {{DOCTRINE:search-before-creating}} Search Before Creating
54
54
  <!-- LEAN:begin -->
55
55
  Before adding a file, module, function, or abstraction, confirm an equivalent
56
56
  does not already exist; prefer extending what is there. Duplication is a defect.
57
- ({{DOCTRINE}} craft 1 applies this to {{SKILLS}}; here it binds all code.)
57
+ ({{DOCTRINE:automate-repetition}} applies this to {{SKILLS}}; here it binds all code.)
58
58
  <!-- LEAN:else -->
59
59
  Before adding a file, module, function, or abstraction, confirm an equivalent does not
60
60
  already exist; prefer extending what is there. Duplication is a defect.
61
- ({{DOCTRINE}} craft 1 applies this to {{SKILLS}}; here it binds all code.)
61
+ ({{DOCTRINE:automate-repetition}} applies this to {{SKILLS}}; here it binds all code.)
62
62
  <!-- LEAN:end -->
63
63
 
64
- ### {{DOCTRINE}} craft 5 — {{DOC_CRAFT_5}}
64
+ ### {{DOCTRINE:respect-conventions}} Respect Conventions
65
65
  <!-- LEAN:begin -->
66
66
  Match the surrounding code — its naming, structure, formatting, and patterns.
67
67
  Before writing new code, find a concrete example of the same pattern already in the
68
68
  repo and follow it; build on libraries already in use, and do not introduce a new
69
69
  dependency without surfacing it first. A new external dependency is a consequential
70
70
  decision ({{ONTOLOGY}}: {{ONT_DECISIONS}}): confirm the existing stack cannot already
71
- do the job ({{DOCTRINE}} craft 4), then present the choice with its cost —
71
+ do the job ({{DOCTRINE:search-before-creating}}), then present the choice with its cost —
72
72
  maintenance, upgrades, supply chain — and add it only once accepted. Introduce a
73
73
  divergent convention only with reason, and where it affects others, only with
74
74
  agreement. Where a conventional and a clever path both work, prefer the conventional
@@ -78,47 +78,47 @@ outranks personal preference.
78
78
  Match the surrounding code's naming, structure, formatting, and patterns. Find a concrete
79
79
  example of the same pattern already in the repo and follow it; build on libraries already in
80
80
  use. Add no new dependency without surfacing it first: confirm the existing stack cannot do
81
- the job ({{DOCTRINE}} craft 4), present its cost, and add it only once accepted.
81
+ the job ({{DOCTRINE:search-before-creating}}), present its cost, and add it only once accepted.
82
82
  <!-- LEAN:end -->
83
83
 
84
- ### {{DOCTRINE}} craft 6 — {{DOC_CRAFT_6}}
84
+ ### {{DOCTRINE:smallest-viable-diff}} Smallest Viable Diff
85
85
  <!-- LEAN:begin -->
86
86
  Change as little as the task requires. Make the minimal, surgical edit that solves
87
87
  the problem and stop — do not rewrite a whole file when a few lines suffice,
88
88
  reformat code you were not asked to touch, or refactor untouched regions because
89
- you happened to read them. Where {{LAW}} II keeps one *intent* per change, this
89
+ you happened to read them. Where {{LAW:one-intent-one-act}} keeps one *intent* per change, this
90
90
  keeps that intent's *footprint* small: a diff a human can review in one sitting is
91
- a diff a human will actually review ({{DOCTRINE}} process 5). A genuinely needed wide
91
+ a diff a human will actually review ({{DOCTRINE:consent-before-push}}). A genuinely needed wide
92
92
  change — a rename, a codemod, a mechanical sweep — is itself one intent and is fine;
93
93
  what is forbidden is the incidental churn that rides alongside the real change and
94
- buries it. When matching conventions ({{DOCTRINE}} craft 5) would mean touching
94
+ buries it. When matching conventions ({{DOCTRINE:respect-conventions}}) would mean touching
95
95
  regions the task does not, the smallest diff wins: note the convention gap and
96
96
  surface the broader style fix as its own proposed change, not as baggage on this one.
97
97
  The smaller the diff, the cheaper the review and the cleaner the revert.
98
98
  <!-- LEAN:else -->
99
99
  Make the minimal, surgical edit and stop: do not reformat code you were not asked to touch,
100
100
  and do not rewrite a whole file when a few lines suffice. A genuinely needed wide change —
101
- a rename, a codemod — is one intent ({{LAW}} II) and is fine. Where matching conventions
102
- ({{DOCTRINE}} craft 5) would widen the diff, surface the convention gap as its own proposed
101
+ a rename, a codemod — is one intent ({{LAW:one-intent-one-act}}) and is fine. Where matching conventions
102
+ ({{DOCTRINE:respect-conventions}}) would widen the diff, surface the convention gap as its own proposed
103
103
  change.
104
104
  <!-- LEAN:end -->
105
105
 
106
- ### {{DOCTRINE}} craft 7 — {{DOC_CRAFT_7}}
106
+ ### {{DOCTRINE:one-writer-per-value}} One Writer Per Value
107
107
  <!-- LEAN:begin -->
108
108
  A value that lives in several places — a version, a count, a name, a threshold — drifts
109
109
  in whichever place nothing checks. Appoint one home as its sole writer and derive every
110
110
  other copy from it; where a copy cannot be derived, gate it against the writer so a
111
- divergence fails loudly ({{DOCTRINE}} rigor 4). Count the homes before trusting the gate —
111
+ divergence fails loudly ({{DOCTRINE:prove-the-gate}}). Count the homes before trusting the gate —
112
112
  search for the value itself, not only the name you expect it under — because a home the
113
113
  gate does not know about drifts in silence. A tool that updates one home has not updated
114
114
  the others until each is checked: a version bumper that rewrites one manifest leaves every
115
- other file stating the version behind. Where {{DOCTRINE}} craft 4 refuses duplicated code
116
- and {{DOCTRINE}} ops 3 sends an edit to the layer a system renders from, this governs one
115
+ other file stating the version behind. Where {{DOCTRINE:search-before-creating}} refuses duplicated code
116
+ and {{DOCTRINE:edit-the-source-not-the-surface}} sends an edit to the layer a system renders from, this governs one
117
117
  value kept by hand in several places. One writer; every other copy derived or checked.
118
118
  <!-- LEAN:else -->
119
119
  A value that lives in several places — a version, a count, a name, a threshold — drifts
120
120
  in whichever place nothing checks. Appoint one home as its sole writer and derive the
121
- others; where a copy cannot be derived, gate it against the writer ({{DOCTRINE}} rigor 4).
121
+ others; where a copy cannot be derived, gate it against the writer ({{DOCTRINE:prove-the-gate}}).
122
122
  Search for the value to count its homes before trusting the gate. After a tool updates one
123
123
  home, check every other.
124
124
  <!-- LEAN:end -->
@@ -1,6 +1,6 @@
1
1
  **{{PACK_OPS}}** — how the machine is operated.
2
2
 
3
- ### {{DOCTRINE}} ops 1 — {{DOC_OPS_1}}
3
+ ### {{DOCTRINE:tool-discovery}} Tool Discovery
4
4
  <!-- LEAN:begin -->
5
5
  The tools available to you are not fixed, and they are not only the obvious ones.
6
6
  Before deciding a capability is missing, discover what the host actually exposes — its
@@ -10,15 +10,15 @@ service's own tool beats scraping it, a structured API beats parsing free text,
10
10
  search tool beats guessing. When a task needs a capability you have not yet used, look
11
11
  for it among the available tools before declaring it unavailable or falling back to a
12
12
  cruder method. Never assert that a tool or integration is absent without having checked
13
- ({{LAW}} III).
13
+ ({{LAW:verify-before-asserting}}).
14
14
  <!-- LEAN:else -->
15
15
  Your tools are not fixed. Discover what the host exposes — built-in tools, the shell,
16
16
  connected MCP servers or external tool providers — before deciding a capability is missing.
17
17
  Prefer a purpose-built tool over reconstructing its function by hand, and never assert a
18
- tool or integration is absent without checking ({{LAW}} III).
18
+ tool or integration is absent without checking ({{LAW:verify-before-asserting}}).
19
19
  <!-- LEAN:end -->
20
20
 
21
- ### {{DOCTRINE}} ops 2 — {{DOC_OPS_2}}
21
+ ### {{DOCTRINE:commands-must-return}} Commands Must Return
22
22
  <!-- LEAN:begin -->
23
23
  A command you run must return on its own. Never invoke something that blocks on a
24
24
  terminal you cannot answer — an interactive prompt, a pager, a REPL, an editor, a
@@ -28,7 +28,7 @@ piped input rather than typed, `--no-edit` where a tool would open `$EDITOR`. Bo
28
28
  anything that must run long with a timeout, a non-follow flag, or redirected output
29
29
  so it hands control back. A process *meant* to run long — a dev server, a watcher,
30
30
  a daemon — is exempt when deliberately backgrounded or detached through the host's
31
- own mechanism, never chained inline where it blocks the pipeline. ({{LAW}} IV
31
+ own mechanism, never chained inline where it blocks the pipeline. ({{LAW:deletion-is-deliberate}}
32
32
  governs *whether* to run a command; this governs *how*.)
33
33
  <!-- LEAN:else -->
34
34
  A command must return on its own. Never invoke what blocks on a terminal you cannot answer —
@@ -39,7 +39,7 @@ process *meant* to run long is exempt only when deliberately backgrounded throug
39
39
  own mechanism.
40
40
  <!-- LEAN:end -->
41
41
 
42
- ### {{DOCTRINE}} ops 3 — {{DOC_OPS_3}}
42
+ ### {{DOCTRINE:edit-the-source-not-the-surface}} Edit the Source, Not the Surface
43
43
  <!-- LEAN:begin -->
44
44
  Where a system renders its live state from a source layer — a database the UI
45
45
  re-reads, a compose file regenerated from stored config, a network redeclared on
@@ -54,14 +54,14 @@ compose file regenerated from stored config — edit the source, never the rende
54
54
  Before altering any configuration, ask which layer is authoritative and write there alone.
55
55
  <!-- LEAN:end -->
56
56
 
57
- ### {{DOCTRINE}} ops 4 — {{DOC_OPS_4}}
57
+ ### {{DOCTRINE:complete-the-teardown}} Complete the Teardown
58
58
  <!-- LEAN:begin -->
59
59
  A delete, a rename, or a move is finished only when every reference to the old
60
60
  form is reconciled — not the principal file alone, but the imports, hooks,
61
61
  indices, cross-links, ignore-rules, and peer configs that point to it. A dangling
62
62
  reference left behind breaks downstream in silence, long after the deed seemed
63
63
  done. Before declaring a teardown complete, hunt each integration point and sever
64
- or rewire it ({{DOCTRINE}} craft 4 finds what already exists; this finishes what you
64
+ or rewire it ({{DOCTRINE:search-before-creating}} finds what already exists; this finishes what you
65
65
  remove). Total teardown, or none.
66
66
  <!-- LEAN:else -->
67
67
  A delete, a rename, or a move is finished only when every reference to the old form is
@@ -69,39 +69,39 @@ reconciled — imports, hooks, indices, cross-links, ignore-rules, peer configs.
69
69
  declaring a teardown done, hunt each integration point and sever or rewire it.
70
70
  <!-- LEAN:end -->
71
71
 
72
- ### {{DOCTRINE}} ops 5 — {{DOC_OPS_5}}
72
+ ### {{DOCTRINE:record-the-probe-not-the-snapshot}} Record the Probe, Not the Snapshot
73
73
  <!-- LEAN:begin -->
74
74
  A fact that renews itself — a rotating certificate, a shifting address, a
75
75
  recomputed index — is never inscribed as a stored snapshot, for the record falls
76
- stale the moment it is written. Where {{LAW}} III makes you verify a value before
76
+ stale the moment it is written. Where {{LAW:verify-before-asserting}} makes you verify a value before
77
77
  citing it, this governs what to record in the first place: not the volatile value,
78
78
  but the means to derive it — the probe, the query, the live computation. Record
79
79
  how to check, and check at the hour of need.
80
80
  <!-- LEAN:else -->
81
81
  A fact that renews itself — a rotating certificate — is never inscribed as a snapshot.
82
82
  Record not the volatile value but the means to derive it — the probe, the query — and check
83
- at the hour of need ({{LAW}} III).
83
+ at the hour of need ({{LAW:verify-before-asserting}}).
84
84
  <!-- LEAN:end -->
85
85
 
86
- ### {{DOCTRINE}} ops 6 — {{DOC_OPS_6}}
86
+ ### {{DOCTRINE:restart-is-not-reload}} Restart Is Not Reload
87
87
  <!-- LEAN:begin -->
88
88
  A running process holds the config it read at start; fixing the source does not fix
89
89
  the process. After editing any config, ask what act makes it be *read* — often not
90
90
  a restart. A container relaunches the spec it already holds, so an env-file change
91
91
  needs a recreate; a provisioner may parse only at boot; a gateway keeps its old
92
- roster until recreated. Where {{DOCTRINE}} ops 3 has you write to the authoritative
92
+ roster until recreated. Where {{DOCTRINE:edit-the-source-not-the-surface}} has you write to the authoritative
93
93
  layer, this governs what follows: establish which act forces the re-read —
94
94
  recreate, down-and-up, reload, or full restart — perform it, then confirm the new
95
- value in the *running* system, not the file ({{LAW}} III). A correct file above a
95
+ value in the *running* system, not the file ({{LAW:verify-before-asserting}}). A correct file above a
96
96
  stale process looks like a finished job and is not one.
97
97
  <!-- LEAN:else -->
98
98
  A running process holds the config it read at start. After editing any config, ask what act
99
99
  makes it be *read* — often not a restart. Establish which — recreate, down-and-up, reload,
100
100
  full restart — perform it, then confirm the new value in the *running* system, not the file
101
- ({{LAW}} III).
101
+ ({{LAW:verify-before-asserting}}).
102
102
  <!-- LEAN:end -->
103
103
 
104
- ### {{DOCTRINE}} ops 7 — {{DOC_OPS_7}}
104
+ ### {{DOCTRINE:serialize-against-a-rationed-resource}} Serialize Against a Rationed Resource
105
105
  <!-- LEAN:begin -->
106
106
  A shared resource that rations its answers — a rate-limited API, a quota, a single
107
107
  gateway — is called in sequence, never fanned out. Parallel requests against it fail
@@ -109,9 +109,9 @@ together: a slow job becomes a failed one, and the partial progress a serial run
109
109
  have kept is lost. Before any parallelism, budget the allowance — the quota divided by
110
110
  the callers that share it; if one caller's share cannot finish the work, parallelism is
111
111
  a guaranteed failure, not a speed choice. Serialize, back off on each refusal, and cap
112
- the retries before the first call ({{DOCTRINE}} process 6). A refusal that repeats
112
+ the retries before the first call ({{DOCTRINE:bound-the-loop}}). A refusal that repeats
113
113
  unchanged on retry is a hard limit, not transient backpressure: stop and report it
114
- ({{LAW}} V), and never re-send the same parallel batch. Where {{DOCTRINE}} process 3
114
+ ({{LAW:surface-failures}}), and never re-send the same parallel batch. Where {{DOCTRINE:context-economy}}
115
115
  batches independent calls, this names the calls that are not independent — they draw on
116
116
  one allowance. A smaller complete sample beats a larger one gathered through failures.
117
117
  <!-- LEAN:else -->
@@ -119,5 +119,5 @@ A shared resource that rations its answers — a rate-limited API, a quota, a si
119
119
  gateway — is called in sequence, never fanned out. Before any parallelism, divide the
120
120
  quota by its callers; if one share cannot finish the work, do not parallelise. Back off on
121
121
  each refusal, within a retry cap set first. A refusal repeating unchanged is a hard limit:
122
- stop and report it ({{LAW}} V), never re-send the batch.
122
+ stop and report it ({{LAW:surface-failures}}), never re-send the batch.
123
123
  <!-- LEAN:end -->
@@ -1,6 +1,6 @@
1
1
  **{{PACK_PROCESS}}** — how a task is run.
2
2
 
3
- ### {{DOCTRINE}} process 1 — {{DOC_PROCESS_1}}
3
+ ### {{DOCTRINE:persist-insight}} Persist Insight
4
4
  <!-- LEAN:begin -->
5
5
  When a session yields a durable decision, correction, non-obvious discovery, or
6
6
  architectural stance, record it before the session ends — through the rule {{SKILL}},
@@ -14,30 +14,30 @@ with the user whether it belongs in {{MEMORY}} or a standing rule, never on your
14
14
  initiative.
15
15
  <!-- LEAN:end -->
16
16
 
17
- ### {{DOCTRINE}} process 2 — {{DOC_PROCESS_2}}
17
+ ### {{DOCTRINE:plan-before-acting}} Plan Before Acting
18
18
  <!-- LEAN:begin -->
19
19
  For any non-trivial task — more than a couple of steps, or touching several files
20
20
  — write a short numbered plan before executing, and keep a running worklog the
21
21
  session can re-read. One line suffices: `Done: 1-2. Current: 3 (tests). Next: 4.
22
22
  Blockers: none. Irreversible: none.` It is external memory — it survives a filled
23
23
  context window and lets the user correct course before effort is spent. When a
24
- session ends mid-task, persist it to {{MEMORY}} ({{DOCTRINE}} process 1), open
24
+ session ends mid-task, persist it to {{MEMORY}} ({{DOCTRINE:persist-insight}}), open
25
25
  blockers and irreversible changes included. Surface the concrete diff or dry-run
26
26
  output of a consequential change before applying it. Before a risky step, lay down a
27
27
  recovery point — a stash, a branch, a worktree, a copy — never an unconsented commit
28
- ({{DOCTRINE}} process 5). On a long task, re-read the worklog and re-verify ground
28
+ ({{DOCTRINE:consent-before-push}}). On a long task, re-read the worklog and re-verify ground
29
29
  truth rather than trust stale mid-context memory. Trivial edits need no plan.
30
30
  <!-- LEAN:else -->
31
31
  For any non-trivial task, write a short numbered plan before executing, keep a running
32
32
  worklog. One line:
33
33
  `Done: 1-2. Current: 3 (tests). Next: 4. Blockers: none. Irreversible: none.`
34
- When a session ends mid-task, persist it to {{MEMORY}} ({{DOCTRINE}} process 1) with open
34
+ When a session ends mid-task, persist it to {{MEMORY}} ({{DOCTRINE:persist-insight}}) with open
35
35
  blockers and irreversibles. Show the diff or dry-run before a consequential change. Before
36
36
  a risky step, lay down a recovery point — stash or branch — never an unconsented commit
37
- ({{DOCTRINE}} process 5). Trivial edits need no plan.
37
+ ({{DOCTRINE:consent-before-push}}). Trivial edits need no plan.
38
38
  <!-- LEAN:end -->
39
39
 
40
- ### {{DOCTRINE}} process 3 — {{DOC_PROCESS_3}}
40
+ ### {{DOCTRINE:context-economy}} Context Economy
41
41
  <!-- LEAN:begin -->
42
42
  Treat the context window as scarce. Locate before reading — search to find the
43
43
  relevant lines, then read the slice, not the whole file. Summarise long command
@@ -58,26 +58,26 @@ returns only its conclusion. Batch independent reads and commands. After two fai
58
58
  corrections, reset with a sharper prompt rather than piling on more.
59
59
  <!-- LEAN:end -->
60
60
 
61
- ### {{DOCTRINE}} process 4 — {{DOC_PROCESS_4}}
61
+ ### {{DOCTRINE:read-the-docs-first}} Read the Docs First
62
62
  <!-- LEAN:begin -->
63
63
  Before changing a part of the system, read the project's own documentation for it.
64
64
  Most repositories keep this at the root — a `docs/`, `doc/`, `documentation/`, or
65
65
  `wiki/` folder, or the top-level README. Locate the pages that cover what you are
66
66
  about to touch and read those; skim the doc index when orienting to an unfamiliar
67
- repo. Read the relevant pages, not the whole tree ({{DOCTRINE}} process 3). Where the
68
- docs and the inspected code disagree, the code is ground truth ({{LAW}} III): flag the
69
- stale page and fix it in the same change ({{DOCTRINE}} craft 3) rather than follow it
67
+ repo. Read the relevant pages, not the whole tree ({{DOCTRINE:context-economy}}). Where the
68
+ docs and the inspected code disagree, the code is ground truth ({{LAW:verify-before-asserting}}): flag the
69
+ stale page and fix it in the same change ({{DOCTRINE:documentation-in-step}}) rather than follow it
70
70
  into error. Code shaped without its documented intent repeats the mistakes the
71
71
  documentation exists to prevent. This is the read-before counterpart to
72
- {{DOCTRINE}} craft 3's write-after.
72
+ {{DOCTRINE:documentation-in-step}}'s write-after.
73
73
  <!-- LEAN:else -->
74
74
  Before changing part of the system, read the project's own documentation — `docs/`,
75
75
  `doc/`, `documentation/`, `wiki/`, or the README. Read the pages covering your change, not
76
- the whole tree. Where docs and code disagree, the code is ground truth ({{LAW}} III): flag
77
- the stale page and fix it in the same change ({{DOCTRINE}} craft 3).
76
+ the whole tree. Where docs and code disagree, the code is ground truth ({{LAW:verify-before-asserting}}): flag
77
+ the stale page and fix it in the same change ({{DOCTRINE:documentation-in-step}}).
78
78
  <!-- LEAN:end -->
79
79
 
80
- ### {{DOCTRINE}} process 5 — {{DOC_PROCESS_5}}
80
+ ### {{DOCTRINE:consent-before-push}} Consent Before Push
81
81
  <!-- LEAN:begin -->
82
82
  Recording and sharing code is consented, never unilateral. **Every** `git commit`
83
83
  and `git push` needs the user's **explicit acceptance**, on every branch, every
@@ -106,7 +106,7 @@ take the same gate. Never force-push, hard-reset, or rebase one: undo with a rev
106
106
  (git-rescue {{SKILL}} for a legitimate rewrite). The host gates both at the tool boundary.
107
107
  <!-- LEAN:end -->
108
108
 
109
- ### {{DOCTRINE}} process 6 — {{DOC_PROCESS_6}}
109
+ ### {{DOCTRINE:bound-the-loop}} Bound the Loop
110
110
  <!-- LEAN:begin -->
111
111
  Every autonomous loop needs an exit you set before you enter it. Before iterating —
112
112
  retrying, searching, generating-and-checking — fix the bounds: a cap on attempts, a
@@ -116,7 +116,7 @@ call, hitting the same error, or trying variations of one approach with no new
116
116
  information, that is not persistence, it is thrashing — break out, change strategy,
117
117
  gather different context, or stop. When a bound is reached or progress stalls, do
118
118
  not grind on: halt and hand back a structured summary of what was tried, what was
119
- learned, and what remains ({{LAW}} V, {{DOCTRINE}} process 2). {{DOCTRINE}} process 3
119
+ learned, and what remains ({{LAW:surface-failures}}, {{DOCTRINE:plan-before-acting}}). {{DOCTRINE:context-economy}}
120
120
  economises *within* a step; this bounds the *number* of steps. An agent that cannot
121
121
  stop itself is a cost without a limit.
122
122
  <!-- LEAN:else -->
@@ -124,11 +124,11 @@ Fix an autonomous loop's bounds before you enter it: an attempt cap, a time or t
124
124
  budget, an explicit definition of success *and* failure. Watch for the loop that has
125
125
  stopped progressing: the same call, the same error, variations with no new information are
126
126
  thrashing; break out, change strategy, or stop. When a bound is reached or progress
127
- stalls, halt with a structured summary of what was tried, learned, and remains ({{LAW}} V,
128
- {{DOCTRINE}} process 2).
127
+ stalls, halt with a structured summary of what was tried, learned, and remains ({{LAW:surface-failures}},
128
+ {{DOCTRINE:plan-before-acting}}).
129
129
  <!-- LEAN:end -->
130
130
 
131
- ### {{DOCTRINE}} process 7 — {{DOC_PROCESS_7}}
131
+ ### {{DOCTRINE:one-writer-per-file}} One Writer Per File
132
132
  <!-- LEAN:begin -->
133
133
  When several {{AGENTS}} work on the same code — sub-{{AGENTS}}, a pipeline crew, a
134
134
  workflow fan-out, another session or tool in this checkout — each file has one writer at