@punks/cli 3.2.0 → 3.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 (87) hide show
  1. package/AGENTS.md +2 -0
  2. package/dist/BASELINE_CHANGELOG.md +47 -1
  3. package/dist/CHANGELOG.md +36 -0
  4. package/dist/baseline/scaffold-baseline/baseline.json +5 -5
  5. package/dist/baseline/scaffold-baseline/data/catalog/lint-assets.json +48 -0
  6. package/dist/baseline/scaffold-baseline/data/catalog/packs.json +2 -1
  7. package/dist/baseline/scaffold-baseline/data/catalog/skills.json +8 -0
  8. package/dist/baseline/scaffold-baseline/skills/agnostic/cli/hi-cli/references/post-command-flow.md +20 -22
  9. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/rule-authoring/SKILL.md +18 -0
  10. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/rule-authoring/references/migration.md +10 -0
  11. package/dist/baseline/scaffold-baseline/skills/agnostic/docs/upstream/mattpocock-writing-skills.md +81 -12
  12. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/REFERENCE.md +11 -14
  13. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/SKILL.md +17 -14
  14. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/architecture-convergence.md +99 -0
  15. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/plan-schema.md +34 -0
  16. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/create-plan/references/planner-task-graph.md +15 -12
  17. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/SKILL.md +6 -5
  18. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +10 -0
  19. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/architecture-conformance.md +100 -0
  20. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/lifecycle.md +25 -2
  21. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +17 -1
  22. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +14 -0
  23. package/dist/baseline/scaffold-baseline/skills/agnostic/planning/implement-spec/references/parallel.md +7 -0
  24. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/SKILL.md +3 -2
  25. package/dist/baseline/scaffold-baseline/skills/agnostic/quality/tdd/high-signal-tests.md +17 -3
  26. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/domain-modeling/{CONTEXT-FORMAT.md → GLOSSARY-FORMAT.md} +9 -9
  27. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/domain-modeling/SKILL.md +12 -12
  28. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/SKILL.md +3 -2
  29. package/dist/baseline/scaffold-baseline/skills/agnostic/requirements/requirements-grill/references/grilling-flow.md +1 -1
  30. package/dist/baseline/scaffold-baseline/skills/frameworks/effect/effect-service-design/UPSTREAM.md +17 -0
  31. package/dist/baseline/scaffold-baseline/skills/misc/wait-what/SKILL.md +1 -1
  32. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/SKILL.md +5 -7
  33. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/review.md +25 -50
  34. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/phases/router.md +22 -27
  35. package/dist/baseline/scaffold-baseline/skills/phases/delivery-phase/references/phase-handoff.md +10 -28
  36. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/AUTHORING-HANDOFF.md +11 -14
  37. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/prepare-review.md +1 -1
  38. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/retain-report.md +2 -9
  39. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/return-route.md +8 -6
  40. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/phases/run-review.md +5 -8
  41. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/durable-report.md +14 -29
  42. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/state-graph.md +32 -45
  43. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/references/targets.md +1 -2
  44. package/dist/baseline/scaffold-baseline/skills/phases/review-phase/scripts/review-contract.mjs +12 -86
  45. package/dist/baseline/scaffold-baseline.json +5 -5
  46. package/dist/baseline/scaffold-baseline.tgz +0 -0
  47. package/dist/data/AGENTS.md +2 -0
  48. package/dist/index.js +15 -15
  49. package/dist/skills/agnostic/cli/hi-cli/references/post-command-flow.md +5 -7
  50. package/dist/skills/agnostic/docs/rule-authoring/SKILL.md +18 -0
  51. package/dist/skills/agnostic/docs/rule-authoring/references/migration.md +10 -0
  52. package/dist/skills/agnostic/docs/upstream/mattpocock-writing-skills.md +81 -12
  53. package/dist/skills/agnostic/planning/create-plan/REFERENCE.md +11 -14
  54. package/dist/skills/agnostic/planning/create-plan/SKILL.md +17 -14
  55. package/dist/skills/agnostic/planning/create-plan/references/architecture-convergence.md +99 -0
  56. package/dist/skills/agnostic/planning/create-plan/references/plan-schema.md +34 -0
  57. package/dist/skills/agnostic/planning/create-plan/references/planner-task-graph.md +15 -12
  58. package/dist/skills/agnostic/planning/implement-spec/SKILL.md +6 -5
  59. package/dist/skills/agnostic/planning/implement-spec/assets/IMPLEMENTATION-NOTES-TEMPLATE.md +10 -0
  60. package/dist/skills/agnostic/planning/implement-spec/references/architecture-conformance.md +100 -0
  61. package/dist/skills/agnostic/planning/implement-spec/references/lifecycle.md +25 -2
  62. package/dist/skills/agnostic/planning/implement-spec/references/parallel-orchestration.md +17 -1
  63. package/dist/skills/agnostic/planning/implement-spec/references/parallel-worker-brief.md +14 -0
  64. package/dist/skills/agnostic/planning/implement-spec/references/parallel.md +7 -0
  65. package/dist/skills/agnostic/quality/tdd/SKILL.md +3 -2
  66. package/dist/skills/agnostic/quality/tdd/high-signal-tests.md +17 -3
  67. package/dist/skills/agnostic/requirements/domain-modeling/{CONTEXT-FORMAT.md → GLOSSARY-FORMAT.md} +9 -9
  68. package/dist/skills/agnostic/requirements/domain-modeling/SKILL.md +12 -12
  69. package/dist/skills/agnostic/requirements/requirements-grill/SKILL.md +3 -2
  70. package/dist/skills/agnostic/requirements/requirements-grill/references/grilling-flow.md +1 -1
  71. package/dist/skills/frameworks/effect/effect-service-design/UPSTREAM.md +17 -0
  72. package/dist/skills/frameworks/nestjs/nestjs-best-practices/.gitignore +29 -0
  73. package/dist/skills/misc/wait-what/SKILL.md +1 -1
  74. package/dist/skills/phases/delivery-phase/SKILL.md +5 -7
  75. package/dist/skills/phases/delivery-phase/phases/review.md +25 -50
  76. package/dist/skills/phases/delivery-phase/phases/router.md +20 -25
  77. package/dist/skills/phases/delivery-phase/references/phase-handoff.md +10 -28
  78. package/dist/skills/phases/review-phase/AUTHORING-HANDOFF.md +11 -14
  79. package/dist/skills/phases/review-phase/phases/prepare-review.md +1 -1
  80. package/dist/skills/phases/review-phase/phases/retain-report.md +2 -9
  81. package/dist/skills/phases/review-phase/phases/return-route.md +8 -6
  82. package/dist/skills/phases/review-phase/phases/run-review.md +5 -8
  83. package/dist/skills/phases/review-phase/references/durable-report.md +14 -29
  84. package/dist/skills/phases/review-phase/references/state-graph.md +6 -19
  85. package/dist/skills/phases/review-phase/references/targets.md +1 -2
  86. package/dist/skills/phases/review-phase/scripts/review-contract.mjs +11 -91
  87. package/package.json +9 -71
