@hxp-tools/godplans 0.0.0-stage → 2.0.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 (144) hide show
  1. package/CHANGELOG.md +1176 -0
  2. package/LICENSE +21 -0
  3. package/PROMPT.md +4006 -0
  4. package/README.md +201 -2
  5. package/assets/README.md +11 -0
  6. package/assets/hero.svg +44 -0
  7. package/assets/plan-loop.svg +62 -0
  8. package/assets/quest-map.svg +80 -0
  9. package/bin/godplans.js +93 -0
  10. package/docs/ARCHITECTURE.md +136 -0
  11. package/docs/RELEASING.md +107 -0
  12. package/evals/README.md +295 -0
  13. package/evals/cases/brownfield-cli/EXPECTATIONS +15 -0
  14. package/evals/cases/brownfield-cli/INPUT/package.json +9 -0
  15. package/evals/cases/brownfield-cli/INPUT/src/cli.js +4 -0
  16. package/evals/cases/brownfield-cli/INPUT/src/format.js +3 -0
  17. package/evals/cases/brownfield-cli/INPUT/test/cli.test.js +7 -0
  18. package/evals/cases/brownfield-cli/REQUEST.baseline.md +10 -0
  19. package/evals/cases/brownfield-cli/REQUEST.md +10 -0
  20. package/evals/cases/compliance-refusal/EXPECTATIONS +4 -0
  21. package/evals/cases/compliance-refusal/REQUEST.baseline.md +9 -0
  22. package/evals/cases/compliance-refusal/REQUEST.md +8 -0
  23. package/evals/cases/greenfield-saas/EXPECTATIONS +21 -0
  24. package/evals/cases/greenfield-saas/REQUEST.baseline.md +11 -0
  25. package/evals/cases/greenfield-saas/REQUEST.md +11 -0
  26. package/evals/cases/nested-pillars/EXPECTATIONS +12 -0
  27. package/evals/cases/nested-pillars/REQUEST.baseline.md +10 -0
  28. package/evals/cases/nested-pillars/REQUEST.md +11 -0
  29. package/evals/cases/observability-evidence/EXPECTATIONS +10 -0
  30. package/evals/cases/observability-evidence/REQUEST.baseline.md +10 -0
  31. package/evals/cases/observability-evidence/REQUEST.md +11 -0
  32. package/evals/cases/product-business/EXPECTATIONS +18 -0
  33. package/evals/cases/product-business/REQUEST.baseline.md +13 -0
  34. package/evals/cases/product-business/REQUEST.md +14 -0
  35. package/evals/cases/product-form-routing/EXPECTATIONS +13 -0
  36. package/evals/cases/product-form-routing/REQUEST.baseline.md +11 -0
  37. package/evals/cases/product-form-routing/REQUEST.md +11 -0
  38. package/evals/cases/prose-integrity/EXPECTATIONS +19 -0
  39. package/evals/cases/prose-integrity/REQUEST.baseline.md +19 -0
  40. package/evals/cases/prose-integrity/REQUEST.md +20 -0
  41. package/evals/cases/replan-preserves-history/EXPECTATIONS +9 -0
  42. package/evals/cases/replan-preserves-history/INPUT/.godplans/PLAN.mdx +115 -0
  43. package/evals/cases/replan-preserves-history/INPUT/package.json +5 -0
  44. package/evals/cases/replan-preserves-history/REQUEST.baseline.md +10 -0
  45. package/evals/cases/replan-preserves-history/REQUEST.md +10 -0
  46. package/evals/cases/stale-prepublication/EXPECTATIONS +10 -0
  47. package/evals/cases/stale-prepublication/REQUEST.baseline.md +12 -0
  48. package/evals/cases/stale-prepublication/REQUEST.md +13 -0
  49. package/evals/cases/stale-source-evidence/EXPECTATIONS +10 -0
  50. package/evals/cases/stale-source-evidence/INPUT/package.json +8 -0
  51. package/evals/cases/stale-source-evidence/REQUEST.baseline.md +11 -0
  52. package/evals/cases/stale-source-evidence/REQUEST.md +12 -0
  53. package/evals/cases/weekend-library/EXPECTATIONS +19 -0
  54. package/evals/cases/weekend-library/REQUEST.baseline.md +10 -0
  55. package/evals/cases/weekend-library/REQUEST.md +11 -0
  56. package/evals/cases-roster.txt +19 -0
  57. package/evals/external/GRADE.schema.json +39 -0
  58. package/evals/external/README.md +42 -0
  59. package/evals/external/RUBRIC.md +32 -0
  60. package/evals/metrics/context-cost.json +154 -0
  61. package/evals/outcomes/README.md +65 -0
  62. package/evals/outcomes/cases/tenant-notes-api/REQUEST.baseline.md +14 -0
  63. package/evals/outcomes/cases/tenant-notes-api/REQUEST.md +13 -0
  64. package/evals/outcomes/cases/tenant-notes-api/VERIFY.sh +13 -0
  65. package/evals/outcomes/results/2026-07-23-tenant-notes-api-codex/README.md +93 -0
  66. package/evals/outcomes/results/2026-07-23-tenant-notes-api-codex/treatment/plan/PLAN.json +547 -0
  67. package/evals/runners/claude-baseline.sh +4 -0
  68. package/evals/runners/claude-grade.sh +3 -0
  69. package/evals/runners/claude.sh +4 -0
  70. package/evals/runners/codex-baseline.sh +181 -0
  71. package/evals/runners/codex-builder.sh +96 -0
  72. package/evals/runners/codex-godaudits.sh +84 -0
  73. package/evals/runners/codex.sh +147 -0
  74. package/evals/runners/gemini-baseline.sh +4 -0
  75. package/evals/runners/gemini-grade.sh +3 -0
  76. package/evals/runners/gemini.sh +4 -0
  77. package/evals/runners/vendor-cli.sh +257 -0
  78. package/evals/runners/vendor-grade.sh +82 -0
  79. package/install.sh +323 -0
  80. package/package.json +92 -4
  81. package/requirements/skills-ref.txt +2 -0
  82. package/scripts/build-catalog.js +114 -0
  83. package/scripts/build-prompt.sh +257 -0
  84. package/scripts/context-metrics.js +118 -0
  85. package/scripts/eval-external.js +226 -0
  86. package/scripts/eval-matrix.sh +172 -0
  87. package/scripts/eval-outcome.js +143 -0
  88. package/scripts/eval.sh +321 -0
  89. package/scripts/lint-parity.js +331 -0
  90. package/scripts/lint.sh +743 -0
  91. package/scripts/outcome-summary.js +126 -0
  92. package/scripts/release-check.sh +108 -0
  93. package/scripts/release-prepare.js +41 -0
  94. package/scripts/summarize-eval.js +91 -0
  95. package/scripts/summarize-matrix.js +101 -0
  96. package/scripts/version-sync.js +65 -0
  97. package/skills/godplans/SKILL.md +192 -0
  98. package/skills/godplans/references/agent-memory.md +168 -0
  99. package/skills/godplans/references/architecture.md +189 -0
  100. package/skills/godplans/references/build.md +130 -0
  101. package/skills/godplans/references/business.md +252 -0
  102. package/skills/godplans/references/code-quality.md +165 -0
  103. package/skills/godplans/references/compliance.md +59 -0
  104. package/skills/godplans/references/database.md +157 -0
  105. package/skills/godplans/references/deploy.md +146 -0
  106. package/skills/godplans/references/discovery.md +297 -0
  107. package/skills/godplans/references/doc-set.md +243 -0
  108. package/skills/godplans/references/exemplar.md +228 -0
  109. package/skills/godplans/references/launch.md +162 -0
  110. package/skills/godplans/references/llm.md +132 -0
  111. package/skills/godplans/references/observe.md +178 -0
  112. package/skills/godplans/references/plan-format.md +340 -0
  113. package/skills/godplans/references/product.md +130 -0
  114. package/skills/godplans/references/repo.md +184 -0
  115. package/skills/godplans/references/roadmap.md +158 -0
  116. package/skills/godplans/references/security.md +156 -0
  117. package/skills/godplans/references/seo.md +133 -0
  118. package/skills/godplans/references/stack.md +133 -0
  119. package/skills/godplans/references/style-genome.md +198 -0
  120. package/skills/godplans/references/ui.md +153 -0
  121. package/skills/godplans/references/ux.md +150 -0
  122. package/skills/godplans/schemas/PLAN.schema.json +275 -0
  123. package/skills/godplans/schemas/PLAN.v1.schema.json +258 -0
  124. package/skills/godplans/scripts/plan-halflife.sh +76 -0
  125. package/skills/godplans/scripts/style-stats.py +630 -0
  126. package/skills/godplans/scripts/validate-plan.sh +1709 -0
  127. package/skills/godplans/templates/PLAN.template.mdx +269 -0
  128. package/tests/agent-memory-guidance.sh +32 -0
  129. package/tests/build-catalog.sh +81 -0
  130. package/tests/codex-runner.sh +139 -0
  131. package/tests/eval-harness.sh +377 -0
  132. package/tests/evidence-harnesses.sh +243 -0
  133. package/tests/fixtures/plan-json-v1-1.13.0.json +472 -0
  134. package/tests/install-regression.sh +246 -0
  135. package/tests/lib/plan-schema-check.js +163 -0
  136. package/tests/lint-selftest.sh +582 -0
  137. package/tests/package-contents.sh +140 -0
  138. package/tests/portable-prompt.test.sh +261 -0
  139. package/tests/release-tooling.sh +204 -0
  140. package/tests/run.sh +14 -0
  141. package/tests/script-usage.sh +37 -0
  142. package/tests/style-stats.sh +170 -0
  143. package/tests/validate-plan.sh +1970 -0
  144. package/tests/vendor-runner.sh +291 -0
