@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
@@ -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
 
@@ -8,7 +8,7 @@ Execution uses plan-derived tasks and parent-owned Task Gates. Read
8
8
  [parallel.md](parallel.md) for Execution Frontier and Active Write Scope rules;
9
9
  shared lifecycle rules remain here.
10
10
 
11
- ## 1. Require an existing agent-ready spec folder
11
+ ## 1. Require the current agent-ready Architecture/SPEC pair
12
12
 
13
13
  Execution must stay grounded in the first matching spec folder:
14
14
 
@@ -18,13 +18,17 @@ Execution must stay grounded in the first matching spec folder:
18
18
 
19
19
  Required files:
20
20
 
21
+ - `ARCHITECTURE.md`
21
22
  - `SPEC.md`
22
23
  - `PLAN.md`
23
24
 
24
- If `SPEC.md` is missing, stop and report the resolved path error.
25
-
26
- Require `readiness: agent-ready`; no separate spec review or approval state is
27
- needed.
25
+ Before any execution or resumed repair, apply the
26
+ **Architecture/SPEC Pair Complete** gate in the installed `delivery-phase`
27
+ skill's `references/artifact-state.md`,
28
+ including direct invocation, existing work and `local` plans. Missing, stale or
29
+ conflicting proof routes the exact gap to Requirements Phase /
30
+ `requirements-grill`. Require the plan to reference that same retained pair.
31
+ Compiler readiness needs no separate spec review or approval state.
28
32
 
29
33
  If `PLAN.md` is missing, stop and use `create-plan`. Do not auto-generate plans from this skill.
30
34
 
@@ -34,7 +38,7 @@ Accept either:
34
38
 
35
39
  - a domain plus spec folder name
36
40
  - a full spec folder path
37
- - a direct `SPEC.md` or `PLAN.md` path
41
+ - a direct `ARCHITECTURE.md`, `SPEC.md` or `PLAN.md` path
38
42
 
39
43
  Normalize to the containing spec folder before doing any work.
40
44
 
@@ -43,10 +47,19 @@ Normalize to the containing spec folder before doing any work.
43
47
  Read, in this order:
44
48
 
45
49
  1. `apps/wiki/AGENTS.md`
46
- 2. `<resolved-spec-folder>/SPEC.md`
47
- 3. `<resolved-spec-folder>/PLAN.md`
48
- 4. `<resolved-spec-folder>/IMPLEMENTATION-NOTES.md` if present
49
- 5. `docs/reference/tech-debt/<domain>/<spec>.md` if present
50
+ 2. `<resolved-spec-folder>/ARCHITECTURE.md`
51
+ 3. `<resolved-spec-folder>/SPEC.md`
52
+ 4. `<resolved-spec-folder>/PLAN.md`
53
+ 5. `<resolved-spec-folder>/IMPLEMENTATION-NOTES.md` if present
54
+ 6. `docs/reference/tech-debt/<domain>/<spec>.md` if present
55
+
56
+ Carry the pair's exact retained source identities and required architecture
57
+ decision selectors, mapped spec codes and source Q evidence in worker Context Pointers, Read Dependencies and Relevant
58
+ Input Sets. Recheck them before dependent dispatch, Task Gates and finalization.
59
+ Refresh changed sources through existing freshness gates; preserve unaffected
60
+ proof and historical review lineage. Missing plan pointers return to
61
+ `create-plan`; missing or conflicting accepted design returns to Requirements
62
+ Phase / `requirements-grill`.
50
63
 
51
64
  When `PLAN.md` declares architecture applicability as `architecture-bearing`,
52
65
  also read [architecture-conformance.md](architecture-conformance.md) before
@@ -15,6 +15,9 @@ description: Brainstorm a bounded system from the operating agent’s perspectiv
15
15
  legible to an agent. Trace intake, state, control, feedback, recovery, and
16
16
  handoff through that tower. Account for each applicable surface with
17
17
  evidence, or record why it does not apply.
18
+ For software flows, apply Flow failure lenses below. Account for each lens
19
+ with grounded findings, an explicit unknown, or a reason it does not apply.
20
+ Surface material gaps as candidate decisions within the accepted scope.
18
21
  3. Derive the smallest changes that make the system agent-intuitive (clear
19
22
  meaning), agent-ergonomic (efficient control), and agent-accretive (reusable
20
23
  verified knowledge benefiting later runs). For each candidate, state
