@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
@@ -4,9 +4,9 @@ The command is `hi`; `hint` is an alias. The npm package remains `@punks/cli`.
4
4
 
5
5
  ## `hi init`
6
6
 
7
- Use before repo-aware setup. It seeds docs onboarding, requirements/backlog/spec skills, and the initial wiki structure.
7
+ Use before repo-aware setup. It seeds docs onboarding and requirements/backlog/spec skills.
8
8
 
9
- Activate `$docs-onboarding` after the command. Reconcile a generated wiki root with the real repository layout before writing durable specs or routed docs.
9
+ Activate `$docs-onboarding` after the command. Follow the [existing wiki structure check](wiki-structure.md) before writing durable specs or routed docs. Wiki structure is project-owned; CLI commands do not create or update it.
10
10
 
11
11
  ## `hi scaffold`
12
12
 
@@ -10,9 +10,11 @@ Existing `.devpunks/` artifacts describe project state. Read an artifact only wh
10
10
 
11
11
  ### Init
12
12
 
13
- - inspect the generated docs-onboarding, requirements/backlog/spec skills, and wiki root
14
- - activate `$docs-onboarding`
15
- - reconcile the wiki root with the real repository before durable docs are written
13
+ - inspect the generated docs-onboarding and requirements/backlog/spec skills
14
+ - complete the [existing wiki structure check](wiki-structure.md)
15
+ - when the check reports `pass` for an existing wiki root, activate `$docs-onboarding` against that root
16
+ - when the check reports `not-applicable`, defer onboarding and hand off project-owned wiki creation or selection; resume onboarding after an authorized setup produces an existing wiki that passes the check
17
+ - when the check reports `fail` or a blocker, report the required correction before onboarding can proceed
16
18
  - reconcile pre-existing skills only when the command reports relevant evidence
17
19
  - do not start requirements discovery unless the user asks for it
18
20
  - run `hi scaffold` only when the repository is ready for repo-aware setup
@@ -46,7 +48,8 @@ Then:
46
48
  - keep root `AGENTS.md` table-free; phase wrappers remain global orchestration
47
49
  entrypoints and are excluded from scoped tables
48
50
  - always link `opensrc/README.md` from scoped prompts and read it when work depends on third-party library behavior
49
- - reconcile only the generated skills, prompts, lint, hooks, scripts, subagents, tools, and wiki assets in scope
51
+ - reconcile only the generated skills, prompts, lint, hooks, scripts, subagents, and tools in scope
52
+ - complete the [existing wiki structure check](wiki-structure.md)
50
53
  - for lint output, complete [managed lint selection and adoption](managed-lint.md); saved owners and verified routes are the completion evidence
51
54
  - preserve repo-owned edits and ask before changing project policy
52
55
  - run targeted validation for the outputs reconciled