@@ -32,16 +32,12 @@ If an expected artifact is missing, continue and report it.
32
32
 
33
33
  Then:
34
34
 
35
+ - activate `$writing-for-agents`, then `$rule-authoring`
35
36
  - author the requested root, docs, and workspace guidance
36
37
  - treat `.devpunks/specs/prompts/**` as the complete prompt-authoring contract; apply every scoped-prompt criterion it contains
37
38
  - ground scoped prompts in current code evidence: structure, placement, dependencies, and boundaries first; applied coding conventions second; enforced constraints outrank the nearest stable module-family pattern
38
39
  - keep each scoped prompt lean with exact-trigger pointers to co-authored reference content; references disclose content and never create deeper prompt scopes
39
- - render every selected non-phase skill in one final `## Skills` table with
40
- `Skill | Exact trigger`; each row names the exact invocation condition
41
- - open every selected installed skill's `SKILL.md`; that installed file remains
42
- workflow authority
43
- - keep root `AGENTS.md` table-free; phase wrappers remain global orchestration
44
- entrypoints and are excluded from scoped tables
40
+ - render every selected non-phase skill in a `Skill | What / when` table derived from its complete `SKILL.md`
45
41
  - always link `opensrc/README.md` from scoped prompts and read it when work depends on third-party library behavior
46
42
  - reconcile only the generated skills, prompts, lint, hooks, scripts, subagents, tools, and wiki assets in scope
47
43
  - preserve repo-owned edits and ask before changing project policy
@@ -76,7 +72,7 @@ For a diff, inspect only paths changed or flagged by this run. Apply every match
76
72
  | Skill added, removed, or renamed | Reconcile affected IDs and their mirrors. |
77
73
  | `local-edited` conflict | Preserve local intent; ask when project and baseline intent conflict. |
78
74
  | Missing or stale path | Confirm the named recreation or deletion and direct references. |
79
- | Prompt input | Reconcile only affected prompt scopes and mirrors. |
75
+ | Prompt or Rule Registry input | Activate `$writing-for-agents`, then `$rule-authoring`; reconcile only affected scopes and mirrors. |
80
76
  | Subagent input | Reconcile only generated and final subagent manifests. |
81
77
  | Lint, hook, or script input | Validate the affected config or command; ask before changing policy. |
82
78
  | Required tools | Check only added, changed, or failed tools. |
@@ -88,6 +84,8 @@ For a diff, inspect only paths changed or flagged by this run. Apply every match
88
84
 
89
85
  After write modes, run targeted validation and one fresh `hi check --json`. Rerun `hi update` once only when that check detects new CLI or baseline drift, then finish with one final `hi check --json`.
90
86
 
87
+ Before completing a changed update, activate `$writing-for-agents`, then `$rule-authoring`. A no-op Rule Registry reconciliation is valid.
88
+
91
89
  ### Tools Ensure
92
90
 
93
91
  Treat the command as a global or external mutation.
@@ -0,0 +1,18 @@
1
+ ---
2
+ name: rule-authoring
3
+ description: Maintain project-owned Codebase Rules after `hi scaffold` or `hi update`. Use only from those post-command handoffs.
4
+ ---
5
+
6
+ # Rule Authoring
7
+
8
+ Use with `$writing-for-agents`.
9
+
10
+ 1. Read or create `.agents/rules/index.md`.
11
+ 2. Keep one stable invariant per scope-grouped rule file. Require current Code Evidence or a linked accepted architecture decision.
12
+ 3. Index each rule by stable id, scope, path trigger, task trigger, optional tags, and file. Tags aid discovery; the other triggers decide activation.
13
+ 4. Keep scoped `AGENTS.md` files to scope, exact skill routing, and one exhaustive Rule Registry pointer.
14
+ 5. Evaluate every activated rule as `pass`, `fail`, or `not-applicable` with evidence in the current handoff or work log.
15
+
16
+ Rule files contain: `id`, `authority`, one positive requirement, activation triggers, verification, and exceptions.
17
+
18
+ For an existing repository, follow [migration.md](references/migration.md). Completion means the index is exhaustive, every pointer resolves, and project-owned rules remain preserved.
@@ -0,0 +1,10 @@
1
+ # Rule Migration
2
+
3
+ Classify each scoped `AGENTS.md` line:
4
+
5
+ - keep the scope boundary and exact skill-routing table
6
+ - move stable codebase patterns and accepted architecture constraints into granular `.agents/rules/<scope>/` files
7
+ - remove duplicated rule bodies after indexing them
8
+ - keep workflow routing at its owning prompt or skill
9
+
10
+ Start with the narrowest scopes. Use current executable code or a durable accepted architecture decision as authority. Preserve project-owned rule files during scaffold and update. Finish when every scoped prompt has one exhaustive `.agents/rules/index.md` pointer and every migrated invariant has one authoritative body.
@@ -1,22 +1,91 @@
1
- # Matt Pocock Writing Skills
1
+ # Matt Pocock Skills: provenance and coverage
2
2
 
