@hecer/yoke 1.11.0 → 1.13.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 (155) hide show
  1. package/.claude-plugin/plugin.json +13 -13
  2. package/.codex-plugin/plugin.json +7 -7
  3. package/CHANGELOG.md +435 -398
  4. package/README.md +943 -915
  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 +41 -41
  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 +57 -57
  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/gemini-rtk-hook.mjs +25 -25
  71. package/canon/tools/graphify.md +3 -3
  72. package/canon/tools/playwright-mcp.md +3 -3
  73. package/canon/tools/qwen-rtk-hook.mjs +25 -0
  74. package/canon/tools/rtk.md +7 -7
  75. package/canon/tools/serena.md +6 -6
  76. package/dist/agents/catalog.js +7 -0
  77. package/dist/agents/contracts.js +3 -1
  78. package/dist/agents/host.js +5 -1
  79. package/dist/agents/process-streams.js +62 -0
  80. package/dist/agents/process.js +43 -3
  81. package/dist/agents/providers.js +61 -6
  82. package/dist/agents/telemetry.js +133 -37
  83. package/dist/canon/manifest.js +2 -1
  84. package/dist/change/inbox.js +1 -1
  85. package/dist/cli.js +30 -24
  86. package/dist/dashboard/page.js +122 -122
  87. package/dist/dashboard/panels.js +91 -91
  88. package/dist/goals/command.js +3 -2
  89. package/dist/loop/claims.js +2 -1
  90. package/dist/loop/decision.js +3 -2
  91. package/dist/loop/parallel-command.js +4 -2
  92. package/dist/loop/prd.js +2 -1
  93. package/dist/loop/reporter.js +1 -0
  94. package/dist/loop/run-command.js +31 -10
  95. package/dist/prd/command.js +19 -19
  96. package/dist/quality/candidate-comparison.js +6 -1
  97. package/dist/quality/command.js +17 -2
  98. package/dist/quality/types.js +6 -1
  99. package/dist/retrofit/apply.js +95 -2
  100. package/dist/retrofit/config.js +9 -1
  101. package/dist/retrofit/detect.js +8 -0
  102. package/dist/retrofit/plan.js +6 -0
  103. package/dist/retrofit/planners/claude.js +14 -14
  104. package/dist/retrofit/planners/kilo.js +44 -0
  105. package/dist/retrofit/planners/opencode.js +44 -0
  106. package/dist/retrofit/planners/pi.js +24 -0
  107. package/dist/retrofit/planners/qwen.js +3 -3
  108. package/dist/retrofit/preserve.js +2 -2
  109. package/dist/retrofit/qwen-settings.js +17 -0
  110. package/dist/retrofit/skill-actions.js +4 -1
  111. package/dist/retrofit/tools.js +8 -0
  112. package/dist/review/command.js +3 -2
  113. package/dist/review/verdict.js +1 -1
  114. package/dist/routing/capability.js +2 -2
  115. package/dist/routing/planning.js +2 -0
  116. package/dist/routing/registry.js +3 -1
  117. package/dist/routing/router.js +7 -3
  118. package/dist/setup/command.js +35 -11
  119. package/dist/setup/model-presets.js +48 -0
  120. package/docs/CAPABILITY-ROUTING.md +51 -51
  121. package/docs/DASHBOARD-EVOLUTION.md +33 -33
  122. package/docs/HARNESSES.md +81 -0
  123. package/docs/MIGRATING-TO-1.0.md +33 -33
  124. package/docs/MIGRATING-TO-1.1.md +27 -27
  125. package/docs/MIGRATING-TO-1.4.md +70 -70
  126. package/docs/PRODUCT-DIRECTION-2026-09-05.md +210 -210
  127. package/docs/PUBLISHING.md +114 -114
  128. package/docs/QWEN-MODEL-SUPPORT.md +142 -0
  129. package/docs/VERIFIED-PROJECTS-VALIDATION.md +29 -29
  130. package/docs/VERIFIED-PROJECTS.md +167 -167
  131. package/docs/superpowers/plans/2026-06-28-baustein-e-context-layer.md +981 -981
  132. package/docs/superpowers/plans/2026-06-29-baustein-f-routing.md +258 -258
  133. package/docs/superpowers/plans/2026-06-29-baustein-g-loop-observability.md +1006 -1006
  134. package/docs/superpowers/plans/2026-06-29-baustein-h-loop-robustness.md +374 -374
  135. package/docs/superpowers/plans/2026-06-30-baustein-i-visual-design-verification.md +450 -450
  136. package/docs/superpowers/plans/2026-07-02-baustein-k-zero-to-100-bootstrap.md +1024 -1024
  137. package/docs/superpowers/plans/2026-07-02-baustein-m-flow-smoke-proofs.md +574 -574
  138. package/docs/superpowers/plans/2026-08-13-gauntlet-quality-loop.md +537 -537
  139. package/docs/superpowers/plans/2026-08-16-artifact-backed-output-compaction.md +329 -329
  140. package/docs/superpowers/plans/2026-09-05-verified-projects.md +83 -83
  141. package/docs/superpowers/specs/2026-06-28-baustein-e-context-layer-design.md +146 -146
  142. package/docs/superpowers/specs/2026-06-29-baustein-f-routing-design.md +106 -106
  143. package/docs/superpowers/specs/2026-06-29-baustein-g-loop-observability-design.md +186 -186
  144. package/docs/superpowers/specs/2026-06-29-baustein-h-loop-robustness-design.md +113 -113
  145. package/docs/superpowers/specs/2026-06-30-baustein-i-visual-design-verification-design.md +98 -98
  146. package/docs/superpowers/specs/2026-07-02-baustein-k-zero-to-100-bootstrap-design.md +200 -200
  147. package/docs/superpowers/specs/2026-07-02-baustein-m-flow-smoke-proofs-design.md +155 -155
  148. package/docs/superpowers/specs/2026-08-13-gauntlet-quality-loop-design.md +422 -422
  149. package/docs/superpowers/specs/2026-08-16-artifact-backed-output-compaction-design.md +166 -166
  150. package/gemini-extension.json +6 -6
  151. package/hooks/hooks.json +19 -19
  152. package/package.json +91 -87
  153. package/dist/dashboard/discovery.js +0 -73
  154. package/docs/community-outreach-2026-08-20.md +0 -85
  155. package/docs/launch-copy-2026-08-21.md +0 -193
