@punks/cli 5.2.0 → 5.2.2

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 (91) hide show
  1. package/README.md +2 -2
  2. package/dist/BASELINE_CHANGELOG.md +46 -1
  3. package/dist/CHANGELOG.md +37 -0
  4. package/dist/baseline/scaffold-baseline/baseline.json +15 -5
  5. package/dist/baseline/scaffold-baseline/data/catalog/packs.json +2 -0
  6. package/dist/baseline/scaffold-baseline/data/catalog/skills.json +16 -0
  7. package/dist/baseline/scaffold-baseline/data/hooks/format-edited-file.mjs +459 -318
  8. package/dist/baseline/scaffold-baseline/data/scripts/commit-gate-runner.d.ts +1 -0
  9. package/dist/baseline/scaffold-baseline/data/scripts/commit-gate-runner.mjs +98 -27
  10. package/dist/baseline/scaffold-baseline/data/scripts/commit-gate-runner.test.ts +156 -8
  11. package/dist/baseline/scaffold-baseline/data/scripts/managed-lint-runner.d.mts +55 -0
  12. package/dist/baseline/scaffold-baseline/data/scripts/managed-lint-runner.mjs +329 -0
  13. package/dist/baseline/scaffold-baseline/data/scripts/managed-lint-runner.test.ts +864 -0
  14. package/dist/baseline/scaffold-baseline/data/scripts/managed-lint.d.mts +97 -0
  15. package/dist/baseline/scaffold-baseline/data/scripts/managed-lint.mjs +658 -0
  16. package/dist/baseline/scaffold-baseline/data/scripts/managed-lint.test.ts +614 -0
  17. package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/SKILL.md +2 -0
  18. package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/commands.md +8 -9
  19. package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/managed-lint.md +165 -0
  20. package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/post-command-flow.md +28 -24
  21. package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/wiki-structure.md +16 -0
  22. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/docs-onboarding/SKILL.md +21 -16
  23. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/docs-onboarding/agents/openai.yaml +1 -1
  24. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/docs-onboarding/references/artifact-contract.md +16 -4
  25. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-architecture/SKILL.md +65 -0
  26. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-architecture/assets/ARCHITECTURE-TEMPLATE.md +119 -0
  27. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-architecture/references/artifact-contract.md +200 -0
  28. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/SKILL.md +11 -3
  29. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/architecture-convergence.md +19 -4
  30. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/plan-schema.md +17 -3
  31. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/SKILL.md +38 -20
  32. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/assets/SPEC-TEMPLATE.md +11 -0
  33. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/readiness.md +40 -0
  34. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/spec-quality-bar.md +8 -0
  35. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/SKILL.md +4 -2
  36. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/architecture-conformance.md +10 -6
  37. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/lifecycle.md +23 -10
  38. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/brainstorm/SKILL.md +22 -0
  39. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/SKILL.md +2 -1
  40. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/references/artifact-output.md +3 -2
  41. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/SKILL.md +6 -3
  42. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/plan.md +4 -2
  43. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/review.md +5 -1
  44. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/router.md +15 -9
  45. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/spec.md +13 -26
  46. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/artifact-state.md +39 -1
  47. package/dist/baseline/scaffold-baseline/skills/phases/requirements-phase/SKILL.md +31 -14
  48. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/prepare-review.md +12 -4
  49. package/dist/baseline/scaffold-baseline.json +5 -5
  50. package/dist/baseline/scaffold-baseline.tgz +0 -0
  51. package/dist/data/hooks/format-edited-file.d.mts +5 -0
  52. package/dist/data/hooks/format-edited-file.mjs +282 -333
  53. package/dist/data/scripts/commit-gate-runner.mjs +98 -27
  54. package/dist/data/scripts/managed-lint-runner.d.mts +55 -0
  55. package/dist/data/scripts/managed-lint-runner.mjs +329 -0
  56. package/dist/data/scripts/managed-lint.d.mts +97 -0
  57. package/dist/data/scripts/managed-lint.mjs +658 -0
  58. package/dist/index.js +86 -1184
  59. package/dist/skills/agnostic/cli/hi-cli/SKILL.md +2 -0
  60. package/dist/skills/agnostic/cli/hi-cli/references/commands.md +8 -9
  61. package/dist/skills/agnostic/cli/hi-cli/references/managed-lint.md +165 -0
  62. package/dist/skills/agnostic/cli/hi-cli/references/post-command-flow.md +15 -11
  63. package/dist/skills/agnostic/cli/hi-cli/references/wiki-structure.md +16 -0
  64. package/dist/skills/agnostic/docs/docs-onboarding/SKILL.md +21 -16
  65. package/dist/skills/agnostic/docs/docs-onboarding/agents/openai.yaml +1 -1
  66. package/dist/skills/agnostic/docs/docs-onboarding/references/artifact-contract.md +16 -4
  67. package/dist/skills/agnostic/planning/create-architecture/SKILL.md +65 -0
  68. package/dist/skills/agnostic/planning/create-architecture/assets/ARCHITECTURE-TEMPLATE.md +119 -0
  69. package/dist/skills/agnostic/planning/create-architecture/references/artifact-contract.md +200 -0
  70. package/dist/skills/agnostic/planning/create-plan/SKILL.md +11 -3
  71. package/dist/skills/agnostic/planning/create-plan/references/architecture-convergence.md +19 -4
  72. package/dist/skills/agnostic/planning/create-plan/references/plan-schema.md +17 -3
  73. package/dist/skills/agnostic/planning/create-spec/SKILL.md +38 -20
  74. package/dist/skills/agnostic/planning/create-spec/assets/SPEC-TEMPLATE.md +11 -0
  75. package/dist/skills/agnostic/planning/create-spec/references/readiness.md +40 -0
  76. package/dist/skills/agnostic/planning/create-spec/references/spec-quality-bar.md +8 -0
  77. package/dist/skills/agnostic/planning/implement-spec/SKILL.md +4 -2
  78. package/dist/skills/agnostic/planning/implement-spec/references/architecture-conformance.md +10 -6
  79. package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +23 -10
  80. package/dist/skills/agnostic/requirements/brainstorm/SKILL.md +22 -0
  81. package/dist/skills/agnostic/requirements/requirements-grill/SKILL.md +2 -1
  82. package/dist/skills/agnostic/requirements/requirements-grill/references/artifact-output.md +3 -2
  83. package/dist/skills/phases/delivery-phase/SKILL.md +6 -3
  84. package/dist/skills/phases/delivery-phase/phases/plan.md +4 -2
  85. package/dist/skills/phases/delivery-phase/phases/review.md +5 -1
  86. package/dist/skills/phases/delivery-phase/phases/router.md +15 -9
  87. package/dist/skills/phases/delivery-phase/phases/spec.md +13 -26
  88. package/dist/skills/phases/delivery-phase/references/artifact-state.md +39 -1
  89. package/dist/skills/phases/requirements-phase/SKILL.md +31 -14
  90. package/dist/skills/phases/review-phase/phases/prepare-review.md +12 -4
  91. package/package.json +3 -2
