@hecer/yoke 0.2.0 → 0.8.0

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 (84) hide show
  1. package/CHANGELOG.md +130 -0
  2. package/README.md +583 -494
  3. package/bench/.runs/claude-2026-07-09T22-34-01/.yoke/config.yaml +6 -0
  4. package/bench/.runs/claude-2026-07-09T22-34-01/.yoke/context/DECISIONS.md +9 -0
  5. package/bench/.runs/claude-2026-07-09T22-34-01/.yoke/prd.yaml +38 -0
  6. package/bench/.runs/claude-2026-07-09T22-34-01/bench-verify.mjs +15 -0
  7. package/bench/.runs/claude-2026-07-09T22-34-01/package.json +9 -0
  8. package/bench/.runs/claude-2026-07-09T22-34-01/src/index.mjs +48 -0
  9. package/bench/.runs/claude-2026-07-09T22-34-01/tests/STORY-1.test.mjs +24 -0
  10. package/bench/.runs/claude-2026-07-09T22-34-01/tests/STORY-2.test.mjs +28 -0
  11. package/bench/.runs/claude-2026-07-09T22-34-01/tests/STORY-3.test.mjs +25 -0
  12. package/bench/.runs/gemini-2026-07-09T22-34-02/.yoke/config.yaml +6 -0
  13. package/bench/.runs/gemini-2026-07-09T22-34-02/.yoke/prd.yaml +32 -0
  14. package/bench/.runs/gemini-2026-07-09T22-34-02/bench-verify.mjs +15 -0
  15. package/bench/.runs/gemini-2026-07-09T22-34-02/package.json +9 -0
  16. package/bench/.runs/gemini-2026-07-09T22-34-02/src/index.mjs +3 -0
  17. package/bench/.runs/gemini-2026-07-09T22-34-02/tests/STORY-1.test.mjs +24 -0
  18. package/bench/.runs/gemini-2026-07-09T22-34-02/tests/STORY-2.test.mjs +28 -0
  19. package/bench/.runs/gemini-2026-07-09T22-34-02/tests/STORY-3.test.mjs +25 -0
  20. package/bench/README.md +42 -0
  21. package/bench/RESULTS.md +36 -0
  22. package/bench/fixtures/string-kit/.yoke/config.yaml +6 -0
  23. package/bench/fixtures/string-kit/.yoke/prd.yaml +32 -0
  24. package/bench/fixtures/string-kit/bench-verify.mjs +15 -0
  25. package/bench/fixtures/string-kit/package.json +9 -0
  26. package/bench/fixtures/string-kit/src/index.mjs +3 -0
  27. package/bench/fixtures/string-kit/tests/STORY-1.test.mjs +24 -0
  28. package/bench/fixtures/string-kit/tests/STORY-2.test.mjs +28 -0
  29. package/bench/fixtures/string-kit/tests/STORY-3.test.mjs +25 -0
  30. package/bench/results/claude-2026-07-09T22-34-01.json +40 -0
  31. package/bench/run.mjs +115 -0
  32. package/canon/loop/loop-spec.md +5 -1
  33. package/canon/manifest.yaml +3 -0
  34. package/canon/skills/yoke-retrofit/SKILL.md +1 -0
  35. package/canon/tools/claude-mem.md +15 -0
  36. package/canon/tools/ui-ux-pro-max.md +15 -0
  37. package/dist/cli.js +37 -6
  38. package/dist/loop/cleanup.js +44 -3
  39. package/dist/loop/loop.js +67 -2
  40. package/dist/loop/reporter.js +88 -4
  41. package/dist/loop/run-command.js +25 -8
  42. package/dist/loop/runner.js +133 -14
  43. package/dist/loop/watchdog.js +67 -17
  44. package/dist/retrofit/apply.js +10 -3
  45. package/dist/retrofit/config.js +9 -1
  46. package/dist/retrofit/gitignore.js +4 -0
  47. package/dist/retrofit/planners/claude.js +4 -1
  48. package/dist/retrofit/planners/gemini.js +2 -1
  49. package/dist/retrofit/preserve.js +51 -0
  50. package/dist/update/check.js +86 -0
  51. package/dist/update/refresh.js +28 -0
  52. package/dist/update/upgrade.js +30 -0
  53. package/docs/PUBLISHING.md +41 -0
  54. package/docs/superpowers/plans/2026-06-27-forge-a-canon.md +815 -0
  55. package/docs/superpowers/plans/2026-06-27-forge-b1-retrofit-claude.md +842 -0
  56. package/docs/superpowers/plans/2026-06-27-forge-b2-codex-gemini-tools.md +884 -0
  57. package/docs/superpowers/plans/2026-06-27-forge-c1-loop-engine.md +891 -0
  58. package/docs/superpowers/plans/2026-06-28-baustein-e-context-layer.md +981 -0
  59. package/docs/superpowers/plans/2026-06-28-forge-b3-settings-merge.md +364 -0
  60. package/docs/superpowers/plans/2026-06-28-forge-c2-loop-verify.md +502 -0
  61. package/docs/superpowers/plans/2026-06-28-forge-c3-multi-agent-runners.md +377 -0
  62. package/docs/superpowers/plans/2026-06-28-forge-c4-worktree-isolation.md +413 -0
  63. package/docs/superpowers/plans/2026-06-28-forge-c5-review-iteration.md +419 -0
  64. package/docs/superpowers/plans/2026-06-28-forge-cleanup-dep0190.md +233 -0
  65. package/docs/superpowers/plans/2026-06-28-forge-d-codegraph-choice-minimal-code.md +523 -0
  66. package/docs/superpowers/plans/2026-06-29-baustein-f-routing.md +258 -0
  67. package/docs/superpowers/plans/2026-06-29-baustein-g-loop-observability.md +1006 -0
  68. package/docs/superpowers/plans/2026-06-29-baustein-h-loop-robustness.md +374 -0
  69. package/docs/superpowers/plans/2026-06-30-baustein-i-visual-design-verification.md +450 -0
  70. package/docs/superpowers/plans/2026-07-02-baustein-j-cross-model-review-gstack-compose.md +645 -0
  71. package/docs/superpowers/plans/2026-07-02-baustein-k-zero-to-100-bootstrap.md +1024 -0
  72. package/docs/superpowers/plans/2026-07-02-baustein-m-flow-smoke-proofs.md +574 -0
  73. package/docs/superpowers/specs/2026-06-27-forge-cross-agent-harness-design.md +144 -0
  74. package/docs/superpowers/specs/2026-06-28-baustein-e-context-layer-design.md +146 -0
  75. package/docs/superpowers/specs/2026-06-29-baustein-f-routing-design.md +106 -0
  76. package/docs/superpowers/specs/2026-06-29-baustein-g-loop-observability-design.md +186 -0
  77. package/docs/superpowers/specs/2026-06-29-baustein-h-loop-robustness-design.md +113 -0
  78. package/docs/superpowers/specs/2026-06-30-baustein-i-visual-design-verification-design.md +98 -0
  79. package/docs/superpowers/specs/2026-07-02-baustein-j-cross-model-review-gstack-compose-design.md +137 -0
  80. package/docs/superpowers/specs/2026-07-02-baustein-k-zero-to-100-bootstrap-design.md +200 -0
  81. package/docs/superpowers/specs/2026-07-02-baustein-m-flow-smoke-proofs-design.md +155 -0
  82. package/docs/superpowers/specs/2026-07-10-companion-tools-decision.md +33 -0
  83. package/docs/superpowers/specs/2026-07-10-multi-agent-parallel-loop-design.md +99 -0
  84. package/package.json +8 -2