@@ -26,3 +29,22 @@ description: Brainstorm a bounded system from the operating agent’s perspectiv
26
29
  4. Return evidence-grounded observations and unresolved decisions. Completion
27
30
  requires every observation to trace to evidence or an explicit unknown.
28
31
  Observations remain candidates until the caller accepts them.
32
+
33
+ ### Flow failure lenses
34
+
35
+ Approach the problem through an end-to-end control-flow, state-consistency and failure-recovery lens. Examine:
36
+
37
+ 1. Entry points and path convergence: where can this behavior start? Do equivalent actions reach the same rules, or take divergent/bypass paths?
38
+ 2. Critical execution paths: what must happen, in which order? Where does execution branch, wait, delegate or continue asynchronously?
39
+ 3. State ownership and authority: what state changes, who owns it, who may change it, and which representation is authoritative?
40
+ 4. Transaction and side-effect boundaries: what commits together? Which effects occur outside that boundary? What intermediate states can become visible?
41
+ 5. Concurrency and stale state: what if two actors run this simultaneously, or state changes between validation and execution?
42
+ 6. Idempotency and retries: what happens when a request is repeated, execution resumes, or an acknowledgement is lost after success?
43
+ 7. Partial failure and recovery: what remains after failure at each boundary? Can we safely retry, reconcile, compensate or roll back?
44
+ 8. Execution lifetime and durability: what survives a disconnect, cancellation or process crash? Who owns unfinished work?
45
+ 9. Lifecycle and dependency transitions: what happens during creation, update, replacement and removal? What still depends on the old state?
46
+ 10. Completion and observability: what proves the requested outcome occurred? Can an operator distinguish accepted, applied, running, failed and partially complete?
47
+
48
+ Use these lenses to surface missing architectural decisions before treating the flow as understood. Ground concerns in the actual system; propose mechanisms only for supported risks.
49
+
50
+ Completion: each applicable lens is covered by evidence or an explicit unknown; non-applicable lenses have a reason. Each material gap is recorded as a candidate decision, with its evidence or unknown and the guarantee at stake.
@@ -35,7 +35,8 @@ Both workflows can happen in one long session, but keep the responsibilities dis
35
35
  - Give `$domain-modeling` the active status glossary before the first question. Invoke it whenever a round changes terminology, relationships, or domain decisions, and persist its accepted results through `artifact-output` before continuing.
36
36
  - Inspect relevant routed learning artifacts before grilling requirements that depend on known behavior, prior bugs, project conventions, or domain facts.
37
37
  - Before `$grilling` constructs the first frontier, identify every active code- or architecture-bearing branch and complete the technical grounding in `grilling-flow`. Ground each branch in current code evidence, then ask code-grounded questions about its applicable topology, dependency direction and injection, seams, boundaries, persistence, and module shape. Each technical question states the observed constraint and the code consequence of the decision. Persist accepted design in the grill artifacts; keep `GLOSSARY.md` glossary-only.
38
- - After technical grounding, complete `$brainstorm` before the first frontier. Add its unresolved decisions to the design tree; treat all output as candidate material until accepted. Rerun only when accepted decisions change the active system boundary.
38
+ - After technical grounding, complete `$brainstorm` before the first frontier. Add its unresolved decisions to the design tree; treat all output as candidate material until accepted.
39
+ - **Response-set checkpoint:** After every `$grilling` response set, including an incomplete frontier response, record supplied answers through `artifact-output`, then invoke `$brainstorm` against updated decisions and evidence before computing and persisting the next frontier or requesting closure. Recheck its applicable lenses, reusing still-valid evidence and tracing changed decisions through affected paths and dependent branches. Add newly exposed uncertainties and decisions to the existing technical grounding record and design tree. The review is complete when every new material finding is resolved, queued, or explicitly parked/deferred; queued findings remain open under the existing branch and grill closure rules. Preserve stable question IDs and accepted decisions; surface contradictions as explicit questions.
39
40
  - Prefer conservative defaults once enough context exists.
40
41
  - If the user authorizes auto-pinning defaults, record obvious remaining defaults without needless extra questions.
41
42
  - Treat parked branches as preserved knowledge, not deleted scope.