package/README.md CHANGED
@@ -1,915 +1,943 @@
1
- <div align="center">
2
-
3
- <h1><img src="https://raw.githubusercontent.com/HECer/yoke/v1.10.0/docs/assets/yoke-logo.png" alt="Yoke" width="100" height="63"></h1>
4
-
5
- <!-- yoke:version:start -->1.11.0<!-- yoke:version:end -->
6
- <!-- yoke:tests:start -->1174<!-- yoke:tests:end -->
7
- <!-- yoke:skills:start -->34<!-- yoke:skills:end -->
8
- <!-- yoke:agents:start -->Claude | Codex | Gemini | Qwen<!-- yoke:agents:end -->
9
-
10
- ### One harness, three agents — and zero trust in "done."
11
-
12
- **Yoke** installs one curated canon of skills, **mechanical safety gates**, and tool wiring into any project — natively for **Claude Code, OpenAI Codex CLI, and Gemini CLI**. Its opt-in loop implements and verifies stories before committing. Independent review and browser proofs run when configured; screenshots and videos require the browser smoke gate.
13
-
14
- [![npm](https://img.shields.io/npm/v/%40hecer%2Fyoke?logo=npm&color=CB3837)](https://www.npmjs.com/package/@hecer/yoke)
15
- [![npm downloads](https://img.shields.io/npm/dm/%40hecer%2Fyoke?logo=npm)](https://www.npmjs.com/package/@hecer/yoke)
16
- [![CI](https://github.com/HECer/yoke/actions/workflows/ci.yml/badge.svg)](https://github.com/HECer/yoke/actions/workflows/ci.yml)
17
- [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](#-license)
18
- ![Node](https://img.shields.io/badge/node-%E2%89%A520-339933?logo=node.js&logoColor=white)
19
- ![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?logo=typescript&logoColor=white)
20
- ![Tests](https://img.shields.io/badge/tests-1174%20defined-blue.svg)
21
- ![Agents](https://img.shields.io/badge/agents-Claude%20%7C%20Codex%20%7C%20Gemini-8A2BE2)
22
- ![Built with TDD](https://img.shields.io/badge/built%20with-TDD%20%2B%20review-ff69b4.svg)
23
-
24
- **Install:** [`npm i -g @hecer/yoke`](https://www.npmjs.com/package/@hecer/yoke)
25
-
26
- </div>
27
-
28
- > **TL;DR** — `yoke setup .` asks six questions and installs the native harness for your agent. `yoke new my-app --idea="..."` bootstraps a project and drafts its story backlog. `yoke loop run my-app --isolate --review` then implements it behind hard gates: **clean tree → acceptance criteria → your real tests green → an independent model approves → commit**. Add `--parallel=N` for dependency-aware workers, or declare a reference and add `--quality` for a bounded critic/repair gauntlet. If any blocking gate is red, nothing is committed. Proof lives in `.yoke/proof/<story>/`.
29
-
30
- **New in 1.10.0:** [dashboard search, filters and period comparisons](docs/DASHBOARD-EVOLUTION.md), [batch task assessments with separate planning models](docs/CAPABILITY-ROUTING.md), and [Windows sandbox preflight and process supervision](docs/WINDOWS-RUNNER-VALIDATION.md). Existing routing settings remain authoritative. See the [changelog](CHANGELOG.md) for migration and validation limits.
31
-
32
- ### One dashboard, multiple projects
33
-
34
- ```sh
35
- npm install -g @hecer/yoke@latest
36
- yoke projects add /path/to/frontend
37
- yoke projects add /path/to/backend
38
- yoke dashboard --no-register
39
- ```
40
-
41
- Open the printed `http://127.0.0.1:...` URL. Each registered project has its own goals, tasks and evidence. The dashboard shows available worker state, per-task duration estimates, planned start offsets, input/output tokens, costs and unknown measurements. You can request a goal pause at a safe boundary.
42
-
43
- The dashboard includes attention-first project search and filters, restorable view links, and usage comparisons against the preceding period. See [dashboard behavior and measurement limits](docs/DASHBOARD-EVOLUTION.md).
44
-
45
- Projects are registered explicitly; this version does not automatically discover every process or aggregate other computers. Start/resume and budget changes use the CLI. Missing history appears as unknown; time ranges are empirical estimates, not exact deadlines.
46
-
47
- ### Verified goals and efficient execution
48
-
49
- ```sh
50
- yoke check /path/to/project --json
51
- # First define executable criteria and protected tests in .yoke/acceptance.yaml.
52
- yoke goal set /path/to/project --objective="Complete guest checkout" --attempts=3 --minutes=30
53
- yoke goal run /path/to/project --runner=codex
54
- yoke goal resume /path/to/project --runner=claude
55
- yoke goal handoff /path/to/project
56
- ```
57
-
58
- Goals persist their objective, attempts and check evidence across runs. Changed protected tests block acceptance; failed work is retained. Explicit routing rules bypass controller calls, configured tool actions use no model, and failed rule-based attempts can escalate to a stronger worker. Context selection stays within a character budget; declared write scopes and dependencies guide parallel scheduling.
59
-
60
- See the [1.7 workflow guide](docs/VERIFIED-PROJECTS.md) for setup, Gemini selection, recovery and budgets. Provider contracts do not establish equal model quality; live comparative savings and calibrated time predictions remain unmeasured. Token budgets apply between provider calls, and browser proofs still require a configured smoke gate.
61
-
62
- Yoke 1.5 keeps failed gate output compact without throwing evidence away: deterministic previews
63
- retain actionable failures and final summaries, while large complete stdout/stderr remains available
64
- in private, content-addressed local artifacts. Existing projects keep their serial behavior and use
65
- safe 2 KiB preview / 8 KiB artifact defaults unless configured otherwise.
66
-
67
- Yoke 1.4 introduced opt-in parallel workers and a bounded, reference-driven quality gauntlet.
68
- Yoke 1.8.0 uses automatic parallelism for tasks with declared write scopes. See [the 1.4 migration guide](docs/MIGRATING-TO-1.4.md)
69
- for the new flags, configuration, cleanup behavior, and review-verdict contract.
70
-
71
- Yoke 1.1 is safe-by-default: provider CLIs use autonomous sandbox profiles unless `--unsafe`
72
- is explicit; reviews require a schema-valid verdict and a different model unless
73
- `--allow-self-review` is explicit; commits enforce the human identity from project config or Git.
74
- See [the 1.1 migration guide](docs/MIGRATING-TO-1.1.md) for setup/decision parity and
75
- [the 1.0 guide](docs/MIGRATING-TO-1.0.md) for the earlier safety-policy changes.
76
-
77
- ---
78
-
79
- ## Why Yoke exists
80
-
81
- Agentic coding in 2026 fails in four well-documented ways. Yoke answers each one **mechanically** — in code, not in a prompt the agent can ignore:
82
-
83
- | The pain | What actually happens | What Yoke does about it |
84
- |---|---|---|
85
- | 🎭 **The verification gap** — *"agent says done, but it isn't"* | A success message can omit untested acceptance criteria. | The loop executes acceptance and project checks. Enabled review and browser gates must pass before a story lands. `yoke check` exposes unmapped outcomes as unverified. |
86
- | 🔀 **Three agents, three configs** | Teams hand-maintain `CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, skills, and MCP wiring separately — copy-paste drift everywhere | **One canon → `yoke retrofit`** generates the idiomatic native artifacts for each agent. Change the canon once, re-retrofit everywhere. |
87
- | 🌀 **Overnight loops going off the rails** | Raw Ralph-loop users "wake up to broken codebases that don't compile" | Yoke is **"Ralph, but with gates"**: clean-worktree gate, acceptance-criteria gate, green-tests gate, review gate, per-story worktree isolation, idle-timeout watchdog, single-flight lock, commit integrity. |
88
- | 😵 **Review fatigue** | AI adoption nearly doubles PR volume and review time; humans start skimming | **`yoke review`**: a second model writes a schema-validated pass/fail verdict — chainable into verify, pre-push, or CI. Cross-model review catches what self-review misses. |
89
-
90
- **Who it's for:** anyone driving Claude Code, Codex CLI, or Gemini CLI on real projects — especially if you use more than one, want autonomous runs you can trust, or are tired of "done" meaning "probably". Greenfield (`yoke new`) and brownfield (`yoke retrofit`) both work.
91
-
92
- **Who it's not for:** if you want a chat pair-programmer with no process, you don't need a harness. Yoke is for shipping with discipline.
93
-
94
- ## Example: idea → verified implementation
95
-
96
- ```console
97
- $ yoke new reading-app --idea="a web app that tracks my reading list"
98
- ✓ reading-app bootstrapped. # git repo · harness for all agents · context · PRD drafted from the idea
99
-
100
- $ yoke prd check reading-app
101
- ✓ PRD valid — 8 stories, 0 pass
102
-
103
- $ yoke loop on reading-app
104
- $ yoke loop run reading-app --isolate --review --max=10
105
- ▶ STORY-1 (0/8 · 0%) — implementing… · verifying… · reviewing… · committing…
106
- ✓ STORY-1 done in 3m12s — 1/8 (13%) · ~22m left
107
- ▶ STORY-2 (1/8 · 13%) — implementing… · ~22m left (Ø 3m12s/story)
108
- ✓ STORY-2 done in 2m48s — 2/8 (25%) · ~18m left
109
- ▶ STORY-3 (2/8 · 25%) — implementing… ✘ blocked: story did not verify (tests red)
110
- # nothing was committed. fix, then re-run.
111
-
112
- $ ls reading-app/.yoke/proof/STORY-2/
113
- home.png list.png # example when browser smoke is configured
114
- ```
115
-
116
- This is an illustrative transcript. Actual durations depend on the project, provider, retries and enabled gates; browser proof requires a configured smoke flow. See [how it was built](#-why--how-it-was-built).
117
-
118
- ## 🚀 Quickstart
119
-
120
- ```bash
121
- npm install -g @hecer/yoke # → global `yoke` on your PATH
122
- # (or from source: git clone https://github.com/HECer/yoke.git && cd yoke && npm install && npm run build && npm link)
123
-
124
- # Greenfield: idea → loop-ready project in one command
125
- yoke new my-app --idea="a CLI that tracks reading lists"
126
- yoke loop on my-app && yoke loop run my-app --isolate
127
-
128
- # — or retrofit an existing project —
129
- yoke setup /path/to/project # interactive: agents, graph, loop, runner, decisions, routing
130
- yoke validate canon # sanity-check the canon
131
- yoke loop run /path/to/project --isolate --parallel=3 --reviewer=codex --max=20
132
- ```
133
-
134
- > Requires Node ≥ 20 and git. No global install? `node /path/to/yoke/dist/cli.js …` or `npm --prefix /path/to/yoke run yoke -- …` work too. The MCP tools (rtk, graphify/Serena, Playwright MCP) are wired by Yoke but installed separately — the generated config is a clearly-labelled, adjustable template.
135
-
136
- ### Skills before the first setup
137
-
138
- The canon is also packaged as a Claude Code plugin — the repo is its own marketplace:
139
-
140
- ```text
141
- /plugin marketplace add HECer/yoke
142
- /plugin install yoke@yoke
143
- ```
144
-
145
- That gives you all canon skills under the `yoke:` namespace (e.g. `yoke:tdd`, `yoke:review`) inside Claude Code — no retrofit needed. The `yoke` CLI (loop, gates, retrofit for Codex/Gemini) still comes from `npm i -g @hecer/yoke`. Gemini CLI users can likewise `gemini extensions install https://github.com/HECer/yoke`.
146
-
147
- For Codex, no preinstalled skill is required: run `npx @hecer/yoke setup .` in a terminal, or
148
- ask Codex to run the six-question Yoke setup flow. The retrofit writes native skills to
149
- `.agents/skills/`, including `yoke-retrofit` and `yoke-workflow`; start a fresh Codex task if an
150
- already-open task does not discover newly installed skills. The npm package also contains
151
- `.codex-plugin/plugin.json` for Codex plugin hosts.
152
-
153
- ### Staying up to date
154
-
155
- Yoke checks for new releases npm/gh-style: a **non-blocking background check** (at most once a day, detached, offline-safe) prints a one-line hint when a newer version exists — upgrading itself is always an explicit act:
156
-
157
- ```bash
158
- yoke upgrade # npm install -g @hecer/yoke@latest
159
- ```
160
-
161
- Disable the check with `YOKE_NO_UPDATE_CHECK=1` (it is also silent in CI, `--json` runs, and piped output). Projects that want the loop to self-update can opt in via `.yoke/config.yaml`:
162
-
163
- ```yaml
164
- update:
165
- auto: true # upgrade at loop START only — never mid-run; applies from the next invocation
166
- ```
167
-
168
- Auto-upgrade is deliberately **not** the default: a gate harness shouldn't change itself mid-project, and unreviewed auto-installs are a supply-chain hazard.
169
-
170
- ## 🤖 Driving it through an agent
171
-
172
- Yoke is meant to be operated *by* your coding agent — after a retrofit, the agent has the skills, the safety policy, and the routing, so it knows the methodology. Copy-paste prompts (identical wording works for Claude Code, Codex CLI, and Gemini CLI):
173
-
174
- > **Set it up** — *"Set up Yoke in this project. Ask me the Yoke setup questions one at a time with your recommendation, then run `yoke setup . --yes` with the selected host, agents, code graph, loop, runner, and decision policy. Commit in my configured identity."*
175
-
176
- > **Work the disciplined way** — *"From now on follow the Yoke skills you just installed: brainstorm → spec → plan → TDD → review before merging. Use the `review` skill before any merge."*
177
-
178
- > **Plan, then run autonomously** — *"Use the `yoke-workflow` skill. Ask only the planning questions that materially change the product, write the approved plan and loop-ready stories, then execute every approved story without routine follow-ups. Follow the configured `auto` or `critical` decision policy."*
179
-
180
- > **Watch / unblock** — *"Run `yoke loop status .`. If it says BLOCKED, run the project's verify command, find the root cause, fix it without weakening tests, then continue the loop."*
181
-
182
- > ⚠️ **Long runs from inside an agent session:** `yoke loop run` has no story cap by default; it continues until every planned story passes or a gate blocks. A multi-story run can therefore outlive most agents' shell-tool timeouts (Claude Code's Bash tool defaults to 2 minutes). If the outer tool call is killed mid-run, you get a stale lock and possibly half-finished state — which *looks* like a hang. Run the loop **in the background** (e.g. Claude Code's `run_in_background`), use `--max=3..5` only when you intentionally want a bounded batch, poll with `yoke loop status`, and after any interrupted run do `yoke loop cleanup` before the next one. A `running` status with no update for 20+ minutes on a claude runner is worth checking — since 0.5.0 the runner streams continuously, so prolonged true silence is no longer normal.
183
-
184
- > ⚠️ **Never kill agent processes by name or command-line pattern** (e.g. every process matching `dangerously-skip-permissions`): on a machine running several yoke projects, that takes down the *healthy* runners of the other projects mid-story — they stall and their loops block. `yoke loop cleanup` is the scoped alternative: each watchdog records its pids in the project's `.yoke/runner.pid`, and cleanup kills exactly those recorded trees — nothing else on the machine.
185
-
186
- ### Agent cheat sheet — every command is an exit-code contract
187
-
188
- Yoke's CLI is deterministic and chainable by design: an agent (or a shell `&&`) can branch on exit codes without parsing prose.
189
-
190
- | Command | What it does | Exit codes |
191
- |---|---|---|
192
- | `yoke dashboard [dir] [--no-register] [--port=N]` | Local overview for every registered project; optionally register `dir` first | `0` stopped normally · `1` shutdown failure · `2` unavailable |
193
- | `yoke projects add\|list\|remove` | Register a project, list registrations or remove a reference by ID | `0` · `2` invalid/unavailable |
194
- | `yoke check [dir] [--json] [--requirement=] [--protect [--refresh]]` | Execute acceptance checks or explicitly pin their infrastructure | `0` passed/pinned · `1` failed · `2` unverified/unavailable |
195
- | `yoke goal set\|run\|resume\|pause\|status\|handoff\|budget [dir]` | Durable objectives, provider handoff, protected checks and checkpoint budgets | run/resume: `0` complete · `1` unfinished · `2` unavailable |
196
- | `yoke setup [dir] [--yes] [--host=] [--agent=] [--runner=] [--code-graph=] [--decision-policy=] [--loop\|--no-loop] [--routing\|--no-routing]` | Shared six-question setup for Claude, Codex, and Gemini; routing defaults on for new setups and preserves explicit opt-outs | `0` · `1` invalid setup |
197
- | `yoke validate [canonDir]` | Validate the canon (schema, frontmatter, templates) | `0` valid · `1` errors |
198
- | `yoke new <dir> [--idea=] [--agent=] [--runner=] [--loop]` | Greenfield bootstrap: git init → scaffold → retrofit → context → PRD (drafted from `--idea`) → committed | `0` · `1` usage / non-empty dir / draft failed (scaffold survives) · `2` draft agent unavailable |
199
- | `yoke retrofit [dir] [--agent=claude,codex,gemini\|all] [--code-graph=graphify\|serena] [--loop]` | Install/update the harness, non-destructively | `0` |
200
- | `yoke prd draft [dir] --idea= [--runner=] [--force]` | Idea → 5–12 stories with testable acceptance criteria | `0` · `1` invalid/guarded · `2` agent unavailable |
201
- | `yoke prd check [dir]` | PRD lint gate (schema, dependencies, cycles, duplicate ids, acceptance) | `0` valid · `1` violations |
202
- | `yoke change add\|status [dir] [--idea=]` | Queue a change at any time; the loop turns it into append-only stories at the next safe boundary | `0` · `1` invalid inbox/request |
203
- | `yoke context init\|status [dir]` | Durable context layer (`PROJECT/DECISIONS/KNOWLEDGE/GLOSSARY.md`, optional `CONTEXT-MAP.md`) | `0` |
204
- | `yoke loop on\|off\|status\|decision\|answer\|resume\|run\|cleanup [dir]` | Autonomous loop; `run` supports `--parallel=N`, bounded reference-driven `--quality`, and blind `--candidates=N` selection; `--max=N` creates an intentional batch cap; `cleanup` retains worktrees unless `--remove-worktrees` is explicit | run: `0` complete · `1` blocked/cap · `2` not runnable / already locked · `3` paused |
205
- | `yoke review [dir] [--reviewer=] [--base=] [--focus=] [--json] [--allow-self-review]` | An independent model writes a schema-valid verdict | `0` approved · `1` findings/invalid verdict · `2` no independent reviewer |
206
- | `yoke audit [dir] [--json]` | Dependency, high-confidence secret, and sensitive-change audit | `0` green · `1` blocking findings · `2` not runnable |
207
- | `yoke design-scan [dir] [--max=N] [--report]` | Static AI-slop design gate | `0` within budget · `1` over |
208
- | `yoke flow-smoke [dir] [--url=] [--label=]` | Browser gate with screenshot/video proofs | `0` green · `1` failures · `2` not runnable |
209
-
210
- A genuinely hung agent self-terminates after the idle timeout (default 20 min; `--timeout`), and `yoke loop status` shows the live phase or a `⚠ possibly stuck` hint — an autonomous run is never a black box.
211
-
212
- ## ⚖️ How it compares — superpowers · gstack · Yoke
213
-
214
- Three excellent projects, three different jobs. Honest version:
215
-
216
- | | [superpowers](https://github.com/obra/superpowers) (obra) | [gstack](https://github.com/garrytan/gstack) (Garry Tan) | **Yoke** |
217
- |---|---|---|---|
218
- | **What it is** | The canonical *skills methodology*: brainstorm → plan → TDD → review as composable skills | A *software factory* for Claude Code: ~40 role skills (QA, CSO, ship…) + a real Chromium browser layer | A *cross-agent harness*: one canon → native installs, plus a gated autonomous loop |
219
- | **Agents** | Claude Code first | Claude Code + hosts like Codex/Cursor/Kiro — **no Gemini CLI** | **Claude Code, Codex CLI, Gemini CLI** from one source of truth |
220
- | **Enforcement** | Advisory — skills *describe* the discipline; following them is up to the agent | Skill-driven; browser QA is genuinely real | **Mechanical** — gates live in code: clean tree, acceptance criteria, green tests, review verdict, commit integrity |
221
- | **Autonomy** | Interactive sessions | Interactive slash-commands (`/qa`, `/ship`, …) | Opt-in **Ralph loop** with watchdog, worktree isolation, single-flight lock, per-story proofs |
222
- | **Visual QA** | — | **Best-in-class**: live browser daemon (Chromium/CDP) with deep interactive QA | Built-in `flow-smoke` gate: screenshots always, video on failure, labelled per story — lighter, but *enforced* and cross-agent |
223
- | **Cross-model review** | — | `/codex` second opinion (Codex-only direction) | `yoke review` — resolves an independent provider and validates a structured verdict, inside or outside the loop |
224
- | **Footprint** | Markdown skills (plugin) | ~230 MB with browser runtime; hourly auto-update | Node CLI + markdown canon; Playwright only if you use flow-smoke, resolved **from your project** |
225
- | **License** | MIT | MIT | MIT |
226
-
227
- **They compose — use all three where they're strongest.** Yoke's canon *ships* the superpowers methodology natively for all three agents (13 skills, [attributed](canon/skills/ATTRIBUTION.md)). And if gstack is installed, `yoke retrofit` detects it and adds a routing note to `CLAUDE.md` telling Claude to prefer gstack's live-browser `/qa`, `/cso`, and ship pipeline for what Yoke deliberately doesn't bundle — no dependency, no conflict, and Codex/Gemini artifacts stay uniform.
228
-
229
- **Choose Yoke when** you run more than one agent, want autonomy you can audit (gates + proofs + logs), or want one place to maintain your team's methodology. **Choose gstack when** you live 100% in Claude Code and want the deepest interactive browser QA. **Choose superpowers when** you want the methodology alone, interactively, in Claude Code — or just use it *through* Yoke.
230
-
231
- ## 🏗️ Architecture
232
-
233
- You curate **one source of truth** — skills, policy, and tool wiring. Yoke generates the **idiomatic, native artifacts** each agent expects, non-destructively, into any repo:
234
-
235
- ```mermaid
236
- flowchart TD
237
- Canon["📦 CANON — single source of truth<br/>skills · policy · loop spec · tool wiring"]
238
- Skill["🛠️ yoke retrofit<br/>detect → plan → apply (backup) → report"]
239
- Canon --> Skill
240
- Skill --> Claude["Claude Code<br/>.claude/skills · .mcp.json · hook"]
241
- Skill --> Codex["Codex CLI<br/>AGENTS.md · config.toml · RTK.md"]
242
- Skill --> Gemini["Gemini CLI<br/>GEMINI.md · commands · settings.json"]
243
- Loop["🤖 yoke loop — autonomous Ralph loop<br/>gates · verify · review · isolation · proofs"]
244
- Claude -. drives .-> Loop
245
- Codex -. drives .-> Loop
246
- Gemini -. drives .-> Loop
247
- ```
248
-
249
- Three layers — **Canon** (`yoke validate`) → **Retrofit** (`yoke retrofit`) → **Loop** (`yoke loop`) — on top of a durable **Context layer** (`yoke context`).
250
-
251
- ### What gets generated per agent
252
-
253
- | Agent | Artifacts |
254
- |---|---|
255
- | **Claude** | Complete skill packages under `.claude/skills/` (including referenced resources), `AGENTS.md`, `CLAUDE.md`, `.mcp.json` (code-graph + Playwright), and an rtk `PreToolUse` hook when WSL is available |
256
- | **Codex** | Complete skill packages under `.agents/skills/`, per-skill implicit-invocation policy, `AGENTS.md`, `RTK.md`, `.codex/config.toml`, native hooks, reusable `.codex/agents/*.toml`, and package plugin metadata |
257
- | **Gemini** | Complete skill packages under `.gemini/skills/`, an auto-invocation index, `GEMINI.md`, `.gemini/commands/*.toml`, and `.gemini/settings.json` (MCP + `AGENTS.md` context) |
258
-
259
- > **rtk integration:** Claude receives its PreToolUse hook; Codex receives a native hook adapter around `rtk hook check`; Gemini retains instruction-mode fallback where its CLI has no equivalent command-rewrite lifecycle.
260
-
261
- > **Composes with gstack:** if [gstack](https://github.com/garrytan/gstack) is installed (repo-local or global), `yoke retrofit` adds a short "Composed tools" routing note to **CLAUDE.md only** — telling Claude to prefer gstack's skills for capabilities Yoke doesn't ship (live-browser QA `/qa`, security audit `/cso`, ship/deploy `/ship`). No bundling, no dependency; the note is never written to the Codex or Gemini artifacts.
262
-
263
- > **Your content survives re-retrofits — preserve blocks:** anything you put between
264
- > `<!-- yoke:preserve:start -->` and `<!-- yoke:preserve:end -->` in a generated file is
265
- > carried into the regenerated version on every future `yoke retrofit`. The generated
266
- > `CLAUDE.md` and `GEMINI.md` ship an empty preserve block scaffold — put your project-specific
267
- > instructions (tech stack, workflow, `@`-includes) inside it. Works in any yoke-written file;
268
- > content *outside* the markers is still replaced (and backed up under `.yoke/backup/`).
269
-
270
- ## 🧰 What's in the canon — 34 skills
271
-
272
- `yoke retrofit` installs all of these into each agent natively. Provenance is credited in [`canon/skills/ATTRIBUTION.md`](canon/skills/ATTRIBUTION.md).
273
-
274
- To stop overlapping skills from auto-invoking against each other, `canon/AGENTS.md` carries a **skill routing & precedence** block (methodology before role; one canonical entrypoint per concern — e.g. pre-merge code review is always `review`), emitted into all three agents.
275
-
276
- Each manifest entry also declares `invocation: auto|manual`. Retrofit translates that intent into
277
- the provider's native controls: Claude disables model invocation for manual skills, Codex writes
278
- `agents/openai.yaml`, and Gemini lists only automatic skills in its generated index. Validation
279
- rejects conflicting package metadata and broken local Markdown links before anything is installed.
280
-
281
- **Process / methodology** — *superpowers-derived discipline (13)*
282
-
283
- | Skill | What it does |
284
- |---|---|
285
- | `brainstorming` | Explore intent, requirements & design before any creative work |
286
- | `writing-plans` | Turn a spec into a bite-sized, TDD implementation plan |
287
- | `executing-plans` | Execute a written plan in a separate session with review checkpoints |
288
- | `subagent-driven-development` | Run a plan task-by-task: fresh subagent + two-stage review each |
289
- | `tdd` | Write the test first, watch it fail, write minimal code, refactor |
290
- | `systematic-debugging` | Root-cause first — no fix without a confirmed cause |
291
- | `verification-before-completion` | Prove it actually works before claiming done |
292
- | `using-git-worktrees` | Isolated worktrees for safe / parallel work |
293
- | `requesting-code-review` | Request a structured review before merging |
294
- | `receiving-code-review` | Handle review feedback with rigor, not blind agreement |
295
- | `dispatching-parallel-agents` | Fan out 2+ independent tasks concurrently |
296
- | `finishing-a-development-branch` | Merge / PR / cleanup a finished branch |
297
- | `writing-skills` | Author and verify new skills |
298
-
299
- **Roles** — *gstack-derived, de-gstacked to be harness-agnostic (7)*
300
-
301
- | Skill | What it does |
302
- |---|---|
303
- | `plan-eng-review` | Architecture / edge-case review of a *plan* |
304
- | `plan-ceo-review` | Founder-mode scope & ambition review of a plan |
305
- | `review` | Single canonical pre-merge code review — diff safety + engineering quality (architecture, edge cases, tests, performance) |
306
- | `ship` | Ship workflow: tests → review → version → changelog → PR |
307
- | `health` | Code-quality dashboard with a composite score |
308
- | `retro` | Engineering retrospective from commit history |
309
- | `document-release` | Post-ship documentation sync (README / CHANGELOG / …) |
310
-
311
- **Yoke-native** — *authored or adapted for this harness (14)*
312
-
313
- | Skill | What it does |
314
- |---|---|
315
- | `yoke-retrofit` | Set up the Yoke harness in a project (detect → plan → apply) |
316
- | `yoke-workflow` | Provider-neutral planning questions → approved PRD → autonomous stories → critical-decision resume |
317
- | `authoring-prd` | Slice a product idea into loop-ready stories with testable acceptance criteria |
318
- | `minimal-code` | Write the least code that solves the task (YAGNI; ponytail-derived) |
319
- | `performance` | Efficiency as a measured requirement: benchmarks as tests, budgets as gates, optimizations local + documented |
320
- | `maintaining-context` | Keep `.yoke/context/` the durable source of truth (the Context layer) |
321
- | `workflow` | The default order of operations, from idea to deploy |
322
- | `unslop-ui` | Detect & remove AI-slop design tells (purple gradients, neon glow, emoji-icons…) |
323
- | `visual-verification` | Widen verify to design-scan + the built-in `yoke flow-smoke` gate (screenshot proofs; video on failure) |
324
- | `no-ai-slop` | Detect and edit generic AI prose while preserving the author's voice; includes its evaluation rubric |
325
- | `domain-modeling` | Model boundaries, invariants, vocabulary, context maps, and decision records before implementation |
326
- | `codebase-design` | Explore architecture, deepen a chosen design, and compare two viable approaches when tradeoffs matter |
327
- | `resolving-merge-conflicts` | Resolve conflicts by reconstructing intent, then verify the integrated result |
328
- | `writing-for-agents` | Write compact agent instructions with explicit triggers, constraints, resources, and checks |
329
-
330
- ## 🌱 Zero to 100: `yoke new` + `yoke prd`
331
-
332
- Yoke's greenfield entrypoint — one command from idea to loop-ready project:
333
-
334
- ```bash
335
- yoke new my-app --idea="a CLI that tracks reading lists" # scaffold + retrofit + context + PRD
336
- yoke loop on my-app && yoke loop run my-app --isolate # hand it to the loop
337
- ```
338
-
339
- `yoke new <dir>` refuses a non-empty directory (greenfield-only — use `yoke retrofit` for
340
- existing projects), then: creates and `git init`s the directory, writes a minimal scaffold
341
- (`README.md`, `.gitignore`), runs the full **retrofit** (`--agent=` as usual), initialises the
342
- **context layer** (with `--idea` seeded into `PROJECT.md` as the north star), writes a commented
343
- **PRD template** to `.yoke/prd.yaml`, and makes the initial commit — so `--isolate` works from
344
- iteration 1. With `--idea`, it then drafts the PRD from your idea via an agent (`--runner=`,
345
- the configured runner or active host) and commits it as a second commit (`docs: draft PRD from idea`).
346
-
347
- - **Exit codes** — `0` success; `1` usage / non-empty dir / draft failure (the scaffold survives —
348
- retry with `yoke prd draft`); `2` requested draft agent unavailable.
349
-
350
- **`yoke prd draft [dir] --idea="..."`** turns an idea into 5–12 small, independently shippable
351
- stories with testable behavioral acceptance criteria (greenfield STORY-1 scaffolds the project
352
- skeleton + test suite and wires `verify.command`). An existing PRD with stories is never
353
- overwritten without `--force`; the untouched template doesn't trigger the guard. Runs through
354
- the same idle-timeout watchdog as the loop (`--timeout`). If `.yoke/plan.md` exists, its approved
355
- goals, non-goals, constraints, and decisions are injected as settled context instead of being
356
- reopened by the drafting agent.
357
-
358
- **`yoke prd check [dir]`** is the chainable pre-loop lint gate: schema validation plus
359
- duplicate-id, empty-acceptance, unresolved-placeholder, and zero-stories checks. Exits `0` with
360
- `✓ PRD valid — N stories, M pass`, `1` on any violation. The `authoring-prd` canon skill
361
- teaches interactive sessions the same story-slicing discipline.
362
-
363
- ## 🤖 The autonomous loop
364
-
365
- Opt-in; `yoke setup` recommends enabling it for new installs, while `retrofit` alone keeps it off unless requested. Each iteration starts a **fresh agent** and passes through hard gates before anything is committed:
366
-
367
- ```mermaid
368
- flowchart LR
369
- I[consume queued change<br/>as new stories] --> A[pick next PRD story]
370
- A --> B{clean worktree?}
371
- B -- no --> X[blocked]
372
- B -- yes --> C{acceptance<br/>criteria?}
373
- C -- no --> X
374
- C -- yes --> D[agent implements<br/>one story]
375
- D --> E{suite + criterion<br/>proof green?}
376
- E -- no --> X
377
- E -- yes --> V{UI design<br/>within budget?}
378
- V -- no --> X
379
- V -- yes --> F{reviewer<br/>approves?}
380
- F -- no --> X
381
- F -- yes --> G[commit + mark passes:true<br/>+ proof in .yoke/proof/]
382
- G --> I
383
- I --> H{all stories pass?}
384
- H -- yes --> J{integrated system<br/>gate green?}
385
- J -- no --> X
386
- J -- yes --> K[current backlog ready]
387
- ```
388
-
389
- ```bash
390
- yoke loop on . # enable (recorded in .yoke/config.yaml)
391
- yoke loop status . # show state + PRD progress
392
- yoke change add . --idea="Add passkey login" # safe while the loop runs
393
- yoke loop run . \
394
- --runner=codex \ # implement with Codex…
395
- --reviewer=claude \ # …review with Claude (role separation)
396
- --isolate \ # each story in a throwaway git worktree
397
- --parallel=3 \ # run dependency-ready, non-colliding stories concurrently
398
- --decision-policy=critical # pause only for high-impact decisions; routine choices stay autonomous
399
- # Optional: add --max=20 only when this run should stop after a bounded batch.
400
- yoke loop off . # disable
401
- ```
402
-
403
- **PRD format** (`.yoke/prd.yaml`):
404
-
405
- ```yaml
406
- - id: STORY-1
407
- title: Add a health endpoint
408
- priority: 1 # lower = higher priority
409
- acceptance: # Definition of Done (required, else blocked)
410
- - id: health-returns-200
411
- text: GET /health returns 200
412
- verify: [npm run test:health-returns-200]
413
- - id: health-rejects-post
414
- text: POST /health returns 405
415
- verify: [npm run test:health-rejects-post]
416
- passes: false # the loop sets this true only on green tests
417
- ```
418
-
419
- New projects default to `verify.requireCriteria: true`: every story has 2–5 behavioral criteria.
420
- Each criterion ID must occur in its single, approved test command; shell operators and broad,
421
- untargeted suites are rejected. Yoke records each result in `.yoke/proof/<story>/evidence.json`. Configure optional
422
- `completion.command` for integrated journeys such as purchase → entitlement → relaunch or
423
- magic-link → callback → authenticated app. It runs whenever the current backlog has no open
424
- stories; this is readiness, not a release.
425
-
426
- No generic tool can infer whether arbitrary test code perfectly represents product meaning. Yoke
427
- closes the mechanical false-done paths—targeted evidence, coverage review, clean committed state,
428
- and integrated journeys—while the project still owns the correctness of its tests and production
429
- observability.
430
-
431
- ### Parallel workers and the quality gauntlet
432
-
433
- `--parallel=N` dispatches dependency-ready stories concurrently. Claims carry leases, workers use
434
- isolated worktrees, collision areas are serialized, and only a mechanically green candidate enters
435
- the FIFO integration queue. Integration repeats the project gates against the merged tree; a worker
436
- success can never bypass a red integrated result. `yoke loop status` reports the dispatcher,
437
- workers, providers, worktrees, lifecycle, queue, integrations, and reopened stories.
438
-
439
- Quality is reference-driven and opt-in. Declare what one story should match:
440
-
441
- ```yaml
442
- quality:
443
- reference: { name: approved-home, source: design/home.png, kind: file }
444
- candidate: { kind: screenshots, paths: [.yoke/proof/STORY-1/home.png] }
445
- rubric: Match the approved layout, hierarchy, spacing, and states.
446
- policy: blocking # or advisory
447
- ```
448
-
449
- Configure project defaults, then enable the gauntlet for a run:
450
-
451
- ```yaml
452
- quality:
453
- enabled: false # keep opt-in, or make it the project default
454
- policy: blocking
455
- maxRounds: 3
456
- maxMinutes: 60
457
- consistencyChecks: 2
458
- maxParallelCandidates: 2
459
- critic: { agent: codex, model: gpt-5.6-sol } # model required for --candidates
460
- repair: { agent: claude }
461
- ```
462
-
463
- ```bash
464
- yoke loop run . --quality --quality-rounds=3 --quality-minutes=60
465
- yoke loop run . --quality --candidates=2 # blind pairwise selection; stories need quality declarations
466
- ```
467
-
468
- The critic compares opaque candidate/reference labels, writes schema-validated provenance, and
469
- cannot modify the project. Blocking findings enter a bounded repair loop and rerun every mechanical
470
- gate; advisory findings are retained without blocking. `--quality-policy=`, `--no-quality`, and
471
- `--quality-unbounded` override defaults for one run. Unbounded mode is explicit and warned because
472
- it removes repair limits, not Yoke's watchdog, isolation, verification, or commit safety.
473
-
474
- State lives **outside the model context** — the PRD file plus git — so each iteration is fresh.
475
- Use `yoke change add` at any time. Its ignored append-only inbox is consumed at the next story
476
- boundary. A separate coverage pass must confirm that every requested outcome maps to behavioral
477
- criteria before Yoke appends and commits the new stories; existing stories are never rewritten and
478
- no restart is needed.
479
-
480
- ### Watching a run
481
-
482
- Every iteration emits token-free, harness-side feedback (Node console + local files — **zero agent tokens**):
483
-
484
- - **Live console with progress + ETA** —
485
- `▶ S6 (19/45 · 42%) — implementing… · ~1h44m left (Ø 4m/story)` … `✓ S6 done in 4m28s — 20/45 (44%) · ~1h40m left`.
486
- The estimate uses the **average duration of stories completed in this run** (current
487
- velocity); before the first story lands it falls back to the recorded history of previous
488
- runs (`.yoke/story-durations.json`, last 50 stories, gitignored). No data yet → no estimate,
489
- never a made-up one.
490
- - **`.yoke/loop-status.json`** — the current state (now including `percent` and an `eta`
491
- block); read it any time with `yoke loop status`:
492
- ```
493
- Loop: RUNNING on S6 "Weekly digest"
494
- implementing · iteration 20 · 19/45 (42%) · updated 30s ago
495
- ~1h44m remaining (Ø 4m/story)
496
- ```
497
- - **Parallel + quality detail** — active workers include provider, candidate ID, worktree,
498
- lifecycle, phase, quality round, and repair budget; the integrator is shown separately.
499
- - **`.yoke/loop.log`** — an append-only timeline of every phase transition.
500
- - **`--json`** — machine mode for supervisors: every status write is *also* emitted as one
501
- NDJSON line on stdout (`{"type":"status","state":"running","phase":"verifying",…}` — the
502
- same shape as `loop-status.json`), the human narrative moves off stdout (the final summary
503
- goes to stderr), and a consumer can follow the stream line by line instead of polling the file.
504
- Provider JSON streams are also accounted: statuses (file + stream) carry cumulative input and
505
- output tokens for the whole run plus provider-reported cache-read, cache-write, reasoning, model,
506
- and cost fields when available. Missing values stay absent—Yoke does not estimate them.
507
-
508
- ### Pausing a run
509
-
510
- Drop a **`.yoke/loop.pause`** file (contents irrelevant) while the loop is running and it
511
- stops at the **next story boundary** — the running story still finishes, verifies, and
512
- commits; no story is ever cut off mid-flight. The loop consumes the pause file, writes
513
- `state: "paused"` to `loop-status.json` (log label `paused`), releases the lock, and exits
514
- with code `3`. Resume by simply running `yoke loop run` again.
515
-
516
- A per-iteration **idle timeout** guards against a genuinely hung agent: if the agent produces
517
- **no output at all** for `--timeout` minutes (default 20; `0` disables), the loop kills it
518
- (SIGTERM→SIGKILL) and marks the story blocked. A slow-but-working agent that keeps streaming
519
- output is **never** killed — the output stream *is* the liveness signal. Set a project default
520
- with `loop.timeoutMinutes` in `.yoke/config.yaml`.
521
-
522
- ### Decision policy: autonomous by default, interrupt only when configured
523
-
524
- Planning questions happen before the loop. The provider-neutral `yoke-workflow` skill asks only
525
- questions whose answer materially changes product behavior, scope, architecture, security, data
526
- ownership, external cost, or an irreversible choice. It saves the approved brief in
527
- `.yoke/plan.md`; `yoke prd draft` consumes it, and `yoke prd check` rejects explicit unresolved
528
- placeholders such as `TBD`.
529
-
530
- The unattended loop then follows `loop.decisionPolicy`:
531
-
532
- ```yaml
533
- loop:
534
- enabled: true
535
- decisionPolicy: critical # or auto
536
- runner:
537
- agent: codex # setup chooses the current host by default
538
- ```
539
-
540
- - **`auto` (default):** routine ambiguity and implementation details are resolved using the
541
- approved plan, acceptance criteria, current code, and project conventions. The loop does not
542
- ask follow-up questions.
543
- - **`critical`:** routine choices are still resolved automatically. Only high-impact decisions
544
- involving public architecture, security/privacy, destructive migration or data loss, material
545
- external cost, legal/compliance exposure, or another irreversible choice may pause the story.
546
- The agent writes a schema-validated request; the loop blocks before verify and preserves it as
547
- `.yoke/pending-decision.yaml`.
548
-
549
- Inspect and answer a critical stop:
550
-
551
- ```bash
552
- yoke loop decision .
553
- yoke loop answer . --choice=A --rationale="Matches the existing identity model"
554
- ```
555
-
556
- `answer` validates the choice against the still-open story, appends it to
557
- `.yoke/context/DECISIONS.md`, commits only that file using the configured human identity, clears
558
- the pending request, and resumes the same story with the original runner, isolation, review,
559
- permission, timeout, JSON, decision-policy, and iteration settings intact. Add
560
- `--no-resume` when a supervisor should restart the loop separately. If the automatic restart
561
- cannot begin because a provider/reviewer is unavailable or another process owns the lock, run
562
- `yoke loop resume .`; its request-bound options are retained under Git's private state directory
563
- until a loop actually runs. To intentionally abandon an orphaned or stale private resume state,
564
- use `yoke loop resume . --discard`; pending decisions are never deleted by that command. Existing
565
- `loop.onAmbiguity: resolve|abort` and `--on-ambiguity=` remain supported as compatibility aliases;
566
- new projects should use `decisionPolicy: auto|critical`.
567
-
568
- ### Adaptive model routing
569
-
570
- `yoke setup` enables routing by default and preserves explicit opt-outs. Without configured
571
- worker profiles, automatic execution keeps the selected parent. When enabled, the selected
572
- parent remains the strong planner/controller. Before each bounded story it receives only the
573
- story, acceptance criteria, and at most three eligible worker profiles, then returns one
574
- machine-readable choice. The worker can be a cheaper/faster Claude, Codex, or Gemini profile;
575
- `SELF` keeps difficult work on the parent. Explicit project rules skip the controller.
576
- Loop runners disable native delegation in Codex, Claude and Gemini so it cannot multiply
577
- the Yoke worker budget. Integration retains its execution slot until the candidate lands.
578
-
579
- **Provider support:** adaptive routing uses Yoke's shared provider adapter and works with Claude
580
- Code, Codex CLI, and Gemini CLI, including mixed-provider worker lists. Internal contract tests
581
- cover invocation and routing behavior for all three providers. The measured performance evidence
582
- below is intentionally **Codex-only**; it does not claim equivalent Claude or Gemini savings
583
- until authenticated, repeated in-the-wild runs exist for those providers.
584
-
585
- ```yaml
586
- runner:
587
- agent: codex
588
- model: gpt-5.6-sol # optional; provider model strings stay opaque to Yoke
589
- reasoningEffort: high
590
- routing:
591
- enabled: true # new setup default; false preserves an explicit opt-out
592
- strategy: balanced # balanced | cost | speed | quality
593
- maxCandidates: 3
594
- workers:
595
- - id: codex-light
596
- agent: codex
597
- reasoningEffort: low
598
- costTier: medium
599
- capabilities: [exploration, implementation, tests]
600
- - id: claude-fast
601
- agent: claude
602
- model: haiku # rolling alias; omit to use the provider's current default
603
- reasoningEffort: low
604
- costTier: low
605
- capabilities: [mechanical-edits, tests]
606
- - id: gemini-auto
607
- agent: gemini # omitted model means the account's current Auto/default route
608
- costTier: low
609
- capabilities: [large-context, implementation]
610
- ```
611
-
612
- Use `yoke loop run . --routing` to explicitly require configured routing or `--no-routing` for a controlled
613
- baseline. Routing control calls are read-only and deliberately tiny; malformed output or no
614
- eligible worker falls back to `SELF`. Yoke does not ship a universal, fast-aging
615
- "intelligence score". Candidate model IDs come from project configuration while setup defaults
616
- prefer rolling aliases or provider Auto/defaults. A per-user registry learns only from Yoke's
617
- independent verify/performance/audit/review gates, keyed by worker + provider + model/effort and expired
618
- after 30 days. It stores no prompts, source, or project paths—only a project hash and aggregate
619
- time/token/outcome evidence. Writes are immutable one-event files, so concurrent Yoke instances
620
- cannot overwrite a shared registry file.
621
-
622
- Routing is not free: stories without a matching rule can add a controller call. Measure it
623
- on your own backlog rather than assuming a win. Routing now also runs within asynchronous
624
- parallel workers. Automatic parallelism starts at up to three workers when pending tasks declare
625
- write scopes; unknown scopes and configured tool actions keep execution serial. Isolation is
626
- on by default. Explicit `--parallel=N`, `--no-routing` and `--no-isolate` remain available.
627
- See [execution defaults and dashboard measurement details](docs/VERIFIED-PROJECTS.md#execution-defaults-in-180).
628
-
629
- ### Performance budgets: efficiency as a gate, not a style
630
-
631
- Clean code is the default (the `minimal-code` skill) — but when efficiency matters, "should
632
- be fast" is a vibe the loop cannot enforce. Yoke makes it mechanical, at two levels:
633
-
634
- - **Per story:** write the requirement as a **measurable acceptance criterion**
635
- ("imports 1M rows in < 2s, asserted by the bench test") and let your verify tests measure
636
- it — no new machinery needed.
637
- - **Per project:** wire a benchmark as a standing **perf gate** in `.yoke/config.yaml`:
638
-
639
- ```yaml
640
- perf:
641
- command: node bench/check-budget.mjs # exit 0 = within budget
642
- retries: 1 # benchmarks are noisy; same retry logic as verify
643
- ```
644
-
645
- The loop runs it **after verify** on every story (phase `perf`, with `YOKE_STORY` set); a
646
- red benchmark blocks the story — `story S6 exceeded its performance budget: p95 62ms > budget 50ms` —
647
- no matter how clean the diff was. The implementer prompt names the budget command, so the
648
- agent knows not to trade hot-path efficiency for style and never "simplifies away" an
649
- optimization without re-running the benchmark. The `performance` canon skill carries the
650
- method: profile first, optimize leaves not boundaries, commit benchmarks as tests, version
651
- the *why* of every optimization in `context/DECISIONS.md`.
652
-
653
- ### Artifact-backed gate output: compact context, complete local evidence
654
-
655
- Failed verify, executable-criterion, performance, configured custom-audit, and completion commands can emit thousands of
656
- low-signal lines. Yoke keeps the model-visible failure summary deterministic and bounded while
657
- preserving large raw stdout/stderr below `.yoke/artifacts/`:
658
-
659
- ```yaml
660
- output:
661
- previewBytes: 2048 # default: maximum compact preview bytes
662
- artifactThresholdBytes: 8192 # default: persist raw output only above this size
663
- ```
664
-
665
- The preview prioritizes errors, warnings, adjacent context, and final test summaries. Above the
666
- artifact threshold it also includes a project-relative path, byte count, and full SHA-256 digest,
667
- for example:
668
-
669
- ```text
670
- [full output: .yoke/artifacts/STORY-4/verify-0123abcd4567.log | 42810 bytes | sha256:0123...]
671
- ```
672
-
673
- An agent can read that ordinary file when the preview is insufficient; nothing is injected into
674
- later stories automatically. Repeated identical failures reuse the same content-addressed path.
675
- Successful gate output is discarded as before. This affects only commands executed by Yoke's own
676
- gates. It does **not** intercept tool output generated internally by Claude Code, Codex, or Gemini,
677
- so benchmark ratios for this feature are not provider-token or billing claims.
678
-
679
- Command capture is capped at 16 MiB per stdout/stderr stream. Exceeding that quota fails the gate
680
- closed and stores the captured prefix with a `[truncated output: ...]` marker; Yoke never labels
681
- partial evidence as full output.
682
-
683
- Yoke treats `.yoke/artifacts/` as local, non-committable runtime state and excludes it from its
684
- clean-tree and story-commit operations; `yoke retrofit` also adds it to `.gitignore`. Raw command output is intentionally stored
685
- without redaction so it remains valid evidence and may therefore contain credentials, personal
686
- data, or other sensitive text emitted by project commands. Inspect artifacts before sharing them.
687
-
688
- The loop trusts **verify**, not the agent's exit code: a story whose tests are green is
689
- committed even if the agent process exited non-zero (a common Windows `.cmd`-wrapper ghost).
690
- A failing verify is retried up to `verify.retries` times (default 1) so a transient flake
691
- self-heals while a real failure still blocks. Structured acceptance criteria are then verified
692
- individually; an unrelated green suite cannot satisfy a criterion without its proof command.
693
-
694
- `.yoke/loop-status.json`, `.yoke/loop.log`, `.yoke/loop.lock`, its takeover/recovery leases, lock/decision temp files, `.yoke/story-durations.json`,
695
- `.yoke/ambiguity.md`, `.yoke/artifacts/`, and the critical-decision request/answering files are runtime artifacts;
696
- `yoke retrofit` gitignores them (along with
697
- `.yoke/worktrees/`, `.yoke/backup/`, `.yoke/proof/`, and `.yoke/changes/`) so they never trip the clean-tree gate.
698
-
699
- ### Single-flight guard + cleanup
700
-
701
- Two concurrent `yoke loop run`s would race on the PRD and status files, so the loop takes a
702
- **lock** (`.yoke/loop.lock`) for the duration of a run. Complete lock metadata is published atomically;
703
- stale takeover is serialized by `.yoke/loop.lock.takeover`. A second invocation exits `2` with
704
- `Another loop is already running here (pid …). If that is wrong, run: yoke loop cleanup`. A lock
705
- whose holder process is dead is taken over automatically (with a warning).
706
-
707
- **`yoke loop cleanup [dir]`** reaps only runner process trees recorded by this project and removes
708
- a stale lock. Yoke-created worktrees are **retained by default** and listed in the output; pass
709
- `--remove-worktrees` to remove `.yoke/worktrees/*` with `git worktree remove --force` + `prune`.
710
- User-created worktrees are never touched. A live lock is reported and left alone. Exits `0` when
711
- cleanup succeeds, `1` if any requested removal fails. If a machine/process crash leaves the cleanup
712
- recovery lease itself behind, an operator can run
713
- `yoke loop cleanup . --discard-stale-recovery`; Yoke refuses while its recorded PID is alive, and
714
- the force flag must not be run concurrently.
715
-
716
- ## 🔍 Cross-model review (`yoke review`)
717
-
718
- Outside the loop, `yoke review` has a **second** model review your current diff as a
719
- pass/fail gate — the interactive counterpart to the loop's `--review`/`--reviewer`.
720
-
721
- ```bash
722
- yoke review . # review the uncommitted working tree
723
- yoke review . --base=main # review the range main..HEAD instead
724
- yoke review . --reviewer=codex # force a specific reviewer
725
- yoke review . --focus="the auth layer" # steer what it scrutinises
726
- ```
727
-
728
- - **Reviewer resolution** — picks the first available of **codex → gemini → claude**,
729
- preferring a model *other* than the one you drive so the review is genuinely cross-model.
730
- On a Claude-only machine it degrades to a self-review (and says so).
731
- - **Scope** — the uncommitted working tree by default, or a commit range with `--base=<ref>`.
732
- - **Exit-code gate** — exits `0` when the reviewer approves, `1` when it finds a blocking
733
- issue, `2` when no (or an unavailable) reviewer CLI is found. Chain it: `... && yoke review`,
734
- or wire it into a pre-push hook.
735
- - Runs through the same idle-timeout watchdog as the loop (`--timeout`, default 20 min).
736
-
737
- ## 🎨 Visual & design verification — done, with a photo
738
-
739
- Unit tests don't catch a blank page, an unwired route, or generic AI-slop design. Yoke adds three things:
740
-
741
- - **`yoke design-scan [dir]`** — a static scanner for the visual *tells* of AI-generated UIs
742
- (AI-purple gradients, gradient hero text, neon glow, emoji-as-icons, gradient overload). It
743
- scores findings and **exits non-zero over budget** (`--max`, default 4; `--report` to list only),
744
- so it drops straight into your verify pipeline.
745
- - **`yoke flow-smoke [dir]`** — a built-in browser gate with **proof artifacts** (below).
746
- - **`unslop-ui` + `visual-verification` skills** — the design rubric, plus how to compose a verify
747
- pipeline (`types → units → design-scan → flow-smoke`).
748
-
749
- Retrofit adds `design: { mode: auto, max: 4 }` when it detects UI dependencies, UI source files,
750
- or configured smoke flows. In `auto` mode the loop runs the design scan after functional verify and
751
- before performance/audit; `on` forces it for any project and `off` disables it. Existing explicit
752
- settings are preserved. `flow-smoke` remains an explicit project verify step because Yoke cannot
753
- infer how to start each application's server.
754
-
755
- `unslop-ui` is the visual-design skill. `no-ai-slop` is separate: it reviews prose for generic AI
756
- patterns and edits only confirmed problems while preserving meaning and voice.
757
-
758
- *Tell set informed by the MIT-licensed [vibecoded-design-tells](https://github.com/JCarterJohnson/vibecoded-design-tells) research.*
759
-
760
- ### `yoke flow-smoke [dir] [--url=<baseUrl>] [--label=<name>]`
761
-
762
- Configure your key user flows once in `.yoke/config.yaml`:
763
-
764
- ```yaml
765
- smoke:
766
- baseUrl: http://localhost:3000
767
- flows:
768
- - name: home
769
- path: /
770
- landmark: "main h1" # optional CSS selector to wait for
771
- - name: login
772
- path: /login
773
- ```
774
-
775
- For every flow, `yoke flow-smoke` loads the route against the running dev server, waits for the
776
- landmark, and fails on a non-OK response or **any console/page error**. The proof contract:
777
-
778
- - **Screenshots always** — every flow (pass *or* fail) saves `.yoke/proof/<label>/<flow>.png`;
779
- the failure screenshot *is* the evidence.
780
- - **Video only on failure** — each flow is recorded, but the clip is kept only when the flow
781
- goes red (`<flow>.webm`); green runs delete it.
782
- - **Labelled per story** — inside the loop, verify runs with `YOKE_STORY=<story-id>`, so proofs
783
- land in `.yoke/proof/<story-id>/` automatically. Standalone runs use `latest`, or pass
784
- `--label=`. The label dir is wiped per run — evidence is always from the latest run.
785
- - **Exit codes** — `0` all flows green (chain it: `... && yoke design-scan . && yoke flow-smoke .`),
786
- `1` any flow failed, `2` not runnable (no `smoke:` config, or Playwright missing).
787
- - **Playwright comes from the *target project*, never Yoke** —
788
- `npm i -D playwright && npx playwright install chromium` there. Start the dev server before
789
- verify (e.g. via `start-server-and-test`); `--url=` overrides `baseUrl`.
790
-
791
- `.yoke/proof/` is gitignored by the retrofit — proofs are runtime artifacts and never break the
792
- loop's clean-tree gate.
793
-
794
- ## 🧠 Context layer (`.yoke/context/`)
795
-
796
- Yoke keeps durable, cross-session context so a fresh-context agent is never blind:
797
-
798
- - `PROJECT.md` — the north star (goal, constraints, non-goals, success criteria).
799
- - `DECISIONS.md` — an append-only ledger. The loop adds an entry per completed story; you and agents add the *why*.
800
- - `KNOWLEDGE.md` — reusable gotchas and conventions.
801
- - `GLOSSARY.md` — the project's canonical terms, meanings, and aliases.
802
- - `CONTEXT-MAP.md` — optional bounded-context relationships for projects that need domain mapping.
803
-
804
- `yoke retrofit` scaffolds the four core files non-destructively; your edits are never overwritten.
805
- It reports `CONTEXT-MAP.md` when the optional file already exists.
806
- The loop reads them into every agent + reviewer prompt and logs decisions back on each story's
807
- commit. Decision history is explicitly delimited as untrusted reference data, so stored text is
808
- never treated as fresh instructions. Manage the files directly with `yoke context init` and `yoke context status`. The
809
- `maintaining-context` skill teaches agents to honour the same files during interactive work.
810
-
811
- > Commit `.yoke/context/` to git. The `--isolate` loop runs each iteration in a worktree
812
- > checked out from HEAD, so it only sees committed context.
813
-
814
- ## 🛡️ Safety model
815
-
816
- Yoke's guardrails are **mechanical, not advisory** — the loop blocks on a dirty worktree, missing acceptance criteria, red tests, or a reviewer rejection, and **none of them rely on the agent choosing to behave**.
817
-
818
- - **Commit integrity** — a story is never recorded `passes: true` without a corresponding commit; a failed commit reverts the PRD.
819
- - **Role separation** — the implementer never reviews its own work; `--reviewer` can even be a different agent.
820
- - **Isolation** — with `--isolate`, failed or partial work is discarded with the worktree and never reaches your main tree.
821
- - **Non-destructive retrofit** — existing files are backed up before any change; settings are merged, not replaced.
822
- - **Independent verification** — "done" means *your test command exits 0*, not "the agent said so".
823
- - **Single-flight** — a lock prevents two loops from racing the same repo; `yoke loop cleanup` recovers after crashes.
824
-
825
- ## 🧠 Choose your code-graph
826
-
827
- `yoke retrofit --code-graph=graphify|serena` (default `graphify`, remembered per project). The `yoke-retrofit` skill asks and recommends based on the project.
828
-
829
- | | **graphify** | **Serena** |
830
- |---|---|---|
831
- | Engine | tree-sitter AST + graph | real language servers (LSP) |
832
- | Strength | fast, multimodal (code + PDFs + images) | symbol-exact cross-file refactoring |
833
- | Token efficiency | ~70× reduction on large mixed repos | standard, no index to go stale |
834
- | Best for | rapid exploration / migration / onboarding | systematic refactoring in typed codebases |
835
- | Caveat | heuristic edges; static index can go stale | one language server per language |
836
-
837
- ## 🪙 Token efficiency
838
-
839
- Yoke attacks tokens on two complementary surfaces:
840
-
841
- - **rtk** compresses noisy command/tool output before it enters context (wired as a hook/instruction per agent).
842
- - The **`minimal-code`** skill installs a YAGNI / "lazy senior dev" ladder so agents write the least code that solves the task — fewer output tokens, smaller review surface. *(Adapted from the MIT-licensed [ponytail](https://github.com/DietrichGebert/ponytail) ruleset.)*
843
-
844
- A Codex-only full-repository study ran three alternating-order pairs per arm. The same Sol parent
845
- completed all 12 stories and all **36/36 hidden acceptance checks**; with routing enabled, a Sol
846
- controller selected Luna for every bounded implementation story. Including controller overhead,
847
- the routed median used **33.8% less wall time, 11.0% less fresh input, 49.5% fewer output tokens,
848
- and 78.2% fewer reasoning tokens**. All three pairs improved wall time and fresh input.
849
-
850
- The boundary matters: an earlier architecture/privacy task correctly stayed on `SELF` and paid
851
- controller overhead, so the routing default is not evidence of universal savings. Codex did not
852
- emit dollar cost for these plan-backed runs; Yoke reports the measured token breakdown instead of
853
- inventing a price. Method, ranges, controller cost, caveats, analyzer, and six raw JSON rows are in
854
- [`bench/RESULTS.md`](bench/RESULTS.md#codex-only-full-repository-routing-study-2026-08-02).
855
-
856
- ## 🧩 Optional companions
857
-
858
- Two external tools pair well with Yoke and are documented (not bundled) in `canon/tools/` — each has its own installer and update cadence, so Yoke wires the boundary instead of vendoring a copy:
859
-
860
- - **[claude-mem](https://github.com/thedotmack/claude-mem)** — persistent cross-session memory for interactive work. Deliberate boundary: the autonomous loop keeps its memory **explicit and versioned** (`context/*.md` + PRD, fresh context per story), so claude-mem's automatic injection stays out of loop runs.
861
- - **[ui-ux-pro-max](https://github.com/nextlevelbuilder/ui-ux-pro-max-skill)** — data-driven design intelligence (styles, palettes, industry rules) for the *generation* side. Yoke's `unslop-ui`, `design-scan`, and `visual-verification` remain the *verification* side: generate with pro-max, gate with Yoke.
862
-
863
- ## 🌱 Why & how it was built
864
-
865
- **The problem.** Coding agents are powerful, but each speaks its own dialect — Claude has skills and hooks, Codex reads `AGENTS.md` and a TOML config, Gemini wants commands and a settings file. Keeping the same skills, safety policy, and tool wiring consistent across all of them means copy-paste drift and three things to maintain. Yoke exists to keep **one** source of truth, generate the right native artifacts for each agent, and let that harness run **autonomously and safely** when you want to hand it a spec and walk away.
866
-
867
- **The inspiration.** Yoke is a synthesis of ideas already proven across the ecosystem: composable-skills methodology ([superpowers](https://github.com/obra/superpowers), [gstack](https://github.com/garrytan/gstack)); the portable [AGENTS.md](https://agents.md/) standard; the *"one source-of-truth → idiomatic per-harness artifacts"* generation pattern ([wshobson/agents](https://github.com/wshobson/agents)); spec-driven autonomous orchestration (GSD); mechanical safety gates and role separation (safe-agentic-workflow); and the **Ralph loop** (Geoff Huntley) — keep handing a *fresh* agent the next task until the spec is done. Token efficiency comes from [rtk](https://github.com/rtk-ai/rtk) and the write-less-code idea behind [ponytail](https://github.com/DietrichGebert/ponytail).
868
-
869
- **How it was built.** Yoke was built the way it's meant to be *used* — agent-driven, incremental, and test-first. The stack was chosen by **researching alternatives first** (which is how `jcodemunch` was dropped for its license and Serena was added as an option). Then every component shipped one small piece at a time through a disciplined loop: **brainstorm → spec → plan → TDD implementation → an independent two-stage review** (does it match the spec? is it well-built?) **→ merge**. Those reviews caught real bugs before they shipped — a Windows `.cmd` spawn failure, a commit-integrity hole, a path-traversal that could delete project data, a resolution bug that broke the CLI's default invocation, a TOML-escaping bug. Yoke was even **dogfooded on its own repo**, which surfaced (and fixed) a genuine Windows bug. Every spec and plan lives in [`docs/superpowers/`](docs/superpowers/).
870
-
871
- ## 🗂️ Project layout
872
-
873
- ```text
874
- canon/ # the source of truth — harness-agnostic
875
- AGENTS.md skills/ policy/ loop/ tools/ manifest.yaml
876
- src/
877
- canon/ # manifest schema + validator (yoke validate)
878
- change/ # append-only change inbox · planning · independent coverage review
879
- retrofit/ # detect · plan · apply · planners (claude/codex/gemini) · tools
880
- loop/ # prd · gates · runner · verify · git/worktree · loop · run-command · lock · cleanup
881
- quality/ # reference collection · blind critic · bounded repair · candidate comparison
882
- new/ # yoke new — greenfield bootstrap
883
- prd/ # yoke prd draft|check — idea → stories + lint gate
884
- review/ # yoke review — cross-model diff gate
885
- smoke/ # yoke flow-smoke — browser gate with screenshot/video proofs
886
- scan/ # yoke design-scan — AI-slop design gate
887
- context/ # the durable context layer
888
- docs/superpowers/ # the spec and every component's implementation plan
889
- ```
890
-
891
- ## 🗺️ Roadmap
892
-
893
- Completed release work lives in the changelog. Remaining, explicitly scoped work is tracked in
894
- [`TODOS.md`](TODOS.md), including broader benchmark samples, native output schemas, and signed
895
- release provenance.
896
-
897
- ## 🧪 Development
898
-
899
- ```bash
900
- npm test # vitest (1174 tests)
901
- npm run build # tsc, no emit errors
902
- npm run yoke -- validate canon
903
- ```
904
-
905
- ## 🙏 Credits & inspiration
906
-
907
- Yoke stands on the shoulders of a great ecosystem: methodology ideas from [superpowers](https://github.com/obra/superpowers) and [gstack](https://github.com/garrytan/gstack); the [AGENTS.md](https://agents.md/) standard; the generator pattern from [wshobson/agents](https://github.com/wshobson/agents); the Ralph autonomous-loop pattern; safety-gate thinking from safe-agentic-workflow; and the wired tools [rtk](https://github.com/rtk-ai/rtk), [graphify](https://github.com/safishamsi/graphify), [Serena](https://github.com/oraios/serena), and [Playwright MCP](https://github.com/microsoft/playwright-mcp). The `minimal-code` skill adapts the MIT-licensed [ponytail](https://github.com/DietrichGebert/ponytail) ruleset.
908
-
909
- ## 📄 License
910
-
911
- MIT — see [`LICENSE`](LICENSE).
912
-
913
- <div align="center">
914
- <sub>Built with a disciplined loop: brainstorm → spec → plan → TDD → two-stage review → merge — and reviewed by a second model, because we don't trust "done" either.</sub>
915
- </div>
1
+ <div align="center">
2
+
3
+ <h1><img src="https://raw.githubusercontent.com/HECer/yoke/v1.13.0/docs/assets/yoke-logo.png" alt="Yoke" width="100" height="63"></h1>
4
+
5
+ <!-- yoke:version:start -->1.13.0<!-- yoke:version:end -->
6
+ <!-- yoke:tests:start -->1231<!-- yoke:tests:end -->
7
+ <!-- yoke:skills:start -->34<!-- yoke:skills:end -->
8
+ <!-- yoke:agents:start -->Claude | Codex | Gemini | Qwen | OpenCode | Kilo | Pi<!-- yoke:agents:end -->
9
+
10
+ ### One harness, seven agents — and zero trust in "done."
11
+
12
+ **Yoke** installs one curated canon of skills, **mechanical safety gates**, and tool wiring into any project — natively for **Claude Code, OpenAI Codex CLI, Gemini CLI, Qwen Code, OpenCode, Kilo, and Pi coding agent**. Its opt-in loop implements and verifies stories before committing. Independent review and browser proofs run when configured; screenshots and videos require the browser smoke gate.
13
+
14
+ [![npm](https://img.shields.io/npm/v/%40hecer%2Fyoke?logo=npm&color=CB3837)](https://www.npmjs.com/package/@hecer/yoke)
15
+ [![npm downloads](https://img.shields.io/npm/dm/%40hecer%2Fyoke?logo=npm)](https://www.npmjs.com/package/@hecer/yoke)
16
+ [![CI](https://github.com/HECer/yoke/actions/workflows/ci.yml/badge.svg)](https://github.com/HECer/yoke/actions/workflows/ci.yml)
17
+ [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](#-license)
18
+ ![Node](https://img.shields.io/badge/node-%E2%89%A520-339933?logo=node.js&logoColor=white)
19
+ ![TypeScript](https://img.shields.io/badge/TypeScript-3178C6?logo=typescript&logoColor=white)
20
+ ![Tests](https://img.shields.io/badge/tests-1231%20defined-blue.svg)
21
+ ![Agents](https://img.shields.io/badge/agents-Claude%20%7C%20Codex%20%7C%20Gemini%20%7C%20Qwen%20%7C%20OpenCode%20%7C%20Kilo%20%7C%20Pi-8A2BE2)
22
+ ![Built with TDD](https://img.shields.io/badge/built%20with-TDD%20%2B%20review-ff69b4.svg)
23
+
24
+ **Install:** [`npm i -g @hecer/yoke`](https://www.npmjs.com/package/@hecer/yoke)
25
+
26
+ </div>
27
+
28
+ > **TL;DR** — `yoke setup .` asks six questions and installs the native harness for your agent. `yoke new my-app --idea="..."` bootstraps a project and drafts its story backlog. `yoke loop run my-app --isolate --review` then implements it behind hard gates: **clean tree → acceptance criteria → your real tests green → an independent model approves → commit**. Add `--parallel=N` for dependency-aware workers, or declare a reference and add `--quality` for a bounded critic/repair gauntlet. If any blocking gate is red, nothing is committed. Proof lives in `.yoke/proof/<story>/`.
29
+
30
+ **New in 1.13.0:** first-class [OpenCode, Kilo and Pi integrations](docs/HARNESSES.md), including native headless invocation, provider/model/variant routing, retrofit artifacts, role configuration and provider telemetry. [Qwen Code hardening and explicit DeepSeek/Kimi API model profiles](docs/QWEN-MODEL-SUPPORT.md) remain available. Since 1.10.0, Yoke also includes [dashboard search, filters and period comparisons](docs/DASHBOARD-EVOLUTION.md), [batch task assessments with separate planning models](docs/CAPABILITY-ROUTING.md), and [Windows sandbox preflight and process supervision](docs/WINDOWS-RUNNER-VALIDATION.md). Existing routing settings remain authoritative. See the [changelog](CHANGELOG.md) and the [harness integration guide](docs/HARNESSES.md) for limitations and setup.
31
+
32
+ OpenCode, Kilo and Pi are real CLI integrations, not bundled runtimes or credentials. OpenCode/Kilo use their JSON headless modes and local MCP configuration; Pi uses JSONL and explicit tool allowlists, but has no native MCP, sub-agent or plan layer. Read the [integration guide](docs/HARNESSES.md) before selecting a permission profile.
33
+
34
+ ### One dashboard, multiple projects
35
+
36
+ ```sh
37
+ npm install -g @hecer/yoke@latest
38
+ yoke projects add /path/to/frontend
39
+ yoke projects add /path/to/backend
40
+ yoke dashboard --no-register
41
+ ```
42
+
43
+ Open the printed `http://127.0.0.1:...` URL. Each registered project has its own goals, tasks and evidence. The dashboard shows available worker state, per-task duration estimates, planned start offsets, input/output tokens, costs and unknown measurements. You can request a goal pause at a safe boundary.
44
+
45
+ The dashboard includes attention-first project search and filters, restorable view links, and usage comparisons against the preceding period. See [dashboard behavior and measurement limits](docs/DASHBOARD-EVOLUTION.md).
46
+
47
+ Projects are registered explicitly; this version does not automatically discover every process or aggregate other computers. Start/resume and budget changes use the CLI. Missing history appears as unknown; time ranges are empirical estimates, not exact deadlines.
48
+
49
+ ### Verified goals and efficient execution
50
+
51
+ ```sh
52
+ yoke check /path/to/project --json
53
+ # First define executable criteria and protected tests in .yoke/acceptance.yaml.
54
+ yoke goal set /path/to/project --objective="Complete guest checkout" --attempts=3 --minutes=30
55
+ yoke goal run /path/to/project --runner=codex
56
+ yoke goal resume /path/to/project --runner=claude
57
+ yoke goal handoff /path/to/project
58
+ ```
59
+
60
+ Goals persist their objective, attempts and check evidence across runs. Changed protected tests block acceptance; failed work is retained. Explicit routing rules bypass controller calls, configured tool actions use no model, and failed rule-based attempts can escalate to a stronger worker. Context selection stays within a character budget; declared write scopes and dependencies guide parallel scheduling.
61
+
62
+ See the [1.7 workflow guide](docs/VERIFIED-PROJECTS.md) for setup, Gemini selection, recovery and budgets. Provider contracts do not establish equal model quality; live comparative savings and calibrated time predictions remain unmeasured. Token budgets apply between provider calls, and browser proofs still require a configured smoke gate.
63
+
64
+ Yoke 1.5 keeps failed gate output compact without throwing evidence away: deterministic previews
65
+ retain actionable failures and final summaries, while large complete stdout/stderr remains available
66
+ in private, content-addressed local artifacts. Existing projects keep their serial behavior and use
67
+ safe 2 KiB preview / 8 KiB artifact defaults unless configured otherwise.
68
+
69
+ Yoke 1.4 introduced opt-in parallel workers and a bounded, reference-driven quality gauntlet.
70
+ Yoke 1.8.0 uses automatic parallelism for tasks with declared write scopes. See [the 1.4 migration guide](docs/MIGRATING-TO-1.4.md)
71
+ for the new flags, configuration, cleanup behavior, and review-verdict contract.
72
+
73
+ Yoke 1.1 is safe-by-default: provider CLIs use autonomous sandbox profiles unless `--unsafe`
74
+ is explicit; reviews require a schema-valid verdict and a different model unless
75
+ `--allow-self-review` is explicit; commits enforce the human identity from project config or Git.
76
+ See [the 1.1 migration guide](docs/MIGRATING-TO-1.1.md) for setup/decision parity and
77
+ [the 1.0 guide](docs/MIGRATING-TO-1.0.md) for the earlier safety-policy changes.
78
+
79
+ ---
80
+
81
+ ## Qwen Code, DeepSeek and Kimi
82
+
83
+ Qwen Code supports Yoke's setup, routing, planning and review workflows. New Qwen
84
+ setups use your configured model. To add DeepSeek and Kimi API model profiles:
85
+
86
+ ```sh
87
+ yoke setup . --yes --agent=qwen --runner=qwen --model-provider=deepseek,kimi
88
+ ```
89
+
90
+ Set `DEEPSEEK_API_KEY` and `MOONSHOT_API_KEY` in the environment. Presets include
91
+ DeepSeek V4 Flash/Pro and Kimi K2.6/K2.7 Code/K3, executed through Qwen Code.
92
+ See [setup, permissions, reasoning configuration and validation limits](docs/QWEN-MODEL-SUPPORT.md).
93
+
94
+ ## Why Yoke exists
95
+
96
+ Agentic coding in 2026 fails in four well-documented ways. Yoke answers each one **mechanically** — in code, not in a prompt the agent can ignore:
97
+
98
+ | The pain | What actually happens | What Yoke does about it |
99
+ |---|---|---|
100
+ | 🎭 **The verification gap** — *"agent says done, but it isn't"* | A success message can omit untested acceptance criteria. | The loop executes acceptance and project checks. Enabled review and browser gates must pass before a story lands. `yoke check` exposes unmapped outcomes as unverified. |
101
+ | 🔀 **Four agents, four configs** | Teams hand-maintain `CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, skills, and MCP wiring separately — copy-paste drift everywhere | **One canon → `yoke retrofit`** generates the idiomatic native artifacts for each agent. Change the canon once, re-retrofit everywhere. |
102
+ | 🌀 **Overnight loops going off the rails** | Raw Ralph-loop users "wake up to broken codebases that don't compile" | Yoke is **"Ralph, but with gates"**: clean-worktree gate, acceptance-criteria gate, green-tests gate, review gate, per-story worktree isolation, idle-timeout watchdog, single-flight lock, commit integrity. |
103
+ | 😵 **Review fatigue** | AI adoption nearly doubles PR volume and review time; humans start skimming | **`yoke review`**: a second model writes a schema-validated pass/fail verdict — chainable into verify, pre-push, or CI. Cross-model review catches what self-review misses. |
104
+
105
+ **Who it's for:** anyone driving Claude Code, Codex CLI, Gemini CLI, Qwen Code, OpenCode, Kilo or Pi on real projects — especially if you use more than one, want autonomous runs you can trust, or are tired of "done" meaning "probably". Greenfield (`yoke new`) and brownfield (`yoke retrofit`) both work.
106
+
107
+ **Who it's not for:** if you want a chat pair-programmer with no process, you don't need a harness. Yoke is for shipping with discipline.
108
+
109
+ ## Example: idea → verified implementation
110
+
111
+ ```console
112
+ $ yoke new reading-app --idea="a web app that tracks my reading list"
113
+ ✓ reading-app bootstrapped. # git repo · harness for all agents · context · PRD drafted from the idea
114
+
115
+ $ yoke prd check reading-app
116
+ ✓ PRD valid — 8 stories, 0 pass
117
+
118
+ $ yoke loop on reading-app
119
+ $ yoke loop run reading-app --isolate --review --max=10
120
+ ▶ STORY-1 (0/8 · 0%) — implementing… · verifying… · reviewing… · committing…
121
+ ✓ STORY-1 done in 3m12s — 1/8 (13%) · ~22m left
122
+ ▶ STORY-2 (1/8 · 13%) — implementing… · ~22m left (Ø 3m12s/story)
123
+ ✓ STORY-2 done in 2m48s — 2/8 (25%) · ~18m left
124
+ ▶ STORY-3 (2/8 · 25%) — implementing… ✘ blocked: story did not verify (tests red)
125
+ # nothing was committed. fix, then re-run.
126
+
127
+ $ ls reading-app/.yoke/proof/STORY-2/
128
+ home.png list.png # example when browser smoke is configured
129
+ ```
130
+
131
+ This is an illustrative transcript. Actual durations depend on the project, provider, retries and enabled gates; browser proof requires a configured smoke flow. See [how it was built](#-why--how-it-was-built).
132
+
133
+ ## 🚀 Quickstart
134
+
135
+ ```bash
136
+ npm install -g @hecer/yoke # → global `yoke` on your PATH
137
+ # (or from source: git clone https://github.com/HECer/yoke.git && cd yoke && npm install && npm run build && npm link)
138
+
139
+ # Greenfield: idea → loop-ready project in one command
140
+ yoke new my-app --idea="a CLI that tracks reading lists"
141
+ yoke loop on my-app && yoke loop run my-app --isolate
142
+
143
+ # — or retrofit an existing project —
144
+ yoke setup /path/to/project # interactive: agents, graph, loop, runner, decisions, routing
145
+ yoke validate canon # sanity-check the canon
146
+ yoke loop run /path/to/project --isolate --parallel=3 --reviewer=codex --max=20
147
+ ```
148
+
149
+ > Requires Node ≥ 20 and git. No global install? `node /path/to/yoke/dist/cli.js …` or `npm --prefix /path/to/yoke run yoke -- …` work too. The MCP tools (rtk, graphify/Serena, Playwright MCP) are wired by Yoke but installed separately — the generated config is a clearly-labelled, adjustable template.
150
+
151
+ ### Skills before the first setup
152
+
153
+ The canon is also packaged as a Claude Code plugin — the repo is its own marketplace:
154
+
155
+ ```text
156
+ /plugin marketplace add HECer/yoke
157
+ /plugin install yoke@yoke
158
+ ```
159
+
160
+ That gives you all canon skills under the `yoke:` namespace (e.g. `yoke:tdd`, `yoke:review`) inside Claude Code — no retrofit needed. The `yoke` CLI (loop, gates, retrofit for Codex/Gemini/Qwen/OpenCode/Kilo/Pi) still comes from `npm i -g @hecer/yoke`. Gemini CLI users can likewise `gemini extensions install https://github.com/HECer/yoke`.
161
+
162
+ For Codex, no preinstalled skill is required: run `npx @hecer/yoke setup .` in a terminal, or
163
+ ask Codex to run the six-question Yoke setup flow. The retrofit writes native skills to
164
+ `.agents/skills/`, including `yoke-retrofit` and `yoke-workflow`; start a fresh Codex task if an
165
+ already-open task does not discover newly installed skills. The npm package also contains
166
+ `.codex-plugin/plugin.json` for Codex plugin hosts.
167
+
168
+ ### Staying up to date
169
+
170
+ Yoke checks for new releases npm/gh-style: a **non-blocking background check** (at most once a day, detached, offline-safe) prints a one-line hint when a newer version exists — upgrading itself is always an explicit act:
171
+
172
+ ```bash
173
+ yoke upgrade # npm install -g @hecer/yoke@latest
174
+ ```
175
+
176
+ Disable the check with `YOKE_NO_UPDATE_CHECK=1` (it is also silent in CI, `--json` runs, and piped output). Projects that want the loop to self-update can opt in via `.yoke/config.yaml`:
177
+
178
+ ```yaml
179
+ update:
180
+ auto: true # upgrade at loop START only — never mid-run; applies from the next invocation
181
+ ```
182
+
183
+ Auto-upgrade is deliberately **not** the default: a gate harness shouldn't change itself mid-project, and unreviewed auto-installs are a supply-chain hazard.
184
+
185
+ ## 🤖 Driving it through an agent
186
+
187
+ Yoke is meant to be operated *by* your coding agent — after a retrofit, the agent has the skills, the safety policy, and the routing, so it knows the methodology. Copy-paste prompts (identical wording works for Claude Code, Codex CLI, Gemini CLI, Qwen Code, OpenCode, Kilo, and Pi):
188
+
189
+ > **Set it up** — *"Set up Yoke in this project. Ask me the Yoke setup questions one at a time with your recommendation, then run `yoke setup . --yes` with the selected host, agents, code graph, loop, runner, and decision policy. Commit in my configured identity."*
190
+
191
+ > **Work the disciplined way** — *"From now on follow the Yoke skills you just installed: brainstorm → spec → plan → TDD → review before merging. Use the `review` skill before any merge."*
192
+
193
+ > **Plan, then run autonomously** — *"Use the `yoke-workflow` skill. Ask only the planning questions that materially change the product, write the approved plan and loop-ready stories, then execute every approved story without routine follow-ups. Follow the configured `auto` or `critical` decision policy."*
194
+
195
+ > **Watch / unblock** — *"Run `yoke loop status .`. If it says BLOCKED, run the project's verify command, find the root cause, fix it without weakening tests, then continue the loop."*
196
+
197
+ > ⚠️ **Long runs from inside an agent session:** `yoke loop run` has no story cap by default; it continues until every planned story passes or a gate blocks. A multi-story run can therefore outlive most agents' shell-tool timeouts (Claude Code's Bash tool defaults to 2 minutes). If the outer tool call is killed mid-run, you get a stale lock and possibly half-finished state — which *looks* like a hang. Run the loop **in the background** (e.g. Claude Code's `run_in_background`), use `--max=3..5` only when you intentionally want a bounded batch, poll with `yoke loop status`, and after any interrupted run do `yoke loop cleanup` before the next one. A `running` status with no update for 20+ minutes on a claude runner is worth checking — since 0.5.0 the runner streams continuously, so prolonged true silence is no longer normal.
198
+
199
+ > ⚠️ **Never kill agent processes by name or command-line pattern** (e.g. every process matching `dangerously-skip-permissions`): on a machine running several yoke projects, that takes down the *healthy* runners of the other projects mid-story — they stall and their loops block. `yoke loop cleanup` is the scoped alternative: each watchdog records its pids in the project's `.yoke/runner.pid`, and cleanup kills exactly those recorded trees — nothing else on the machine.
200
+
201
+ ### Agent cheat sheet — every command is an exit-code contract
202
+
203
+ Yoke's CLI is deterministic and chainable by design: an agent (or a shell `&&`) can branch on exit codes without parsing prose.
204
+
205
+ | Command | What it does | Exit codes |
206
+ |---|---|---|
207
+ | `yoke dashboard [dir] [--no-register] [--port=N]` | Local overview for every registered project; optionally register `dir` first | `0` stopped normally · `1` shutdown failure · `2` unavailable |
208
+ | `yoke projects add\|list\|remove` | Register a project, list registrations or remove a reference by ID | `0` · `2` invalid/unavailable |
209
+ | `yoke check [dir] [--json] [--requirement=] [--protect [--refresh]]` | Execute acceptance checks or explicitly pin their infrastructure | `0` passed/pinned · `1` failed · `2` unverified/unavailable |
210
+ | `yoke goal set\|run\|resume\|pause\|status\|handoff\|budget [dir]` | Durable objectives, provider handoff, protected checks and checkpoint budgets | run/resume: `0` complete · `1` unfinished · `2` unavailable |
211
+ | `yoke setup [dir] [--yes] [--host=] [--agent=] [--runner=] [--code-graph=] [--decision-policy=] [--loop\|--no-loop] [--routing\|--no-routing] [--model-provider=deepseek,kimi]` | Shared setup for all seven harnesses; optional DeepSeek/Kimi API profiles run through Qwen | `0` · `1` invalid setup |
212
+ | `yoke validate [canonDir]` | Validate the canon (schema, frontmatter, templates) | `0` valid · `1` errors |
213
+ | `yoke new <dir> [--idea=] [--agent=] [--runner=] [--loop]` | Greenfield bootstrap: git init → scaffold → retrofit → context → PRD (drafted from `--idea`) → committed | `0` · `1` usage / non-empty dir / draft failed (scaffold survives) · `2` draft agent unavailable |
214
+ | `yoke retrofit [dir] [--agent=claude,codex,gemini,qwen,opencode,kilo,pi\|all] [--code-graph=graphify\|serena] [--loop]` | Install/update the harness for the selected agents, non-destructively | `0` |
215
+ | `yoke prd draft [dir] --idea= [--runner=] [--force]` | Idea → 5–12 stories with testable acceptance criteria | `0` · `1` invalid/guarded · `2` agent unavailable |
216
+ | `yoke prd check [dir]` | PRD lint gate (schema, dependencies, cycles, duplicate ids, acceptance) | `0` valid · `1` violations |
217
+ | `yoke change add\|status [dir] [--idea=]` | Queue a change at any time; the loop turns it into append-only stories at the next safe boundary | `0` · `1` invalid inbox/request |
218
+ | `yoke context init\|status [dir]` | Durable context layer (`PROJECT/DECISIONS/KNOWLEDGE/GLOSSARY.md`, optional `CONTEXT-MAP.md`) | `0` |
219
+ | `yoke loop on\|off\|status\|decision\|answer\|resume\|run\|cleanup [dir]` | Autonomous loop; `run` supports `--parallel=N`, bounded reference-driven `--quality`, and blind `--candidates=N` selection; `--max=N` creates an intentional batch cap; `cleanup` retains worktrees unless `--remove-worktrees` is explicit | run: `0` complete · `1` blocked/cap · `2` not runnable / already locked · `3` paused |
220
+ | `yoke review [dir] [--reviewer=] [--base=] [--focus=] [--json] [--allow-self-review]` | An independent model writes a schema-valid verdict | `0` approved · `1` findings/invalid verdict · `2` no independent reviewer |
221
+ | `yoke audit [dir] [--json]` | Dependency, high-confidence secret, and sensitive-change audit | `0` green · `1` blocking findings · `2` not runnable |
222
+ | `yoke design-scan [dir] [--max=N] [--report]` | Static AI-slop design gate | `0` within budget · `1` over |
223
+ | `yoke flow-smoke [dir] [--url=] [--label=]` | Browser gate with screenshot/video proofs | `0` green · `1` failures · `2` not runnable |
224
+
225
+ A genuinely hung agent self-terminates after the idle timeout (default 20 min; `--timeout`), and `yoke loop status` shows the live phase or a `⚠ possibly stuck` hint — an autonomous run is never a black box.
226
+
227
+ ## ⚖️ How it compares — superpowers · gstack · Yoke
228
+
229
+ Three excellent projects, three different jobs. Honest version:
230
+
231
+ | | [superpowers](https://github.com/obra/superpowers) (obra) | [gstack](https://github.com/garrytan/gstack) (Garry Tan) | **Yoke** |
232
+ |---|---|---|---|
233
+ | **What it is** | The canonical *skills methodology*: brainstorm → plan → TDD → review as composable skills | A *software factory* for Claude Code: ~40 role skills (QA, CSO, ship…) + a real Chromium browser layer | A *cross-agent harness*: one canon → native installs, plus a gated autonomous loop |
234
+ | **Agents** | Claude Code first | Claude Code + hosts like Codex/Cursor/Kiro — **no Gemini CLI** | **Claude Code, Codex CLI, Gemini CLI, Qwen Code, OpenCode, Kilo, Pi** from one source of truth |
235
+ | **Enforcement** | Advisory — skills *describe* the discipline; following them is up to the agent | Skill-driven; browser QA is genuinely real | **Mechanical** — gates live in code: clean tree, acceptance criteria, green tests, review verdict, commit integrity |
236
+ | **Autonomy** | Interactive sessions | Interactive slash-commands (`/qa`, `/ship`, …) | Opt-in **Ralph loop** with watchdog, worktree isolation, single-flight lock, per-story proofs |
237
+ | **Visual QA** | — | **Best-in-class**: live browser daemon (Chromium/CDP) with deep interactive QA | Built-in `flow-smoke` gate: screenshots always, video on failure, labelled per story — lighter, but *enforced* and cross-agent |
238
+ | **Cross-model review** | — | `/codex` second opinion (Codex-only direction) | `yoke review` — resolves an independent provider and validates a structured verdict, inside or outside the loop |
239
+ | **Footprint** | Markdown skills (plugin) | ~230 MB with browser runtime; hourly auto-update | Node CLI + markdown canon; Playwright only if you use flow-smoke, resolved **from your project** |
240
+ | **License** | MIT | MIT | MIT |
241
+
242
+ **They compose — use all three where they're strongest.** Yoke's canon *ships* the superpowers methodology natively for all seven agents (13 skills, [attributed](canon/skills/ATTRIBUTION.md)). And if gstack is installed, `yoke retrofit` detects it and adds a routing note to `CLAUDE.md` telling Claude to prefer gstack's live-browser `/qa`, `/cso`, and ship pipeline for what Yoke deliberately doesn't bundle — no dependency, no conflict, and non-Claude artifacts stay uniform.
243
+
244
+ **Choose Yoke when** you run more than one agent, want autonomy you can audit (gates + proofs + logs), or want one place to maintain your team's methodology. **Choose gstack when** you live 100% in Claude Code and want the deepest interactive browser QA. **Choose superpowers when** you want the methodology alone, interactively, in Claude Code — or just use it *through* Yoke.
245
+
246
+ ## 🏗️ Architecture
247
+
248
+ You curate **one source of truth** — skills, policy, and tool wiring. Yoke generates the **idiomatic, native artifacts** each agent expects, non-destructively, into any repo:
249
+
250
+ ```mermaid
251
+ flowchart TD
252
+ Canon["📦 CANON — single source of truth<br/>skills · policy · loop spec · tool wiring"]
253
+ Skill["🛠️ yoke retrofit<br/>detect → plan → apply (backup) → report"]
254
+ Canon --> Skill
255
+ Skill --> Claude["Claude Code<br/>.claude/skills · .mcp.json · hook"]
256
+ Skill --> Codex["Codex CLI<br/>AGENTS.md · config.toml · RTK.md"]
257
+ Skill --> Gemini["Gemini CLI<br/>GEMINI.md · commands · settings.json"]
258
+ Skill --> Qwen["Qwen Code<br/>QWEN.md · skills · settings.json"]
259
+ Skill --> OpenCode["OpenCode<br/>AGENTS.md · opencode.json · .opencode/skills"]
260
+ Skill --> Kilo["Kilo<br/>AGENTS.md · kilo.jsonc · .kilo/skills"]
261
+ Skill --> Pi["Pi<br/>AGENTS.md · .pi/settings.json · .pi/skills"]
262
+ Loop["🤖 yoke loop — autonomous Ralph loop<br/>gates · verify · review · isolation · proofs"]
263
+ Claude -. drives .-> Loop
264
+ Codex -. drives .-> Loop
265
+ Gemini -. drives .-> Loop
266
+ Qwen -. drives .-> Loop
267
+ OpenCode -. drives .-> Loop
268
+ Kilo -. drives .-> Loop
269
+ Pi -. drives .-> Loop
270
+ ```
271
+
272
+ Three layers — **Canon** (`yoke validate`) → **Retrofit** (`yoke retrofit`) → **Loop** (`yoke loop`) — on top of a durable **Context layer** (`yoke context`).
273
+
274
+ ### What gets generated per agent
275
+
276
+ | Agent | Artifacts |
277
+ |---|---|
278
+ | **Claude** | Complete skill packages under `.claude/skills/` (including referenced resources), `AGENTS.md`, `CLAUDE.md`, `.mcp.json` (code-graph + Playwright), and an rtk `PreToolUse` hook when WSL is available |
279
+ | **Codex** | Complete skill packages under `.agents/skills/`, per-skill implicit-invocation policy, `AGENTS.md`, `RTK.md`, `.codex/config.toml`, native hooks, reusable `.codex/agents/*.toml`, and package plugin metadata |
280
+ | **Gemini** | Complete skill packages under `.gemini/skills/`, an auto-invocation index, `GEMINI.md`, `.gemini/commands/*.toml`, and `.gemini/settings.json` (MCP + `AGENTS.md` context) |
281
+ | **Qwen** | Complete skill packages under `.qwen/skills/`, `QWEN.md`, `.qwen/settings.json`, native invocation restrictions, and an RTK PreToolUse retry guard |
282
+ | **OpenCode** | Complete skill packages under `.opencode/skills/`, shared `AGENTS.md`, merged `opencode.json` (instructions + local MCP), and `.opencode/agents/yoke-reviewer.md` |
283
+ | **Kilo** | Complete skill packages under `.kilo/skills/`, shared `AGENTS.md`, merged `kilo.jsonc` (instructions + local MCP), and `.kilo/agents/yoke-reviewer.md` |
284
+ | **Pi** | Complete skill packages under `.pi/skills/`, shared `AGENTS.md`, and merged `.pi/settings.json`; Pi's tool allowlists are applied at invocation time |
285
+
286
+ > **rtk integration:** Claude receives its PreToolUse hook; Codex receives a native hook adapter around `rtk hook check`; Gemini retains instruction-mode fallback where its CLI has no equivalent command-rewrite lifecycle.
287
+
288
+ > **Composes with gstack:** if [gstack](https://github.com/garrytan/gstack) is installed (repo-local or global), `yoke retrofit` adds a short "Composed tools" routing note to **CLAUDE.md only** — telling Claude to prefer gstack's skills for capabilities Yoke doesn't ship (live-browser QA `/qa`, security audit `/cso`, ship/deploy `/ship`). No bundling, no dependency; the note is never written to the Codex or Gemini artifacts.
289
+
290
+ > **Your content survives re-retrofits — preserve blocks:** anything you put between
291
+ > `<!-- yoke:preserve:start -->` and `<!-- yoke:preserve:end -->` in a generated file is
292
+ > carried into the regenerated version on every future `yoke retrofit`. The generated
293
+ > `CLAUDE.md` and `GEMINI.md` ship an empty preserve block scaffold — put your project-specific
294
+ > instructions (tech stack, workflow, `@`-includes) inside it. Works in any yoke-written file;
295
+ > content *outside* the markers is still replaced (and backed up under `.yoke/backup/`).
296
+
297
+ ## 🧰 What's in the canon — 34 skills
298
+
299
+ `yoke retrofit` installs all of these into each selected agent natively. Provenance is credited in [`canon/skills/ATTRIBUTION.md`](canon/skills/ATTRIBUTION.md).
300
+
301
+ To stop overlapping skills from auto-invoking against each other, `canon/AGENTS.md` carries a **skill routing & precedence** block (methodology before role; one canonical entrypoint per concern — e.g. pre-merge code review is always `review`), emitted into all seven agents.
302
+
303
+ Each manifest entry also declares `invocation: auto|manual`. Retrofit translates that intent into
304
+ the provider's native controls: Claude and Qwen disable model invocation for manual skills, Codex writes
305
+ `agents/openai.yaml`, Gemini lists only automatic skills in its generated index, and OpenCode/Kilo/Pi
306
+ receive complete project-local skill packages. Validation
307
+ rejects conflicting package metadata and broken local Markdown links before anything is installed.
308
+
309
+ **Process / methodology** — *superpowers-derived discipline (13)*
310
+
311
+ | Skill | What it does |
312
+ |---|---|
313
+ | `brainstorming` | Explore intent, requirements & design before any creative work |
314
+ | `writing-plans` | Turn a spec into a bite-sized, TDD implementation plan |
315
+ | `executing-plans` | Execute a written plan in a separate session with review checkpoints |
316
+ | `subagent-driven-development` | Run a plan task-by-task: fresh subagent + two-stage review each |
317
+ | `tdd` | Write the test first, watch it fail, write minimal code, refactor |
318
+ | `systematic-debugging` | Root-cause first — no fix without a confirmed cause |
319
+ | `verification-before-completion` | Prove it actually works before claiming done |
320
+ | `using-git-worktrees` | Isolated worktrees for safe / parallel work |
321
+ | `requesting-code-review` | Request a structured review before merging |
322
+ | `receiving-code-review` | Handle review feedback with rigor, not blind agreement |
323
+ | `dispatching-parallel-agents` | Fan out 2+ independent tasks concurrently |
324
+ | `finishing-a-development-branch` | Merge / PR / cleanup a finished branch |
325
+ | `writing-skills` | Author and verify new skills |
326
+
327
+ **Roles** — *gstack-derived, de-gstacked to be harness-agnostic (7)*
328
+
329
+ | Skill | What it does |
330
+ |---|---|
331
+ | `plan-eng-review` | Architecture / edge-case review of a *plan* |
332
+ | `plan-ceo-review` | Founder-mode scope & ambition review of a plan |
333
+ | `review` | Single canonical pre-merge code review — diff safety + engineering quality (architecture, edge cases, tests, performance) |
334
+ | `ship` | Ship workflow: tests → review → version → changelog → PR |
335
+ | `health` | Code-quality dashboard with a composite score |
336
+ | `retro` | Engineering retrospective from commit history |
337
+ | `document-release` | Post-ship documentation sync (README / CHANGELOG / …) |
338
+
339
+ **Yoke-native** — *authored or adapted for this harness (14)*
340
+
341
+ | Skill | What it does |
342
+ |---|---|
343
+ | `yoke-retrofit` | Set up the Yoke harness in a project (detect → plan → apply) |
344
+ | `yoke-workflow` | Provider-neutral planning questions → approved PRD → autonomous stories → critical-decision resume |
345
+ | `authoring-prd` | Slice a product idea into loop-ready stories with testable acceptance criteria |
346
+ | `minimal-code` | Write the least code that solves the task (YAGNI; ponytail-derived) |
347
+ | `performance` | Efficiency as a measured requirement: benchmarks as tests, budgets as gates, optimizations local + documented |
348
+ | `maintaining-context` | Keep `.yoke/context/` the durable source of truth (the Context layer) |
349
+ | `workflow` | The default order of operations, from idea to deploy |
350
+ | `unslop-ui` | Detect & remove AI-slop design tells (purple gradients, neon glow, emoji-icons…) |
351
+ | `visual-verification` | Widen verify to design-scan + the built-in `yoke flow-smoke` gate (screenshot proofs; video on failure) |
352
+ | `no-ai-slop` | Detect and edit generic AI prose while preserving the author's voice; includes its evaluation rubric |
353
+ | `domain-modeling` | Model boundaries, invariants, vocabulary, context maps, and decision records before implementation |
354
+ | `codebase-design` | Explore architecture, deepen a chosen design, and compare two viable approaches when tradeoffs matter |
355
+ | `resolving-merge-conflicts` | Resolve conflicts by reconstructing intent, then verify the integrated result |
356
+ | `writing-for-agents` | Write compact agent instructions with explicit triggers, constraints, resources, and checks |
357
+
358
+ ## 🌱 Zero to 100: `yoke new` + `yoke prd`
359
+
360
+ Yoke's greenfield entrypoint — one command from idea to loop-ready project:
361
+
362
+ ```bash
363
+ yoke new my-app --idea="a CLI that tracks reading lists" # scaffold + retrofit + context + PRD
364
+ yoke loop on my-app && yoke loop run my-app --isolate # hand it to the loop
365
+ ```
366
+
367
+ `yoke new <dir>` refuses a non-empty directory (greenfield-only — use `yoke retrofit` for
368
+ existing projects), then: creates and `git init`s the directory, writes a minimal scaffold
369
+ (`README.md`, `.gitignore`), runs the full **retrofit** (`--agent=` as usual), initialises the
370
+ **context layer** (with `--idea` seeded into `PROJECT.md` as the north star), writes a commented
371
+ **PRD template** to `.yoke/prd.yaml`, and makes the initial commit — so `--isolate` works from
372
+ iteration 1. With `--idea`, it then drafts the PRD from your idea via an agent (`--runner=`,
373
+ the configured runner or active host) and commits it as a second commit (`docs: draft PRD from idea`).
374
+
375
+ - **Exit codes** — `0` success; `1` usage / non-empty dir / draft failure (the scaffold survives —
376
+ retry with `yoke prd draft`); `2` requested draft agent unavailable.
377
+
378
+ **`yoke prd draft [dir] --idea="..."`** turns an idea into 5–12 small, independently shippable
379
+ stories with testable behavioral acceptance criteria (greenfield STORY-1 scaffolds the project
380
+ skeleton + test suite and wires `verify.command`). An existing PRD with stories is never
381
+ overwritten without `--force`; the untouched template doesn't trigger the guard. Runs through
382
+ the same idle-timeout watchdog as the loop (`--timeout`). If `.yoke/plan.md` exists, its approved
383
+ goals, non-goals, constraints, and decisions are injected as settled context instead of being
384
+ reopened by the drafting agent.
385
+
386
+ **`yoke prd check [dir]`** is the chainable pre-loop lint gate: schema validation plus
387
+ duplicate-id, empty-acceptance, unresolved-placeholder, and zero-stories checks. Exits `0` with
388
+ `✓ PRD valid — N stories, M pass`, `1` on any violation. The `authoring-prd` canon skill
389
+ teaches interactive sessions the same story-slicing discipline.
390
+
391
+ ## 🤖 The autonomous loop
392
+
393
+ Opt-in; `yoke setup` recommends enabling it for new installs, while `retrofit` alone keeps it off unless requested. Each iteration starts a **fresh agent** and passes through hard gates before anything is committed:
394
+
395
+ ```mermaid
396
+ flowchart LR
397
+ I[consume queued change<br/>as new stories] --> A[pick next PRD story]
398
+ A --> B{clean worktree?}
399
+ B -- no --> X[blocked]
400
+ B -- yes --> C{acceptance<br/>criteria?}
401
+ C -- no --> X
402
+ C -- yes --> D[agent implements<br/>one story]
403
+ D --> E{suite + criterion<br/>proof green?}
404
+ E -- no --> X
405
+ E -- yes --> V{UI design<br/>within budget?}
406
+ V -- no --> X
407
+ V -- yes --> F{reviewer<br/>approves?}
408
+ F -- no --> X
409
+ F -- yes --> G[commit + mark passes:true<br/>+ proof in .yoke/proof/]
410
+ G --> I
411
+ I --> H{all stories pass?}
412
+ H -- yes --> J{integrated system<br/>gate green?}
413
+ J -- no --> X
414
+ J -- yes --> K[current backlog ready]
415
+ ```
416
+
417
+ ```bash
418
+ yoke loop on . # enable (recorded in .yoke/config.yaml)
419
+ yoke loop status . # show state + PRD progress
420
+ yoke change add . --idea="Add passkey login" # safe while the loop runs
421
+ yoke loop run . \
422
+ --runner=codex \ # implement with Codex…
423
+ --reviewer=claude \ # …review with Claude (role separation)
424
+ --isolate \ # each story in a throwaway git worktree
425
+ --parallel=3 \ # run dependency-ready, non-colliding stories concurrently
426
+ --decision-policy=critical # pause only for high-impact decisions; routine choices stay autonomous
427
+ # Optional: add --max=20 only when this run should stop after a bounded batch.
428
+ yoke loop off . # disable
429
+ ```
430
+
431
+ **PRD format** (`.yoke/prd.yaml`):
432
+
433
+ ```yaml
434
+ - id: STORY-1
435
+ title: Add a health endpoint
436
+ priority: 1 # lower = higher priority
437
+ acceptance: # Definition of Done (required, else blocked)
438
+ - id: health-returns-200
439
+ text: GET /health returns 200
440
+ verify: [npm run test:health-returns-200]
441
+ - id: health-rejects-post
442
+ text: POST /health returns 405
443
+ verify: [npm run test:health-rejects-post]
444
+ passes: false # the loop sets this true only on green tests
445
+ ```
446
+
447
+ New projects default to `verify.requireCriteria: true`: every story has 2–5 behavioral criteria.
448
+ Each criterion ID must occur in its single, approved test command; shell operators and broad,
449
+ untargeted suites are rejected. Yoke records each result in `.yoke/proof/<story>/evidence.json`. Configure optional
450
+ `completion.command` for integrated journeys such as purchase → entitlement → relaunch or
451
+ magic-link → callback → authenticated app. It runs whenever the current backlog has no open
452
+ stories; this is readiness, not a release.
453
+
454
+ No generic tool can infer whether arbitrary test code perfectly represents product meaning. Yoke
455
+ closes the mechanical false-done paths—targeted evidence, coverage review, clean committed state,
456
+ and integrated journeys—while the project still owns the correctness of its tests and production
457
+ observability.
458
+
459
+ ### Parallel workers and the quality gauntlet
460
+
461
+ `--parallel=N` dispatches dependency-ready stories concurrently. Claims carry leases, workers use
462
+ isolated worktrees, collision areas are serialized, and only a mechanically green candidate enters
463
+ the FIFO integration queue. Integration repeats the project gates against the merged tree; a worker
464
+ success can never bypass a red integrated result. `yoke loop status` reports the dispatcher,
465
+ workers, providers, worktrees, lifecycle, queue, integrations, and reopened stories.
466
+
467
+ Quality is reference-driven and opt-in. Declare what one story should match:
468
+
469
+ ```yaml
470
+ quality:
471
+ reference: { name: approved-home, source: design/home.png, kind: file }
472
+ candidate: { kind: screenshots, paths: [.yoke/proof/STORY-1/home.png] }
473
+ rubric: Match the approved layout, hierarchy, spacing, and states.
474
+ policy: blocking # or advisory
475
+ ```
476
+
477
+ Configure project defaults, then enable the gauntlet for a run:
478
+
479
+ ```yaml
480
+ quality:
481
+ enabled: false # keep opt-in, or make it the project default
482
+ policy: blocking
483
+ maxRounds: 3
484
+ maxMinutes: 60
485
+ consistencyChecks: 2
486
+ maxParallelCandidates: 2
487
+ critic: { agent: codex, model: gpt-5.6-sol } # model required for --candidates
488
+ repair: { agent: claude }
489
+ ```
490
+
491
+ ```bash
492
+ yoke loop run . --quality --quality-rounds=3 --quality-minutes=60
493
+ yoke loop run . --quality --candidates=2 # blind pairwise selection; stories need quality declarations
494
+ ```
495
+
496
+ The critic compares opaque candidate/reference labels, writes schema-validated provenance, and
497
+ cannot modify the project. Blocking findings enter a bounded repair loop and rerun every mechanical
498
+ gate; advisory findings are retained without blocking. `--quality-policy=`, `--no-quality`, and
499
+ `--quality-unbounded` override defaults for one run. Unbounded mode is explicit and warned because
500
+ it removes repair limits, not Yoke's watchdog, isolation, verification, or commit safety.
501
+
502
+ State lives **outside the model context** — the PRD file plus git — so each iteration is fresh.
503
+ Use `yoke change add` at any time. Its ignored append-only inbox is consumed at the next story
504
+ boundary. A separate coverage pass must confirm that every requested outcome maps to behavioral
505
+ criteria before Yoke appends and commits the new stories; existing stories are never rewritten and
506
+ no restart is needed.
507
+
508
+ ### Watching a run
509
+
510
+ Every iteration emits token-free, harness-side feedback (Node console + local files — **zero agent tokens**):
511
+
512
+ - **Live console with progress + ETA** —
513
+ `▶ S6 (19/45 · 42%) — implementing… · ~1h44m left (Ø 4m/story)` … `✓ S6 done in 4m28s — 20/45 (44%) · ~1h40m left`.
514
+ The estimate uses the **average duration of stories completed in this run** (current
515
+ velocity); before the first story lands it falls back to the recorded history of previous
516
+ runs (`.yoke/story-durations.json`, last 50 stories, gitignored). No data yet → no estimate,
517
+ never a made-up one.
518
+ - **`.yoke/loop-status.json`** — the current state (now including `percent` and an `eta`
519
+ block); read it any time with `yoke loop status`:
520
+ ```
521
+ Loop: RUNNING on S6 "Weekly digest"
522
+ implementing · iteration 20 · 19/45 (42%) · updated 30s ago
523
+ ~1h44m remaining (Ø 4m/story)
524
+ ```
525
+ - **Parallel + quality detail** — active workers include provider, candidate ID, worktree,
526
+ lifecycle, phase, quality round, and repair budget; the integrator is shown separately.
527
+ - **`.yoke/loop.log`** — an append-only timeline of every phase transition.
528
+ - **`--json`** — machine mode for supervisors: every status write is *also* emitted as one
529
+ NDJSON line on stdout (`{"type":"status","state":"running","phase":"verifying",…}` — the
530
+ same shape as `loop-status.json`), the human narrative moves off stdout (the final summary
531
+ goes to stderr), and a consumer can follow the stream line by line instead of polling the file.
532
+ Provider JSON streams are also accounted: statuses (file + stream) carry cumulative input and
533
+ output tokens for the whole run plus provider-reported cache-read, cache-write, reasoning, model,
534
+ and cost fields when available. Missing values stay absent—Yoke does not estimate them.
535
+
536
+ ### Pausing a run
537
+
538
+ Drop a **`.yoke/loop.pause`** file (contents irrelevant) while the loop is running and it
539
+ stops at the **next story boundary** — the running story still finishes, verifies, and
540
+ commits; no story is ever cut off mid-flight. The loop consumes the pause file, writes
541
+ `state: "paused"` to `loop-status.json` (log label `paused`), releases the lock, and exits
542
+ with code `3`. Resume by simply running `yoke loop run` again.
543
+
544
+ A per-iteration **idle timeout** guards against a genuinely hung agent: if the agent produces
545
+ **no output at all** for `--timeout` minutes (default 20; `0` disables), the loop kills it
546
+ (SIGTERM→SIGKILL) and marks the story blocked. A slow-but-working agent that keeps streaming
547
+ output is **never** killed — the output stream *is* the liveness signal. Set a project default
548
+ with `loop.timeoutMinutes` in `.yoke/config.yaml`.
549
+
550
+ ### Decision policy: autonomous by default, interrupt only when configured
551
+
552
+ Planning questions happen before the loop. The provider-neutral `yoke-workflow` skill asks only
553
+ questions whose answer materially changes product behavior, scope, architecture, security, data
554
+ ownership, external cost, or an irreversible choice. It saves the approved brief in
555
+ `.yoke/plan.md`; `yoke prd draft` consumes it, and `yoke prd check` rejects explicit unresolved
556
+ placeholders such as `TBD`.
557
+
558
+ The unattended loop then follows `loop.decisionPolicy`:
559
+
560
+ ```yaml
561
+ loop:
562
+ enabled: true
563
+ decisionPolicy: critical # or auto
564
+ runner:
565
+ agent: codex # setup chooses the current host by default
566
+ ```
567
+
568
+ - **`auto` (default):** routine ambiguity and implementation details are resolved using the
569
+ approved plan, acceptance criteria, current code, and project conventions. The loop does not
570
+ ask follow-up questions.
571
+ - **`critical`:** routine choices are still resolved automatically. Only high-impact decisions
572
+ involving public architecture, security/privacy, destructive migration or data loss, material
573
+ external cost, legal/compliance exposure, or another irreversible choice may pause the story.
574
+ The agent writes a schema-validated request; the loop blocks before verify and preserves it as
575
+ `.yoke/pending-decision.yaml`.
576
+
577
+ Inspect and answer a critical stop:
578
+
579
+ ```bash
580
+ yoke loop decision .
581
+ yoke loop answer . --choice=A --rationale="Matches the existing identity model"
582
+ ```
583
+
584
+ `answer` validates the choice against the still-open story, appends it to
585
+ `.yoke/context/DECISIONS.md`, commits only that file using the configured human identity, clears
586
+ the pending request, and resumes the same story with the original runner, isolation, review,
587
+ permission, timeout, JSON, decision-policy, and iteration settings intact. Add
588
+ `--no-resume` when a supervisor should restart the loop separately. If the automatic restart
589
+ cannot begin because a provider/reviewer is unavailable or another process owns the lock, run
590
+ `yoke loop resume .`; its request-bound options are retained under Git's private state directory
591
+ until a loop actually runs. To intentionally abandon an orphaned or stale private resume state,
592
+ use `yoke loop resume . --discard`; pending decisions are never deleted by that command. Existing
593
+ `loop.onAmbiguity: resolve|abort` and `--on-ambiguity=` remain supported as compatibility aliases;
594
+ new projects should use `decisionPolicy: auto|critical`.
595
+
596
+ ### Adaptive model routing
597
+
598
+ `yoke setup` enables routing by default and preserves explicit opt-outs. Without configured
599
+ worker profiles, automatic execution keeps the selected parent. When enabled, the selected
600
+ parent remains the strong planner/controller. Before each bounded story it receives only the
601
+ story, acceptance criteria, and at most three eligible worker profiles, then returns one
602
+ machine-readable choice. The worker can be a cheaper/faster profile for any configured harness;
603
+ `SELF` keeps difficult work on the parent. Explicit project rules skip the controller.
604
+ Loop runners disable native delegation in Codex, Claude, Gemini, Qwen, OpenCode and Kilo so it cannot multiply
605
+ the Yoke worker budget. Integration retains its execution slot until the candidate lands.
606
+
607
+ **Provider support:** adaptive routing uses Yoke's shared provider adapter and works with Claude
608
+ Code, Codex CLI, Gemini CLI, Qwen Code, OpenCode, Kilo and Pi, including mixed-provider worker lists.
609
+ Internal contract tests cover invocation and routing behavior for all seven providers. The measured
610
+ performance evidence below is intentionally **Codex-only**; it does not claim equivalent savings
611
+ until authenticated, repeated in-the-wild runs exist for each provider.
612
+
613
+ ```yaml
614
+ runner:
615
+ agent: codex
616
+ model: gpt-5.6-sol # optional; provider model strings stay opaque to Yoke
617
+ reasoningEffort: high
618
+ routing:
619
+ enabled: true # new setup default; false preserves an explicit opt-out
620
+ strategy: balanced # balanced | cost | speed | quality
621
+ maxCandidates: 3
622
+ workers:
623
+ - id: codex-light
624
+ agent: codex
625
+ reasoningEffort: low
626
+ costTier: medium
627
+ capabilities: [exploration, implementation, tests]
628
+ - id: claude-fast
629
+ agent: claude
630
+ model: haiku # rolling alias; omit to use the provider's current default
631
+ reasoningEffort: low
632
+ costTier: low
633
+ capabilities: [mechanical-edits, tests]
634
+ - id: gemini-auto
635
+ agent: gemini # omitted model means the account's current Auto/default route
636
+ costTier: low
637
+ capabilities: [large-context, implementation]
638
+ ```
639
+
640
+ Use `yoke loop run . --routing` to explicitly require configured routing or `--no-routing` for a controlled
641
+ baseline. Routing control calls are read-only and deliberately tiny; malformed output or no
642
+ eligible worker falls back to `SELF`. Yoke does not ship a universal, fast-aging
643
+ "intelligence score". Candidate model IDs come from project configuration while setup defaults
644
+ prefer rolling aliases or provider Auto/defaults. A per-user registry learns only from Yoke's
645
+ independent verify/performance/audit/review gates, keyed by worker + provider + model/effort and expired
646
+ after 30 days. It stores no prompts, source, or project paths—only a project hash and aggregate
647
+ time/token/outcome evidence. Writes are immutable one-event files, so concurrent Yoke instances
648
+ cannot overwrite a shared registry file.
649
+
650
+ Routing is not free: stories without a matching rule can add a controller call. Measure it
651
+ on your own backlog rather than assuming a win. Routing now also runs within asynchronous
652
+ parallel workers. Automatic parallelism starts at up to three workers when pending tasks declare
653
+ write scopes; unknown scopes and configured tool actions keep execution serial. Isolation is
654
+ on by default. Explicit `--parallel=N`, `--no-routing` and `--no-isolate` remain available.
655
+ See [execution defaults and dashboard measurement details](docs/VERIFIED-PROJECTS.md#execution-defaults-in-180).
656
+
657
+ ### Performance budgets: efficiency as a gate, not a style
658
+
659
+ Clean code is the default (the `minimal-code` skill) — but when efficiency matters, "should
660
+ be fast" is a vibe the loop cannot enforce. Yoke makes it mechanical, at two levels:
661
+
662
+ - **Per story:** write the requirement as a **measurable acceptance criterion**
663
+ ("imports 1M rows in < 2s, asserted by the bench test") and let your verify tests measure
664
+ it — no new machinery needed.
665
+ - **Per project:** wire a benchmark as a standing **perf gate** in `.yoke/config.yaml`:
666
+
667
+ ```yaml
668
+ perf:
669
+ command: node bench/check-budget.mjs # exit 0 = within budget
670
+ retries: 1 # benchmarks are noisy; same retry logic as verify
671
+ ```
672
+
673
+ The loop runs it **after verify** on every story (phase `perf`, with `YOKE_STORY` set); a
674
+ red benchmark blocks the story — `story S6 exceeded its performance budget: p95 62ms > budget 50ms` —
675
+ no matter how clean the diff was. The implementer prompt names the budget command, so the
676
+ agent knows not to trade hot-path efficiency for style and never "simplifies away" an
677
+ optimization without re-running the benchmark. The `performance` canon skill carries the
678
+ method: profile first, optimize leaves not boundaries, commit benchmarks as tests, version
679
+ the *why* of every optimization in `context/DECISIONS.md`.
680
+
681
+ ### Artifact-backed gate output: compact context, complete local evidence
682
+
683
+ Failed verify, executable-criterion, performance, configured custom-audit, and completion commands can emit thousands of
684
+ low-signal lines. Yoke keeps the model-visible failure summary deterministic and bounded while
685
+ preserving large raw stdout/stderr below `.yoke/artifacts/`:
686
+
687
+ ```yaml
688
+ output:
689
+ previewBytes: 2048 # default: maximum compact preview bytes
690
+ artifactThresholdBytes: 8192 # default: persist raw output only above this size
691
+ ```
692
+
693
+ The preview prioritizes errors, warnings, adjacent context, and final test summaries. Above the
694
+ artifact threshold it also includes a project-relative path, byte count, and full SHA-256 digest,
695
+ for example:
696
+
697
+ ```text
698
+ [full output: .yoke/artifacts/STORY-4/verify-0123abcd4567.log | 42810 bytes | sha256:0123...]
699
+ ```
700
+
701
+ An agent can read that ordinary file when the preview is insufficient; nothing is injected into
702
+ later stories automatically. Repeated identical failures reuse the same content-addressed path.
703
+ Successful gate output is discarded as before. This affects only commands executed by Yoke's own
704
+ gates. It does **not** intercept tool output generated internally by Claude Code, Codex, Gemini, or Qwen,
705
+ so benchmark ratios for this feature are not provider-token or billing claims.
706
+
707
+ Command capture is capped at 16 MiB per stdout/stderr stream. Exceeding that quota fails the gate
708
+ closed and stores the captured prefix with a `[truncated output: ...]` marker; Yoke never labels
709
+ partial evidence as full output.
710
+
711
+ Yoke treats `.yoke/artifacts/` as local, non-committable runtime state and excludes it from its
712
+ clean-tree and story-commit operations; `yoke retrofit` also adds it to `.gitignore`. Raw command output is intentionally stored
713
+ without redaction so it remains valid evidence and may therefore contain credentials, personal
714
+ data, or other sensitive text emitted by project commands. Inspect artifacts before sharing them.
715
+
716
+ The loop trusts **verify**, not the agent's exit code: a story whose tests are green is
717
+ committed even if the agent process exited non-zero (a common Windows `.cmd`-wrapper ghost).
718
+ A failing verify is retried up to `verify.retries` times (default 1) so a transient flake
719
+ self-heals while a real failure still blocks. Structured acceptance criteria are then verified
720
+ individually; an unrelated green suite cannot satisfy a criterion without its proof command.
721
+
722
+ `.yoke/loop-status.json`, `.yoke/loop.log`, `.yoke/loop.lock`, its takeover/recovery leases, lock/decision temp files, `.yoke/story-durations.json`,
723
+ `.yoke/ambiguity.md`, `.yoke/artifacts/`, and the critical-decision request/answering files are runtime artifacts;
724
+ `yoke retrofit` gitignores them (along with
725
+ `.yoke/worktrees/`, `.yoke/backup/`, `.yoke/proof/`, and `.yoke/changes/`) so they never trip the clean-tree gate.
726
+
727
+ ### Single-flight guard + cleanup
728
+
729
+ Two concurrent `yoke loop run`s would race on the PRD and status files, so the loop takes a
730
+ **lock** (`.yoke/loop.lock`) for the duration of a run. Complete lock metadata is published atomically;
731
+ stale takeover is serialized by `.yoke/loop.lock.takeover`. A second invocation exits `2` with
732
+ `Another loop is already running here (pid …). If that is wrong, run: yoke loop cleanup`. A lock
733
+ whose holder process is dead is taken over automatically (with a warning).
734
+
735
+ **`yoke loop cleanup [dir]`** reaps only runner process trees recorded by this project and removes
736
+ a stale lock. Yoke-created worktrees are **retained by default** and listed in the output; pass
737
+ `--remove-worktrees` to remove `.yoke/worktrees/*` with `git worktree remove --force` + `prune`.
738
+ User-created worktrees are never touched. A live lock is reported and left alone. Exits `0` when
739
+ cleanup succeeds, `1` if any requested removal fails. If a machine/process crash leaves the cleanup
740
+ recovery lease itself behind, an operator can run
741
+ `yoke loop cleanup . --discard-stale-recovery`; Yoke refuses while its recorded PID is alive, and
742
+ the force flag must not be run concurrently.
743
+
744
+ ## 🔍 Cross-model review (`yoke review`)
745
+
746
+ Outside the loop, `yoke review` has a **second** model review your current diff as a
747
+ pass/fail gate — the interactive counterpart to the loop's `--review`/`--reviewer`.
748
+
749
+ ```bash
750
+ yoke review . # review the uncommitted working tree
751
+ yoke review . --base=main # review the range main..HEAD instead
752
+ yoke review . --reviewer=codex # force a specific reviewer
753
+ yoke review . --focus="the auth layer" # steer what it scrutinises
754
+ ```
755
+
756
+ - **Reviewer resolution** — picks the first available of **codex → gemini → claude**,
757
+ preferring a model *other* than the one you drive so the review is genuinely cross-model.
758
+ On a Claude-only machine it degrades to a self-review (and says so).
759
+ - **Scope** — the uncommitted working tree by default, or a commit range with `--base=<ref>`.
760
+ - **Exit-code gate** — exits `0` when the reviewer approves, `1` when it finds a blocking
761
+ issue, `2` when no (or an unavailable) reviewer CLI is found. Chain it: `... && yoke review`,
762
+ or wire it into a pre-push hook.
763
+ - Runs through the same idle-timeout watchdog as the loop (`--timeout`, default 20 min).
764
+
765
+ ## 🎨 Visual & design verification — done, with a photo
766
+
767
+ Unit tests don't catch a blank page, an unwired route, or generic AI-slop design. Yoke adds three things:
768
+
769
+ - **`yoke design-scan [dir]`** — a static scanner for the visual *tells* of AI-generated UIs
770
+ (AI-purple gradients, gradient hero text, neon glow, emoji-as-icons, gradient overload). It
771
+ scores findings and **exits non-zero over budget** (`--max`, default 4; `--report` to list only),
772
+ so it drops straight into your verify pipeline.
773
+ - **`yoke flow-smoke [dir]`** — a built-in browser gate with **proof artifacts** (below).
774
+ - **`unslop-ui` + `visual-verification` skills** — the design rubric, plus how to compose a verify
775
+ pipeline (`types → units → design-scan → flow-smoke`).
776
+
777
+ Retrofit adds `design: { mode: auto, max: 4 }` when it detects UI dependencies, UI source files,
778
+ or configured smoke flows. In `auto` mode the loop runs the design scan after functional verify and
779
+ before performance/audit; `on` forces it for any project and `off` disables it. Existing explicit
780
+ settings are preserved. `flow-smoke` remains an explicit project verify step because Yoke cannot
781
+ infer how to start each application's server.
782
+
783
+ `unslop-ui` is the visual-design skill. `no-ai-slop` is separate: it reviews prose for generic AI
784
+ patterns and edits only confirmed problems while preserving meaning and voice.
785
+
786
+ *Tell set informed by the MIT-licensed [vibecoded-design-tells](https://github.com/JCarterJohnson/vibecoded-design-tells) research.*
787
+
788
+ ### `yoke flow-smoke [dir] [--url=<baseUrl>] [--label=<name>]`
789
+
790
+ Configure your key user flows once in `.yoke/config.yaml`:
791
+
792
+ ```yaml
793
+ smoke:
794
+ baseUrl: http://localhost:3000
795
+ flows:
796
+ - name: home
797
+ path: /
798
+ landmark: "main h1" # optional CSS selector to wait for
799
+ - name: login
800
+ path: /login
801
+ ```
802
+
803
+ For every flow, `yoke flow-smoke` loads the route against the running dev server, waits for the
804
+ landmark, and fails on a non-OK response or **any console/page error**. The proof contract:
805
+
806
+ - **Screenshots always** — every flow (pass *or* fail) saves `.yoke/proof/<label>/<flow>.png`;
807
+ the failure screenshot *is* the evidence.
808
+ - **Video only on failure** — each flow is recorded, but the clip is kept only when the flow
809
+ goes red (`<flow>.webm`); green runs delete it.
810
+ - **Labelled per story** — inside the loop, verify runs with `YOKE_STORY=<story-id>`, so proofs
811
+ land in `.yoke/proof/<story-id>/` automatically. Standalone runs use `latest`, or pass
812
+ `--label=`. The label dir is wiped per run — evidence is always from the latest run.
813
+ - **Exit codes** — `0` all flows green (chain it: `... && yoke design-scan . && yoke flow-smoke .`),
814
+ `1` any flow failed, `2` not runnable (no `smoke:` config, or Playwright missing).
815
+ - **Playwright comes from the *target project*, never Yoke** —
816
+ `npm i -D playwright && npx playwright install chromium` there. Start the dev server before
817
+ verify (e.g. via `start-server-and-test`); `--url=` overrides `baseUrl`.
818
+
819
+ `.yoke/proof/` is gitignored by the retrofit — proofs are runtime artifacts and never break the
820
+ loop's clean-tree gate.
821
+
822
+ ## 🧠 Context layer (`.yoke/context/`)
823
+
824
+ Yoke keeps durable, cross-session context so a fresh-context agent is never blind:
825
+
826
+ - `PROJECT.md` — the north star (goal, constraints, non-goals, success criteria).
827
+ - `DECISIONS.md` — an append-only ledger. The loop adds an entry per completed story; you and agents add the *why*.
828
+ - `KNOWLEDGE.md` — reusable gotchas and conventions.
829
+ - `GLOSSARY.md` — the project's canonical terms, meanings, and aliases.
830
+ - `CONTEXT-MAP.md` — optional bounded-context relationships for projects that need domain mapping.
831
+
832
+ `yoke retrofit` scaffolds the four core files non-destructively; your edits are never overwritten.
833
+ It reports `CONTEXT-MAP.md` when the optional file already exists.
834
+ The loop reads them into every agent + reviewer prompt and logs decisions back on each story's
835
+ commit. Decision history is explicitly delimited as untrusted reference data, so stored text is
836
+ never treated as fresh instructions. Manage the files directly with `yoke context init` and `yoke context status`. The
837
+ `maintaining-context` skill teaches agents to honour the same files during interactive work.
838
+
839
+ > Commit `.yoke/context/` to git. The `--isolate` loop runs each iteration in a worktree
840
+ > checked out from HEAD, so it only sees committed context.
841
+
842
+ ## 🛡️ Safety model
843
+
844
+ Yoke's guardrails are **mechanical, not advisory** — the loop blocks on a dirty worktree, missing acceptance criteria, red tests, or a reviewer rejection, and **none of them rely on the agent choosing to behave**.
845
+
846
+ - **Commit integrity** — a story is never recorded `passes: true` without a corresponding commit; a failed commit reverts the PRD.
847
+ - **Role separation** — the implementer never reviews its own work; `--reviewer` can even be a different agent.
848
+ - **Isolation** — with `--isolate`, failed or partial work is discarded with the worktree and never reaches your main tree.
849
+ - **Non-destructive retrofit** — existing files are backed up before any change; settings are merged, not replaced.
850
+ - **Independent verification** — "done" means *your test command exits 0*, not "the agent said so".
851
+ - **Single-flight** — a lock prevents two loops from racing the same repo; `yoke loop cleanup` recovers after crashes.
852
+
853
+ ## 🧠 Choose your code-graph
854
+
855
+ `yoke retrofit --code-graph=graphify|serena` (default `graphify`, remembered per project). The `yoke-retrofit` skill asks and recommends based on the project.
856
+
857
+ | | **graphify** | **Serena** |
858
+ |---|---|---|
859
+ | Engine | tree-sitter AST + graph | real language servers (LSP) |
860
+ | Strength | fast, multimodal (code + PDFs + images) | symbol-exact cross-file refactoring |
861
+ | Token efficiency | ~70× reduction on large mixed repos | standard, no index to go stale |
862
+ | Best for | rapid exploration / migration / onboarding | systematic refactoring in typed codebases |
863
+ | Caveat | heuristic edges; static index can go stale | one language server per language |
864
+
865
+ ## 🪙 Token efficiency
866
+
867
+ Yoke attacks tokens on two complementary surfaces:
868
+
869
+ - **rtk** compresses noisy command/tool output before it enters context (wired as a hook/instruction per agent).
870
+ - The **`minimal-code`** skill installs a YAGNI / "lazy senior dev" ladder so agents write the least code that solves the task — fewer output tokens, smaller review surface. *(Adapted from the MIT-licensed [ponytail](https://github.com/DietrichGebert/ponytail) ruleset.)*
871
+
872
+ A Codex-only full-repository study ran three alternating-order pairs per arm. The same Sol parent
873
+ completed all 12 stories and all **36/36 hidden acceptance checks**; with routing enabled, a Sol
874
+ controller selected Luna for every bounded implementation story. Including controller overhead,
875
+ the routed median used **33.8% less wall time, 11.0% less fresh input, 49.5% fewer output tokens,
876
+ and 78.2% fewer reasoning tokens**. All three pairs improved wall time and fresh input.
877
+
878
+ The boundary matters: an earlier architecture/privacy task correctly stayed on `SELF` and paid
879
+ controller overhead, so the routing default is not evidence of universal savings. Codex did not
880
+ emit dollar cost for these plan-backed runs; Yoke reports the measured token breakdown instead of
881
+ inventing a price. Method, ranges, controller cost, caveats, analyzer, and six raw JSON rows are in
882
+ [`bench/RESULTS.md`](bench/RESULTS.md#codex-only-full-repository-routing-study-2026-08-02).
883
+
884
+ ## 🧩 Optional companions
885
+
886
+ Two external tools pair well with Yoke and are documented (not bundled) in `canon/tools/` — each has its own installer and update cadence, so Yoke wires the boundary instead of vendoring a copy:
887
+
888
+ - **[claude-mem](https://github.com/thedotmack/claude-mem)** — persistent cross-session memory for interactive work. Deliberate boundary: the autonomous loop keeps its memory **explicit and versioned** (`context/*.md` + PRD, fresh context per story), so claude-mem's automatic injection stays out of loop runs.
889
+ - **[ui-ux-pro-max](https://github.com/nextlevelbuilder/ui-ux-pro-max-skill)** — data-driven design intelligence (styles, palettes, industry rules) for the *generation* side. Yoke's `unslop-ui`, `design-scan`, and `visual-verification` remain the *verification* side: generate with pro-max, gate with Yoke.
890
+
891
+ ## 🌱 Why & how it was built
892
+
893
+ **The problem.** Coding agents are powerful, but each speaks its own dialect — Claude has skills and hooks, Codex reads `AGENTS.md` and a TOML config, Gemini wants commands and a settings file. Keeping the same skills, safety policy, and tool wiring consistent across all of them means copy-paste drift and three things to maintain. Yoke exists to keep **one** source of truth, generate the right native artifacts for each agent, and let that harness run **autonomously and safely** when you want to hand it a spec and walk away.
894
+
895
+ **The inspiration.** Yoke is a synthesis of ideas already proven across the ecosystem: composable-skills methodology ([superpowers](https://github.com/obra/superpowers), [gstack](https://github.com/garrytan/gstack)); the portable [AGENTS.md](https://agents.md/) standard; the *"one source-of-truth → idiomatic per-harness artifacts"* generation pattern ([wshobson/agents](https://github.com/wshobson/agents)); spec-driven autonomous orchestration (GSD); mechanical safety gates and role separation (safe-agentic-workflow); and the **Ralph loop** (Geoff Huntley) — keep handing a *fresh* agent the next task until the spec is done. Token efficiency comes from [rtk](https://github.com/rtk-ai/rtk) and the write-less-code idea behind [ponytail](https://github.com/DietrichGebert/ponytail).
896
+
897
+ **How it was built.** Yoke was built the way it's meant to be *used* — agent-driven, incremental, and test-first. The stack was chosen by **researching alternatives first** (which is how `jcodemunch` was dropped for its license and Serena was added as an option). Then every component shipped one small piece at a time through a disciplined loop: **brainstorm → spec → plan → TDD implementation → an independent two-stage review** (does it match the spec? is it well-built?) **→ merge**. Those reviews caught real bugs before they shipped — a Windows `.cmd` spawn failure, a commit-integrity hole, a path-traversal that could delete project data, a resolution bug that broke the CLI's default invocation, a TOML-escaping bug. Yoke was even **dogfooded on its own repo**, which surfaced (and fixed) a genuine Windows bug. Every spec and plan lives in [`docs/superpowers/`](docs/superpowers/).
898
+
899
+ ## 🗂️ Project layout
900
+
901
+ ```text
902
+ canon/ # the source of truth — harness-agnostic
903
+ AGENTS.md skills/ policy/ loop/ tools/ manifest.yaml
904
+ src/
905
+ canon/ # manifest schema + validator (yoke validate)
906
+ change/ # append-only change inbox · planning · independent coverage review
907
+ retrofit/ # detect · plan · apply · planners (all seven harnesses) · tools
908
+ loop/ # prd · gates · runner · verify · git/worktree · loop · run-command · lock · cleanup
909
+ quality/ # reference collection · blind critic · bounded repair · candidate comparison
910
+ new/ # yoke new — greenfield bootstrap
911
+ prd/ # yoke prd draft|check — idea → stories + lint gate
912
+ review/ # yoke review — cross-model diff gate
913
+ smoke/ # yoke flow-smoke — browser gate with screenshot/video proofs
914
+ scan/ # yoke design-scan — AI-slop design gate
915
+ context/ # the durable context layer
916
+ docs/superpowers/ # the spec and every component's implementation plan
917
+ ```
918
+
919
+ ## 🗺️ Roadmap
920
+
921
+ Completed release work lives in the changelog. Remaining, explicitly scoped work is tracked in
922
+ [`TODOS.md`](TODOS.md), including broader benchmark samples, native output schemas, and signed
923
+ release provenance.
924
+
925
+ ## 🧪 Development
926
+
927
+ ```bash
928
+ npm test # vitest (1231 tests)
929
+ npm run build # tsc, no emit errors
930
+ npm run yoke -- validate canon
931
+ ```
932
+
933
+ ## 🙏 Credits & inspiration
934
+
935
+ Yoke stands on the shoulders of a great ecosystem: methodology ideas from [superpowers](https://github.com/obra/superpowers) and [gstack](https://github.com/garrytan/gstack); the [AGENTS.md](https://agents.md/) standard; the generator pattern from [wshobson/agents](https://github.com/wshobson/agents); the Ralph autonomous-loop pattern; safety-gate thinking from safe-agentic-workflow; and the wired tools [rtk](https://github.com/rtk-ai/rtk), [graphify](https://github.com/safishamsi/graphify), [Serena](https://github.com/oraios/serena), and [Playwright MCP](https://github.com/microsoft/playwright-mcp). The `minimal-code` skill adapts the MIT-licensed [ponytail](https://github.com/DietrichGebert/ponytail) ruleset.
936
+
937
+ ## 📄 License
938
+
939
+ MIT — see [`LICENSE`](LICENSE).
940
+
941
+ <div align="center">
942
+ <sub>Built with a disciplined loop: brainstorm → spec → plan → TDD → two-stage review → merge — and reviewed by a second model, because we don't trust "done" either.</sub>
943
+ </div>