@hecer/yoke 1.6.0 → 1.6.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 (106) hide show
  1. package/.claude-plugin/plugin.json +13 -13
  2. package/.codex-plugin/plugin.json +7 -7
  3. package/CHANGELOG.md +304 -288
  4. package/README.md +874 -874
  5. package/TODOS.md +5 -5
  6. package/agents/docs.toml +6 -6
  7. package/agents/implementer.toml +6 -6
  8. package/agents/reviewer.toml +6 -6
  9. package/agents/security.toml +6 -6
  10. package/bench/README.md +86 -86
  11. package/bench/RESULTS.md +35 -35
  12. package/bench/output-compaction.mjs +65 -65
  13. package/bench/result-schema.mjs +12 -12
  14. package/bench/results/claude-2026-07-27T18-03-26.json +50 -50
  15. package/bench/results/codex-unavailable-1785175418318.json +15 -15
  16. package/bench/results/gemini-2026-07-27T18-03-44.json +46 -46
  17. package/bench/run-matrix.mjs +26 -26
  18. package/bench/run.mjs +106 -106
  19. package/canon/AGENTS.md +30 -30
  20. package/canon/context/DECISIONS.md +4 -4
  21. package/canon/context/GLOSSARY.md +11 -11
  22. package/canon/context/KNOWLEDGE.md +4 -4
  23. package/canon/context/PROJECT.md +15 -15
  24. package/canon/loop/loop-spec.md +65 -65
  25. package/canon/loop/prd.schema.md +43 -43
  26. package/canon/manifest.yaml +59 -59
  27. package/canon/policy/gates.md +7 -7
  28. package/canon/policy/roles.md +9 -9
  29. package/canon/skills/ATTRIBUTION.md +99 -99
  30. package/canon/skills/authoring-prd/SKILL.md +58 -58
  31. package/canon/skills/brainstorming/SKILL.md +164 -164
  32. package/canon/skills/codebase-design/DEEPENING.md +15 -15
  33. package/canon/skills/codebase-design/DESIGN-IT-TWICE.md +12 -12
  34. package/canon/skills/codebase-design/SKILL.md +39 -39
  35. package/canon/skills/dispatching-parallel-agents/SKILL.md +182 -182
  36. package/canon/skills/document-release/SKILL.md +302 -302
  37. package/canon/skills/domain-modeling/ADR-FORMAT.md +19 -19
  38. package/canon/skills/domain-modeling/CONTEXT-FORMAT.md +39 -39
  39. package/canon/skills/domain-modeling/SKILL.md +35 -35
  40. package/canon/skills/executing-plans/SKILL.md +70 -70
  41. package/canon/skills/finishing-a-development-branch/SKILL.md +200 -200
  42. package/canon/skills/health/SKILL.md +177 -177
  43. package/canon/skills/maintaining-context/SKILL.md +34 -34
  44. package/canon/skills/minimal-code/SKILL.md +21 -21
  45. package/canon/skills/no-ai-slop/SKILL.md +103 -103
  46. package/canon/skills/no-ai-slop/eval.md +43 -43
  47. package/canon/skills/plan-ceo-review/SKILL.md +541 -541
  48. package/canon/skills/plan-eng-review/SKILL.md +362 -362
  49. package/canon/skills/receiving-code-review/SKILL.md +213 -213
  50. package/canon/skills/requesting-code-review/SKILL.md +105 -105
  51. package/canon/skills/resolving-merge-conflicts/SKILL.md +18 -18
  52. package/canon/skills/retro/SKILL.md +397 -397
  53. package/canon/skills/review/SKILL.md +246 -246
  54. package/canon/skills/ship/SKILL.md +691 -691
  55. package/canon/skills/subagent-driven-development/SKILL.md +277 -277
  56. package/canon/skills/systematic-debugging/SKILL.md +296 -296
  57. package/canon/skills/tdd/SKILL.md +371 -371
  58. package/canon/skills/unslop-ui/SKILL.md +34 -34
  59. package/canon/skills/using-git-worktrees/SKILL.md +218 -218
  60. package/canon/skills/verification-before-completion/SKILL.md +139 -139
  61. package/canon/skills/visual-verification/SKILL.md +54 -54
  62. package/canon/skills/workflow/SKILL.md +22 -22
  63. package/canon/skills/writing-for-agents/SKILL-MECHANICS.md +27 -27
  64. package/canon/skills/writing-for-agents/SKILL.md +42 -42
  65. package/canon/skills/writing-plans/SKILL.md +152 -152
  66. package/canon/skills/writing-skills/SKILL.md +655 -655
  67. package/canon/skills/yoke-retrofit/SKILL.md +26 -26
  68. package/canon/skills/yoke-workflow/SKILL.md +20 -20
  69. package/canon/tools/codex-rtk-hook.mjs +35 -35
  70. package/canon/tools/graphify.md +3 -3
  71. package/canon/tools/playwright-mcp.md +3 -3
  72. package/canon/tools/rtk.md +7 -7
  73. package/canon/tools/serena.md +6 -6
  74. package/dist/agents/process.js +5 -0
  75. package/dist/agents/providers.js +1 -1
  76. package/dist/loop/cleanup.js +3 -0
  77. package/dist/loop/reporter.js +4 -1
  78. package/dist/loop/watchdog.js +3 -1
  79. package/dist/prd/command.js +17 -17
  80. package/dist/retrofit/planners/claude.js +14 -14
  81. package/dist/retrofit/preserve.js +2 -2
  82. package/docs/MIGRATING-TO-1.0.md +33 -33
  83. package/docs/MIGRATING-TO-1.1.md +27 -27
  84. package/docs/MIGRATING-TO-1.4.md +70 -70
  85. package/docs/PUBLISHING.md +114 -91
  86. package/docs/superpowers/plans/2026-06-28-baustein-e-context-layer.md +981 -981
  87. package/docs/superpowers/plans/2026-06-29-baustein-f-routing.md +258 -258
  88. package/docs/superpowers/plans/2026-06-29-baustein-g-loop-observability.md +1006 -1006
  89. package/docs/superpowers/plans/2026-06-29-baustein-h-loop-robustness.md +374 -374
  90. package/docs/superpowers/plans/2026-06-30-baustein-i-visual-design-verification.md +450 -450
  91. package/docs/superpowers/plans/2026-07-02-baustein-k-zero-to-100-bootstrap.md +1024 -1024
  92. package/docs/superpowers/plans/2026-07-02-baustein-m-flow-smoke-proofs.md +574 -574
  93. package/docs/superpowers/plans/2026-08-13-gauntlet-quality-loop.md +537 -537
  94. package/docs/superpowers/plans/2026-08-16-artifact-backed-output-compaction.md +329 -329
  95. package/docs/superpowers/specs/2026-06-28-baustein-e-context-layer-design.md +146 -146
  96. package/docs/superpowers/specs/2026-06-29-baustein-f-routing-design.md +106 -106
  97. package/docs/superpowers/specs/2026-06-29-baustein-g-loop-observability-design.md +186 -186
  98. package/docs/superpowers/specs/2026-06-29-baustein-h-loop-robustness-design.md +113 -113
  99. package/docs/superpowers/specs/2026-06-30-baustein-i-visual-design-verification-design.md +98 -98
  100. package/docs/superpowers/specs/2026-07-02-baustein-k-zero-to-100-bootstrap-design.md +200 -200
  101. package/docs/superpowers/specs/2026-07-02-baustein-m-flow-smoke-proofs-design.md +155 -155
  102. package/docs/superpowers/specs/2026-08-13-gauntlet-quality-loop-design.md +422 -422
  103. package/docs/superpowers/specs/2026-08-16-artifact-backed-output-compaction-design.md +166 -166
  104. package/gemini-extension.json +6 -6
  105. package/hooks/hooks.json +19 -19
  106. package/package.json +87 -87