@@ -128,8 +128,9 @@ After each response set:
128
128
  1. Process every supplied answer separately against its stable question id.
129
129
  2. Add answered decisions to the log and mark those ids `answered` in status.
130
130
  3. Leave omitted questions `unanswered`; do not infer an answer or drop them from status.
131
- 4. Persist the updated status, including the frontier and branch dashboard, before continuing.
132
- 5. When the frontier is empty, set confirmation to `pending`; set it to `confirmed` only after the user explicitly confirms shared understanding.
131
+ 4. Complete the [response-set checkpoint](../SKILL.md#core-behavior).
132
+ 5. Compute the next frontier and persist the updated status, including the frontier and branch dashboard, before continuing.
133
+ 6. When the frontier is empty, set confirmation to `pending`; set it to `confirmed` only after the user explicitly confirms shared understanding.
133
134
 
134
135
  ## Status File Contract
135
136
 
@@ -11,7 +11,7 @@ disable-model-invocation: true
11
11
  `delivery-phase` is a reusable phase router.
12
12
 
13
13
  1. Read [phases/router.md](phases/router.md).
14
- 2. Inspect only enough issue, spec, plan, notes, diff, retained review, durable
14
+ 2. Inspect only enough issue, architecture, spec, plan, notes, diff, retained review, durable
15
15
  handoff, validation, and docs state to choose the current gate.
16
16
  3. If approved artifact links or UI Evidence links are present, carry them as routing evidence.
17
17
  4. Load exactly one phase file from `phases/`.
@@ -29,7 +29,7 @@ Within accepted bounds, full delivery grants its selected inner steps the author
29
29
  ## Phase Files
30
30
 
31
31
  - [phases/router.md](phases/router.md): choose the next phase from artifacts and evidence.
32
- - [phases/spec.md](phases/spec.md): create or repair the agent-ready spec.
32
+ - [phases/spec.md](phases/spec.md): route missing or stale Architecture/SPEC proof to Requirements Phase.
33
33
  - [phases/backlog.md](phases/backlog.md): verify or project the agent-ready spec into delivery backlog items.
34
34
  - [phases/plan.md](phases/plan.md): create or repair the execution-ready plan.
35
35
  - [phases/implement.md](phases/implement.md): execute the accepted plan.
@@ -43,7 +43,10 @@ Within accepted bounds, full delivery grants its selected inner steps the author
43
43
  ## Router Rules
44
44
 
45
45
  - Read `router.md` and its continuity contract before selecting exactly one phase.
46
- - Reuse fresh matching authority; activate child skills only from their selected phase.
46
+ - Require the [Architecture/SPEC pair](references/artifact-state.md#architecturespec-pair-complete)
47
+ before dependent dispatch in every entry mode, including local and resumed
48
+ delivery. Reuse fresh matching authority; activate child skills only from
49
+ their selected phase.
47
50
  - Full Delivery continues within accepted bounds. Other modes emit one common
48
51
  Phase Result and stop at their requested boundary.
49
52
  - [references/context-continuity.md](references/context-continuity.md) owns
@@ -1,6 +1,6 @@
1
1
  # Plan Phase
2
2
 
3
- Use this phase when a matching spec exists but no execution-ready `PLAN.md`
3
+ Use this phase when a matching Architecture/SPEC pair exists but no execution-ready `PLAN.md`
4
4
  exists, or the plan is stale, vague, or missing validation gates.
5
5
 
6
6
  ## Delegate
@@ -9,7 +9,9 @@ Load `create-plan` only after this phase is selected.
9
9
 
10
10
  ## Checks Before Delegating
11
11
 
12
- - Verify the spec still matches the requested goal.
12
+ - Verify the [Architecture/SPEC pair](../references/artifact-state.md#architecturespec-pair-complete)
13
+ still matches the requested goal. Carry both retained source identities and
14
+ decision selectors into plan Context Pointers and task Read Dependencies.
13
15
  - Preserve tracker hierarchy and every child-story or sub-issue requirement.
14
16
  - Require dependencies, Active Write Scopes, Read Dependencies, Shared Runtime
15
17
  Resources, Relevant Input Set identities, validation gates, review routing and
@@ -6,7 +6,11 @@ current snapshot.
6
6
 
7
7
  ## Prepare Review
8
8
 
9
- 1. Require implementation, applicable task checks and Task Gates, Verification,
9
+ 1. Recheck the [Architecture/SPEC pair](../references/artifact-state.md#architecturespec-pair-complete)
10
+ before review or retained-state resume. Carry the exact architecture identity
11
+ and required decision selectors as governing review sources alongside Spec
12
+ and plan, including in the frozen Review Packet.
13
+ Require implementation, applicable task checks and Task Gates, Verification,
10
14
  parent shared-summary reconciliation, Architecture Checkpoints and final
11
15
  acceptance evidence. Missing or stale proof returns the exact owning gate;
12
16
  it cannot enter Code Review. Review consumes Verification evidence while
@@ -8,10 +8,16 @@ Choose one next phase from current durable authority.
8
8
  2. Preserve terminal `human_steering_required` until current user direction
9
9
  resolves the required decision. New boundary evidence selects
10
10
  [human-steering.md](human-steering.md).
11
- 3. For failed tasks or repair evidence, apply
11
+ 3. Before any dependent dispatch, require the
12
+ [Architecture/SPEC Pair Complete gate](../references/artifact-state.md#architecturespec-pair-complete)
13
+ for every delivery, including existing, resumed and local work. Missing,
14
+ stale or conflicting architecture/spec proof routes the exact gap to
15
+ Requirements Phase / `requirements-grill` before review, repair, debug,
16
+ implementation or closeout can resume. Preserve review lineage and counts.
17
+ 4. For failed tasks or repair evidence, apply
12
18
  [failure continuity](../references/failure-continuity.md). Independent eligible
13
19
  work continues through the implementation owner's gates.
14
- 4. Recover review lineage, valid completed ordinals and durable active repair
20
+ 5. Recover review lineage, valid completed ordinals and durable active repair
15
21
  state separately from current evidence freshness. Review due, retention pending,
16
22
  unrouted findings, or budget decisions select [review.md](review.md), the sole
17
23
  delivery review-transition authority. It validates bounds and target before
@@ -21,21 +27,21 @@ Choose one next phase from current durable authority.
21
27
  Route legacy `focused_validation` to its recorded implementation/debugging
22
28
  owner and `clean_handoff` to remaining docs or closeout after checking proof.
23
29
  Reuse recorded run IDs and debt keys; a resume cannot consume them twice.
24
- 5. Before planning, require a matching agent-ready `SPEC.md` with verified remote
30
+ 6. Before planning, require the pair's agent-ready `SPEC.md` with verified remote
25
31
  retention and its current Write Backlog result through the
26
- [Spec Complete and Backlog Projection Complete gates](../references/artifact-state.md).
32
+ [Backlog Projection Complete gate](../references/artifact-state.md#backlog-projection-complete).
27
33
  Missing, stale or contradictory required proof routes the exact gap to
28
- Requirements Phase before planning. It owns Requirements Grill, Create Spec
29
- and Write Backlog. Valid current proof proceeds without a new approval gate;
34
+ Requirements Phase before planning. It owns Requirements Grill, Create Architecture,
35
+ Create Spec and Write Backlog. Valid current proof proceeds without a new approval gate;
30
36
  optional Finder context is passed only when supplied, never manufactured.
31
- 6. A missing or stale execution plan selects [plan.md](plan.md). Incomplete plan
37
+ 7. A missing or stale execution plan selects [plan.md](plan.md). Incomplete plan
32
38
  work, invalidated implementation evidence or an observed provider lifecycle
33
39
  fact lacking exact readback selects [implement.md](implement.md).
34
- 7. Completed implementation needing Code Review selects [review.md](review.md).
40
+ 8. Completed implementation needing Code Review selects [review.md](review.md).
35
41
  Accepted repair follows that same transition authority's Focused Repair
36
42
  Validation and risk-triggered second-pass rules. Passing ordinary focused
37
43
  checks proceed without automatically reopening Code Review.
38
- 8. Remaining docs-affecting work selects [docs-ingest.md](docs-ingest.md), otherwise
44
+ 9. Remaining docs-affecting work selects [docs-ingest.md](docs-ingest.md), otherwise
39
45
  [closeout.md](closeout.md). A fresh completed closeout needs no repeated mutation.
40
46
 
41
47
  Read only the selected phase. Each exit emits the common Phase Result. Full