@@ -0,0 +1,258 @@
1
+ # Baustein F — Routing/Precedence + Review Consolidation Implementation Plan
2
+
3
+ > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
4
+
5
+ **Goal:** Emit explicit skill precedence + a canonical-entrypoint routing into every agent (via `canon/AGENTS.md`), and collapse the `eng-review`/`review` pre-merge overlap into one canonical `review` skill — closing the article's auto-invocation-chaos gap.
6
+
7
+ **Architecture:** Pure canon-content change (no `src/` logic): `review` absorbs `eng-review`'s engineering checklist; `eng-review` is deleted from the canon dir + manifest; a routing section is appended to `canon/AGENTS.md` (copied verbatim to all 3 agents). One retrofit integration test that asserted `eng-review` is repointed; canon-validation tests gain routing assertions; the README skills catalog is updated (mandatory).
8
+
9
+ **Tech Stack:** Markdown canon files + `canon/manifest.yaml`; vitest for canon/retrofit tests; `npx vitest run`, `npx tsc --noEmit`.
10
+
11
+ ---
12
+
13
+ ## File Structure
14
+
15
+ | File | Change |
16
+ |------|--------|
17
+ | `canon/skills/review/SKILL.md` | Sharpen description; add an "Engineering-manager checklist" body section (absorbs eng-review) |
18
+ | `canon/skills/eng-review/` | **Delete** the directory |
19
+ | `canon/manifest.yaml` | Remove the `eng-review` entry |
20
+ | `canon/AGENTS.md` | Append a "Skill routing & precedence" section |
21
+ | `tests/retrofit/retrofit.integration.test.ts` | Repoint the `eng-review` existence assertion to `review` |
22
+ | `tests/canon/real-canon.test.ts` | Assert `eng-review` absent + routing section present |
23
+ | `README.md` | Skills catalog: drop eng-review row, fold into review, Roles 8→7, total 25→24 |
24
+
25
+ **Note:** Historical plan docs under `docs/superpowers/plans/2026-06-27-*` mention `eng-review` — leave them (historical record, like the "Forge" codename). Only the live canon/tests/README change.
26
+
27
+ ---
28
+
29
+ ### Task 1: `review` absorbs the engineering-manager checklist
30
+
31
+ **Files:**
32
+ - Modify: `canon/skills/review/SKILL.md`
33
+ - Test: `tests/canon/real-canon.test.ts` (validateCanon must stay green — exercised by the existing "validates with zero errors" test)
34
+
35
+ - [ ] **Step 1: Sharpen the description.** Replace the frontmatter `description: |` block in `canon/skills/review/SKILL.md` (lines 3-7) with:
36
+
37
+ ```yaml
38
+ description: |
39
+ Pre-merge code review — the single canonical review of a change before it lands. Covers BOTH
40
+ diff safety/structure (SQL safety, LLM trust-boundary violations, conditional side effects)
41
+ AND engineering quality (architecture fit, edge cases, test coverage, performance). Use when
42
+ asked to "review this PR", "code review", "pre-landing review", "check my diff", or before
43
+ merging. (For plan-time review use plan-eng-review or plan-ceo-review instead.)
44
+ ```
45
+ Keep the existing `triggers:` list as-is.
46
+
47
+ - [ ] **Step 2: Add the engineering-manager checklist to the body.** At the END of `canon/skills/review/SKILL.md`, append:
48
+
49
+ ```markdown
50
+
51
+ ## Engineering-manager checklist
52
+
53
+ Beyond the structural/safety scan above, also review the change as an engineering manager would —
54
+ this is the angle the old `eng-review` skill covered, now folded in here so there is one
55
+ pre-merge review:
56
+
57
+ - **Architecture fit:** does the change follow the project's established patterns, or does it
58
+ drift? Flag architectural drift.
59
+ - **Edge cases & error paths:** are unhandled inputs, failure modes, and boundary conditions
60
+ covered?
61
+ - **Test coverage:** is the changed behavior covered by tests that verify behavior (not just
62
+ mocks)? Missing or weak tests for changed behavior is a blocking issue.
63
+ - **Performance:** any obvious regressions (N+1, unbounded growth, needless work in hot paths)?
64
+
65
+ Output a pass/block verdict with specific, actionable findings. A reviewer never reviews their
66
+ own implementation (see `policy/roles.md`).
67
+ ```
68
+
69
+ - [ ] **Step 3: Verify canon still validates.**
70
+
71
+ Run: `npx vitest run tests/canon/`
72
+ Expected: PASS — `review`'s frontmatter is intact (name + description), `validateCanon` reports zero errors.
73
+
74
+ - [ ] **Step 4: Commit**
75
+
76
+ ```bash
77
+ git add canon/skills/review/SKILL.md
78
+ git commit -m "feat(canon): review absorbs the engineering-manager checklist (one canonical pre-merge review)"
79
+ ```
80
+
81
+ ---
82
+
83
+ ### Task 2: Remove `eng-review` from the canon + repoint its test
84
+
85
+ **Files:**
86
+ - Delete: `canon/skills/eng-review/` (dir + `SKILL.md`)
87
+ - Modify: `canon/manifest.yaml` (remove the entry)
88
+ - Modify: `tests/retrofit/retrofit.integration.test.ts` (repoint assertion)
89
+ - Test: `tests/canon/real-canon.test.ts` (add an absence assertion)
90
+
91
+ - [ ] **Step 1: Write the failing assertion.** In `tests/canon/real-canon.test.ts`, add inside `describe('real canon', ...)`:
92
+
93
+ ```typescript
94
+ it('no longer ships the eng-review skill (folded into review)', () => {
95
+ const manifest = loadManifest(join(repoRoot, 'canon', 'manifest.yaml'))
96
+ expect(manifest.skills.some(s => s.id === 'eng-review')).toBe(false)
97
+ expect(manifest.skills.some(s => s.id === 'review')).toBe(true)
98
+ })
99
+ ```
100
+
101
+ - [ ] **Step 2: Run it to verify it fails.**
102
+
103
+ Run: `npx vitest run tests/canon/real-canon.test.ts`
104
+ Expected: FAIL — `eng-review` is still in the manifest.
105
+
106
+ - [ ] **Step 3: Remove the manifest entry.** In `canon/manifest.yaml`, delete the line:
107
+ ```yaml
108
+ - { id: eng-review, path: skills/eng-review, kind: role }
109
+ ```
110
+
111
+ - [ ] **Step 4: Delete the skill directory.**
112
+
113
+ ```bash
114
+ git rm -r canon/skills/eng-review
115
+ ```
116
+
117
+ - [ ] **Step 5: Repoint the retrofit integration test.** In `tests/retrofit/retrofit.integration.test.ts`, the line (~20) asserts the eng-review skill is written:
118
+ ```typescript
119
+ expect(existsSync(join(target, '.claude/skills/eng-review/SKILL.md'))).toBe(true)
120
+ ```
121
+ Change it to a skill that still exists:
122
+ ```typescript
123
+ expect(existsSync(join(target, '.claude/skills/review/SKILL.md'))).toBe(true)
124
+ ```
125
+
126
+ - [ ] **Step 6: Run tests.**
127
+
128
+ Run: `npx vitest run tests/canon/ tests/retrofit/`
129
+ Expected: PASS — the new absence assertion passes, `validateCanon` stays zero-error (no manifest entry points at a missing dir), and the repointed integration test passes.
130
+
131
+ - [ ] **Step 7: Run the full suite + types.**
132
+
133
+ Run: `npx vitest run && npx tsc --noEmit`
134
+ Expected: PASS, clean.
135
+
136
+ - [ ] **Step 8: Commit**
137
+
138
+ ```bash
139
+ git add canon/manifest.yaml tests/canon/real-canon.test.ts tests/retrofit/retrofit.integration.test.ts
140
+ git commit -m "feat(canon): remove eng-review (folded into review); repoint its retrofit test"
141
+ ```
142
+
143
+ ---
144
+
145
+ ### Task 3: Routing & precedence section in `canon/AGENTS.md`
146
+
147
+ **Files:**
148
+ - Modify: `canon/AGENTS.md`
149
+ - Test: `tests/canon/real-canon.test.ts`
150
+
151
+ - [ ] **Step 1: Write the failing test.** In `tests/canon/real-canon.test.ts`, add (with `readFileSync` imported from `node:fs` — add the import at the top):
152
+
153
+ ```typescript
154
+ it('AGENTS.md carries the skill routing/precedence section', () => {
155
+ const agents = readFileSync(join(repoRoot, 'canon', 'AGENTS.md'), 'utf8')
156
+ expect(agents).toMatch(/Skill routing/i)
157
+ expect(agents).toContain('Pre-merge code review')
158
+ expect(agents).toContain('`review`')
159
+ })
160
+ ```
161
+
162
+ - [ ] **Step 2: Run it to verify it fails.**
163
+
164
+ Run: `npx vitest run tests/canon/real-canon.test.ts`
165
+ Expected: FAIL — the routing section does not exist yet.
166
+
167
+ - [ ] **Step 3: Append the routing section** to `canon/AGENTS.md` (after the existing baseline list):
168
+
169
+ ```markdown
170
+
171
+ ## Skill routing & precedence
172
+
173
+ When several skills could match the same task, resolve deterministically:
174
+
175
+ 1. **Methodology before role.** Skills that decide *how* to work (`brainstorming`, `writing-plans`,
176
+ `tdd`, `subagent-driven-development`, `systematic-debugging`, …) take precedence and set the
177
+ process. Role skills (`review`, `ship`, `health`, `retro`, …) add a perspective on top.
178
+ 2. **One canonical entrypoint per concern** — pick the most specific:
179
+ - Plan-time architecture review → `plan-eng-review`
180
+ - Plan-time product / scope review → `plan-ceo-review`
181
+ - **Pre-merge code review → `review`** (the single canonical one)
182
+ - Requesting a review (dispatch a reviewer) → `requesting-code-review`
183
+ - Handling review feedback → `receiving-code-review`
184
+ - Overall order of operations (idea → deploy) → `workflow`
185
+ 3. **Don't double-run.** These skills declare their own triggers aggressively; when more than one
186
+ matches, the precedence above and the most-specific entrypoint decide. Do not run two skills
187
+ that serve the same concern on the same task.
188
+ ```
189
+
190
+ - [ ] **Step 4: Run tests.**
191
+
192
+ Run: `npx vitest run tests/canon/`
193
+ Expected: PASS — routing assertions green, `validateCanon` still zero-error.
194
+
195
+ - [ ] **Step 5: Commit**
196
+
197
+ ```bash
198
+ git add canon/AGENTS.md tests/canon/real-canon.test.ts
199
+ git commit -m "feat(canon): emit skill routing/precedence into AGENTS.md (all 3 agents)"
200
+ ```
201
+
202
+ ---
203
+
204
+ ### Task 4: Update the README skills catalog (mandatory)
205
+
206
+ **Files:**
207
+ - Modify: `README.md`
208
+
209
+ - [ ] **Step 1: Update the Roles table + counts.** In `README.md`, in the "What's in the canon" catalog:
210
+ - Remove the `eng-review` row from the **Roles** table.
211
+ - Update the `review` row's description to: `Single canonical pre-merge code review — diff safety + engineering quality (architecture, edge cases, tests, performance)`.
212
+ - Change the Roles group heading count from **8** to **7**.
213
+ - Change the section heading "What's in the canon — 25 skills" to "**24 skills**".
214
+
215
+ Exact edits:
216
+ - Find the line `| \`eng-review\` | Engineering-manager review of a change before merge |` and delete it.
217
+ - Find the `review` row `| \`review\` | Pre-landing diff review (SQL safety, trust boundaries, side effects) |` and replace its description cell with `Single canonical pre-merge code review — diff safety + engineering quality (architecture, edge cases, tests, performance)`.
218
+ - Find `**Roles** — *gstack-derived, de-gstacked to be harness-agnostic (8)*` → change `(8)` to `(7)`.
219
+ - Find `## 🧰 What's in the canon — 25 skills` → change `25` to `24`.
220
+
221
+ - [ ] **Step 2: Verify counts add up.** Methodology (13) + Roles (7) + Yoke-native (4) = **24**. Confirm the three group counts in the README sum to 24 and the heading says 24.
222
+
223
+ - [ ] **Step 3: Run the suite** (docs change shouldn't affect tests, but confirm nothing references a removed symbol).
224
+
225
+ Run: `npx vitest run`
226
+ Expected: PASS.
227
+
228
+ - [ ] **Step 4: Commit**
229
+
230
+ ```bash
231
+ git add README.md
232
+ git commit -m "docs: drop eng-review from the skills catalog (folded into review), 25→24"
233
+ ```
234
+
235
+ ---
236
+
237
+ ## Self-Review
238
+
239
+ **Spec coverage:**
240
+ - Routing section in AGENTS.md (precedence + canonical map + arbitration) → Task 3.
241
+ - `review` absorbs eng-review's checklist → Task 1.
242
+ - `eng-review` removed (dir + manifest) → Task 2.
243
+ - Description sharpened (review names its phase; the others — plan-eng-review/plan-ceo-review/
244
+ requesting-/receiving-code-review — are already phase-distinct, so YAGNI: no change) → Task 1.
245
+ - Validator stays green + routing/absence assertions → Tasks 2 & 3.
246
+ - Retrofit integration test repointed (the one test that hard-codes eng-review) → Task 2.
247
+ - README catalog updated (mandatory) → Task 4.
248
+
249
+ **Placeholder scan:** No TBD/TODO. Every content step shows the exact markdown/yaml. The README
250
+ edits are spelled out as find/replace pairs with the exact strings.
251
+
252
+ **Consistency:** Skill count is 24 everywhere (manifest has 24 entries after removal; README says
253
+ 24; groups 13+7+4=24). The `review` description and the AGENTS.md routing line agree that `review`
254
+ is the single pre-merge code review. No task references `eng-review` as still-present after Task 2.
255
+
256
+ **Integration note:** Task 2 must run after Task 1 (review must already carry the checklist before
257
+ eng-review is deleted, so no coverage is lost between commits). Tasks 3 and 4 are independent and
258
+ can run in any order after Task 2.