@punks/cli 5.2.1 → 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 (76) hide show
  1. package/README.md +2 -2
  2. package/dist/BASELINE_CHANGELOG.md +37 -0
  3. package/dist/CHANGELOG.md +20 -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 +59 -17
  8. package/dist/baseline/scaffold-baseline/data/scripts/managed-lint-runner.mjs +7 -1
  9. package/dist/baseline/scaffold-baseline/data/scripts/managed-lint-runner.test.ts +43 -0
  10. package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/commands.md +2 -2
  11. package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/post-command-flow.md +24 -21
  12. package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/wiki-structure.md +16 -0
  13. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/docs-onboarding/SKILL.md +21 -16
  14. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/docs-onboarding/agents/openai.yaml +1 -1
  15. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/docs-onboarding/references/artifact-contract.md +16 -4
  16. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-architecture/SKILL.md +65 -0
  17. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-architecture/assets/ARCHITECTURE-TEMPLATE.md +119 -0
  18. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-architecture/references/artifact-contract.md +200 -0
  19. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/SKILL.md +11 -3
  20. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/architecture-convergence.md +19 -4
  21. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/plan-schema.md +17 -3
  22. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/SKILL.md +38 -20
  23. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/assets/SPEC-TEMPLATE.md +11 -0
  24. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/readiness.md +40 -0
  25. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-spec/references/spec-quality-bar.md +8 -0
  26. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/SKILL.md +4 -2
  27. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/architecture-conformance.md +10 -6
  28. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/lifecycle.md +23 -10
  29. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/brainstorm/SKILL.md +22 -0
  30. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/SKILL.md +2 -1
  31. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/references/artifact-output.md +3 -2
  32. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/SKILL.md +6 -3
  33. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/plan.md +4 -2
  34. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/review.md +5 -1
  35. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/router.md +15 -9
  36. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/spec.md +13 -26
  37. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/artifact-state.md +39 -1
  38. package/dist/baseline/scaffold-baseline/skills/phases/requirements-phase/SKILL.md +31 -14
  39. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/prepare-review.md +12 -4
  40. package/dist/baseline/scaffold-baseline.json +5 -5
  41. package/dist/baseline/scaffold-baseline.tgz +0 -0
  42. package/dist/data/hooks/format-edited-file.d.mts +5 -0
  43. package/dist/data/hooks/format-edited-file.mjs +52 -15
  44. package/dist/data/scripts/managed-lint-runner.mjs +7 -1
  45. package/dist/index.js +56 -1129
  46. package/dist/skills/agnostic/cli/hi-cli/references/commands.md +2 -2
  47. package/dist/skills/agnostic/cli/hi-cli/references/post-command-flow.md +9 -6
  48. package/dist/skills/agnostic/cli/hi-cli/references/wiki-structure.md +16 -0
  49. package/dist/skills/agnostic/docs/docs-onboarding/SKILL.md +21 -16
  50. package/dist/skills/agnostic/docs/docs-onboarding/agents/openai.yaml +1 -1
  51. package/dist/skills/agnostic/docs/docs-onboarding/references/artifact-contract.md +16 -4
  52. package/dist/skills/agnostic/planning/create-architecture/SKILL.md +65 -0
  53. package/dist/skills/agnostic/planning/create-architecture/assets/ARCHITECTURE-TEMPLATE.md +119 -0
  54. package/dist/skills/agnostic/planning/create-architecture/references/artifact-contract.md +200 -0
  55. package/dist/skills/agnostic/planning/create-plan/SKILL.md +11 -3
  56. package/dist/skills/agnostic/planning/create-plan/references/architecture-convergence.md +19 -4
  57. package/dist/skills/agnostic/planning/create-plan/references/plan-schema.md +17 -3
  58. package/dist/skills/agnostic/planning/create-spec/SKILL.md +38 -20
  59. package/dist/skills/agnostic/planning/create-spec/assets/SPEC-TEMPLATE.md +11 -0
  60. package/dist/skills/agnostic/planning/create-spec/references/readiness.md +40 -0
  61. package/dist/skills/agnostic/planning/create-spec/references/spec-quality-bar.md +8 -0
  62. package/dist/skills/agnostic/planning/implement-spec/SKILL.md +4 -2
  63. package/dist/skills/agnostic/planning/implement-spec/references/architecture-conformance.md +10 -6
  64. package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +23 -10
  65. package/dist/skills/agnostic/requirements/brainstorm/SKILL.md +22 -0
  66. package/dist/skills/agnostic/requirements/requirements-grill/SKILL.md +2 -1
  67. package/dist/skills/agnostic/requirements/requirements-grill/references/artifact-output.md +3 -2
  68. package/dist/skills/phases/delivery-phase/SKILL.md +6 -3
  69. package/dist/skills/phases/delivery-phase/phases/plan.md +4 -2
  70. package/dist/skills/phases/delivery-phase/phases/review.md +5 -1
  71. package/dist/skills/phases/delivery-phase/phases/router.md +15 -9
  72. package/dist/skills/phases/delivery-phase/phases/spec.md +13 -26
  73. package/dist/skills/phases/delivery-phase/references/artifact-state.md +39 -1
  74. package/dist/skills/phases/requirements-phase/SKILL.md +31 -14
  75. package/dist/skills/phases/review-phase/phases/prepare-review.md +12 -4
  76. package/package.json +3 -2