@@ -1,146 +1,146 @@
1
- # Baustein E — Context Layer (durable cross-session context)
2
-
3
- **Status:** Design approved 2026-06-28
4
- **Component:** Yoke (🐂)
5
- **Relates to:** [[harness-project-goal]], [[harness-stack-decisions]], [[harness-loop-technique]]
6
-
7
- ## Problem & Goal
8
-
9
- The dev.to article ("A Claude Code Skills Stack") frames a three-layer division of labor:
10
- **gstack decides → GSD stabilizes context → Superpowers executes.** Yoke today has the
11
- Decision layer (ported gstack roles) and a strong Execution layer (superpowers methodology +
12
- the Ralph loop), but it never built the **Context layer** — GSD's actual contribution:
13
- durable, cross-session artifacts that prevent specification drift.
14
-
15
- Concretely, the loop's [`buildClaudePrompt`](../../../src/loop/runner.ts) injects **only the
16
- current story + its acceptance criteria**. Every fresh-context iteration starts blind to the
17
- project's overall goal, the decisions already made, and the gotchas already learned. Over many
18
- iterations this is exactly where drift leaks in. The user's own auto-memory does this job by
19
- hand; the harness should give its users the same thing.
20
-
21
- **Goal:** a durable Context layer — three markdown files under `.yoke/context/` that the loop
22
- **reads before each iteration** and **writes decisions back to**, plus a skill so interactive
23
- (non-loop) sessions honor the same files. This closes the spec-drift hole and completes the
24
- third leg of the article's model.
25
-
26
- ## Key Decisions (locked)
27
-
28
- | Decision | Choice |
29
- |---|---|
30
- | Scope | Loop **and** interactive sessions (retrofit scaffolds for all 3 agents) |
31
- | Write-back | **Hybrid**: loop deterministically auto-logs decisions; agents enrich `DECISIONS`/`KNOWLEDGE` via the skill |
32
- | Files location | `.yoke/context/` (agent-agnostic shared state, like `.yoke/prd.yaml`) |
33
- | Config | None new — injection auto-on when files present; prompt bound is a constant |
34
- | Backwards-compat | No `.yoke/context/` → loop prompt is byte-identical to today |
35
- | Out of scope | Routing/priority fix (separate Baustein F), structured decision schema, cross-file linking |
36
-
37
- ## The three files — `.yoke/context/`
38
-
39
- | File | Role | Writer |
40
- |------|------|--------|
41
- | `PROJECT.md` | North star: goal, constraints, **non-goals**, success criteria | Human/brainstorm authored; retrofit scaffolds a template. Read-only input. |
42
- | `DECISIONS.md` | Append-only ADR ledger | Loop auto-appends per completed+verified story; agents append in interactive work. |
43
- | `KNOWLEDGE.md` | Gotchas, conventions, reusable learnings | Agent/human maintained via the skill. |
44
-
45
- The files are plain markdown — no schema, no required structure beyond `DECISIONS.md`'s
46
- append format (so the loop can append unambiguously). Missing or partial files are valid:
47
- the layer degrades gracefully (an absent file contributes nothing to the prompt).
48
-
49
- ## Architecture
50
-
51
- ### New module — `src/context/context.ts`
52
- Pure and unit-testable, structured like `src/loop/prd.ts`:
53
-
54
- - `loadContext(dir): ProjectContext` — read the three files if present; missing → empty strings. Never throws on absence.
55
- - `formatForPrompt(ctx, maxChars): string` — render a "Project context" block, **tail-bounding** each file to `maxChars` (constant, ~2 KB) so a large ledger can't blow up the prompt. Returns `''` when all three are empty.
56
- - `appendDecision(dir, entry): { rollback: () => void }` — append a `DECISIONS.md` entry and return a rollback that restores the prior file content (captured before the write). Creates the file if absent.
57
-
58
- `ProjectContext = { project: string; decisions: string; knowledge: string }`.
59
-
60
- A decision entry is formatted as:
61
- ```
62
- ## <YYYY-MM-DD> — <story-id>: <title>
63
- <one-line summary>
64
- ```
65
- The date comes from the Node runtime at loop time (the loop is normal Node, not a Workflow
66
- script — `Date` is available).
67
-
68
- ### Loop read — `src/loop/runner.ts`
69
- `buildClaudePrompt(story, context?)` and `buildReviewPrompt(story, context?)` gain an optional
70
- pre-formatted `context` string. When present, a "Project context" section is inserted **ahead
71
- of** the story block. The reviewer gets the north star too (so it reviews against goals, not
72
- just acceptance criteria). When `context` is undefined/empty, the prompts are unchanged.
73
-
74
- The loop loads + formats context once per iteration (`.yoke/context/` resolved relative to
75
- `targetDir`) and threads it through the runner/review call.
76
-
77
- ### Loop write-back — `src/loop/loop.ts`
78
- After verify (and optional review) passes, **before the commit**:
79
-
80
- 1. `appendDecision(contextDir, { storyId, title, summary })` → keep the returned `rollback`.
81
- 2. `savePrd(passes:true)`.
82
- 3. `commitAll(...)` — now also stages `DECISIONS.md`, so the decision and the `passes:true`
83
- flip land in the **same atomic commit**.
84
-
85
- If the commit throws, revert **both**: `savePrd(prior stories)` *and* `rollback()` for the
86
- decision file. This preserves the existing invariant — *`passes:true` never persists without a
87
- commit* — and extends it to the decision ledger (no orphan decision without a commit).
88
-
89
- In `--isolate` mode the append happens inside the worktree before the worktree commit, so
90
- `integrate` fast-forwards the decision back into the main tree along with the code.
91
-
92
- ### Retrofit scaffolding — `src/retrofit/`
93
- A retrofit action writes `.yoke/context/{PROJECT,DECISIONS,KNOWLEDGE}.md` from
94
- `canon/context/*.md` templates **only if absent** (non-destructive + idempotent, the same rule
95
- as every other artifact). Agent-agnostic — one set under `.yoke/` serves claude/codex/gemini,
96
- so it is emitted once regardless of `--agent`. The report lists the scaffolded files.
97
-
98
- ### Skill — `canon/skills/maintaining-context/SKILL.md`
99
- Agent-facing, flows to all three agents via the existing planners + `manifest.yaml`:
100
- > Before substantial work, read `.yoke/context/PROJECT.md` for the north star and
101
- > `KNOWLEDGE.md` for known gotchas. When you make a non-obvious decision, append it to
102
- > `DECISIONS.md`. When you learn a reusable fact or gotcha, append it to `KNOWLEDGE.md`.
103
-
104
- This is what extends drift-protection from the loop to interactive sessions.
105
-
106
- ### CLI — `src/cli.ts`
107
- - `yoke context init` — scaffold the three files standalone (idempotent, non-destructive).
108
- - `yoke context status` — show presence, byte sizes, and the last decision heading.
109
-
110
- ## Data flow (loop iteration)
111
-
112
- ```
113
- load PRD ─► pick story ─► load+format .yoke/context ─► runner(prompt + context)
114
- ─► verify ─► [review] ─► appendDecision() ─► savePrd(passes:true) ─► commitAll(+DECISIONS.md)
115
- └── on commit failure: rollback() + savePrd(prior) ──► blocked
116
- ```
117
-
118
- ## Error handling
119
-
120
- - Missing/partial context files: treated as empty; no error, prompt simply omits that part.
121
- - Oversized files: tail-bounded to a constant per file; never unbounded.
122
- - `appendDecision` before commit + rollback on commit failure: no orphan decisions.
123
- - Isolate mode: decision written in the worktree, carried back only on successful integrate.
124
- - `yoke context init` over existing files: skips them (reports "exists"), never overwrites.
125
-
126
- ## Testing (subagent-driven TDD, like A–D)
127
-
128
- **context.ts units:** load with all/none/partial files present; `formatForPrompt` bounding +
129
- empty-returns-`''`; `appendDecision` format correctness + rollback restores prior content +
130
- creates file when absent.
131
-
132
- **loop:** prompt includes the context block when `.yoke/context/` present; prompt unchanged
133
- when absent; decision appended on success; **not** appended on a blocked story; both PRD and
134
- decision reverted on commit failure; isolate path carries the decision back via integrate.
135
-
136
- **retrofit:** scaffolds the three files; idempotent on re-run; non-destructive over existing
137
- files; emitted once for `--agent=all`.
138
-
139
- **canon:** `maintaining-context` present in `manifest.yaml`; `yoke validate canon` stays green.
140
-
141
- ## Non-goals (YAGNI)
142
-
143
- - No new config keys (injection is automatic; bound is a constant).
144
- - No structured/parsed decision schema — markdown append only.
145
- - No cross-file linking or decision superseding.
146
- - Routing/priority arbitration is **Baustein F**, not this spec.
1
+ # Baustein E — Context Layer (durable cross-session context)
2
+
3
+ **Status:** Design approved 2026-06-28
4
+ **Component:** Yoke (🐂)
5
+ **Relates to:** [[harness-project-goal]], [[harness-stack-decisions]], [[harness-loop-technique]]
6
+
7
+ ## Problem & Goal
8
+
9
+ The dev.to article ("A Claude Code Skills Stack") frames a three-layer division of labor:
10
+ **gstack decides → GSD stabilizes context → Superpowers executes.** Yoke today has the
11
+ Decision layer (ported gstack roles) and a strong Execution layer (superpowers methodology +
12
+ the Ralph loop), but it never built the **Context layer** — GSD's actual contribution:
13
+ durable, cross-session artifacts that prevent specification drift.
14
+
15
+ Concretely, the loop's [`buildClaudePrompt`](../../../src/loop/runner.ts) injects **only the
16
+ current story + its acceptance criteria**. Every fresh-context iteration starts blind to the
17
+ project's overall goal, the decisions already made, and the gotchas already learned. Over many
18
+ iterations this is exactly where drift leaks in. The user's own auto-memory does this job by
19
+ hand; the harness should give its users the same thing.
20
+
21
+ **Goal:** a durable Context layer — three markdown files under `.yoke/context/` that the loop
22
+ **reads before each iteration** and **writes decisions back to**, plus a skill so interactive
23
+ (non-loop) sessions honor the same files. This closes the spec-drift hole and completes the
24
+ third leg of the article's model.
25
+
26
+ ## Key Decisions (locked)
27
+
28
+ | Decision | Choice |
29
+ |---|---|
30
+ | Scope | Loop **and** interactive sessions (retrofit scaffolds for all 3 agents) |
31
+ | Write-back | **Hybrid**: loop deterministically auto-logs decisions; agents enrich `DECISIONS`/`KNOWLEDGE` via the skill |
32
+ | Files location | `.yoke/context/` (agent-agnostic shared state, like `.yoke/prd.yaml`) |
33
+ | Config | None new — injection auto-on when files present; prompt bound is a constant |
34
+ | Backwards-compat | No `.yoke/context/` → loop prompt is byte-identical to today |
35
+ | Out of scope | Routing/priority fix (separate Baustein F), structured decision schema, cross-file linking |
36
+
37
+ ## The three files — `.yoke/context/`
38
+
39
+ | File | Role | Writer |
40
+ |------|------|--------|
41
+ | `PROJECT.md` | North star: goal, constraints, **non-goals**, success criteria | Human/brainstorm authored; retrofit scaffolds a template. Read-only input. |
42
+ | `DECISIONS.md` | Append-only ADR ledger | Loop auto-appends per completed+verified story; agents append in interactive work. |
43
+ | `KNOWLEDGE.md` | Gotchas, conventions, reusable learnings | Agent/human maintained via the skill. |
44
+
45
+ The files are plain markdown — no schema, no required structure beyond `DECISIONS.md`'s
46
+ append format (so the loop can append unambiguously). Missing or partial files are valid:
47
+ the layer degrades gracefully (an absent file contributes nothing to the prompt).
48
+
49
+ ## Architecture
50
+
51
+ ### New module — `src/context/context.ts`
52
+ Pure and unit-testable, structured like `src/loop/prd.ts`:
53
+
54
+ - `loadContext(dir): ProjectContext` — read the three files if present; missing → empty strings. Never throws on absence.
55
+ - `formatForPrompt(ctx, maxChars): string` — render a "Project context" block, **tail-bounding** each file to `maxChars` (constant, ~2 KB) so a large ledger can't blow up the prompt. Returns `''` when all three are empty.
56
+ - `appendDecision(dir, entry): { rollback: () => void }` — append a `DECISIONS.md` entry and return a rollback that restores the prior file content (captured before the write). Creates the file if absent.
57
+
58
+ `ProjectContext = { project: string; decisions: string; knowledge: string }`.
59
+
60
+ A decision entry is formatted as:
61
+ ```
62
+ ## <YYYY-MM-DD> — <story-id>: <title>
63
+ <one-line summary>
64
+ ```
65
+ The date comes from the Node runtime at loop time (the loop is normal Node, not a Workflow
66
+ script — `Date` is available).
67
+
68
+ ### Loop read — `src/loop/runner.ts`
69
+ `buildClaudePrompt(story, context?)` and `buildReviewPrompt(story, context?)` gain an optional
70
+ pre-formatted `context` string. When present, a "Project context" section is inserted **ahead
71
+ of** the story block. The reviewer gets the north star too (so it reviews against goals, not
72
+ just acceptance criteria). When `context` is undefined/empty, the prompts are unchanged.
73
+
74
+ The loop loads + formats context once per iteration (`.yoke/context/` resolved relative to
75
+ `targetDir`) and threads it through the runner/review call.
76
+
77
+ ### Loop write-back — `src/loop/loop.ts`
78
+ After verify (and optional review) passes, **before the commit**:
79
+
80
+ 1. `appendDecision(contextDir, { storyId, title, summary })` → keep the returned `rollback`.
81
+ 2. `savePrd(passes:true)`.
82
+ 3. `commitAll(...)` — now also stages `DECISIONS.md`, so the decision and the `passes:true`
83
+ flip land in the **same atomic commit**.
84
+
85
+ If the commit throws, revert **both**: `savePrd(prior stories)` *and* `rollback()` for the
86
+ decision file. This preserves the existing invariant — *`passes:true` never persists without a
87
+ commit* — and extends it to the decision ledger (no orphan decision without a commit).
88
+
89
+ In `--isolate` mode the append happens inside the worktree before the worktree commit, so
90
+ `integrate` fast-forwards the decision back into the main tree along with the code.
91
+
92
+ ### Retrofit scaffolding — `src/retrofit/`
93
+ A retrofit action writes `.yoke/context/{PROJECT,DECISIONS,KNOWLEDGE}.md` from
94
+ `canon/context/*.md` templates **only if absent** (non-destructive + idempotent, the same rule
95
+ as every other artifact). Agent-agnostic — one set under `.yoke/` serves claude/codex/gemini,
96
+ so it is emitted once regardless of `--agent`. The report lists the scaffolded files.
97
+
98
+ ### Skill — `canon/skills/maintaining-context/SKILL.md`
99
+ Agent-facing, flows to all three agents via the existing planners + `manifest.yaml`:
100
+ > Before substantial work, read `.yoke/context/PROJECT.md` for the north star and
101
+ > `KNOWLEDGE.md` for known gotchas. When you make a non-obvious decision, append it to
102
+ > `DECISIONS.md`. When you learn a reusable fact or gotcha, append it to `KNOWLEDGE.md`.
103
+
104
+ This is what extends drift-protection from the loop to interactive sessions.
105
+
106
+ ### CLI — `src/cli.ts`
107
+ - `yoke context init` — scaffold the three files standalone (idempotent, non-destructive).
108
+ - `yoke context status` — show presence, byte sizes, and the last decision heading.
109
+
110
+ ## Data flow (loop iteration)
111
+
112
+ ```
113
+ load PRD ─► pick story ─► load+format .yoke/context ─► runner(prompt + context)
114
+ ─► verify ─► [review] ─► appendDecision() ─► savePrd(passes:true) ─► commitAll(+DECISIONS.md)
115
+ └── on commit failure: rollback() + savePrd(prior) ──► blocked
116
+ ```
117
+
118
+ ## Error handling
119
+
120
+ - Missing/partial context files: treated as empty; no error, prompt simply omits that part.
121
+ - Oversized files: tail-bounded to a constant per file; never unbounded.
122
+ - `appendDecision` before commit + rollback on commit failure: no orphan decisions.
123
+ - Isolate mode: decision written in the worktree, carried back only on successful integrate.
124
+ - `yoke context init` over existing files: skips them (reports "exists"), never overwrites.
125
+
126
+ ## Testing (subagent-driven TDD, like A–D)
127
+
128
+ **context.ts units:** load with all/none/partial files present; `formatForPrompt` bounding +
129
+ empty-returns-`''`; `appendDecision` format correctness + rollback restores prior content +
130
+ creates file when absent.
131
+
132
+ **loop:** prompt includes the context block when `.yoke/context/` present; prompt unchanged
133
+ when absent; decision appended on success; **not** appended on a blocked story; both PRD and
134
+ decision reverted on commit failure; isolate path carries the decision back via integrate.
135
+
136
+ **retrofit:** scaffolds the three files; idempotent on re-run; non-destructive over existing
137
+ files; emitted once for `--agent=all`.
138
+
139
+ **canon:** `maintaining-context` present in `manifest.yaml`; `yoke validate canon` stays green.
140
+
141
+ ## Non-goals (YAGNI)
142
+
143
+ - No new config keys (injection is automatic; bound is a constant).
144
+ - No structured/parsed decision schema — markdown append only.
145
+ - No cross-file linking or decision superseding.
146
+ - Routing/priority arbitration is **Baustein F**, not this spec.
@@ -1,106 +1,106 @@
1
- # Baustein F — Skill Routing/Precedence + Review-Family Consolidation
2
-
3
- **Status:** Design approved 2026-06-29
4
- **Component:** Yoke (🐂)
5
- **Relates to:** [[harness-build-progress]], [[readme-always-update]]
6
-
7
- ## Problem & Goal
8
-
9
- The dev.to skills-stack article's #1 warning is **auto-invocation chaos**: when superpowers
10
- (aggressive "1% chance → you MUST invoke") and gstack roles ("proactively suggest") are both
11
- installed, overlapping skills compete on the same triggers, causing random/redundant selection.
12
- Yoke's `canon/manifest.yaml` distinguishes `kind: methodology|role` but emits **no precedence or
13
- routing** — nothing tells an agent which skill is canonical when several match.
14
-
15
- The collision is concentrated in the review family. From the actual descriptions:
16
-
17
- | Skill | Phase / angle | Status |
18
- |---|---|---|
19
- | `plan-eng-review` | plan-time, architecture | distinct ✓ |
20
- | `plan-ceo-review` | plan-time, product/scope | distinct ✓ |
21
- | `review` | **pre-merge, diff safety/structure** | collides ⚠ |
22
- | `eng-review` (14-line stub) | **pre-merge, architecture/edge-cases/tests** | collides ⚠ |
23
- | `requesting-code-review` | protocol: request a review | distinct ✓ |
24
- | `receiving-code-review` | protocol: handle feedback | distinct ✓ |
25
-
26
- The one real overlap is `eng-review` ↔ `review` — both "review the change before merge."
27
-
28
- **Goal:** emit an explicit routing/precedence into every agent so auto-invocation resolves
29
- deterministically, and collapse the `eng-review`/`review` overlap into one canonical pre-merge
30
- review skill.
31
-
32
- ## Key Decisions (locked)
33
-
34
- | Decision | Choice |
35
- |---|---|
36
- | Routing location | Authored prose section in `canon/AGENTS.md` (injected verbatim into all 3 agents) — NOT a new manifest field or generator |
37
- | Precedence rule | Methodology (HOW) before role (perspective); process before implementation |
38
- | Review collision | Fold `eng-review`'s checklist into `review`; **remove `eng-review`**; `review` becomes the single canonical pre-merge code review |
39
- | Description hygiene | Sharpen the remaining review-family descriptions so triggers are phase-distinct, non-overlapping |
40
- | Skill count | Canon 25 → **24** |
41
- | README | Update the skills catalog (Roles 8→7, total 25→24) — **mandatory deliverable** |
42
- | Out of scope (YAGNI) | No NLP trigger-collision validator (too fragile); no `priority` manifest field + generator (the `kind` distinction + authored prose suffices) |
43
-
44
- ## Architecture
45
-
46
- ### 1. Routing section in `canon/AGENTS.md`
47
- A new "Skill routing & precedence" section appended to the baseline (which already covers
48
- quality-first/stop-the-line/role-separation). It states three things:
49
-
50
- 1. **Precedence** — methodology skills decide *how* to work and take precedence over role skills
51
- (which add a perspective). Process before implementation.
52
- 2. **Canonical entrypoint per concern** — a small map, especially the review family:
53
- - Plan-time architecture review → `plan-eng-review`
54
- - Plan-time product/scope review → `plan-ceo-review`
55
- - **Pre-merge code review → `review`** (the single canonical one)
56
- - Requesting a review (dispatch a reviewer) → `requesting-code-review`
57
- - Handling review feedback → `receiving-code-review`
58
- - Build flow / order of operations → `workflow`
59
- 3. **Arbitration rule** — "These skills declare their own triggers aggressively; when several
60
- match the same task, this precedence + the most-specific-entrypoint rule decides. Don't run
61
- two skills that serve the same concern."
62
-
63
- `canon/AGENTS.md` is copied verbatim by the Claude/Codex/Gemini planners and imported by the
64
- generated `CLAUDE.md`/`GEMINI.md`, so this reaches all three agents with no generator change.
65
-
66
- ### 2. Review-family consolidation
67
- - **`review`** absorbs `eng-review`'s checklist: in addition to diff safety (SQL, trust
68
- boundaries, side effects), it now also covers architecture fit, edge cases, test coverage, and
69
- performance — the engineering-manager angle. One canonical pre-merge review.
70
- - **`eng-review` removed**: delete `canon/skills/eng-review/` and its `manifest.yaml` entry.
71
- - **Descriptions sharpened**: each review-family skill's description names its phase explicitly
72
- so triggers don't overlap (plan-time vs pre-merge vs protocol).
73
-
74
- ### 3. Manifest + validator
75
- - Remove the `eng-review` entry from `canon/manifest.yaml`.
76
- - `validateCanon` must stay green (it validates that each listed skill has a dir + frontmatter;
77
- removing the entry + dir keeps it consistent). No validator code change required unless a test
78
- hard-codes the skill list.
79
-
80
- ### 4. README (mandatory)
81
- Update the skills catalog: remove the `eng-review` row, move its purpose into the `review` row,
82
- change the Roles count 8→7 and the total 25→24. Per the standing rule, the README must reflect
83
- what shipped.
84
-
85
- ## Data flow (how routing reaches an agent)
86
- ```
87
- canon/AGENTS.md (routing section)
88
- └─ planClaude → AGENTS.md + CLAUDE.md (@AGENTS.md import) → Claude reads precedence
89
- └─ planCodex → AGENTS.md (Codex reads it natively) → Codex reads precedence
90
- └─ planGemini → GEMINI.md + .gemini/settings (AGENTS.md ctx) → Gemini reads precedence
91
- ```
92
-
93
- ## Testing
94
- - `tests/canon/real-canon.test.ts`: assert `eng-review` is NOT in the manifest; assert
95
- `canon/AGENTS.md` contains the routing section (e.g. a stable heading + the "Pre-merge code
96
- review → `review`" line); `validateCanon('canon')` stays zero-error.
97
- - `tests/retrofit/plan-dispatch.test.ts` (or planners tests): the emitted skill set no longer
98
- includes `eng-review`; total skill count reflects 24. Adjust any hard-coded count.
99
- - `review` skill still validates (frontmatter intact after the checklist merge).
100
- - Full suite green; `tsc` clean.
101
-
102
- ## Non-goals (YAGNI)
103
- - No automated trigger-collision detection.
104
- - No new manifest `priority` field or routing generator.
105
- - No change to plan-ceo-review / plan-eng-review / requesting- / receiving-code-review bodies
106
- beyond description sharpening.
1
+ # Baustein F — Skill Routing/Precedence + Review-Family Consolidation
2
+
3
+ **Status:** Design approved 2026-06-29
4
+ **Component:** Yoke (🐂)
5
+ **Relates to:** [[harness-build-progress]], [[readme-always-update]]
6
+
7
+ ## Problem & Goal
8
+
9
+ The dev.to skills-stack article's #1 warning is **auto-invocation chaos**: when superpowers
10
+ (aggressive "1% chance → you MUST invoke") and gstack roles ("proactively suggest") are both
11
+ installed, overlapping skills compete on the same triggers, causing random/redundant selection.
12
+ Yoke's `canon/manifest.yaml` distinguishes `kind: methodology|role` but emits **no precedence or
13
+ routing** — nothing tells an agent which skill is canonical when several match.
14
+
15
+ The collision is concentrated in the review family. From the actual descriptions:
16
+
17
+ | Skill | Phase / angle | Status |
18
+ |---|---|---|
19
+ | `plan-eng-review` | plan-time, architecture | distinct ✓ |
20
+ | `plan-ceo-review` | plan-time, product/scope | distinct ✓ |
21
+ | `review` | **pre-merge, diff safety/structure** | collides ⚠ |
22
+ | `eng-review` (14-line stub) | **pre-merge, architecture/edge-cases/tests** | collides ⚠ |
23
+ | `requesting-code-review` | protocol: request a review | distinct ✓ |
24
+ | `receiving-code-review` | protocol: handle feedback | distinct ✓ |
25
+
26
+ The one real overlap is `eng-review` ↔ `review` — both "review the change before merge."
27
+
28
+ **Goal:** emit an explicit routing/precedence into every agent so auto-invocation resolves
29
+ deterministically, and collapse the `eng-review`/`review` overlap into one canonical pre-merge
30
+ review skill.
31
+
32
+ ## Key Decisions (locked)
33
+
34
+ | Decision | Choice |
35
+ |---|---|
36
+ | Routing location | Authored prose section in `canon/AGENTS.md` (injected verbatim into all 3 agents) — NOT a new manifest field or generator |
37
+ | Precedence rule | Methodology (HOW) before role (perspective); process before implementation |
38
+ | Review collision | Fold `eng-review`'s checklist into `review`; **remove `eng-review`**; `review` becomes the single canonical pre-merge code review |
39
+ | Description hygiene | Sharpen the remaining review-family descriptions so triggers are phase-distinct, non-overlapping |
40
+ | Skill count | Canon 25 → **24** |
41
+ | README | Update the skills catalog (Roles 8→7, total 25→24) — **mandatory deliverable** |
42
+ | Out of scope (YAGNI) | No NLP trigger-collision validator (too fragile); no `priority` manifest field + generator (the `kind` distinction + authored prose suffices) |
43
+
44
+ ## Architecture
45
+
46
+ ### 1. Routing section in `canon/AGENTS.md`
47
+ A new "Skill routing & precedence" section appended to the baseline (which already covers
48
+ quality-first/stop-the-line/role-separation). It states three things:
49
+
50
+ 1. **Precedence** — methodology skills decide *how* to work and take precedence over role skills
51
+ (which add a perspective). Process before implementation.
52
+ 2. **Canonical entrypoint per concern** — a small map, especially the review family:
53
+ - Plan-time architecture review → `plan-eng-review`
54
+ - Plan-time product/scope review → `plan-ceo-review`
55
+ - **Pre-merge code review → `review`** (the single canonical one)
56
+ - Requesting a review (dispatch a reviewer) → `requesting-code-review`
57
+ - Handling review feedback → `receiving-code-review`
58
+ - Build flow / order of operations → `workflow`
59
+ 3. **Arbitration rule** — "These skills declare their own triggers aggressively; when several
60
+ match the same task, this precedence + the most-specific-entrypoint rule decides. Don't run
61
+ two skills that serve the same concern."
62
+
63
+ `canon/AGENTS.md` is copied verbatim by the Claude/Codex/Gemini planners and imported by the
64
+ generated `CLAUDE.md`/`GEMINI.md`, so this reaches all three agents with no generator change.
65
+
66
+ ### 2. Review-family consolidation
67
+ - **`review`** absorbs `eng-review`'s checklist: in addition to diff safety (SQL, trust
68
+ boundaries, side effects), it now also covers architecture fit, edge cases, test coverage, and
69
+ performance — the engineering-manager angle. One canonical pre-merge review.
70
+ - **`eng-review` removed**: delete `canon/skills/eng-review/` and its `manifest.yaml` entry.
71
+ - **Descriptions sharpened**: each review-family skill's description names its phase explicitly
72
+ so triggers don't overlap (plan-time vs pre-merge vs protocol).
73
+
74
+ ### 3. Manifest + validator
75
+ - Remove the `eng-review` entry from `canon/manifest.yaml`.
76
+ - `validateCanon` must stay green (it validates that each listed skill has a dir + frontmatter;
77
+ removing the entry + dir keeps it consistent). No validator code change required unless a test
78
+ hard-codes the skill list.
79
+
80
+ ### 4. README (mandatory)
81
+ Update the skills catalog: remove the `eng-review` row, move its purpose into the `review` row,
82
+ change the Roles count 8→7 and the total 25→24. Per the standing rule, the README must reflect
83
+ what shipped.
84
+
85
+ ## Data flow (how routing reaches an agent)
86
+ ```
87
+ canon/AGENTS.md (routing section)
88
+ └─ planClaude → AGENTS.md + CLAUDE.md (@AGENTS.md import) → Claude reads precedence
89
+ └─ planCodex → AGENTS.md (Codex reads it natively) → Codex reads precedence
90
+ └─ planGemini → GEMINI.md + .gemini/settings (AGENTS.md ctx) → Gemini reads precedence
91
+ ```
92
+
93
+ ## Testing
94
+ - `tests/canon/real-canon.test.ts`: assert `eng-review` is NOT in the manifest; assert
95
+ `canon/AGENTS.md` contains the routing section (e.g. a stable heading + the "Pre-merge code
96
+ review → `review`" line); `validateCanon('canon')` stays zero-error.
97
+ - `tests/retrofit/plan-dispatch.test.ts` (or planners tests): the emitted skill set no longer
98
+ includes `eng-review`; total skill count reflects 24. Adjust any hard-coded count.
99
+ - `review` skill still validates (frontmatter intact after the checklist merge).
100
+ - Full suite green; `tsc` clean.
101
+
102
+ ## Non-goals (YAGNI)
103
+ - No automated trigger-collision detection.
104
+ - No new manifest `priority` field or routing generator.
105
+ - No change to plan-ceo-review / plan-eng-review / requesting- / receiving-code-review bodies
106
+ beyond description sharpening.