@@ -0,0 +1,200 @@
1
+ # Architecture Artifact Contract
2
+
3
+ The single consumer contract for `create-architecture`, `create-spec`, planning,
4
+ implementation, and delivery. Read it when compiling, consuming, refreshing, or
5
+ checking `ARCHITECTURE.md`.
6
+
7
+ ## Identity and authority
8
+
9
+ The artifact is
10
+ `<resolved-specs-root>/<domain>/<topic>/ARCHITECTURE.md`, using
11
+ [create-spec's folder rules](../../create-spec/references/folder-naming.md).
12
+ Its capability identity is the resolved folder plus the accepted capability
13
+ boundary. Updating an existing folder requires both to match current inputs.
14
+
15
+ The required flow is `requirements-grill -> create-architecture -> create-spec ->
16
+ write-backlog`. Architecture compiles before `SPEC.md` exists. An absent spec
17
+ cannot block architecture compilation; record its intended sibling path as text.
18
+ When a spec exists, check agreement; add a sibling link only when its target
19
+ exists in the retained architecture tree. Explicit source supersession
20
+ allows architecture to refresh first; report the exact stale spec constraints for
21
+ subsequent spec refresh. An unexplained conflict remains a decision gap.
22
+
23
+ The grill log records decisions; the status records current closure, grounding,
24
+ and glossary. Architecture explains those decisions across system levels.
25
+ `SPEC.md` remains the authority for resolved requirements, outcomes, and acceptance
26
+ criteria. It must incorporate accepted constraints, not merely link architecture.
27
+ Both artifacts must agree with current grill evidence. A conflict returns to
28
+ `requirements-phase` / `requirements-grill`; neither artifact silently overrides
29
+ the other. Architecture creates no new acceptance criteria or approval gate.
30
+ `create-plan` owns task choreography, worker assignments, edit lists, and commands.
31
+ Accepted implementation paths and APIs remain architecture evidence, not tasks.
32
+
33
+ `status: compiled` and `readiness: agent-ready` describe compiler readiness.
34
+ They imply neither human approval nor implemented behavior. Artifact frontmatter
35
+ alone is insufficient for handoff: the retention and freshness checks below must
36
+ also pass. Honor an explicitly requested human checkpoint without adding one.
37
+
38
+ ## Source readiness
39
+
40
+ Resolve the installed `requirements-grill` skill and read its
41
+ `references/artifact-output.md`; read status, then log under that contract.
42
+ For the accepted in-scope branches require:
43
+
44
+ - closed decisions, explicit shared-understanding confirmation, grounded
45
+ technical branches, and no unanswered material question or open decision;
46
+ percentages, timestamps, a candidate, or an `answered` label alone do not prove
47
+ closure;
48
+ - matching current status, durable decisions, glossary terms, relationships,
49
+ axioms, and explicit supersession; preserve stable `Q<N>` IDs and distinguish
50
+ superseding entries by their anchors;
51
+ - retrievable evidence for every accepted claim that depends on it, including
52
+ accepted dependency, prototype, interface, and implementation constraints;
53
+ - any excluded parked/deferred item explicitly outside current scope, with owner
54
+ and resume trigger. Parking cannot hide an unresolved in-scope guarantee.
55
+
56
+ Record exact locations and content identities for status, log, glossary, and
57
+ each used evidence source: repository/path or URL, section/symbol/question anchor,
58
+ and immutable revision or content hash. A glossary embedded in status uses that
59
+ file's identity plus its glossary anchor. Identify any separately published
60
+ glossary and reconcile it with the current accepted terms. Record evidence as
61
+ observed current behavior or accepted design; neither proves the other.
62
+
63
+ Track source disposition truthfully: `accepted`, `superseded`, `parked`, or
64
+ `unknown`. A candidate is `unknown` acceptance, never accepted by the compiler.
65
+ Preserve explicit replacement links for superseded decisions. A missing version
66
+ or rationale that was never provided is `not recorded`, not an invented value
67
+ or automatic blocker. Required missing evidence, contradictions, or a newly
68
+ exposed material decision do block readiness.
69
+
70
+ Resolve the installed `brainstorm` skill and read its canonical **Flow failure
71
+ lenses**; use its exact lens labels in the artifact's coverage rows. Each row records grounded evidence,
72
+ an explicit unknown, or a justified not-applicable result. For an unknown, name
73
+ the guarantee at stake and whether it is material to the accepted scope.
74
+ Non-material unknowns remain visible; material unresolved guarantees block.
75
+
76
+ ## Exact decision coverage
77
+
78
+ For every current accepted decision, map its question ID and evidence anchor to
79
+ a concrete architecture section, detail, and applicable visual. Use separate rows
80
+ when one answer contains several choices. Preserve supplied library and version,
81
+ helper/API name and path, algorithm, configuration key/value, protocol, ordering,
82
+ limits, alternatives, and rationale. Preserve exact canonical glossary terms.
83
+
84
+ A broad summary or source link alone is not coverage. Include the actual accepted
85
+ detail in the architecture and connect it to the owner, state, boundary, flow, or
86
+ system constraint it serves. Record `not recorded` for unprovided rationale or
87
+ version when relevant. A superseded choice belongs in disposition history, never
88
+ in the current design. A parked choice remains outside the active design.
89
+
90
+ Each visual preserves accepted/current/unknown distinctions and source ordering.
91
+ Place its source anchors and a causal plain-language conclusion beside it.
92
+ Record the actual Mermaid parser/render check, or the unavailable-check limit;
93
+ a successful source read is not a successful render.
94
+
95
+ ## Spec traceability
96
+
97
+ Architecture owns the mapping from each spec code to design and grill evidence.
98
+ Give addressable architecture blocks stable `ARC-###` selectors; give flows stable
99
+ `FLOW-###` selectors and addressed steps `FLOW-###-STEP-###` selectors. Use
100
+ `DEC-###` for an accepted detail only when block/step selectors cannot locate it
101
+ precisely. Provide an explicit, resolvable anchor for each selector and include
102
+ its code in the relevant heading, table row, or diagram label. Diagrams may use
103
+ separate internal node IDs; record the public selector on the visible element.
104
+
105
+ Preserve selectors across refresh and reordering. Keep retired or superseded
106
+ selectors with their disposition and replacement links; allocate a new code for
107
+ a new element. Never reuse or renumber codes to match document position.
108
+
109
+ Maintain one **Spec Traceability** table in architecture: real `OUT-###` / `AC-###`
110
+ code and SPEC section selector; architecture block/flow-step/detail selectors;
111
+ exact accepted grill `Q<N>` log-entry and evidence anchors; coverage explanation.
112
+ This is a many-to-many mapping: list every applicable target or use separate rows
113
+ when the relationships differ. An ID without a resolvable target is not coverage.
114
+ A Q ID alone is insufficient when the log has superseding entries: select the
115
+ accepted entry using its exact anchor and the recorded source identity.
116
+
117
+ Architecture precedes SPEC. Its initial table records `pending-spec-ids` with
118
+ architecture selectors and Q evidence ready; it invents no OUT/AC codes. A
119
+ source-driven architecture refresh marks affected mappings pending until the spec
120
+ is reconciled. Pending mappings permit the architecture-to-create-spec handoff,
121
+ not backlog projection or delivery.
122
+
123
+ After drafting stable OUT/AC codes, `create-spec` completes only architecture's
124
+ traceability metadata (table, state, and necessary links/updated date). It does
125
+ not change accepted design. Require every current outcome and criterion to map
126
+ to the relevant architecture selectors and accepted Q evidence; coverage must
127
+ reflect the actual constraint, not merely shared vocabulary. When an outcome or
128
+ criterion has no structural counterpart, record `not applicable` with the reason
129
+ and its accepted Q evidence. Architecture and spec use the same codes. Preserve
130
+ existing spec codes; retire superseded mappings explicitly.
131
+
132
+ Validate the whole proposed pair, set traceability to `complete`, retain the
133
+ updated architecture under **Retention and handoff**, then put that final
134
+ immutable architecture identity in SPEC and retain SPEC. Architecture uses real
135
+ spec codes as lookup keys; validate them against the proposed/current pair. A
136
+ sibling SPEC link is optional only when its target exists in the retained tree,
137
+ not merely in a later commit. The final pair handoff carries verified immutable
138
+ URLs for both artifacts. Architecture stores no immutable SPEC identity, which
139
+ would create a hash cycle. Missing or inconsistent mappings
140
+ block the final pair and return exact gaps to requirements; a structural mapping
141
+ error can be repaired as metadata without reopening an accepted decision.
142
+
143
+ ## Atomic failure
144
+
145
+ Validate the whole candidate before writing canonical architecture or bookkeeping.
146
+ On a source, identity, coverage, or consistency failure, preserve the prior
147
+ canonical artifact and return one `architecture-not-ready` result listing **all**
148
+ exact gaps, affected question/evidence anchors, guarantees at stake, and upstream
149
+ routes. Route decisions and contradictions to `requirements-phase` /
150
+ `requirements-grill`; request targeted evidence through that phase when needed.
151
+ Do not interview, fill gaps with defaults, or publish a partial replacement.
152
+
153
+ A retention failure also returns `architecture-not-ready`, naming the failed
154
+ retention check and repair needed. Keep any complete local candidate or commit
155
+ explicitly unretained; downstream work cannot consume it. Preserve unrelated
156
+ changes and any previously verified artifact identity.
157
+
158
+ ## Retention and handoff
159
+
160
+ 1. Persist the complete architecture and required planning-surface bookkeeping in
161
+ a dedicated commit limited to those paths. Inspect the staged diff; preserve
162
+ unrelated edits and staging. Include all final visual content before commit.
163
+ 2. Push or retain that commit through the repository-approved remote mechanism.
164
+ Verify the retained remote ref contains the commit. Construct an immutable
165
+ blob URL pinned to the full commit SHA and exact artifact path.
166
+ 3. Read back the remote artifact, compare its bytes with the committed artifact,
167
+ and verify that the recorded source identities still match current inputs.
168
+ Mutable branch URLs, a local-only SHA/path, or a timestamp are insufficient.
169
+ 4. Only then return `architecture-written`, `readiness: agent-ready`, capability
170
+ identity, source identities, artifact path, full commit SHA, verified remote
171
+ ref, and verified immutable blob URL. Include spec-traceability state,
172
+ validation limits, and non-material unknowns. Carry this proof in the handoff or Context Pointer; do not try to
173
+ embed an artifact's own commit SHA in that artifact.
174
+
175
+ Git retention is the only publication here. Perform no issue, backlog, or other
176
+ provider writes. Failure to retain prevents handoff, not an invitation to add
177
+ an approval ceremony.
178
+
179
+ ## Freshness and downstream use
180
+
181
+ Every delivery requires a current retained `ARCHITECTURE.md` / `SPEC.md` pair
182
+ before dispatch, including fresh, resumed, direct, review, repair, debugging, and
183
+ closeout entrypoints. Local delivery and architecture applicability do not exempt
184
+ the artifact requirement. Architecture compilation is the earlier producer step;
185
+ it requires source decisions, not that downstream pair.
186
+
187
+ At each consumption, verify the immutable URL/commit/path and retained bytes,
188
+ capability identity, current source content identities, and accepted decisions.
189
+ Compare both artifacts with current grill status/log/glossary and with each other.
190
+ Require the spec to reference the verified architecture identity and incorporate
191
+ its accepted constraints. Require complete **Spec traceability** coverage for
192
+ every current OUT/AC code, resolving its architecture and accepted Q targets. A path that still exists or a newer timestamp does not
193
+ establish freshness.
194
+
195
+ Missing, changed, unretained, or conflicting evidence blocks downstream dispatch.
196
+ Return exact gaps to `requirements-phase`; refresh and retain affected artifacts
197
+ in architecture-then-spec order before continuing. Neither a previous ready
198
+ handoff nor a plan can waive this check. Carry the verified pair and source
199
+ identities through the existing Context Pointer to planning, implementation, and
200
+ review; planning adds execution detail without assuming architecture authorship.
@@ -9,7 +9,7 @@ description: Creates execution-ready `PLAN.md` artifacts by composing `grilling`
9
9
 
10
10
  - **Role:** higher-order planning orchestrator
11
11
  - **Entrypoint type:** public entrypoint
12
- - **Upstream:** agent-ready `SPEC.md` or explicit planning request
12
+ - **Upstream:** current retained agent-ready `ARCHITECTURE.md` and `SPEC.md`, including for an explicit planning request
13
13
  - **Delegates to:** `planning-discovery` for bounded readonly orientation when subagents are available; `$grilling`, `$parallel-research`, `$swarm-planner`, `$tdd`, `$codebase-design`; `plan-reviewer` for the final readonly plan review
14
14
  - **Downstream:** execution-ready `PLAN.md` for `implement-spec`
15
15
  - **Entry conditions:** scope is clear enough to plan; stop if required planning inputs or tools are missing
@@ -35,6 +35,12 @@ silently renaming them.
35
35
  ## Quick start
36
36
 
37
37
  1. Read repo, git, existing plan, and backlog context before asking questions.
38
+ Before planning on any entry or resume, verify the
39
+ **Architecture/SPEC Pair Complete** gate in the installed `delivery-phase`
40
+ skill's `references/artifact-state.md`.
41
+ This includes direct requests and `local` plans. Return missing, stale or
42
+ conflicting proof to Requirements Phase / `requirements-grill`; planning
43
+ cannot choose replacement architecture decisions.
38
44
  2. Keep a visible planning control panel in the conversation: locked decisions, open decisions, current graph step, and next step.
39
45
  3. Read `references/grill-ambiguity.md` and run `$grilling` as explicit ambiguity reduction.
40
46
  4. Update a running decision ledger after every response set, processing each answer individually so the user never has to reconstruct state from memory.
@@ -52,8 +58,10 @@ silently renaming them.
52
58
  10. For every implementation task, convert applicable scoped or named skill
53
59
  obligations into `implementation_skill_guidance`; preserve `assigned_skills`
54
60
  as planning provenance.
55
- 11. Read `references/architecture-convergence.md`. Persist architecture applicability. For architecture-bearing
56
- work, derive and validate the architecture contract accepted in `SPEC.md`; route missing or contradictory target design back to `requirements-grill`.
61
+ 11. Read `references/architecture-convergence.md`. Persist architecture applicability.
62
+ Derive applicable convergence detail from the current Architecture/SPEC pair;
63
+ route missing or contradictory target design to Requirements Phase /
64
+ `requirements-grill`. Applicability never waives the architecture artifact.
57
65
  12. Read `references/planner-task-graph.md` and run `$swarm-planner` to produce the swarm graph and `Tn` task contract.
58
66
  13. Read `references/tdd-shaping.md` and run `$tdd` to attach RED/GREEN targets to each `Tn` task.
59
67
  14. Read `references/backlog-sync.md`. For eligible projected work, preserve the
@@ -1,10 +1,16 @@
1
1
  # Architecture Convergence
2
2
 
3
- Use this branch when a plan can change cumulative code ownership. `SPEC.md` owns the accepted target architecture; the saved plan derives its execution contract and later execution checks conformance against it.
3
+ Every plan consumes the retained Architecture/SPEC pair. `ARCHITECTURE.md` is
4
+ its source-attributed design companion; `SPEC.md` owns resolved requirements,
5
+ outcomes and acceptance criteria, including accepted architecture constraints.
6
+ The plan derives execution detail from both. Use this branch's convergence views
7
+ when work can change cumulative code ownership.
4
8
 
5
9
  ## Classify Applicability
6
10
 
7
11
  Persist `architecture_applicability: local | architecture-bearing` with evidence.
12
+ This classification controls convergence detail, not the required architecture
13
+ artifact or pair freshness check.
8
14
 
9
15
  - `local`: one bounded responsibility, with no domain-owner, public-seam, composition, or cross-domain
10
16
  dependency change. Keep the ordinary task graph and `codebase_design_notes`; record why this branch does
@@ -18,7 +24,12 @@ cannot use `local` merely because each task looks small in isolation.
18
24
 
19
25
  ## Derive the Contract
20
26
 
21
- Read the accepted technical decisions and verification seams in `SPEC.md`. If the target topology, dependency direction, boundaries, or public seams are absent or contradictory, return to `requirements-grill`; do not invent a competing target.
27
+ Read `ARCHITECTURE.md` and the accepted constraints, technical decisions and
28
+ verification seams in `SPEC.md`. Preserve their exact retained identities and
29
+ source-question IDs or decision selectors. Missing or contradictory required
30
+ topology, dependency direction, boundaries or public seams returns the exact gap
31
+ to Requirements Phase / `requirements-grill`; planning cannot accept a competing
32
+ target.
22
33
 
23
34
  For backend scope, invoke `$backend-domain-structure` and read its layout reference. Derive honest feature,
24
35
  platform/composition, integration, persistence, model, and public-boundary ownership from the repository.
@@ -35,7 +46,9 @@ in the applicable theory and current code evidence.
35
46
 
36
47
  For an architecture-bearing plan, invoke `$show-me` while authoring **each persisted view** below. Save the
37
48
  smallest visual that preserves exact owners, edges, order, labels, and uncertainty next to a terse textual
38
- conclusion. These views are normative `PLAN.md` content, not a conversational summary.
49
+ conclusion. These views are normative `PLAN.md` execution content derived from
50
+ the pair, with source selectors beside the relevant view. Diagrams explain
51
+ accepted decisions; they never accept new ones or override the companion.
39
52
 
40
53
  ### Target Ownership Topology
41
54
 
@@ -77,7 +90,9 @@ remains behavior-complete; architecture work is not deferred wholesale to final
77
90
  ### Public Seam Contract
78
91
 
79
92
  Name each consumer-facing command, result, port, event, component, hook, or entrypoint affected by the plan;
80
- list its owner and allowed consumers. A task that changes the declared public seam must amend the plan contract
93
+ list its owner and allowed consumers. A change to accepted seam design returns
94
+ to Requirements Phase / `requirements-grill` and updates the pair before plan
95
+ amendment. Execution-only detail may amend the plan within those accepted bounds
81
96
  before dependent work continues.
82
97
 
83
98
  ### Migration Ledger
@@ -8,6 +8,13 @@ The generated `PLAN.md` is the execution handoff. It must stand alone without hi
8
8
 
9
9
  Include:
10
10
 
11
+ - Context Pointers to the current retained `ARCHITECTURE.md` and `SPEC.md`, with
12
+ immutable blob URLs, exact source identities, required decision selectors and
13
+ freshness rules. Each task carries its relevant spec codes, architecture block/flow
14
+ selectors and source Q evidence through the canonical architecture traceability
15
+ mapping, so workers can reconstruct accepted decisions. Use the existing
16
+ Context Pointer contract in the installed `delivery-phase` skill's
17
+ `references/context-continuity.md`
11
18
  - `architecture_applicability: local | architecture-bearing` with evidence
12
19
  - initial situation
13
20
  - issue or problem statement
@@ -87,7 +94,7 @@ Every architecture-bearing task must also include:
87
94
  - `responsibility_acceptance_criteria`
88
95
 
89
96
  These fields bind the task to cumulative ownership rather than file placement. Local-plan tasks omit them;
90
- their plan-level applicability evidence and ordinary `codebase_design_notes` are the explicit escape hatch.
97
+ their applicability evidence and ordinary `codebase_design_notes` replace only convergence fields. The retained architecture and pair checks still apply.
91
98
 
92
99
  `architecture_wave` is a stable architecture sequence id, for example `A2`; `wave_boundary` remains the worker
93
100
  parallelism id. `responsibility_acceptance_criteria` lists the stable criterion ids this task advances or proves.
@@ -120,6 +127,13 @@ processes, ports, fixtures, provider objects or databases and compatible access.
120
127
  needed to detect changes before/after checks, release and finalization. Record
121
128
  explicit `none` with rationale where applicable; absence is unknown.
122
129
 
130
+ Every task carries the pair's exact source identities and its applicable
131
+ architecture decision selectors through Context Pointers, `read_dependencies`
132
+ and `relevant_input_set`. Add concrete code/contract reads as needed. Preserve
133
+ accepted detail at its source; a bounded excerpt must retain identity, selector
134
+ and freshness. Changes invalidate affected task proof before dependent dispatch.
135
+ Neither `local` applicability nor `planning-only` task identity waives the pair.
136
+
123
137
  A declared read/write or incompatible runtime conflict delays only affected work.
124
138
  Read/read overlap is safe. Changed relevant inputs invalidate affected gate proof
125
139
  and require affected checks again. Task-local gates include relevant RED/GREEN,
@@ -173,9 +187,9 @@ Use `not_applicable` for the other runtime fields when `runtime_validation: not_
173
187
  - **depends_on**: [T1, T2]
174
188
  - **location**: src/example.ts
175
189
  - **owned_paths**: [src/example.ts, tests/example.test.ts]
176
- - **read_dependencies**: [src/contracts.ts]
190
+ - **read_dependencies**: [ARCHITECTURE.md, SPEC.md, src/contracts.ts]
177
191
  - **shared_runtime_resources**: Isolated task fixture database; exclusive fixture writes.
178
- - **relevant_input_set**: Hash src/contracts.ts before/after checks; record fixture database identity.
192
+ - **relevant_input_set**: Resolve retained Architecture/SPEC Context Pointers and applicable decision selectors; hash src/contracts.ts before/after checks; record fixture database identity.
179
193
  - **wave_boundary**: W2
180
194
  - **description**: Implement the task behavior.
181
195
  - **validation**: Public-interface behavior that proves completion.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: create-spec
3
- description: Compile confirmed product decisions into SPEC.md. Use when requirements are closed or explicitly parked and an agent-ready provider-neutral specification is needed before backlog or planning.
3
+ description: Compile confirmed product decisions and retained ARCHITECTURE.md into SPEC.md. Use when requirements are closed or explicitly parked and a provider-neutral specification is needed before backlog or planning.
4
4
  ---
5
5
 
6
6
  # Create Spec
@@ -11,7 +11,9 @@ no questions, runs no local grill, and performs no backlog mutation.
11
11
 
12
12
  ## Inputs
13
13
 
14
- Accept confirmed decision evidence: grill status and logs, research reports,
14
+ Require the current retained sibling `ARCHITECTURE.md` from `create-architecture`
15
+ with its verified immutable blob URL and exact source identities. Accept
16
+ confirmed decision evidence: grill status and logs, research reports,
15
17
  prototype verdicts, ADRs, glossary, axioms, constraints, system facts, accepted
16
18
  implementation and testing decisions, dependency evidence, and accepted
17
19
  parent/base constraints. Provider backlog items may be source evidence, but
@@ -29,24 +31,35 @@ silently renaming them.
29
31
  2. Validate readiness using [readiness.md](references/readiness.md). If required
30
32
  evidence is missing, return one atomic `spec-not-ready` result and write no
31
33
  partial `SPEC.md`.
32
- 3. Compile [SPEC-TEMPLATE.md](assets/SPEC-TEMPLATE.md). Preserve only confirmed
33
- decisions; never invent closure. Serialize `Dependency Readiness` and
34
- `Branch/Base Intent` using the readiness contract.
35
- 4. Apply [spec-quality-bar.md](references/spec-quality-bar.md).
36
- 5. Update existing planning-surface indexes through
34
+ 3. Draft [SPEC-TEMPLATE.md](assets/SPEC-TEMPLATE.md). Preserve confirmed decisions
35
+ and existing `OUT-###` / `AC-###` identities. Incorporate accepted architecture
36
+ constraints and exact technical details without copying the narrative.
37
+ Serialize `Dependency Readiness` and `Branch/Base Intent` using the readiness
38
+ contract.
39
+ 4. Invoke `$show-me` to place the completed spec's useful explanatory views in
40
+ `SPEC.md`. Derive them only from confirmed decisions; add no approval gate or
41
+ new closure. Finalize all spec content before mapping or retention.
42
+ 5. Complete the [Spec traceability contract](../create-architecture/references/artifact-contract.md#spec-traceability)
43
+ in `ARCHITECTURE.md` using the draft's real spec codes, stable architecture
44
+ selectors and exact grill question/log-entry evidence anchors. This is a
45
+ metadata-only amendment; new design decisions return to Requirements Grill.
46
+ Validate complete mapping and both drafts before replacing either artifact.
47
+ 6. Retain the enriched architecture first, using `create-architecture`'s retention
48
+ contract. Verify its immutable blob URL and bytes, then record that final
49
+ identity as the spec's `Architecture Source` and frontmatter link. Link each
50
+ outcome and criterion back to its canonical architecture mapping and sections.
51
+ 7. Apply [spec-quality-bar.md](references/spec-quality-bar.md).
52
+ 8. Update existing planning-surface indexes through
37
53
  [wiki-bookkeeping.md](references/wiki-bookkeeping.md).
38
- 6. Persist the completed spec and bookkeeping in a dedicated git commit. Never
54
+ 9. Persist the completed spec and bookkeeping in a dedicated git commit. Never
39
55
  stage unrelated changes.
40
- 7. Push or explicitly retain the spec commit through the repository-approved remote
41
- mechanism. Verify the retained ref contains the spec commit, then construct and
42
- verify a stable blob URL before `write-backlog` may consume it. A local
43
- commit SHA plus path is insufficient.
44
- 8. Invoke `$show-me` to present the completed spec in `SPEC.md`. Derive the presentation
45
- only from the compiled spec and continue without adding an approval gate or
46
- inferring new closure.
47
- 9. Return `spec-written`, `readiness: agent-ready`, and the verified stable blob
48
- URL. If retention or URL verification fails, return one atomic
49
- `spec-not-ready` result and do not invoke backlog projection.
56
+ 10. Push or explicitly retain the spec commit through the repository-approved
57
+ remote mechanism. Verify the retained ref contains the spec commit, and
58
+ construct and verify its stable blob URL before `write-backlog` may consume it.
59
+ A local commit SHA plus path is insufficient.
60
+ 11. Return `spec-written`, `readiness: agent-ready`, and both verified immutable
61
+ artifact URLs. If retention or URL verification fails, return one atomic
62
+ `spec-not-ready` result and do not invoke backlog projection.
50
63
 
51
64
  ## Boundaries
52
65
 
@@ -57,8 +70,13 @@ silently renaming them.
57
70
  reuses the provider Epic, Stories, Tasks, and blocker graph supported by the
58
71
  compiled requirements and current provider evidence.
59
72
  - A mutable path or local-only commit is not a backlog handoff.
60
- - Accepted technical and testing decisions belong in the spec. Detailed task
61
- choreography does not.
73
+ - `ARCHITECTURE.md` is the source-attributed design companion; the spec owns
74
+ resolved requirements, outcomes and acceptance criteria. Both must agree with
75
+ current grill decisions. A conflict returns to Requirements Phase and
76
+ `requirements-grill`; neither artifact silently overrides the other.
77
+ - Accepted architecture constraints and technical and testing decisions belong
78
+ in the spec. Detailed task choreography does not. Architecture diagrams
79
+ explain accepted decisions; they cannot accept new ones.
62
80
  - `create-plan` preserves provider Task identities and owns files, commands,
63
81
  workers, and validation detail.
64
82
  - `Dependency Readiness` and `Branch/Base Intent` preserve accepted dependency
@@ -19,10 +19,13 @@ updated: YYYY-MM-DD
19
19
 
20
20
  ### OUT-001: [Observable outcome]
21
21
 
22
+ _Architecture: immutable `#spec-traceability` link labeled OUT-001, plus relevant selectors._
23
+
22
24
  ## Acceptance Criteria
23
25
 
24
26
  - AC-001: [Binary observable criterion]
25
27
  - Covers: OUT-001
28
+ - Architecture: [Immutable #spec-traceability link labeled AC-001, plus relevant selectors]
26
29
 
27
30
  ## Constraints
28
31
 
@@ -36,8 +39,16 @@ and list each dependency's immutable landing or branch/base evidence._
36
39
  _When accepted intent exists, record the intended parent or base, child branch
37
40
  constraint, and supporting evidence. Otherwise write `Not applicable`._
38
41
 
42
+ ## Architecture Source
43
+
44
+ _Verified immutable blob URL (also in `links`), commit, path, and content identity
45
+ of the current retained sibling `ARCHITECTURE.md`._
46
+
39
47
  ## Accepted Technical Decisions
40
48
 
49
+ _Preserve accepted architecture constraints and exact technical details with
50
+ source-question IDs or decision selectors. Link the companion for explanation._
51
+
41
52
  ## Accepted Testing Decisions
42
53
 
43
54
  ## Verification Seams
@@ -5,6 +5,11 @@ explicitly parked with an owner and resume trigger.
5
5
 
6
6
  Required inputs:
7
7
 
8
+ - current retained sibling `ARCHITECTURE.md` satisfying the
9
+ [architecture artifact contract](../../create-architecture/references/artifact-contract.md),
10
+ with `status: compiled`, `readiness: agent-ready`, verified immutable blob URL
11
+ and exact identity; its capability, grill status/log, glossary and referenced
12
+ evidence must match the current confirmed sources
8
13
  - actor, outcome, capability boundary, non-goals, and constraints
9
14
  - accepted functional behavior and observable success
10
15
  - accepted implementation and testing decisions, when any were made upstream
@@ -17,6 +22,41 @@ Required inputs:
17
22
  Provider backlog items may supply evidence. Compilation never requires a
18
23
  preselected provider delivery item.
19
24
 
25
+ ## Architecture source and traceability contract
26
+
27
+ Before compiling, verify the retained architecture commit/ref, blob URL and
28
+ bytes. Resolve its source identities and decision selectors against the current
29
+ confirmed grill status/log; a timestamp or stored URL alone proves no freshness.
30
+ Missing, stale or conflicting architecture produces `spec-not-ready` with the
31
+ exact gap routed to Requirements Phase / `requirements-grill`. Preserve the
32
+ existing canonical pair until both proposed artifacts and their mapping agree.
33
+
34
+ Read the [Spec traceability contract](../../create-architecture/references/artifact-contract.md#spec-traceability).
35
+ An initial architecture may have a pending map because the spec does not exist
36
+ yet. Draft real `OUT-###` and `AC-###` identities before completing that map in
37
+ `ARCHITECTURE.md`. Preserve existing codes when their meaning is unchanged;
38
+ retire superseded codes explicitly and never reuse them for another requirement.
39
+ Every outcome and criterion must resolve through the canonical mapping to stable
40
+ architecture selectors and exact source Q/log-entry evidence anchors. Follow the
41
+ contract's justified no-structural-counterpart rule where applicable. Never
42
+ invent a question, design decision or rationale to fill a row.
43
+
44
+ The amendment changes traceability metadata only. Pending, dangling, stale,
45
+ unsupported or incomplete mappings block `spec-written` and downstream handoff.
46
+ Resolve the whole proposed pair before writes, retain the enriched architecture,
47
+ then bind its final immutable blob URL, commit, path and content identity in the
48
+ spec's `Architecture Source` and frontmatter `links`. Retain the spec afterward.
49
+ Architecture uses spec codes as lookup keys, without a reverse immutable spec
50
+ identity or a link into a future commit. Return both immutable URLs as the pair.
51
+
52
+ Give each outcome and criterion a backlink to `#spec-traceability` labeled with
53
+ its spec code, plus links to the relevant architecture selectors. Keep the many-to-many map in architecture;
54
+ backlinks in the spec are navigation, not a competing mapping table. Preserve
55
+ applicable source-question IDs and decision selectors beside accepted constraints
56
+ and technical decisions, including exact accepted libraries/versions, helpers,
57
+ APIs/paths, algorithms, configuration and protocols. Link the companion's narrative
58
+ and diagrams instead of copying them. Retain confirmed rationale; never infer it.
59
+
20
60
  ## Dependency output contract
21
61
 
22
62
  Serialize both sections in every compiled spec:
@@ -53,11 +53,19 @@ Avoid:
53
53
  - ensure frontmatter has a non-empty string `title`, especially for specs saved
54
54
  directly in routed Fumadocs trees
55
55
  - ensure frontmatter contains `readiness: agent-ready`
56
+ - verify `Architecture Source` and frontmatter `links` name the exact retained
57
+ sibling architecture; its current source identities agree with the spec
58
+ - verify accepted architecture constraints and concrete technical details are
59
+ incorporated with decision selectors; links alone do not preserve decisions
56
60
  - ensure `Dependency Readiness` records `No Stack Required` or `Ready` with
57
61
  evidence
58
62
  - ensure `Branch/Base Intent` records accepted parent/base constraints or
59
63
  `Not applicable`
60
64
  - ensure every outcome passes the one-way coverage contract
65
+ - validate the [Spec traceability contract](../../create-architecture/references/artifact-contract.md#spec-traceability):
66
+ every real outcome and criterion has a complete source-grounded architecture
67
+ mapping; its spec backlinks resolve to the final retained architecture
68
+ - preserve unchanged spec codes; explicitly retire superseded codes
61
69
  - remove all template scaffolding and empty irrelevant sections
62
70
  - ensure the document reads cleanly without ghost instructions
63
71
  - check that terminology matches repository domain language
@@ -9,7 +9,7 @@ description: Implement an agent-ready spec folder through a plan-derived Executi
9
9
 
10
10
  - **Role:** higher-order execution orchestrator
11
11
  - **Entrypoint type:** public entrypoint
12
- - **Upstream:** agent-ready spec folder with `SPEC.md` and `PLAN.md`
12
+ - **Upstream:** current retained agent-ready `ARCHITECTURE.md` / `SPEC.md` pair and execution-ready `PLAN.md`
13
13
  - **Delegates to:** `$tdd`, `$codebase-design`, `$simplify`, tiny `$requirements-phase` sessions for debt ambiguity, and internal scoped-worker orchestration
14
14
  - **Downstream:** `docs-ingest-phase` when the resulting spec folder should be ingested into domain knowledge
15
15
  - **Entry conditions:** existing agent-ready spec folder; stop and use `create-plan` if `PLAN.md` is missing
@@ -57,7 +57,9 @@ Provider mechanics remain inside `write-backlog`.
57
57
  ## Quick start
58
58
 
59
59
  1. Resolve the target spec folder by checking, in order: `apps/wiki/content/docs/project/specs/<domain>/<spec>/`, legacy `apps/wiki/specs/<domain>/<spec>/`, then `docs/specs/<domain>/<spec>/`.
60
- 2. Read `references/lifecycle.md` and follow the shared execution contract exactly.
60
+ 2. Read `references/lifecycle.md` and verify its required Architecture/SPEC pair
61
+ before any direct or resumed execution, including local plans and repair.
62
+ Follow the shared execution contract exactly.
61
63
  3. Read `references/parallel.md`, parse the plan graph, and compute the complete eligible Execution Frontier. When the plan is architecture-bearing, also read and enforce `references/architecture-conformance.md`.
62
64
  4. Launch scoped workers for the eligible tasks using
63
65
  `references/parallel-worker-brief.md`. Forward every guidance item unchanged,
@@ -4,14 +4,18 @@ Use this contract when `PLAN.md` declares architecture applicability as
4
4
  `architecture-bearing`. A `local` plan keeps the normal task design checks and
5
5
  does not invent an architecture contract during execution.
6
6
 
7
- The plan is authoritative. Execute its **Target Ownership Topology**, **Declared
8
- Dependency Graph**, **Responsibility Acceptance Criteria**, **Architecture Waves**,
7
+ The plan owns execution detail derived from the retained Architecture/SPEC pair.
8
+ Execute its **Target Ownership Topology**, **Declared Dependency Graph**,
9
+ **Responsibility Acceptance Criteria**, **Architecture Waves**,
9
10
  public seam contract, and migration ledger. Execution may clarify
10
11
  evidence. An evidence-only clarification may be recorded locally when it changes
11
- no owner, edge, criterion, wave, seam, migration, or task contract. Any target
12
- contract change pauses execution and routes back through `$create-plan` on the
13
- same spec folder for architecture convergence authoring and plan review. Reload
14
- the amended plan before dispatching more architecture-bearing work.
12
+ no owner, edge, criterion, wave, seam, migration, or task contract.
13
+
14
+ A change to accepted architecture decisions pauses dependent execution and
15
+ returns the exact gap to Requirements Phase / `requirements-grill`; refresh the
16
+ pair before `$create-plan`. Execution-only contract changes within accepted bounds
17
+ route through `$create-plan` on the same spec folder for architecture convergence
18
+ and plan review. Reload the amended plan before dispatching more architecture-bearing work.
15
19
 
16
20
  ## Load the theory
17
21