@@ -0,0 +1,65 @@
1
+ ---
2
+ name: create-architecture
3
+ description: Compile closed requirements-grill decisions into ARCHITECTURE.md before create-spec. Use for a new delivery or to refresh architecture after its sources change.
4
+ ---
5
+
6
+ # Create Architecture
7
+
8
+ Compile a source-attributed explanation of the whole system. Every delivery
9
+ needs this artifact. The flow is `requirements-grill -> create-architecture ->
10
+ create-spec -> write-backlog`; `SPEC.md` need not exist to run this compiler.
11
+
12
+ ## Steps
13
+
14
+ 1. Read [artifact-contract.md](references/artifact-contract.md) for source
15
+ readiness, authority, freshness, retention, and handoff. Read the grill status
16
+ first, then the durable log. Reconcile stable question IDs, explicit
17
+ supersession, and the current glossary. Read referenced evidence and routed
18
+ learnings needed to establish the accepted scope. Stop with the contract's
19
+ atomic `architecture-not-ready` result when material inputs are unresolved.
20
+ 2. Resolve the planning surface and capability folder through
21
+ [create-spec's folder-naming.md](../create-spec/references/folder-naming.md).
22
+ Use `ARCHITECTURE.md` in that folder, applying the same identity and collision
23
+ rules. Reserve the future sibling `SPEC.md` path without requiring or
24
+ fabricating the file. Reuse an existing artifact only for the same capability.
25
+ 3. Resolve and invoke the installed `$brainstorm` skill on the accepted
26
+ bounded flow from the operating agent's perspective. Trace intake, state,
27
+ control, feedback, recovery, and handoff across linked abstraction levels.
28
+ Account for every lens in its **Flow failure lenses** with evidence, an
29
+ explicit unknown, or a justified not-applicable result. Its suggestions remain
30
+ candidates. Route material gaps through the contract; compilation cannot
31
+ accept a new mechanism or guarantee.
32
+ 4. Compile a complete candidate using
33
+ [ARCHITECTURE-TEMPLATE.md](assets/ARCHITECTURE-TEMPLATE.md). Start with actors,
34
+ purpose, capability boundary, and canonical terms. Connect owners,
35
+ authoritative state, entrypoints, critical flows, interfaces, dependencies,
36
+ recovery, and observable completion across levels. Preserve every accepted
37
+ detail through the contract's decision coverage. Assign stable block and flow
38
+ selectors under its **Spec traceability** rules; preserve exact grill entry
39
+ anchors. Before SPEC exists, leave spec-code mapping explicitly pending.
40
+ Explain how each low-level choice supports a system constraint; keep unknowns
41
+ and parked work visible.
42
+ 5. Resolve and invoke the installed `$show-me` skill to put the smallest useful
43
+ views **inside the document**: a system map and applicable flow, state, or
44
+ sequence views, each answering a distinct question. Use Mermaid for component,
45
+ data, and control relationships; use pseudocode or shallow call/file trees
46
+ when clearer. Place a short causal conclusion and question/evidence anchors
47
+ beside each view. Preserve source labels, uncertainty, ownership, and order.
48
+ Write context before detail in ASD-STE100 Simplified Technical English, keeping
49
+ exact accepted glossary terms and technical identifiers.
50
+ 6. Check the complete candidate against the contract before replacing the
51
+ canonical artifact. Resolve relative links and selectors, cover every accepted
52
+ detail, and check each visual against its sources. Validate Mermaid with an available
53
+ parser or renderer; record what ran and any unavailable check. A syntax defect
54
+ needs correction; unavailable rendering must remain a stated limitation.
55
+ Remove template instructions and empty optional sections.
56
+ 7. Save the complete artifact and apply
57
+ [create-spec's wiki-bookkeeping.md](../create-spec/references/wiki-bookkeeping.md)
58
+ to this artifact: use the architecture title, `ARCHITECTURE.md` path, and
59
+ `Compiled` status in the existing planning indexes, applicable metadata, and
60
+ maintained log. Before a spec exists, record only the architecture link.
61
+ Preserve existing spec entries and unrelated work.
62
+ 8. Follow the contract's path-limited retention and byte-verification procedure.
63
+ Return its handoff only after retention succeeds. `create-spec` consumes that
64
+ handoff next and completes spec-code mapping under the same contract before
65
+ retaining the final pair. This skill performs no backlog/provider writes.
@@ -0,0 +1,119 @@
1
+ ---
2
+ title: "[Title]"
3
+ domain: "[Domain]"
4
+ type: architecture
5
+ status: compiled
6
+ readiness: agent-ready
7
+ links: []
8
+ created: YYYY-MM-DD
9
+ updated: YYYY-MM-DD
10
+ ---
11
+
12
+ # Architecture: [Title]
13
+
14
+ <!-- Fill under ../references/artifact-contract.md. Remove instructions and
15
+ unused optional rows/sections. Keep source, disposition, coverage, and validation
16
+ records. Frontmatter is compiler state; retention proof belongs in the handoff. -->
17
+
18
+ ## Context and Scope
19
+
20
+ - Capability identity: [Resolved folder and accepted capability boundary]
21
+ - Actors and outcome: [Who needs what, and why]
22
+ - In scope / non-goals: [Accepted boundaries and constraints; source Q anchors]
23
+ - Spec: [Sibling path; link only if its target exists in the retained tree]
24
+
25
+ ## Canonical Terms
26
+
27
+ [Exact accepted terms, definitions, relationships, and axioms used below.
28
+ Link the current glossary and its question anchors.]
29
+
30
+ ## Sources
31
+
32
+ | Source | Role | Exact location and anchor | Immutable revision or content hash |
33
+ | ------ | ------------------------ | ---------------------------------------------------------------- | ---------------------------------- |
34
+ | S1 | Grill status and closure | [Path; current round/branch anchors] | [Identity] |
35
+ | S2 | Durable grill log | [Path; Q entry anchors] | [Identity] |
36
+ | S3 | Current glossary | [Status glossary or separate path/anchor] | [Identity] |
37
+ | S4 | Referenced evidence | [Path:symbol or URL/anchor; current behavior or accepted design] | [Identity] |
38
+
39
+ ## Source Disposition
40
+
41
+ | Question / entry | Disposition | Accepted detail, replacement, or unresolved point | Evidence | Parked owner / resume trigger |
42
+ | --------------------- | ------------------------------------------ | ------------------------------------------------- | --------------- | ----------------------------- |
43
+ | [Q ID + entry anchor] | [accepted / superseded / parked / unknown] | [Exact source claim; superseding entry if any] | [S ID + anchor] | [When parked] |
44
+
45
+ ## Whole System
46
+
47
+ [Explain how actors, entrypoints, components, owners, and authoritative state
48
+ connect. Place a source-labelled system map here. Show accepted design and
49
+ observed current behavior distinctly; mark unknowns.]
50
+
51
+ [Beside the map: question/evidence anchors and a short causal conclusion.]
52
+
53
+ | Block selector / component / level | Owner | State and authority | Interface / dependency | Supported constraint and source |
54
+ | ---------------------------------- | ------- | ------------------------------- | ------------------------- | ------------------------------- |
55
+ | [ARC code + explicit anchor; name] | [Owner] | [Authority and mutation rights] | [Exact accepted boundary] | [Constraint; Q/evidence] |
56
+
57
+ ## Critical Flows and Boundaries
58
+
59
+ [Assign stable FLOW codes and addressed STEP codes with explicit anchors. Show
60
+ those selectors beside the represented steps. Connect system intent to concrete
61
+ calls, state changes, and implementation choices. Use applicable flow/state/sequence views or pseudocode/call/file trees;
62
+ each must answer a different question. Preserve accepted order, branches, waits,
63
+ transaction/side-effect boundaries, recovery, and observable completion.]
64
+
65
+ [Beside each view: question/evidence anchors and a causal plain-language
66
+ conclusion. Include accepted dependency/lifecycle constraints where they apply.]
67
+
68
+ ## Accepted Detail Coverage
69
+
70
+ | Question + exact entry/evidence anchor | Exact accepted choice and supplied detail | Provided rationale / alternatives | Architecture selector + applicable visual | System constraint served |
71
+ | --------------------------------------- | -------------------------------------------------------------------------------------- | --------------------------------- | ----------------------------------------- | -------------------------------- |
72
+ | [Q; exact accepted log entry; S:anchor] | [Library/version, helper/API/path, algorithm/config/protocol, order/limit as supplied] | [Provided text or not recorded] | [ARC / FLOW-STEP / optional DEC selector] | [Why this matters across levels] |
73
+
74
+ ## Spec Traceability
75
+
76
+ - State: [pending-spec-ids before SPEC; complete only after every current OUT/AC
77
+ has a validated mapping under the artifact contract]
78
+
79
+ [Before SPEC exists, keep selectors and Q evidence ready and record that spec
80
+ codes are pending. When create-spec drafts real codes, it replaces this notice
81
+ with the completed mapping. Codes and section selectors are lookup keys; link
82
+ only to targets present in the retained tree. Pair URLs belong in the handoff.]
83
+
84
+ | Spec code / section selector | Architecture selectors | Accepted grill Q / exact log-entry and evidence anchors | Coverage explanation |
85
+ | ------------------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------- | ---------------------------------------------------------------- |
86
+ | [Real OUT or AC code; pending until assigned by create-spec] | [One or more ARC / FLOW-STEP / DEC links, or justified not applicable] | [Q; exact accepted entry; S:anchor] | [Constraint mapped, or reason no structural counterpart applies] |
87
+
88
+ ### Retired or Superseded Selectors
89
+
90
+ | Selector | Disposition | Replacement / reason | Source |
91
+ | ------------------------------------------------------------ | ---------------------- | -------------------------------------- | ------------ |
92
+ | [Previously published architecture selector or spec mapping] | [retired / superseded] | [Replacement link or accepted removal] | [Q/evidence] |
93
+
94
+ ## Flow Failure Coverage
95
+
96
+ [Use every exact lens label from brainstorm's Flow failure lenses; the list is
97
+ owned there. Reference accepted guarantees and their evidence.]
98
+
99
+ | Lens | Evidence / unknown / justified not applicable | Guarantee at stake | Material unresolved gap |
100
+ | ---------------------- | --------------------------------------------- | --------------------- | ---------------------------------------- |
101
+ | [Canonical lens label] | [Q/evidence or explicit reason] | [Accepted constraint] | [None, or return architecture-not-ready] |
102
+
103
+ ## Parked Work and Non-material Unknowns
104
+
105
+ | Question / source | Disposition and scope consequence | Owner / resume trigger | Why current guarantees remain closed |
106
+ | ----------------- | ---------------------------------------------------- | -------------------------- | ------------------------------------ |
107
+ | [Anchor] | [Parked work or unknown; candidates stay unaccepted] | [Required for parked work] | [Evidence-grounded reason] |
108
+
109
+ ## Validation
110
+
111
+ - Decision/source/glossary reconciliation: [Evidence and result]
112
+ - Exact-detail and cross-level coverage: [Evidence and result]
113
+ - Relative links, selector targets, and visual source/order checks: [Result]
114
+ - Spec-code -> architecture -> grill coverage: [Complete OUT/AC coverage with
115
+ exact accepted entry anchors, or pending-spec-ids for initial compilation]
116
+ - Mermaid parsing/rendering: [Actual tool/result or explicit unavailable limit]
117
+ - Existing spec agreement: [Result, exact superseded constraints to refresh, or
118
+ absent: architecture precedes spec]
119
+ - Remaining limits: [Non-material unknowns or validation limits; no approval stamp]
@@ -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