@@ -87,7 +90,7 @@ For a diff, inspect only paths changed or flagged by this run. Apply every match
87
90
  | Lint, hook, or script input | Follow [managed lint adoption](managed-lint.md#reconcile-lint-adoption); validate affected routes and preserve accepted project policy. |
88
91
  | Required tools | Check only added, changed, or failed tools. |
89
92
  | Source-guide content | Inspect only affected guide files. |
90
- | Wiki input | Reconcile affected routes or documents, then validate them. |
93
+ | Wiki guidance, routes, content schema, source documents, or sync inputs | Complete the [existing wiki structure check](wiki-structure.md) for the affected paths and their routed copies. |
91
94
  | Default or detected pack addition | Follow only categories changed by that addition. |
92
95
  | Optional/removal/policy/surface decision | Ask for the unresolved decision. |
93
96
  | First adoption or missing final output | Run applicable scaffold follow-through. |
@@ -146,7 +149,7 @@ Before completing reconciliation, compare existing project-owned paths and bytes
146
149
 
147
150
  ## 3. Complete the Branch
148
151
 
149
- - init: generated onboarding/skills/wiki state is reported and the next bounded action is clear
152
+ - init: generated skills and existing wiki check are reported; onboarding runs only after a passing check, otherwise the wiki setup or correction handoff is clear
150
153
  - scaffold: applicable generated instructions are reconciled, targeted validation ran, and unresolved policy choices are named
151
154
  - check: current drift is reported without writes
152
155
  - ensure: settings were reconfigured or the exact blocker is reported
@@ -0,0 +1,16 @@
1
+ # Existing Wiki Structure Check
2
+
3
+ Run after `hi init` and `hi scaffold`. After `hi update`, run when changed or flagged paths affect wiki guidance, routes, content schema, canonical source documents, or content synchronization. Limit update checks to those paths and their routed copies.
4
+
5
+ 1. Resolve the existing wiki root from project guidance and the repository. If no wiki exists, report `not-applicable`; creating a wiki is separate project work.
6
+ 2. Read the nearest `AGENTS.md`, matching Rule Registry entries, and the project's docs/wiki runbook. Use its current content configuration and sync script to resolve source ownership. These project standards define the expected structure; a baseline template does not.
7
+ 3. Check the applicable standards:
8
+ - routed pages belong to the project's accepted article tree and navigation metadata;
9
+ - pages have schema-valid frontmatter and resolved links;
10
+ - source specifications, raw inputs, and ingest bookkeeping use their declared locations;
11
+ - canonical documentation and generated wiki copies have clear ownership and remain synchronized;
12
+ - deliberate project/domain routes and authored content remain intact.
13
+ 4. Run the project's documented checks for content, links, navigation, and source synchronization. Use a check or dry-run mode for sync scripts. Inspect the proposed diff for loss of durable pages before any separately authorized synchronization.
14
+ 5. Report `pass`, `fail`, or `not-applicable`, the wiki root, standards consulted, commands and results, and each concrete mismatch with its path and required correction. If a required check cannot run, report the exact blocker; do not call the structure verified.
15
+
16
+ This handoff inspects project-owned wiki structure. Preserve its files, route decisions, and framework configuration unless the current task already authorizes a specific repair. CLI scaffold/update ownership does not extend to wiki creation, replacement, or cleanup.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: docs-onboarding
3
- description: Onboard an existing project into a scaffolded Harness wiki by inspecting code, docs, and backlog context, building a Project Map, closing a targeted requirements grill, compiling specs, then projecting them to the backlog. Use immediately after hi init or when an existing repository needs initial wiki/spec context reconstructed.
3
+ description: Onboard an existing project into the scaffolded Harness wiki by inspecting code, docs and backlog, closing reconstruction decisions, then compiling architecture/spec pairs through requirements-phase. Use after hi init or when initial wiki/spec context must be reconstructed.
4
4
  ---
5
5
 
6
6
  # Docs Onboarding
@@ -14,8 +14,9 @@ routed `requirements-grill` status artifact. Preserve its canonical terms;
14
14
  route proposed terminology changes through `requirements-grill` instead of
15
15
  silently renaming them.
16
16
 
17
- 1. Read repo guidance and the scaffolded wiki guidance.
18
- 2. Read `<wiki-root>/backlog-provider.md` and `<wiki-root>/wiki-framework.md`.
17
+ 1. Read repo guidance and the existing project-owned wiki guidance.
18
+ 2. Read any existing backlog provider and wiki framework decisions. Resolve
19
+ their locations from project guidance; `hi init` does not generate those files.
19
20
  3. Discover backlog context:
20
21
  - Probe the pinned remote backlog provider first when connector/tool/auth access exists.
21
22
  - Inspect local backlog clues after that: existing specs, issue matrices, backlog markdown, project docs, and `.devpunks` metadata.
@@ -28,16 +29,17 @@ silently renaming them.
28
29
  Product/Backlog Root, Product Areas, Initiatives, `V*` context, and saved
29
30
  views from accepted wiki and provider evidence.
30
31
  7. For every candidate existing flow accepted by the onboarding grill, invoke
31
- `create-spec` and record its readiness result. Project an agent-ready spec
32
- with `write-backlog` only when the reconstructed evidence already supplies
33
- the exact existing Epic/Story and accepted projection authority required by
34
- that branch. Otherwise record the missing authority and exact human Finder
35
- invocation; retain the compiled spec without provider mutation.
36
- 8. Leave new feature work to explicit human invocation of Business or
37
- Functional Finder. Onboarding never invokes a Finder
38
- implicitly.
39
-
40
- For the required Project Map sections, onboarding artifacts, evidence labels, and spec reconstruction rules, read [references/artifact-contract.md](references/artifact-contract.md).
32
+ `requirements-phase` with its confirmed status/log and Project Map evidence.
33
+ Require `create-architecture` before `create-spec`, then record the retained
34
+ pair and its readiness result. Pass the onboarding projection boundary:
35
+ an agent-ready spec and its mapped architecture may reach `write-backlog`
36
+ only when reconstructed evidence already supplies the exact existing Epic/Story
37
+ and accepted projection authority required by that branch. Otherwise record
38
+ the missing authority and exact human Finder invocation; retain the compiled
39
+ pair and return a blocked backlog delta without provider mutation. Onboarding
40
+ never invokes a Finder implicitly and does not create higher-level placement.
41
+ 8. Update onboarding navigation and indexes using
42
+ [references/artifact-contract.md](references/artifact-contract.md).
41
43
 
42
44
  ## Discovery Depth
43
45
 
@@ -47,9 +49,12 @@ Do not deep-read every implementation file by default. Deep-read implementation
47
49
 
48
50
  ## Targeted Grill
49
51
 
50
- Grill contradictions, missing backlog location, unclear feature ownership, and high-impact inferred requirements before `create-spec` runs.
51
-
52
- Low-risk current-state facts can proceed into `create-spec` as `Inferred`. Keep code-only low-risk facts `Inferred` unless the developer confirms them or unambiguous docs/backlog intent backs them.
52
+ Grill contradictions, missing backlog location, unclear feature ownership and
53
+ inferred requirements before either compiler runs. Observed code-only facts may
54
+ remain `Inferred` in the Project Map as evidence; they become accepted requirements
55
+ or design choices only through confirmed intent and the recorded grill decisions.
56
+ Pass unresolved material decisions back to `requirements-phase`; an inferred
57
+ current implementation is not permission to choose architecture or requirements.
53
58
 
54
59
  ## Resumability
55
60
 
@@ -1,4 +1,4 @@
1
1
  interface:
2
2
  display_name: "Docs Onboarding"
3
3
  short_description: "Reconstruct project wiki/spec context"
4
- default_prompt: "Use $docs-onboarding to inspect code, docs, and backlog context, build the Project Map, close the targeted requirements grill, compile agent-ready specs with create-spec, then project written specs with write-backlog."
4
+ default_prompt: "Use $docs-onboarding to inspect code, docs, and backlog context, build the Project Map, close the targeted requirements grill, pass confirmed sources through requirements-phase for create-architecture then create-spec, then project written specs with write-backlog within accepted onboarding placement authority."
@@ -46,7 +46,7 @@ The targeted grill can close when every blocking contradiction, missing backlog
46
46
 
47
47
  Do not grill every low-risk current-state fact. Carry those into the reconstruction record as `Inferred`, but do not claim agent readiness while a required product decision remains inferred.
48
48
 
49
- ## Reconstructed Specs
49
+ ## Reconstructed Architecture/SPEC Pairs
50
50
 
51
51
  Group reconstructed specs:
52
52
 
@@ -64,6 +64,18 @@ Evidence levels:
64
64
  - `Contradicted`: source evidence conflicts and needs resolution before the spec can be trusted.
65
65
  - `Missing`: expected context was not found, and the spec must ask a follow-up.
66
66
 
67
- Reconstructed specs must link back to relevant Project Map sections and onboarding grill decisions.
68
-
69
- Only specs that pass `create-spec` readiness and return a verified stable blob URL may be projected by `write-backlog`. A `spec-not-ready` result returns its named gaps to onboarding; it produces neither a partial spec nor backlog mutations.
67
+ Reconstructed architecture/spec pairs must link back to relevant Project Map sections and onboarding grill decisions.
68
+
69
+ Pass confirmed candidates to `requirements-phase`, which compiles architecture
70
+ before spec and completes the canonical spec-to-architecture-to-question mapping.
71
+ Retain both immutable artifact URLs, the final architecture identity in the spec,
72
+ and links to the relevant Project Map evidence and exact grill question entries.
73
+ `Inferred` facts remain attributed evidence, not accepted design or requirements.
74
+ `Contradicted` or `Missing` material inputs block compilation until resolved.
75
+
76
+ Only specs that pass `create-spec` readiness, resolve their complete architecture
77
+ mapping and return a verified stable blob URL may be projected by `write-backlog`,
78
+ within onboarding's existing placement authority. Missing authority blocks only
79
+ projection; retain the compiled pair and name the exact human Finder invocation.
80
+ An `architecture-not-ready` or `spec-not-ready` result returns its named gaps to
81
+ onboarding; it produces neither partial canonical artifacts nor backlog mutations.
@@ -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