3
- Source: https://github.com/mattpocock/skills/tree/main/skills/in-progress
3
+ This is the source-of-truth audit for Matt Pocock material retained in the
4
+ Devpunks skill library.
4
5
 
5
- Imported from upstream commit:
6
+ ## Audit snapshot
6
7
 
7
- ```text
8
- 694fa30311e02c2639942308513555e61ee84a6f
9
- ```
8
+ - Checked: 2026-08-12
9
+ - Curated catalog: <https://www.aihero.dev/skills>
10
+ - Upstream repository: <https://github.com/mattpocock/skills>
11
+ - Compared GitHub snapshot: `84fdeffd12f2ee307994d1eb6feb48173b6e0502`
12
+ - Upstream license SHA-256: `0e7ac423bf2c6e223b7c5b156f8cf72da49d748e56a1641402c31f22ad07dbb5`
10
13
 
11
- Imported skills:
14
+ The local files below are the only direct Matt-derived skills in this repo.
15
+ Each directory carries an adjacent `LICENSE` copied from the upstream root
16
+ license and an `UPSTREAM.md` with its immutable source commit. The local
17
+ adaptations remain intentionally customized; this audit does not replace them
18
+ with upstream files.
12
19
 
13
- - `writing-fragments`
14
- - `writing-beats`
15
- - `writing-shape`
20
+ ## Direct Matt-derived skills
16
21
 