@@ -0,0 +1,192 @@
1
+ ---
2
+ name: godplans
3
+ description: "Produce an audit-aware, agent-executable master plan (PLAN.mdx) before application code is written. One command runs discovery, forces hard-to-reverse decisions, and plans product, business (pricing, entitlements, billing, metrics, feedback), architecture, roadmap, stack, repo, build, deploy, observability, launch, security, code quality, style genome, database, LLM integration, SEO, UI, UX, and agent memory upfront. After-the-fact audit checks become plan-time acceptance criteria, a prose-integrity pass removes generic language without changing meaning, and a self-contained validator enforces task structure and approval state. Use when the user says: plan this project, godplans, master plan, product plan, plan everything upfront, plan before code, audit-aware plan, replan, or starts a greenfield project or major feature. Refuses plan theater, vague tasks without verification, unsupported quality guarantees, and projects whose core purpose violates the Anthropic Usage Policy."
4
+ license: MIT
5
+ metadata:
6
+ version: "2.0.0"
7
+ author: Hanns Peter
8
+ homepage: https://github.com/hannsxpeter/godplans
9
+ ---
10
+
11
+ > Invocation: `/godplans` in Claude Code, Cursor, VS Code, Zed, and Factory; `$godplans` in Codex; `@godplans` in Windsurf; auto-triggered elsewhere. Treat any text after the command as the argument: an idea, a path, or a constraint. There are no sub-commands.
12
+
13
+ # godplans
14
+
15
+ Plan everything before anything. godplans is a planning superskill: it runs the decision arc of a software project upfront and emits one master plan, `.godplans/PLAN.mdx`, whose decisions, hypotheses, open questions, tasks, and verification commands are explicit enough for a coding agent to execute checkbox by checkbox.
16
+
17
+ The core move is inversion. Auditors run after the work exists and tell you what is wrong. godplans takes the dimensions those auditors check (code quality, security, database, LLM integration, SEO, UI, UX, product delivery and monetization) and the disciplines the arc tiers enforce (PRD, architecture, roadmap, stack, repo, build, deploy, observability, launch, hardening) and converts applicable checks into plan-time requirements with acceptance criteria on concrete tasks. This is designed to prevent avoidable findings and rewrites; it does not replace runtime verification or an independent final audit.
18
+
19
+ godplans descends from: hannsxpeter/arc-ready and hannsxpeter/ready-suite (the tier disciplines), hannsxpeter/auditor-suite (codeauditor, secauditor, dbauditor, llmauditor, seoauditor, uiauditor, uxauditor, and productauditor: the inverted audit dimensions), hannsxpeter/pillars (agent memory), hannsxpeter/codedna (style genome), hannsxpeter/docdna (the documentation set), UditAkhourii/adhd (the critic is not the author), BuilderIO visual-plan (plan discipline and the visual layer), mattpocock/skills wayfinder (one fact in one place, and a frontier that is proved rather than asserted), cursor/pstack unslop (a meaning-preserving prose integrity pass before independent scoring), and t3dotgg/tstack council (a cross-provider review panel that reports a missing member instead of substituting one).
20
+
21
+ ## Ground rules (non-negotiable)
22
+
23
+ 1. **Planning is read-only.** Make no source edits while building the plan. The only files godplans writes are under `.godplans/`.
24
+ 2. **Every plan element is exactly one of three things**: a grounded decision with rationale, a flagged hypothesis with a validation plan, or a named open question with a recommended default. Anything that is none of the three is theater; rewrite or delete it.
25
+ 3. **The substitution test.** For any sentence in the plan, substitute a near-equivalent (a competitor, another framework, another product). If it still reads plausibly, it decides nothing specific and fails. Cut it or make it specific.
26
+ 4. **Standalone-plan rule.** No revision language, no chat-context dependencies. A reader who never saw this conversation must understand the plan completely.
27
+ 5. **Decide the hard-to-reverse bets first.** Wire formats, public identifiers, data-model shape, auth and ownership boundaries come before anything scoped or cosmetic. Every hard-to-reverse decision carries a `Falsifier:` block with `Signal`, `Failure boundary`, and `Replan action` fields. The block names what is observed, the event or measurement that proves the decision wrong, and the concrete return-to-planning action. A bet you cannot lose is not a bet.
28
+ 6. **Reuse-first.** Every task names what it reuses (existing schema, components, helpers, services) before what it adds.
29
+ 7. **Never pad, never stub.** No single-step plans, no filler sections, no placeholder content. If a domain does not apply, exclude it with a stated reason; do not fill it with generic prose.
30
+ 8. **Read the module before authoring.** Each domain has a reference module under `references/`. Read it at the moment you author that plan section. Do not author from memory; the modules carry the inverted audit checks, and memory drifts.
31
+ 9. **Compliance is standing.** Follow `references/compliance.md` for the whole session: never coach a model past a refusal, never route subscription OAuth outside official clients, and screen the project itself against the Anthropic Usage Policy before planning it.
32
+ 10. **Absence of a look is never absence of a thing.** Every exclusion, of a domain or a document, records the evidence state behind it: `absent` when something checked and the reason names what checked, or `by-design` when the plan itself settles it. `unknown` and `hint` never exclude; they make the thing applicable or become an open question with a default. And every exclusion carries a `revisit when` predicate, because an exclusion with no expiry is a silence with a reason attached.
33
+ 11. **No invented numbers.** Availability targets, recovery objectives, retention periods, error budgets, review cadences, and thresholds quoted as existing behavior are commitments somebody owns. Cite the source, take the user's answer, make it a decision with a falsifier boundary, or put it in Open Questions with a recommended default. A number invented at plan time gets quoted back later as though somebody had committed to it.
34
+
35
+ ## Method
36
+
37
+ Run the phases in order. Do not skip a phase; a phase that does not apply still gets a one-line disposition so the trail is complete.
38
+
39
+ ### Phase 0: Orient
40
+
41
+ Detect what exists. Look for:
42
+
43
+ - `.godplans/PLAN.mdx` -> **replan mode** (see Modes below).
44
+ - Source code (manifests like `package.json`, `pyproject.toml`, `go.mod`, `Cargo.toml`) -> **brownfield mode**.
45
+ - Neither -> **greenfield mode**.
46
+
47
+ Record the mode. In replan mode, run `scripts/plan-halflife.sh .godplans/PLAN.mdx .godplans/PLAN.metrics.json` now, while `.godplans/validate-plan.sh` is still the outgoing plan's own validator; if no validator can measure the outgoing plan, log `half-life: not measured (<reason>)` in the session log and continue. Bind the plan to disk evidence before planning: record the current Git revision when available, list the source and intake evidence used, compute a SHA-256 input digest, and record the UTC validation timestamp. In brownfield mode, fingerprint before planning: read the manifests, entry points, and directory shape, run `scripts/style-stats.py` from this skill on the project root for the measured style baseline, then close-read enough representative source to interpret it. The plan must extend what exists, not fight it. This pass is read-only. Record what the fingerprint did not reach as explicitly as what it found; a pass that never ran is not a pass that came back empty.
48
+
49
+ ### Phase 1: Compliance gate
50
+
51
+ Read `references/compliance.md` and screen the project idea against it before investing in discovery.
52
+
53
+ - **Hard stop**: the core purpose is prohibited (fake-review farms, engagement bots, phishing kits, scrapers that evade platform safeguards, undisclosed AI passing as human, malware). Say plainly why, cite the policy category, and stop. Do not produce a plan.
54
+ - **Mitigate**: the project is legitimate but has a risky component (consumer chatbot, high-risk consumer domain, web automation, scraping). Continue, and inject the module's mitigation requirements into the plan as mandatory tasks.
55
+ - **Pass**: note "Compliance gate: pass" and continue.
56
+
57
+ The result, one short section, goes into the plan.
58
+
59
+ For a mitigate or pass result, create `.godplans/` and copy
60
+ `scripts/validate-plan.sh` from this skill into it immediately, before discovery
61
+ or plan authoring. Make it executable and confirm it is byte-identical to the
62
+ resolved skill source. Create the validator companion before drafting the plan.
63
+ A hard stop creates neither artifact. In replan mode, copy only after the Phase 0
64
+ half-life measurement.
65
+
66
+ ### Phase 2: Intake and applicability
67
+
68
+ Read `references/discovery.md`. Establish:
69
+
70
+ 1. **Product form**: web application, API or service, CLI or SDK, mobile or desktop, data or ML, or infrastructure or IaC. Pick this before archetype and domain composition because it defines vertical slices and completion evidence. Record secondary forms only when they have independent users, contracts, distribution paths, and deliverables.
71
+ 2. **Archetype and overlays**: score the nine archetypes on weighted signals with vetoes, record primary, runner-up, margin, and the confidence those numbers give, and price what changes if the runner-up is right. Below the 0.45 floor the archetype is `unknown` and takes a slot in the question batch. Then add the overlays that fire (`ai-system`, `public-ui`, `shipped-artifact`, `operated-by-others`, `regulated-data`, `agent-skill-package`, `monetized`). An archetype says what this is; an overlay says what extra obligations it carries, and an overlay raises a domain's disposition and never lowers it.
72
+ 3. **Applicability matrix**: every planning domain in the table below is applicable, deferred, or excluded. A CLI tool excludes seo and ui; it does not get empty SEO sections. An excluded row carries three things: the evidence state (`absent:` or `by-design:`), the project-specific reason, and a `revisit when:` predicate that would make the domain applicable again. Deferral is reserved for the deferrable set in the discovery module (seo, launch, observe, ui, deploy): the row names the observable trigger that forces the domain pass and argues reversibility until then. The matrix goes into the plan verbatim.
73
+ 4. **Scale calibration**: weekend project, side project, funded product, or enterprise system. Requirements scale with the calibration; a guestbook does not get a compliance program. Weekend plans have at most 3 phases and 8 tasks. Treat that as a hard ceiling, not a target, and fit the total task appetites inside the user's stated capacity.
74
+
75
+ ### Phase 3: Discovery
76
+
77
+ Read `references/discovery.md` for the interview protocol. Ask at most one batch of 3 to 5 high-leverage questions, each with a recommended default so the user can answer "defaults" and proceed. Everything not asked becomes a stated assumption in the plan, flagged as a hypothesis. Surface the hard-to-reverse bets now; they are the questions worth spending the batch on.
78
+
79
+ ### Phase 4: Domain passes
80
+
81
+ For each applicable domain, in this order, read its module and author that plan section:
82
+
83
+ | Order | Domain | Module | Descends from |
84
+ |---|---|---|---|
85
+ | 1 | Product (PRD) | `references/product.md` | prd-ready |
86
+ | 2 | Business (product-director lens) | `references/business.md` | productauditor |
87
+ | 3 | Architecture | `references/architecture.md` | architecture-ready |
88
+ | 4 | Stack | `references/stack.md` | stack-ready |
89
+ | 5 | Database | `references/database.md` | dbauditor |
90
+ | 6 | Security | `references/security.md` | secauditor, harden-ready |
91
+ | 7 | LLM integration | `references/llm.md` | llmauditor |
92
+ | 8 | UX | `references/ux.md` | uxauditor |
93
+ | 9 | UI | `references/ui.md` | uiauditor |
94
+ | 10 | SEO and AI visibility | `references/seo.md` | seoauditor |
95
+ | 11 | Code quality | `references/code-quality.md` | codeauditor |
96
+ | 12 | Style genome | `references/style-genome.md` | codedna |
97
+ | 13 | Agent memory | `references/agent-memory.md` | pillars |
98
+ | 14 | Repository | `references/repo.md` | repo-ready |
99
+ | 15 | Application build | `references/build.md` | production-ready |
100
+ | 16 | Roadmap and tasks | `references/roadmap.md` | roadmap-ready, kickoff-ready |
101
+ | 17 | Deployment | `references/deploy.md` | deploy-ready |
102
+ | 18 | Observability | `references/observe.md` | observe-ready |
103
+ | 19 | Launch | `references/launch.md` | launch-ready |
104
+
105
+ Each module gives you: the decisions to force, plan requirements, task seeds, a self-audit rubric (used in Phase 6), and anti-patterns. Apply them at the selected scale. Satisfy load-bearing requirements and record a compact module-level disposition for requirements dropped by scale, archetype, or form. Do not instantiate a task seed merely because it exists. Weekend plans select only requirements that materially change product behavior, public compatibility, security, or verification within the stated appetite.
106
+
107
+ Excluded domains get one line in the applicability matrix and nothing else. Deferred domains get a matrix row, a trigger, and a reversibility argument, but no domain section or tasks until the trigger fires.
108
+
109
+ ### Phase 5: Inversion pass
110
+
111
+ Walk every applicable module's Plan requirements section and give each requirement one of two dispositions: landed somewhere concrete, or dropped in the compact module disposition with its dropping layer (`scale`, `archetype`, or `form`) and a specific reason. Deferral applies to a whole domain in the matrix, never to one requirement. A landed requirement appears as a decision, an acceptance criterion on a task, or an entry in Open Questions with a recommended default. Distribute landed requirement IDs (R-PRD-3, R-SEC-12, R-DB-4) onto tasks via their `Requirements:` lines so traceability is grep-able. An applicable requirement with neither disposition is a hole; fix it before Phase 6. Recount phases, tasks, and total appetite against the scale ceiling before continuing.
112
+
113
+ ### Phase 5b: Prose integrity pass
114
+
115
+ Read `references/exemplar.md`, including its prose-integrity gate. Freeze the plan's meaning before editing: IDs, decisions, hypotheses, question owners and defaults, requirement references, numbers, sources, file paths, commands, applicability dispositions, task dependencies, and lifecycle state may not change during this pass. Rewrite human-facing prose only. Code, commands, paths, identifiers, protocol fields, quoted evidence, and wording required by an external contract stay literal.
116
+
117
+ Scan every plan section against that gate's ten checks: a vague attribution names its source or becomes a flagged hypothesis or is deleted; a quality claim names its mechanism; plain verbs replace filler and indirect wording; lists and ranges express a real relationship; dense or actorless sentences are split and planned actions name their actor; one domain concept keeps one canonical noun; hedging matches recorded uncertainty; and decorative explanation is deleted.
118
+
119
+ Run the substitution test and three-label test again after rewriting. Then compare the before and after plan: if a commitment, uncertainty label, source, scope boundary, or verification condition changed, restore the original meaning and rewrite only the sentence. This gate is contextual, not a global word blacklist. A technical term is allowed when it is the exact term the design needs.
120
+
121
+ ### Phase 6: Independent audit gate
122
+
123
+ The author does not grade the author. Run this phase under critic posture, in a turn separate from Phase 4 authoring, and where the harness allows it in an isolated context (a Claude Code subagent, a fresh Codex run, a new Cursor chat) given only the drafted `.godplans/PLAN.mdx` and the rubric text, with nothing carried from the authoring conversation. When no isolated context is available, run it as a distinct turn and record that the critic was not isolated.
124
+
125
+ **6a. Score.** Read `references/exemplar.md` first; it is the calibration for what full marks mean. Then score the draft against the landed requirement set for every applicable module, 0 to 100 per domain. Score the drafted text only: authoring intent is not evidence, and no section is credited for what it meant to say. Dropped rubric items stay out of the denominator only when their module disposition names the dropping layer and a specific reason. Repair nothing while scoring; a critic that edits has become an author again.
126
+
127
+ **6b. Name every deduction.** Each lost point cites the section, quotes the sentence that lost it, names the rubric line, and states the points. A deduction with no quoted text is not a deduction, and those points are restored. Produce the complete scorecard before any revision.
128
+
129
+ **6c. Revise and rescore.** Any scored domain below 85: revise that section and rescore. Every revision quotes the deduction it answers. A rescore that raises a domain with no corresponding revision is a self-report and is discarded. Do not raise a score by adding work that breaks the scale ceiling; cut or consolidate first.
130
+
131
+ **6d. Council (opt-in).** Runs only when the user's request asks for a council or cross-provider review (read from the argument text; there is no sub-command). Otherwise Phase 6 runs as written, with one critic as the default.
132
+
133
+ - **Check first.** Assemble the draft per Phase 7 step 1 before round one, then run `bash .godplans/validate-plan.sh --allow-planning .godplans/PLAN.mdx` and fix what it reports until it exits zero. A round costs three model runs. Phase 7's emission gate still runs at the end.
134
+ - **Panel.** Three delegates, one current flagship model from each of three provider families, as the user or harness picks. Name no model IDs; record the names the harness reports. Use the host's delegation tools or each provider's official client under its own sign-in (`references/compliance.md` A2, Authentication hygiene), never extracted subscription credentials, at high reasoning effort where exposed. Before sending, name in chat the providers that receive the plan; in brownfield mode it describes private code.
135
+ - **No substitution.** Two delegates from one family are not a council. Name any unreachable family. With two families, run and record the council as partial; with fewer, run the single critic and record that council did not run.
136
+ - **Delegates.** Each runs isolated and read-only, never sees another's output, gets the Phase 6 inputs only, runs 6a and 6b, and returns per-domain scores with quoted deductions. Discard any deduction whose quote is not verbatim in the plan. Record a missing score as `no score`; never invent one.
137
+ - **Aggregate.** A domain passes at a median of 85 or higher. In council mode the median rule and the round cap below replace 6c's per-score trigger and open-ended loop; the rest of 6c binds: every revision quotes the deduction it answers, a rescore with no matching revision is discarded, and the scale ceiling holds. Answer each surviving deduction with a revision or dismiss it with a one-line reason printed in chat; a deduction answerable only by work past the ceiling is cut, consolidated, or dismissed with that reason.
138
+ - **Rounds.** One full panel pass is a round; later rounds rescore revised domains only, delegates see the dismissal list, and a dismissal returns only with new evidence. After round three, a domain under 85 goes to the user in the Phase 7 presentation as a blocking disagreement with its deductions; the plan does not ship until the user decides.
139
+ - **Output.** The scorecard shows one column per delegate per round, each domain's median and spread, the panel, round count, and dismissed deductions. Add one Session log line (under 140 characters).
140
+
141
+ Print the scorecard in chat when done, including whether the critic ran isolated. A plan that would not survive its own descendant auditors does not ship.
142
+
143
+ ### Phase 7: Emit and hand off
144
+
145
+ 1. Read `references/plan-format.md` and `templates/PLAN.template.mdx`. Assemble `.godplans/PLAN.mdx` per that contract: frontmatter machine state, mermaid visuals where they carry weight, one Documentation set section, phases and waves, GP-numbered checkbox tasks with Files, Depends on, Reuses, Acceptance, Verify, and Requirements lines, one Open Questions section at the bottom, executor rules, session log.
146
+ 2. Complete the three-artifact emission gate before any response: re-copy `scripts/validate-plan.sh` from this skill byte-for-byte to the pre-created `.godplans/validate-plan.sh`, make the companion executable, use `cmp -s` against that same resolved source path, then run `bash .godplans/validate-plan.sh --allow-planning --emit-json .godplans/PLAN.json .godplans/PLAN.mdx`. The emission is incomplete if PLAN.mdx, its executable validator, or PLAN.json is missing. When a planned task runs `.godplans/style-stats.py`, also copy `scripts/style-stats.py` from this skill byte-for-byte to that path, a conditional copy outside the three-artifact gate. The validator embeds its requirement catalog, validates provenance and conditional public-release gate structure, and must work without access to the installed skill on stock macOS and Linux. It is the machine gate; do not recreate its checks with grep. Fix every failure before presenting. PLAN.json is a generated, derived view; it is never hand-edited, and its `plan_digest` lets consumers detect staleness.
147
+ 3. Present in chat: the objective, the mode and archetype, the applicability matrix, the scorecard, task and phase counts, the open questions with recommended defaults, and the executor protocol in three lines. Name every task, decision, and question you mention by its title, with the ID in support: "GP-204 wire session middleware into the API router", never a bare "GP-204". IDs are how the machine addresses the plan; a wall of them is how a human loses it. Lead with the result. Omit canned greetings, praise, sycophantic agreement, generic disclaimers, and generic closing lines. First-person voice is allowed when it identifies what the planning agent did or carries an attributed user or founder statement; never invent a collective "we". Presenting the plan is the sign-off request; wait for approval before anyone builds.
148
+ 4. After explicit user sign-off, change `status: planning` to `status: approved`, update the date, and run `bash .godplans/validate-plan.sh .godplans/PLAN.mdx`. Do not start application work as part of approval.
149
+
150
+ Final artifact check: `test -f .godplans/PLAN.mdx && test -x .godplans/validate-plan.sh && test -f .godplans/PLAN.json`. Never present a plan until this command and the structural validator both exit zero.
151
+
152
+ ## Modes
153
+
154
+ - **Greenfield**: the full method above.
155
+ - **Brownfield**: Phase 0 fingerprints the existing codebase first. The style genome is extracted, not invented; the stack section records what is and plans only deliberate changes; tasks reference real existing files. The plan extends the codebase, never restarts it.
156
+ - **Replan**: `.godplans/PLAN.mdx` exists. Snapshot it to `.godplans/archive/PLAN-v<n>.mdx`, then re-derive state from disk: count checked and unchecked tasks, read the session log, and recompute the recorded source and completed-or-imported evidence. If material evidence drifted, treat the plan as stale and return it to `planning` before reconciliation. Completed tasks are never renumbered, reworded, or unchecked. New and changed work gets new task IDs. Superseded unstarted tasks are struck through with a one-line reason, not deleted. The Phase 0 half-life report on the outgoing plan measures cumulative task survival and per-domain supersession rate; a domain struck repeatedly was over-planned at that scale, so shrink its appetite instead of reseeding the same tasks. If the re-copied validator reports a missing domain, the skill gained it after the plan was written: add its matrix row, frontmatter entry, and (when applicable) disposition line on the usual rules, re-point any documentation row whose catalog owner moved, and treat an applicable new domain as material. Refresh provenance, bump the plan version, record the delta in the session log, regenerate PLAN.json, and require fresh approval before execution resumes.
157
+
158
+ ## After the plan: execution
159
+
160
+ godplans plans; it does not build. The status lifecycle is `planning -> approved -> executing -> done`. A material replan restarts at `planning` and requires fresh approval. The emitted PLAN.mdx and `.godplans/validate-plan.sh` companion are self-sufficient: the plan carries its own executor rules and machine gate, so any coding agent (this one, or another tool entirely) can execute it without godplans installed. When the user asks you to execute a godplans plan, refuse unless frontmatter status is `approved` or `executing`, run `bash .godplans/validate-plan.sh .godplans/PLAN.mdx`, then follow the "Rules for executing agents" section inside PLAN.mdx itself. The first executor changes `approved` to `executing`; only a successful final Verification phase changes `executing` to `done`. When execution drifts from the plan, return it to `planning` and patch it (replan mode), because the document, not the chat, is the source of truth.
161
+
162
+ ## What godplans refuses
163
+
164
+ - **Plan theater**: sections filled, decisions absent. Every section either decides something specific or names the open question.
165
+ - **Invisible plans**: prose that substitutes cleanly into any other project. Specificity is the discipline.
166
+ - **Vague tasks**: any task without grep-verifiable acceptance criteria and an exact verify command does not ship.
167
+ - **Feature laundry lists**: features without prioritization and sequencing are not a roadmap.
168
+ - **Scope leak at plan time**: godplans does not write application code, scaffold repos, or run deploys. It plans them.
169
+ - **Policy-violating projects**: the Phase 1 gate is not advisory. Prohibited purposes get a refusal with the policy category named.
170
+ - **Silent domain skipping**: a domain is planned now, deferred with an observable trigger and reversibility argument, or excluded with an evidence state, a reason, and a tripwire. Never silently absent.
171
+ - **Laundered gaps**: an exclusion, of a domain or a document, that reads like a considered decision because nothing records whether anyone looked. The evidence state and the `revisit when` predicate are what separate a decision from a silence, and both are machine-checked.
172
+ - **Invented numbers**: an availability target, recovery objective, retention period, or review cadence the plan made up so a section would be complete. Cite it, decide it with a falsifier, or ask it.
173
+ - **Ungated promises**: a marker an executor acts on that nothing verifies. `[P]` promises a task is safe to run beside its wave siblings, and the frontmatter domain lists promise they say what the applicability matrix says. Both are machine-checked, because a promise the machine does not check is a claim the plan makes on the executor's behalf.
174
+
175
+ ## File map
176
+
177
+ | File | Role |
178
+ |---|---|
179
+ | `SKILL.md` | This orchestrator |
180
+ | `references/plan-format.md` | The PLAN.mdx contract: structure, task format, MDX safety, executor rules |
181
+ | `references/discovery.md` | Intake, archetype detection, applicability matrix, interview protocol |
182
+ | `references/compliance.md` | Anthropic Usage Policy gate and account-safety rules |
183
+ | `references/exemplar.md` | Worked GOOD and BAD plan fragments; the quality bar |
184
+ | `references/doc-set.md` | The documentation-set contract: catalog, lifecycle stages, durability, selection and exclusion rules |
185
+ | `references/<domain>.md` | 19 domain modules (see Phase 4 table) |
186
+ | `templates/PLAN.template.mdx` | The skeleton PLAN.mdx |
187
+ | `scripts/validate-plan.sh` | Self-contained validator copied beside each emitted plan |
188
+ | `scripts/plan-halflife.sh` | Replan metric generator for cumulative and per-domain task supersession |
189
+ | `scripts/style-stats.py` | Measured style baseline for the style-genome pass (naming histograms, comment density, function length) |
190
+ | `schemas/PLAN.schema.json` | Published JSON Schema for the generated PLAN.json sidecar (`plan-json@2`; `PLAN.v1.schema.json` covers `@1` sidecars) |
191
+
192
+ ## Skill version: 2.0.0
@@ -0,0 +1,168 @@
1
+ # Agent memory (pillars) planning module
2
+
3
+ Plans the AGENTS.md loader plus the agents/ pillar tree the project ships at scaffold time, so executing agents load correct project memory from the first commit. The orchestrator loads this module for every archetype: the pillar SET varies by archetype, but the loader, the floor pillars, and the exclusion discipline are universal. The style genome arrives as pillar content inside agents/quality.md (see style-genome.md R-DNA-16), never as additions to the AGENTS.md loader or the CLAUDE.md redirect.
4
+
5
+ ## Lineage
6
+
7
+ Descends from the Pillars standard (github.com/hannsxpeter/pillars, spec v1.2.2) and its three operational skills: pillars-init (archetype detection, AGENTS.md drop, local catalog, stub creation, exclusion defaults), pillars-author (evidence-based drafting of one pillar with approval gates and a no-fabrication rule), and pillars-verify (read-only drift audit of pillar claims against actual code). The discipline that carries over: agent memory is a thin constant-size loader plus per-domain files whose frontmatter routes loading; each concern is present, stubbed, excluded, locally cataloged as absent, or unknown; prescriptive content must earn its keep by being non-inferable from code; nested scopes inherit outer guidance with nearest-scope precedence; and every claim a pillar makes is checkable against the tree, so a plan that states facts the build will not produce creates drift at birth. godplans inverts the verify pass: instead of auditing pillars after the fact, the plan specifies pillars whose claims are true by construction while preserving Pillars 1.0 single-scope behavior.
8
+
9
+ ## Decisions to force
10
+
11
+ 1. Archetype declaration. Question: which of the eight standard archetypes is this project (CLI tool, internal API service, SaaS dashboard/web app, marketing site, mobile app, ML pipeline, OSS library, greenfield/custom)? Hard to reverse because the archetype fixes the Core-pillar applicability matrix, the starter exclusion list, and the primary Tier 3 pillar; changing it later invalidates the whole inventory. Options: pick one archetype and cite the file signals that will exist after scaffolding; or declare custom and skip exclusion defaults. Default: pick the single closest archetype; if two fit (Next.js as dashboard vs marketing site), resolve it as a discovery question, never guess.
12
+
13
+ 2. Pillar inventory and exclusion set. Question: for each of the 11 Core pillars (stack, arch, data, api, ui, auth, quality, development, release, deploy, observe) and 11 Common pillars (config, security, privacy, compliance, i18n, a11y, analytics, integrations, async, cache, notifications), is it present, stubbed, excluded, cataloged absent, or unknown, and which Domain pillars join them? Hard to reverse because pillars-verify flags code appearing in an excluded area as a finding, and conflating absence with unknown creates false project claims. Options: full authoring at birth, stubs with Gaps questions, local `agents/catalog.yaml` entries for known absences, structured exclusions, or no Pillars-specific claim for unknown concerns. Default: author what the plan decides, stub what needs the user, catalog known absences that must remain discoverable, exclude inapplicable concerns with concrete reasons, and leave truly unknown concerns unknown.
14
+
15
+ 3. Boundary assignments. Question: which pillar owns each piece of content (secrets in config not auth; product analytics separate from system observe; file layout in repo vs module shape in arch; transactional notifications vs marketing email; web UI in ui.md, CLI UX in cli.md; testing, errors, style bundled in quality)? Hard to reverse because content migrates poorly once agents have learned where to look, and wrong boundaries breed cross-pillar duplication. Options: follow the standard's tiebreakers or document a deviation. Default: follow the tiebreakers; deviations require a stated reason in the plan.
16
+
17
+ 4. Coupling graph shape. Question: which pillars hard-couple via must_read_with (depth 1 only, max 3 per pillar) and what graduates to always_load? Hard to reverse because agents rely on frontmatter for predictable loading; hidden transitive deps or a fat always_load set are structural, not editorial, fixes. Options: keep the mandatory floor (context, repo) as the full always_load set and use sparse must_read_with; or promote a widely shared dependency after documenting the repeated dependency and confirming the total always-load budget still holds. Default: floor-only always_load; if 3 or more planned pillars would list the same dependency, promote it only when the budget has room, otherwise restructure the boundary.
18
+
19
+ 5. Instruction-file topology and scopes. Question: which directories are real Pillars scopes, each containing both AGENTS.md and agents/, and which tool-native files redirect to the applicable loader? Hard to reverse because parallel instruction documents fork memory while an accidental nested scope changes precedence. Options: one root scope for a single project; root plus independently governed package scopes in a monorepo; or tool-native files as primary (non-compliant). Default: one root scope with redirects, adding a nested package scope only when it needs local routing or overrides. Outer guidance applies first and nearest-scope guidance wins conflicts.
20
+
21
+ 6. Floor authoring depth. Question: are context.md and repo.md born as status: present or as stubs? Hard to reverse only in cost: stubs force every early agent session to pause and ask. Options: present at birth from plan content, or stubs. Default: present at birth; a greenfield plan already knows the domain vocabulary, invariants, and intended layout.
22
+
23
+ 7. Portable discovery and budget. Question: which task phrases must route deterministically, and how much context may each scope load? Hard to reverse because fuzzy-only routing and oversized always-loaded files make behavior depend on the host and tax every task. Options: the Pillars ASCII token matcher plus routing fixtures and standard budgets; semantic matching only as an optional superset. Default: deterministic token matching, fixtures for representative tasks, always-loaded files at most 1,000 words and 8 KiB each, and task-routed files at most 2,000 words and 16 KiB each unless a documented exception earns the cost.
24
+
25
+ ## Plan requirements
26
+
27
+ 1. R-MEM-1: PLAN.mdx declares the project archetype from the standard 8-archetype table and cites the concrete signals (manifest fields, framework dependencies, directory shape) that will exist once scaffolded. Mapping from the godplans archetype set (discovery.md, Archetype detection): cli-tool -> CLI tool, api-service -> internal API service, saas-dashboard -> SaaS dashboard/web app, marketing-site -> marketing site, mobile-app -> mobile app, ml-pipeline -> ML pipeline, library -> OSS library; extension and game map to greenfield/custom, and an `unknown` archetype (below the 0.45 floor) maps to greenfield/custom until the archetype question resolves.
28
+ Criterion: WHEN the archetype is declared, THE PLAN SHALL cite at least two file signals such that pillars-init detection on the finished repo would agree without asking.
29
+
30
+ 2. R-MEM-2: PLAN.mdx schedules AGENTS.md at the repo root in the first commit, containing exactly the canonical elements: reference to Pillars 1.2.2, the 6-step loading protocol, the 5-state missing-pillar table, a structured excluded: yaml block, and nested-scope precedence when nested scopes exist.
31
+ Criterion: WHEN the AGENTS.md task is specified, THE PLAN SHALL require the first four elements, SHALL add nested-scope precedence when nested scopes exist, and SHALL forbid enumerating pillar names inside AGENTS.md.
32
+
33
+ 3. R-MEM-3: PLAN.mdx resolves all 11 Core and 11 Common identities as present, stubbed, excluded, locally cataloged absent, or unknown; it never silently promotes unknown to absent.
34
+ Criterion: WHEN the inventory is emitted THE PLAN SHALL include development, release, and privacy, SHALL distinguish cataloged absence from unknown, and SHALL never claim a missing local catalog knows an absent concern.
35
+
36
+ 4. R-MEM-4: PLAN.mdx specifies the excluded: list in structured {name, reason} form with project-specific reasons derived from the actual stack, not generic archetype boilerplate.
37
+ Criterion: WHEN an exclusion is stated, THE PLAN SHALL give a concrete reason (e.g. "Vercel Analytics covers monitoring"), not a bare archetype default.
38
+
39
+ 5. R-MEM-5: PLAN.mdx creates agents/context.md and agents/repo.md at status: present with always_load: true, authored from the plan's own objective, domain glossary, invariants, and repo layout section.
40
+ Criterion: WHEN the scaffold phase is planned, THE PLAN SHALL include a task authoring both floor pillars at status: present, and SHALL NOT leave either as a stub.
41
+
42
+ 6. R-MEM-6: PLAN.mdx enumerates the exact pillar inventory: every Core and applicable Common concern resolved, the archetype's primary Domain pillars included (cli.md for CLI tools, ml.md for ML pipelines, seo.md for marketing sites, payments.md for e-commerce, realtime.md for collab apps), and one-level sub-pillars planned where stable subdomains are known upfront. A sub-pillar at `agents/<parent>/<name>.md` has path-derived identity `<parent>/<name>` while frontmatter `pillar` remains the leaf `<name>`.
43
+ Criterion: WHEN the inventory is listed, THE PLAN SHALL show a table of every planned pillar with tier, status at birth, and owning task.
44
+
45
+ 7. R-MEM-7: PLAN.mdx specifies complete frontmatter for every planned pillar: pillar equal to the leaf filename (lowercase noun, never a verb), path-derived canonical identity, status, always_load true for the mandatory context and repo floor and false by default for every other pillar, a covers list, a triggers list authored for recall with synonyms starting from the standard's per-pillar trigger tables, must_read_with capped at 3, and see_also. An additional pillar may set always_load true only when the plan documents the repeated dependency under R-MEM-13 and keeps the always-loaded scope inside the R-MEM-22 total budget. Sub-pillar references are path-qualified; bare names resolve top-level pillars only.
46
+ Criterion: WHEN a pillar file task is specified, THE PLAN SHALL state its full frontmatter, and every must_read_with reference SHALL resolve to a planned-present pillar or an excluded name.
47
+
48
+ 8. R-MEM-8: PLAN.mdx mandates the exact 8-section body in every pillar (Scope, Context, Decisions, Rules, Workflows, Watchouts, Touchpoints, Gaps, in that order), unearned sections marked (none), no custom sections, Touchpoints mirroring frontmatter in plain English.
49
+ Criterion: IF a pillar body is planned, THE PLAN SHALL require the 8 headings in order and SHALL reject any custom section.
50
+
51
+ 9. R-MEM-9: PLAN.mdx records decision rationale (why this ORM, why this auth provider, why this deploy target) in its own Decisions section so each pillar's Decisions can be written truthfully at birth; anything genuinely undecided is planned as a Gaps entry, not fabricated.
52
+ Criterion: WHEN a pillar's Decisions content is planned, THE PLAN SHALL trace each entry to a decision recorded in the plan; IF rationale is absent, THE PLAN SHALL route it to that pillar's Gaps as an ask-the-human item.
53
+
54
+ 10. R-MEM-10: PLAN.mdx writes pillar Rules only for constraints not inferable from code and Context (the earn-your-keep test), such as a single allowed raw-SQL location or tenant_id required on tenant-scoped tables; Watchouts are (none) at birth with a Gaps note that they accumulate after incidents.
55
+ Criterion: IF a planned Rule restates a fact an agent could infer from the tree ("we use Drizzle"), THE PLAN SHALL drop it; WHEN Watchouts are planned, THE PLAN SHALL set them to (none) at birth.
56
+
57
+ 11. R-MEM-11: PLAN.mdx makes pillar Context sections the binding spec: declared stack versions, file locations, naming conventions, and service topology are identical to what the plan's build tasks produce, because pillars-verify checks manifests, paths, and 3-5 file convention samples.
58
+ Criterion: IF a pillar claims a fact (path, dependency, convention), THE PLAN SHALL contain a build task whose Files or Acceptance lines produce exactly that fact.
59
+
60
+ 12. R-MEM-12: PLAN.mdx assigns content to pillars per the standard's boundary tiebreakers: secrets and env vars in config.md not auth.md; product analytics separate from system observe; file layout in repo.md, module shape in arch.md; transactional notifications separate from marketing email; ui.md web-only with CLI UX in cli.md; quality bundled until depth justifies sub-pillars.
61
+ Criterion: WHEN content is assigned across pillars, THE PLAN SHALL follow the tiebreakers or state a reasoned deviation; cross-boundary references SHALL go through Touchpoints, not duplicated prose.
62
+
63
+ 13. R-MEM-13: PLAN.mdx keeps the coupling graph clean by design: no pillar exceeds 3 must_read_with entries, a dependency shared by 3 or more planned pillars is promoted to always_load only when the repeated dependency is documented and the R-MEM-22 total budget still holds, otherwise the boundary is restructured. Sub-pillars explicitly declare must_read_with: [parent] when the parent is required (it is never auto-loaded). References resolve inside their declaring scope and dependencies remain depth 1.
64
+ Criterion: IF a planned pillar would need more than 3 must_read_with entries THE PLAN SHALL restructure the boundary before emission; IF a shared dependency is promoted THE PLAN SHALL record the dependent pillars and prove the always-loaded scope remains inside the total budget.
65
+
66
+ 14. R-MEM-14: PLAN.mdx schedules the exclusion lifecycle against the roadmap: any milestone that introduces code into a currently excluded area also removes that exclusion and authors the pillar in the same milestone.
67
+ Criterion: WHEN a phase adds code to an excluded area (e.g. a web UI in milestone 3), THE PLAN SHALL include, in that same phase, a task updating AGENTS.md excluded: and authoring the pillar.
68
+
69
+ 15. R-MEM-15: PLAN.mdx specifies any CLAUDE.md, .cursorrules, or similar tool file as a one-line redirect to the applicable AGENTS.md and agents/, never a parallel instruction document, and records every root or nested scope. A descendant exclusion suppresses the inherited task-routed identity in that scope; non-conflicting ancestor guidance remains active.
70
+ Criterion: IF a tool-native instruction file is planned, THE PLAN SHALL specify its entire content as a redirect line.
71
+
72
+ 16. R-MEM-16: PLAN.mdx bakes Pillars 1.2.2 conformance into CI from day one: the current validator checks path-derived identities, portable selector collisions, list types and duplicates, hard and soft references, self-references, dependency fan-out, floors, exclusions, optional catalogs, context budgets, and nested scopes; routing fixtures prove deterministic load sets.
73
+ Criterion: WHEN CI is planned, THE PLAN SHALL include the pinned Pillars 1.2.2 validator with recursive-scope discovery and representative routing fixtures, and SHALL fail on any ERROR or fixture mismatch.
74
+
75
+ 17. R-MEM-17: PLAN.mdx defines pillar maintenance as part of the delivery workflow: new decisions land in the owning pillar's Decisions, new hard constraints in Rules, incidents produce Watchouts, resolved Gaps entries are removed, and pillars-verify runs are scheduled after each major refactor or milestone with a target of zero drift, zero rule violations, no stale exclusions.
76
+ Criterion: WHEN phases are laid out, THE PLAN SHALL name the pillar-update step in each phase's Must-haves and SHALL schedule a pillars-verify run in the final Verification phase.
77
+
78
+ 18. R-MEM-18: PLAN.mdx states the executing-agent contract: agents follow the 6-step loading protocol and the 5-state table (present: comply; stub: ask before deciding; excluded: treat as not applicable; absent: infer from code, state the assumption, recommend the pillar; unknown: make no Pillars-specific claim), and pause on a missing non-excluded floor pillar rather than degrading silently.
79
+ Criterion: WHEN the Agent memory section is emitted, THE PLAN SHALL state there that the AGENTS.md protocol is binding for all build tasks; the Rules for executing agents block stays verbatim per plan-format.md and receives no additions.
80
+
81
+ 19. R-MEM-19: PLAN.mdx treats `agents/catalog.yaml` as an optional local index of known absences. Present and excluded identities never appear in it; `context` and `repo` can never be cataloged absent; when the file is missing, unknown concerns remain unknown.
82
+ Criterion: WHEN a known absent concern must remain discoverable THE PLAN SHALL add its identity and deterministic triggers to the local catalog, and WHEN that concern becomes present or excluded THE PLAN SHALL remove the catalog entry in the same task.
83
+
84
+ 20. R-MEM-20: PLAN.mdx resolves applicable scopes from repository root to each target path. Non-conflicting guidance accumulates outer to inner, nearest-scope guidance wins conflicts, and unrelated targets keep separately labeled scope chains.
85
+ Criterion: IF nested scopes exist THE PLAN SHALL name each scope root, its local floor, exclusions, catalog, and override behavior, and SHALL include a fixture proving one inherited rule, one nearest-scope override, and one descendant exclusion.
86
+
87
+ 21. R-MEM-21: PLAN.mdx requires the portable minimum matcher for primary triggers, catalog triggers, and conditional see_also routing: ASCII lowercase, non-alphanumeric runs collapsed to spaces, trim, split, and contiguous complete-token-sequence matching. Semantic matching may only add recall.
88
+ Criterion: WHEN routing fixtures are planned THE PLAN SHALL prove that `schema-change` matches `Schema change` and that `api` does not match `capital`, with identical baseline results across hosts.
89
+
90
+ 22. R-MEM-22: PLAN.mdx applies Pillars context budgets: always-loaded files target at most 1,000 words and 8 KiB each with a 2,000-word and 16-KiB always-loaded scope total; task-routed files target at most 2,000 words and 16 KiB each. Context and repo remain mandatory inside that total. Exceeding a budget is a warning that requires a documented exception.
91
+ Criterion: WHEN pillar validation runs THE PLAN SHALL report budget warnings and SHALL split or trim content unless the plan records why the additional context is load-bearing.
92
+
93
+ ## Task seeds
94
+
95
+ - [ ] GP-xxx Write AGENTS.md loader at repo root
96
+ - Files: AGENTS.md
97
+ - Acceptance: contains Pillars 1.2.2 reference, 6-step loading protocol, 5-state missing-pillar table, structured excluded: yaml block with {name, reason} entries, and nested-scope precedence when applicable; contains no enumeration of present pillar names
98
+ - Verify: grep -q 'excluded:' AGENTS.md && grep -qi 'always_load' AGENTS.md && test -d agents
99
+ - Requirements: R-MEM-2, R-MEM-3, R-MEM-4
100
+
101
+ - [ ] GP-xxx Author floor pillars context.md and repo.md at status present
102
+ - Files: agents/context.md, agents/repo.md
103
+ - Acceptance: both files have YAML frontmatter with pillar matching filename, status: present, always_load: true, covers list; both bodies have the 8 headings in order; context.md carries the domain glossary and product invariants from the plan; repo.md carries the planned file layout and naming conventions
104
+ - Verify: grep -q 'always_load: true' agents/context.md && grep -q 'always_load: true' agents/repo.md && grep -q 'status: present' agents/context.md && grep -q 'status: present' agents/repo.md
105
+ - Requirements: R-MEM-5, R-MEM-8, R-MEM-11
106
+
107
+ - [ ] GP-xxx Author Core pillar set per inventory table
108
+ - Files: agents/stack.md, agents/arch.md, agents/quality.md, agents/development.md, agents/release.md (plus data/api/ui/auth/deploy/observe and applicable Common pillars such as privacy per inventory)
109
+ - Acceptance: all 11 Core and 11 Common identities have one of the five states; every planned-present pillar has full frontmatter and the 8-section body; path-derived sub-pillar identities are used in references; Decisions trace to plan decisions; Watchouts are (none)
110
+ - Verify: grep -L 'triggers:' agents/*.md | grep -v -e context.md -e repo.md | wc -l | grep -q '^ *0$'
111
+ - Requirements: R-MEM-6, R-MEM-7, R-MEM-8, R-MEM-9, R-MEM-10
112
+
113
+ - [ ] GP-xxx Author primary Tier 3 domain pillar
114
+ - Files: agents/<domain>.md (cli.md, ml.md, seo.md, payments.md, or realtime.md per archetype)
115
+ - Acceptance: frontmatter and 8-section body conform; content covers the concern that defines the product; boundary tiebreakers respected with Touchpoints cross-references instead of duplicated prose
116
+ - Verify: test -f agents/<domain>.md && grep -q 'pillar: <domain>' agents/<domain>.md
117
+ - Requirements: R-MEM-6, R-MEM-8, R-MEM-12
118
+
119
+ - [ ] GP-xxx Add Pillars structural validation to CI
120
+ - Files: scripts/validate_pillars.py, tests/pillars-routing.yaml, .github/workflows/ci.yml
121
+ - Acceptance: validator pinned from Pillars v1.2.2; CI enables recursive scopes, catalogs, budgets, and routing fixtures; fixtures cover nested inheritance, nearest-scope override, descendant exclusion, schema-change normalization, and api versus capital
122
+ - Verify: python3 scripts/validate_pillars.py --recursive-scopes . && grep -q 'pillars-routing' .github/workflows/ci.yml
123
+ - Requirements: R-MEM-16, R-MEM-20, R-MEM-21, R-MEM-22
124
+
125
+ - [ ] GP-xxx Maintain the local absent catalog
126
+ - Files: agents/catalog.yaml
127
+ - Acceptance: file is optional; every entry is absent locally with deterministic triggers; no present, excluded, context, or repo identity appears; entries are removed in the task that creates or excludes the concern
128
+ - Verify: python3 scripts/validate_pillars.py --recursive-scopes .
129
+ - Requirements: R-MEM-3, R-MEM-19, R-MEM-21
130
+
131
+ - [ ] GP-xxx Reduce tool-native instruction files to redirects
132
+ - Files: CLAUDE.md
133
+ - Acceptance: file body is a single redirect line pointing at AGENTS.md and ./agents/; no parallel rules content
134
+ - Verify: test "$(grep -vc '^$' CLAUDE.md)" -le 2 && grep -q 'AGENTS.md' CLAUDE.md
135
+ - Requirements: R-MEM-15
136
+
137
+ - [ ] GP-xxx Run drift audit in final verification phase
138
+ - Files: none (read-only audit)
139
+ - Acceptance: pillars-verify (or the equivalent prompt) run against the finished tree reports zero drift, zero rule violations, and no code in excluded areas
140
+ - Verify: python3 scripts/validate_pillars.py && git ls-files 'src/components/*' | wc -l | grep -q '^ *0$' # sample stale-exclusion probe when ui is excluded
141
+ - Requirements: R-MEM-14, R-MEM-17
142
+
143
+ ## Self-audit rubric
144
+
145
+ - Archetype and applicability (15): archetype declared with two or more concrete file signals; all 11 Core and 11 Common identities receive one of the five states without conflating unknown with absent; primary Domain pillar included.
146
+ - Loader conformance (15): AGENTS.md task specifies the Pillars 1.2.2 protocol, five states, local exclusions, and nested precedence where applicable, with no present-pillar enumeration.
147
+ - Floor pillars (10): context.md and repo.md planned at status: present, always_load: true, authored from the plan's own glossary, invariants, and layout.
148
+ - Frontmatter and body format (15): every planned pillar has complete frontmatter (leaf name = filename, path-derived identity, covers, recall-oriented triggers, must_read_with <= 3 resolvable in its scope), 8 sections in order, (none) markers, Touchpoints mirroring.
149
+ - Truthfulness discipline (15): Decisions trace to recorded plan rationale, no fabrication; Rules pass earn-your-keep; Watchouts (none) at birth; undecided items in Gaps as ask-the-human entries.
150
+ - Drift-proofing (15): every pillar claim is produced by a named build task; boundaries and nested precedence hold; catalog entries leave when concerns become present or excluded; coupling graph stays depth 1 and local to scope.
151
+ - Lifecycle and CI (15): exclusion and catalog removals are scheduled with the code; pinned current validator, recursive scopes, budget warnings, and routing fixtures run in CI; maintenance workflow and final verification are named.
152
+
153
+ ## Anti-patterns refused
154
+
155
+ - Silent pillar absence: a Core or Common concern with no explicit state, or an unknown concern mislabeled absent. Refusal: the plan forces the five-state protocol and uses the optional local catalog only for known absences.
156
+ - Fabricated rationale: Decisions or Watchouts invented to fill sections. Refusal: unknown rationale is planned into Gaps as an explicit question; Watchouts start at (none).
157
+ - Loader bloat: AGENTS.md enumerating pillars or accumulating rules, growing with the project. Refusal: the plan pins AGENTS.md to the constant-size canonical text, with one conditional nested-scope rule; routing lives in per-file frontmatter.
158
+ - Born drifted: the plan's pillar claims describe a stack, path, or convention no build task produces. Refusal: every claim maps to a task's Files or Acceptance line; unmapped claims are cut or converted to Gaps.
159
+ - Boundary creep: auth content written into data.md, secrets into auth.md, marketing email into notifications. Refusal: content is reassigned per the tiebreakers and linked via Touchpoints.
160
+ - Coupling smell: a pillar with more than 3 must_read_with entries, or several pillars sharing the same hidden dependency. Refusal: restructure the boundary or document the repeated dependency and promote it to always_load only when the total budget still holds.
161
+ - Scope flattening: a monorepo package override copied to root or an ancestor rule discarded wholesale. Refusal: compute scope chains outer to inner and apply nearest-scope precedence only to conflicts.
162
+ - Leaf-name collision: a sub-pillar referenced by bare leaf name. Refusal: use its path-derived `<parent>/<name>` identity; bare names resolve top-level pillars only.
163
+ - Fuzzy-only routing: task selection that differs by model because no portable baseline exists. Refusal: deterministic ASCII token matching and routing fixtures are required; semantic matching may only add recall.
164
+ - Context-budget drift: always-loaded prose grows without bound. Refusal: report budget warnings, trim the always-loaded set without dropping the mandatory floor, and document any exception that remains load-bearing.
165
+ - Stale exclusion by schedule: a roadmap phase adds code to an excluded area with no exclusion removal planned. Refusal: the exclusion update and pillar authoring task land in the same phase.
166
+ - Rules as rails: Rules restating inferable facts, putting the agent on rails instead of preventing drift. Refusal: each Rule must fail the inference test or it is deleted; (none) is the honest default.
167
+ - Parallel instruction forks: a hand-built CLAUDE.md or .cursorrules carrying its own rules alongside AGENTS.md. Refusal: tool-native files are planned as one-line redirects; existing ones are reduced, never deleted.
168
+ - Guessed archetype: ambiguous detection (dashboard vs marketing site) resolved by assumption. Refusal: the ambiguity becomes a discovery question or a named open question with a recommended default; the exclusion set is never guessed.