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