17
- These skills were in upstream `skills/in-progress` at import time. Devpunks adopts them as reusable agnostic docs/writing skills and distributes them through the normal shared skills sync.
22
+ | Local skill | Upstream skill | Relationship | Imported source |
23
+ | --- | --- | --- | --- |
24
+ | `agnostic/docs/writing-beats` | `in-progress/writing-beats` | adapted | [`694fa303`](https://github.com/mattpocock/skills/tree/694fa30311e02c2639942308513555e61ee84a6f/skills/in-progress/writing-beats) |
25
+ | `agnostic/docs/writing-fragments` | `in-progress/writing-fragments` | adapted | [`694fa303`](https://github.com/mattpocock/skills/tree/694fa30311e02c2639942308513555e61ee84a6f/skills/in-progress/writing-fragments) |
26
+ | `agnostic/docs/writing-shape` | `in-progress/writing-shape` | adapted | [`694fa303`](https://github.com/mattpocock/skills/tree/694fa30311e02c2639942308513555e61ee84a6f/skills/in-progress/writing-shape) |
27
+ | `agnostic/docs/writing-for-agents` | `productivity/writing-for-agents` | imported unchanged | [`2ffb184f`](https://github.com/mattpocock/skills/tree/2ffb184ffbb752faa664c0b204f3c9241b1428e9/skills/productivity/writing-for-agents) |
28
+ | `agnostic/generic/handoff` | `productivity/handoff` | adapted | [`221ffca9`](https://github.com/mattpocock/skills/tree/221ffca96736afefdc08ca7cf0b3965e9ea83f41/skills/productivity/handoff) |
29
+ | `agnostic/quality/codebase-design` | `engineering/codebase-design` | adapted | [`221ffca9`](https://github.com/mattpocock/skills/tree/221ffca96736afefdc08ca7cf0b3965e9ea83f41/skills/engineering/codebase-design) |
30
+ | `agnostic/quality/review` | `in-progress/review` | adapted | [`801dca68`](https://github.com/mattpocock/skills/tree/801dca688564c529fa84f247f64472520d9ebe28/skills/in-progress/review) |
31
+ | `agnostic/quality/tdd` | `engineering/tdd` | adapted | [`62f43a18`](https://github.com/mattpocock/skills/tree/62f43a18177be6ec82da242e59ffbc490a4c22ea/skills/engineering/tdd) |
32
+ | `agnostic/requirements/grilling` | `in-progress/batch-grill-me` | imported with local contract | [`9603c1cc`](https://github.com/mattpocock/skills/tree/9603c1cc8118d08bc1b3bf34cf714f62178dea3b/skills/in-progress/batch-grill-me) |
33
+ | `agnostic/research/improve-codebase-architecture` | `engineering/improve-codebase-architecture` | adapted | [`62f43a18`](https://github.com/mattpocock/skills/tree/62f43a18177be6ec82da242e59ffbc490a4c22ea/skills/engineering/improve-codebase-architecture) |
34
+ | `agnostic/research/prototype` | `engineering/prototype` | adapted | [`2ffb184f`](https://github.com/mattpocock/skills/tree/2ffb184ffbb752faa664c0b204f3c9241b1428e9/skills/engineering/prototype) |
35
+ | `misc/wait-what` | `productivity/wait-what` | imported unchanged | [`2ffb184f`](https://github.com/mattpocock/skills/tree/2ffb184ffbb752faa664c0b204f3c9241b1428e9/skills/productivity/wait-what) |
18
36
 
19
- ## MIT License Notice
37
+ The retained writing skills were in upstream `skills/in-progress` at import
38
+ time, so they remain licensed and attributed even though they are not part of
39
+ the current curated page.
40
+
41
+ ## Indirect derivative with Matt's retained license
42
+
43
+ `frameworks/effect/effect-service-design` is adapted from Dillon Mulroy's
44
+ `dmmulroy/skills` at commit
45
+ `8603380821fee6a77c82639f364ce8fe4f5a92be`. Dillon's source repository
46
+ retains the same Matt Pocock MIT license, so the local skill keeps that exact
47
+ license and now documents the full attribution chain in its adjacent
48
+ `UPSTREAM.md`. It is not counted as one of Matt's direct catalog skills.
49
+
50
+ ## Comparison with the current AI Hero catalog
51
+
52
+ The AI Hero page currently lists 25 curated skills. A dash means the local
53
+ repo does not carry that skill. “Local analogue” means a Devpunks skill with a
54
+ similar role, not copied Matt material, and therefore it does not receive
55
+ Matt's license or attribution solely because the names overlap.
56
+
57
+ | AI Hero skill | Local coverage |
58
+ | --- | --- |
59
+ | `setup-matt-pocock-skills` | — |
60
+ | `ask-matt` | — |
61
+ | `grill-with-docs` | — |
62
+ | `to-spec` | local analogue: `agnostic/planning/create-spec` |
63
+ | `to-tickets` | local analogue: `agnostic/requirements/write-backlog` |
64
+ | `implement` | local analogue: `agnostic/planning/implement-spec` |
65
+ | `code-review` | direct adaptation: `agnostic/quality/review` |
66
+ | `wayfinder` | local analogue: `agnostic/planning/wayfinder` |
67
+ | `prototype` | direct adaptation: `agnostic/research/prototype` |
68
+ | `research` | local analogue: `agnostic/research/parallel-research` |
69
+ | `improve-codebase-architecture` | direct adaptation: `agnostic/research/improve-codebase-architecture` |
70
+ | `diagnosing-bugs` | local analogue: `agnostic/debug/debug-agent` |
71
+ | `resolving-merge-conflicts` | — |
72
+ | `triage` | — |
73
+ | `wizard` | — |
74
+ | `grill-me` | — |
75
+ | `handoff` | direct adaptation: `agnostic/generic/handoff` |
76
+ | `to-questionnaire` | — |
77
+ | `teach` | — |
78
+ | `wait-what` | imported unchanged: `misc/wait-what` |
79
+ | `writing-for-agents` | imported unchanged: `agnostic/docs/writing-for-agents` |
80
+ | `codebase-design` | direct adaptation: `agnostic/quality/codebase-design` |
81
+ | `domain-modeling` | — |
82
+ | `grilling` | direct adaptation: `agnostic/requirements/grilling` |
83
+ | `tdd` | direct adaptation: `agnostic/quality/tdd` |
84
+
85
+ ## MIT license notice
86
+
87
+ The adjacent `LICENSE` files for the direct Matt-derived skills preserve the
88
+ upstream notice exactly:
20
89
 
21
90
  MIT License
22
91
 
@@ -4,31 +4,28 @@
4
4
 
5
5
  ## Required inner skills
6
6
 
7
- - MUST use `$grilling`
8
- - MUST use `$swarm-planner`
9
- - MUST use `$tdd`
10
- - MUST use `$codebase-design`
7
+ The required-inner-skills list in canonical [SKILL.md](SKILL.md) is authoritative and includes `$show-me`.
8
+ Execute every listed skill; keep this reference focused on sequencing and disclosed rules.
9
+
11
10
  - `opensrc` provides source context for installed or external packages
12
- - scoped `AGENTS.md` files provide per-path skill requirements through one final
13
- `## Skills` table with `Skill | Exact trigger`; select matching non-phase rows
14
- and open each selected installed skill's `SKILL.md`, which remains workflow
15
- authority. Root `AGENTS.md` stays table-free. Phase wrappers remain global
16
- orchestration entrypoints and are excluded from scoped tables.
11
+ - scoped `AGENTS.md` files provide per-path skill requirements through `Skill | What / when` tables; select exact trigger matches and open each selected skill's complete `SKILL.md`
17
12
 
18
13
  ## Graph map
19
14
 
20
15
  1. Read current repo state and derive as much context as possible before asking.
21
16
  2. Reduce ambiguity before task synthesis:
22
17
  - see [references/grill-ambiguity.md](references/grill-ambiguity.md)
23
- 3. Build the swarm graph of `Tn` tasks:
18
+ 3. Classify architecture applicability and persist convergence views when required:
19
+ - see [references/architecture-convergence.md](references/architecture-convergence.md)
20
+ 4. Build the swarm graph of `Tn` tasks from that contract:
24
21
  - see [references/planner-task-graph.md](references/planner-task-graph.md)
25
- 4. Attach TDD shaping to each `Tn` task:
22
+ 5. Attach TDD shaping to each `Tn` task:
26
23
  - see [references/tdd-shaping.md](references/tdd-shaping.md)
27
- 5. Normalize the saved plan using:
24
+ 6. Normalize the saved plan using:
28
25
  - [references/plan-schema.md](references/plan-schema.md)
29
- 6. Sync backlog items using:
26
+ 7. Sync backlog items using:
30
27
  - [references/backlog-sync.md](references/backlog-sync.md)
31
- 7. Stop using:
28
+ 8. Stop using:
32
29
  - [references/stop-conditions.md](references/stop-conditions.md)
33
30
 
34
31
  ## Global rules
@@ -43,27 +43,27 @@ silently renaming them.
43
43
  remains step 13.
44
44
  7. If readonly discovery has independent code paths, specs, backlog items, external docs, or hypotheses, read and use `$parallel-research` before final task synthesis.
45
45
  8. Research with `opensrc path <package>` or `opensrc path <owner>/<repo>` plus primary-source web docs when current behavior matters.
46
- 9. Locate scoped `AGENTS.md` files for every planned task path. Scoped guidance
47
- uses one final `## Skills` table with `Skill | Exact trigger`. Select only
48
- non-phase rows whose exact triggers match the task, then open each selected
49
- installed skill's `SKILL.md`; that installed file is workflow authority.
50
- Root `AGENTS.md` stays table-free. Phase wrappers remain global orchestration
51
- entrypoints and are excluded from scoped tables.
46
+ 9. Locate scoped `AGENTS.md` files for every planned task path. Read each
47
+ applicable `Skill | What / when` table, select rows whose exact `What / when`
48
+ triggers match the task, and open each selected skill's complete `SKILL.md`
49
+ before finalizing task design.
52
50
  10. For every implementation task, convert applicable scoped or named skill
53
51
  obligations into `implementation_skill_guidance`; preserve `assigned_skills`
54
52
  as planning provenance.
55
- 11. Read `references/planner-task-graph.md` and run `$swarm-planner` to produce the swarm graph and `Tn` task contract.
56
- 12. Read `references/tdd-shaping.md` and run `$tdd` to attach RED/GREEN targets to each `Tn` task.
57
- 13. Read `references/backlog-sync.md`. Sync backlog at epic/story level only when
53
+ 11. Read `references/architecture-convergence.md`. Persist architecture applicability. For architecture-bearing
54
+ work, derive and validate the architecture contract accepted in `SPEC.md`; route missing or contradictory target design back to `requirements-grill`.
55
+ 12. Read `references/planner-task-graph.md` and run `$swarm-planner` to produce the swarm graph and `Tn` task contract.
56
+ 13. Read `references/tdd-shaping.md` and run `$tdd` to attach RED/GREEN targets to each `Tn` task.
57
+ 14. Read `references/backlog-sync.md`. Sync backlog at epic/story level only when
58
58
  backlog sync is eligible and in scope; otherwise record an explicit skip
59
59
  reason and continue plan completion.
60
- 14. Invoke `$show-me` to present the task graph, dependencies, waves, and
60
+ 15. Invoke `$show-me` to present the task graph, dependencies, waves, and
61
61
  validation gates from the complete plan state before `$wait-what`. The
62
62
  presentation is a derived view; `PLAN.md` fields remain the execution authority.
63
- 15. Before writing `PLAN.md`, invoke `$wait-what` on the complete plan. Proceed
63
+ 16. Before writing `PLAN.md`, invoke `$wait-what` on the complete plan. Proceed
64
64
  only when its language contract passes without changing the resolved
65
65
  decision ledger.
66
- 16. Read `references/stop-conditions.md` and stop exactly there.
66
+ 17. Read `references/stop-conditions.md` and stop exactly there.
67
67
 
68
68
  ## Workflows
69
69
 
@@ -76,8 +76,8 @@ silently renaming them.
76
76
  5. Scan relevant routed learning artifacts before task synthesis when prior bug knowledge, domain behavior, or project conventions could affect the plan.
77
77
  6. Resolve each task's scoped guidance from root `AGENTS.md` down to the nearest `AGENTS.md` for its `location`.
78
78
  7. Use each task's required skill guidance while shaping its scope, dependencies, validation, RED target, and review mode; do not merely list skills after the plan is written.
79
- 8. Assign each task the deduplicated union of skills whose exact triggers match
80
- in every touched scope, merging all touched scopes for
79
+ 8. Assign each task the deduplicated union of skills whose exact `What / when`
80
+ triggers match in every touched scope, merging all touched scopes for
81
81
  cross-directory tasks.
82
82
  9. Build plan-derived worker waves: place every currently unblocked task with
83
83
  a disjoint write scope in the same wave. Use a one-task wave only when
@@ -89,6 +89,8 @@ silently renaming them.
89
89
  `tdd_status`, `tdd_target`, RED/GREEN commands, evidence fields,
90
90
  `codebase_design_notes`, `review_mode`, `runtime_validation`,
91
91
  `runtime_target`, `runtime_evidence`, and `runtime_cleanup`.
92
+ Architecture-bearing tasks also carry the convergence fields required by
93
+ `references/architecture-convergence.md`.
92
94
  11. Keep `PLAN.md` self-contained: embed gathered context, relevant code paths, existing patterns, constraints, assumptions, design reasoning, tradeoffs, initial situation, issue, solution shape, findings, research, dependency graph, testing strategy, skill-routing notes, risks, validation gates, unresolved questions, and a resolved decision ledger.
93
95
  12. Write enough conceptual reasoning that an executor can implement from `PLAN.md` alone, using supplementary research only when they choose to refresh or deepen context.
94
96
  13. For complex work, express the plan as a swarm graph of `Tn` tasks with dependency-aware validation gates, expected outcomes, assertions, or checks that let the executor self-verify before moving on.
@@ -123,5 +125,6 @@ See [REFERENCE.md](REFERENCE.md) for the overview and graph map.
123
125
  - Planner / swarm graph: see [references/planner-task-graph.md](references/planner-task-graph.md)
124
126
  - TDD shaping: see [references/tdd-shaping.md](references/tdd-shaping.md)
125
127
  - `PLAN.md` schema and task contract: see [references/plan-schema.md](references/plan-schema.md)
128
+ - Architecture applicability and convergence contract: see [references/architecture-convergence.md](references/architecture-convergence.md)
126
129
  - Backlog sync rules: see [references/backlog-sync.md](references/backlog-sync.md)
127
130
  - Stop conditions: see [references/stop-conditions.md](references/stop-conditions.md)
@@ -0,0 +1,99 @@
1
+ # Architecture Convergence
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.
4
+
5
+ ## Classify Applicability
6
+
7
+ Persist `architecture_applicability: local | architecture-bearing` with evidence.
8
+
9
+ - `local`: one bounded responsibility, with no domain-owner, public-seam, composition, or cross-domain
10
+ dependency change. Keep the ordinary task graph and `codebase_design_notes`; record why this branch does
11
+ not apply.
12
+ - `architecture-bearing`: multiple stories or tasks change one capability cumulatively; or any task crosses
13
+ an ownership boundary, changes composition, changes a public seam, introduces a domain, migrates callers,
14
+ or changes cross-domain dependencies.
15
+
16
+ Classification is complete when every planned location and consumer is covered by one outcome. A plan
17
+ cannot use `local` merely because each task looks small in isolation.
18
+
19
+ ## Derive the Contract
20
+
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.
22
+
23
+ For backend scope, invoke `$backend-domain-structure` and read its layout reference. Derive honest feature,
24
+ platform/composition, integration, persistence, model, and public-boundary ownership from the repository.
25
+
26
+ For frontend scope, invoke `$frontend-domain-structure` and read its agnostic reference. Apply the invariant-owner,
27
+ domain-worthiness, public-entrypoint, one-way, and acyclic dependency rules. For React scope, also read its
28
+ React addendum and classify route composition, components, hooks, providers, and behavior-test seams.
29
+
30
+ For mixed scope, apply both theories at their respective boundaries. Preserve repository vocabulary and
31
+ existing honest owners. Completion requires every changed responsibility and dependency edge to be grounded
32
+ in the applicable theory and current code evidence.
33
+
34
+ ## Persist the Architecture Contract
35
+
36
+ For an architecture-bearing plan, invoke `$show-me` while authoring **each persisted view** below. Save the
37
+ 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.
39
+
40
+ ### Target Ownership Topology
41
+
42
+ Show the target domains/modules and composition roots as a shallow tree or ownership map. For every owner,
43
+ state its responsibility, public entrypoint, owned paths, and responsibilities it must not absorb. Ownership
44
+ means semantic policy and behavior, not file placement alone.
45
+
46
+ ### Declared Dependency Graph
47
+
48
+ Show every changed or newly relevant cross-owner edge. Label allowed edges with the public seam they traverse;
49
+ list forbidden static imports and forbidden semantic calls. Require one-way, acyclic dependencies and deliberate
50
+ public entrypoints under the applicable frontend/backend theory.
51
+
52
+ ### Responsibility Acceptance Criteria
53
+
54
+ Give every target owner observable acceptance criteria proving that its policy, orchestration, persistence,
55
+ integration, transport, or presentation responsibility lives there. Include focused behavior and architecture
56
+ checks; file existence alone is insufficient evidence. Each criterion records a stable `criterion_id`, its
57
+ owner, observable assertion, evidence command or inspection, and `due_architecture_wave`. Every criterion id
58
+ must map to at least one task and exactly one due wave.
59
+
60
+ ### Architecture Waves
61
+
62
+ Show ordered architecture waves separately from worker parallelism:
63
+
64
+ ```text
65
+ boundary establishment
66
+ vertical slice / caller migration
67
+ continuous convergence checkpoint
68
+ next slice
69
+ continuous convergence checkpoint
70
+ final closure
71
+ ```
72
+
73
+ Each wave has a stable `architecture_wave` id distinct from worker `wave_boundary`; it names its topology delta,
74
+ entry dependencies, criterion ids due in that wave, allowed temporary seams, and checkpoint. Vertical delivery
75
+ remains behavior-complete; architecture work is not deferred wholesale to final closure.
76
+
77
+ ### Public Seam Contract
78
+
79
+ 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
81
+ before dependent work continues.
82
+
83
+ ### Migration Ledger
84
+
85
+ For every temporary seam record its introducing task, reason, allowed consumers, removal task, expiry wave, and
86
+ removal proof. Undeclared temporary seams are drift. Final closure requires the migration ledger to be empty.
87
+
88
+ ## Shape Continuous Convergence
89
+
90
+ Every architecture-bearing task declares `architecture_wave`, `behavior_owner`, `integration_surface`,
91
+ `public_seam`, `topology_delta`, `forbidden_ownership`, `temporary_seams`, and
92
+ `responsibility_acceptance_criteria`. Each architecture wave ends with a **continuous convergence checkpoint**
93
+ that compares cumulative implementation with all persisted views: actual ownership, allowed and forbidden edges,
94
+ public-seam amendments, topology delta, and migration-ledger additions/removals. The checkpoint evaluates every
95
+ criterion due through the current wave and regression-checks every criterion previously met. Missing, failing,
96
+ or regressed evidence blocks dependent waves.
97
+
98
+ Final closure confirms the target responsibilities, graph, public seams, and acceptance evidence; all migration
99
+ entries are removed. It is a zero-drift proof, not the first consolidation pass.
@@ -8,6 +8,7 @@ The generated `PLAN.md` is the execution handoff. It must stand alone without hi
8
8
 
9
9
  Include:
10
10
 
11
+ - `architecture_applicability: local | architecture-bearing` with evidence
11
12
  - initial situation
12
13
  - issue or problem statement
13
14
  - proposed solution shape
@@ -22,6 +23,12 @@ Include:
22
23
  - validation gates per `Tn` task and dependency wave
23
24
  - unresolved questions
24
25
 
26
+ When `architecture_applicability: architecture-bearing`, also include the normative **Target Ownership
27
+ Topology**, **Declared Dependency Graph**, **Responsibility Acceptance Criteria**, **Architecture Waves**,
28
+ **Public Seam Contract**, and **Migration Ledger** defined in
29
+ [architecture-convergence.md](architecture-convergence.md). Persist each view using `$show-me`; the migration
30
+ ledger starts with every planned temporary seam and final closure requires it to be empty.
31
+
25
32
  `unresolved questions` is not a hiding place for skipped planning. Include only `$grilling`-deferred, externally blocked, or non-blocking questions, and state why each remains open.
26
33
 
27
34
  Each wave contains every currently unblocked task whose `owned_paths` are
@@ -62,6 +69,25 @@ Every task must include:
62
69
  - `runtime_evidence`
63
70
  - `runtime_cleanup`
64
71
 
72
+ Every architecture-bearing task must also include:
73
+
74
+ - `architecture_wave`
75
+ - `behavior_owner`
76
+ - `integration_surface`
77
+ - `public_seam`
78
+ - `topology_delta`
79
+ - `forbidden_ownership`
80
+ - `temporary_seams`
81
+ - `responsibility_acceptance_criteria`
82
+
83
+ These fields bind the task to cumulative ownership rather than file placement. Local-plan tasks omit them;
84
+ their plan-level applicability evidence and ordinary `codebase_design_notes` are the explicit escape hatch.
85
+
86
+ `architecture_wave` is a stable architecture sequence id, for example `A2`; `wave_boundary` remains the worker
87
+ parallelism id. `responsibility_acceptance_criteria` lists the stable criterion ids this task advances or proves.
88
+ Every listed id must exist in the plan-level Responsibility Acceptance Criteria view, whose entry declares its
89
+ `due_architecture_wave`. Each criterion maps to at least one task and exactly one due architecture wave.
90
+
65
91
  `backlog_item_id` and `backlog_item_url` reference the owning product-facing story, not a task-owned backlog record.
66
92
 
67
93
  `owned_paths` lists the exact write scope assigned to the task. Tasks in the
@@ -142,4 +168,12 @@ Use `not_applicable` for the other runtime fields when `runtime_validation: not_
142
168
  - **runtime_target**: Supported local API and background worker.
143
169
  - **runtime_evidence**: Public response plus correlated persisted state and worker completion.
144
170
  - **runtime_cleanup**: Tag fixtures with a unique run id; remove only resources carrying that id.
171
+ - **architecture_wave**: A2
172
+ - **behavior_owner**: Target domain or module responsible for the changed behavior.
173
+ - **integration_surface**: Composition, transport, UI, or caller surface consuming the owner.
174
+ - **public_seam**: Declared entrypoint and command/result/port contract, or unchanged.
175
+ - **topology_delta**: Exact owner or dependency edge moved toward the target topology.
176
+ - **forbidden_ownership**: Policy or mechanics this task must keep outside its owner.
177
+ - **temporary_seams**: Ledger entries introduced or removed by this task, or none.
178
+ - **responsibility_acceptance_criteria**: [RAC-2, RAC-3]
145
179
  ```
@@ -16,23 +16,21 @@ Before finalizing task boundaries:
16
16
 
17
17
  1. List every concrete `location` each task may touch.
18
18
  2. For each location, inspect the `AGENTS.md` chain from repo root to the nearest scoped file.
19
- 3. Read the final `## Skills` table with `Skill | Exact trigger` in every
20
- applicable scoped file and select only non-phase rows whose exact trigger
21
- matches the task.
22
- 4. Verify each selected skill exists in `.agents/skills/` or another installed
23
- skill source visible to the agent.
24
- 5. Open each selected installed skill's `SKILL.md`; that installed file is
25
- workflow authority while finalizing the task's boundary, validation, RED
26
- target, and review mode.
19
+ 3. Read every applicable `Skill | What / when` table and select only rows whose
20
+ exact `What / when` trigger matches the task.
21
+ 4. Verify each selected skill exists in `.agents/skills/` or an installed skill
22
+ source visible to the agent.
23
+ 5. Open each selected skill's complete `SKILL.md` before finalizing the task's
24
+ boundary, validation, RED target, and review mode.
27
25
  6. Add the merged, deduplicated union from every touched scope to the task as
28
26
  `assigned_skills`.
29
27
  7. For every implementation-applicable item, add exactly one
30
28
  `implementation_skill_guidance` entry with the exact skill identity and its
31
29
  concise applicable behavior. Planning-only items remain provenance without a
32
30
  guidance entry.
33
-
34
- Root `AGENTS.md` stays table-free. Phase wrappers remain global orchestration
35
- entrypoints and are excluded from scoped tables.
31
+ 8. Classify architecture applicability using `architecture-convergence.md` before locking dependencies and
32
+ waves. For architecture-bearing plans, derive task boundaries and architecture waves from the persisted
33
+ target ownership topology, dependency graph, responsibility criteria, public seams, and migration ledger.
36
34
 
37
35
  If a task spans multiple scopes, include all selected skills from all touched
38
36
  scopes. If a matching row names a missing skill, keep the task planned but
@@ -55,10 +53,15 @@ Preserve `$swarm-planner` behavior:
55
53
  - validations per task
56
54
  - parallel execution waves
57
55
  - risks and mitigations
58
- - explicit `assigned_skills` per task from exact scoped trigger
56
+ - explicit `assigned_skills` per task from exact scoped `What / when` trigger
59
57
  matches, with task design shaped by those skills
60
58
  - complete one-to-one `implementation_skill_guidance` for every
61
59
  implementation-applicable assigned skill
60
+ - architecture-bearing task fields `architecture_wave`, `behavior_owner`, `integration_surface`, `public_seam`,
61
+ `topology_delta`, `forbidden_ownership`, `temporary_seams`, and `responsibility_acceptance_criteria`
62
+ - stable criterion ids mapped to at least one task and exactly one due architecture wave
63
+ - a continuous convergence checkpoint after every architecture wave that checks all criteria due through the
64
+ current wave and regression-checks previously met criteria
62
65
  - a final `plan-reviewer` subagent review for missing deps, missing
63
66
  `owned_paths`, missing `wave_boundary`, ordering issues, edge cases, invalid
64
67
  parallelism, unsafe write overlap, missing RED targets, missing validation,
@@ -41,15 +41,15 @@ implementation tasks.
41
41
 
42
42
  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>/`.
43
43
  2. Read `references/lifecycle.md` and follow the shared execution contract exactly.
44
- 3. Read `references/parallel.md`, parse the plan graph, and build the first unblocked wave.
44
+ 3. Read `references/parallel.md`, parse the plan graph, and build the first unblocked wave. When the plan is architecture-bearing, also read and enforce `references/architecture-conformance.md`.
45
45
  4. Launch scoped workers for the current wave using
46
46
  `references/parallel-worker-brief.md`. Forward every guidance item unchanged,
47
47
  preserving its `implementation_skill_guidance` skill and behavior fields.
48
48
  5. After each validated wave, update `PLAN.md`, `IMPLEMENTATION-NOTES.md`, and
49
49
  spec-linked tech debt before advancing. Require exactly one skill-application
50
- evidence record per guidance entry. Use `$show-me` for a derived wave board
51
- when it materially improves operator orientation; the shared artifacts remain
52
- authoritative.
50
+ evidence record per guidance entry. For architecture-bearing plans, run the
51
+ cumulative conformance checkpoint after every architecture wave and persist
52
+ its `$show-me` evidence; a failed checkpoint blocks dependent waves.
53
53
  6. Use `$codebase-design` vocabulary while reviewing each worker change: interface, seam, adapter, depth, leverage, locality, and test surface.
54
54
  7. Resolve implementation debt as soon as it appears. Do not leave "later" work, TODOs, temporary compromises, or vague follow-up debt.
55
55
  8. If a debt item needs a product/scope decision outside the active goal, stop and run a very small `$requirements-phase` clarification before continuing.
@@ -61,7 +61,7 @@ implementation tasks.
61
61
  classification. A mismatch is runtime evidence: route it to
62
62
  `debugging-phase`. If the required interaction capability is unavailable,
63
63
  record the explicit blocker and keep affected acceptance criteria blocked.
64
- 13. Finish with the shared acceptance audit, manual review checklist, and spec finalization contract.
64
+ 13. Finish with the shared acceptance audit, manual review checklist, and spec finalization contract. Architecture-bearing plans also require final zero-drift closure and an empty migration ledger.
65
65
  14. Invoke `$show-me` to present the implementation notes, final code changes,
66
66
  acceptance status, and manual review path from finalized
67
67
  `IMPLEMENTATION-NOTES.md`, the diff, and recorded evidence. The presentation
@@ -106,3 +106,4 @@ at the same gate. That branch owns the complete run.
106
106
  - Worker-wave execution: see [references/parallel.md](references/parallel.md)
107
107
  - Plan parsing and wave construction: see [references/parallel-orchestration.md](references/parallel-orchestration.md)
108
108
  - Worker brief contract: see [references/parallel-worker-brief.md](references/parallel-worker-brief.md)
109
+ - Architecture-bearing wave checkpoints and final closure: see [references/architecture-conformance.md](references/architecture-conformance.md)
@@ -34,6 +34,16 @@ where the guidance was assessed.
34
34
  |------|-------|--------|-----------|-----------------------------------------------|
35
35
  | | | | | |
36
36
 
37
+ ## Architecture Conformance Evidence
38
+
39
+ Persist the `$show-me` ownership tree, dependency graph, wave delta, or seam
40
+ diff beside each conclusion. Use one row after every architecture wave and one
41
+ for final closure. Local plans remove this section.
42
+
43
+ | Architecture wave id | Target ownership topology and observed state | Declared dependency graph and observed state | Due criterion ids, evidence, and prior-met regression status | Public seam delta | Migration ledger delta, expiry waves, and final empty-ledger status | Validation evidence | Verdict or exact drift |
44
+ |----------------------|----------------------------------------------|----------------------------------------------|------------------------------------------------------------|------------------|-------------------------------------------------------------------|---------------------|------------------------|
45
+ | | | | | | | | |
46
+
37
47
  ## UI Evidence Links
38
48
 
39
49
  | Surface | Viewport | Before | After | Notes |