@hecer/yoke 1.10.0 → 1.11.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.
- package/.claude-plugin/plugin.json +13 -13
- package/.codex-plugin/plugin.json +7 -7
- package/CHANGELOG.md +398 -379
- package/README.md +915 -915
- package/TODOS.md +5 -5
- package/agents/docs.toml +6 -6
- package/agents/implementer.toml +6 -6
- package/agents/reviewer.toml +6 -6
- package/agents/security.toml +6 -6
- package/bench/README.md +86 -86
- package/bench/RESULTS.md +35 -35
- package/bench/output-compaction.mjs +65 -65
- package/bench/result-schema.mjs +12 -12
- package/bench/results/claude-2026-07-27T18-03-26.json +50 -50
- package/bench/results/codex-unavailable-1785175418318.json +15 -15
- package/bench/results/gemini-2026-07-27T18-03-44.json +46 -46
- package/bench/run-matrix.mjs +26 -26
- package/bench/run.mjs +106 -106
- package/canon/AGENTS.md +30 -30
- package/canon/context/DECISIONS.md +4 -4
- package/canon/context/GLOSSARY.md +11 -11
- package/canon/context/KNOWLEDGE.md +4 -4
- package/canon/context/PROJECT.md +15 -15
- package/canon/loop/loop-spec.md +65 -65
- package/canon/loop/prd.schema.md +41 -41
- package/canon/manifest.yaml +59 -59
- package/canon/policy/gates.md +7 -7
- package/canon/policy/roles.md +9 -9
- package/canon/skills/ATTRIBUTION.md +99 -99
- package/canon/skills/authoring-prd/SKILL.md +56 -56
- package/canon/skills/brainstorming/SKILL.md +164 -164
- package/canon/skills/codebase-design/DEEPENING.md +15 -15
- package/canon/skills/codebase-design/DESIGN-IT-TWICE.md +12 -12
- package/canon/skills/codebase-design/SKILL.md +39 -39
- package/canon/skills/dispatching-parallel-agents/SKILL.md +182 -182
- package/canon/skills/document-release/SKILL.md +302 -302
- package/canon/skills/domain-modeling/ADR-FORMAT.md +19 -19
- package/canon/skills/domain-modeling/CONTEXT-FORMAT.md +39 -39
- package/canon/skills/domain-modeling/SKILL.md +35 -35
- package/canon/skills/executing-plans/SKILL.md +70 -70
- package/canon/skills/finishing-a-development-branch/SKILL.md +200 -200
- package/canon/skills/health/SKILL.md +177 -177
- package/canon/skills/maintaining-context/SKILL.md +34 -34
- package/canon/skills/minimal-code/SKILL.md +21 -21
- package/canon/skills/no-ai-slop/SKILL.md +103 -103
- package/canon/skills/no-ai-slop/eval.md +43 -43
- package/canon/skills/plan-ceo-review/SKILL.md +541 -541
- package/canon/skills/plan-eng-review/SKILL.md +362 -362
- package/canon/skills/receiving-code-review/SKILL.md +213 -213
- package/canon/skills/requesting-code-review/SKILL.md +105 -105
- package/canon/skills/resolving-merge-conflicts/SKILL.md +18 -18
- package/canon/skills/retro/SKILL.md +397 -397
- package/canon/skills/review/SKILL.md +246 -246
- package/canon/skills/ship/SKILL.md +691 -691
- package/canon/skills/subagent-driven-development/SKILL.md +277 -277
- package/canon/skills/systematic-debugging/SKILL.md +296 -296
- package/canon/skills/tdd/SKILL.md +371 -371
- package/canon/skills/unslop-ui/SKILL.md +34 -34
- package/canon/skills/using-git-worktrees/SKILL.md +218 -218
- package/canon/skills/verification-before-completion/SKILL.md +139 -139
- package/canon/skills/visual-verification/SKILL.md +54 -54
- package/canon/skills/workflow/SKILL.md +22 -22
- package/canon/skills/writing-for-agents/SKILL-MECHANICS.md +27 -27
- package/canon/skills/writing-for-agents/SKILL.md +42 -42
- package/canon/skills/writing-plans/SKILL.md +152 -152
- package/canon/skills/writing-skills/SKILL.md +655 -655
- package/canon/skills/yoke-retrofit/SKILL.md +26 -26
- package/canon/skills/yoke-workflow/SKILL.md +20 -20
- package/canon/tools/codex-rtk-hook.mjs +35 -35
- package/canon/tools/gemini-rtk-hook.mjs +25 -25
- package/canon/tools/graphify.md +3 -3
- package/canon/tools/playwright-mcp.md +3 -3
- package/canon/tools/rtk.md +7 -7
- package/canon/tools/serena.md +6 -6
- package/dist/agents/contracts.js +1 -1
- package/dist/agents/host.js +4 -0
- package/dist/agents/providers.js +13 -0
- package/dist/agents/telemetry.js +33 -0
- package/dist/canon/manifest.js +1 -1
- package/dist/cli.js +9 -9
- package/dist/dashboard/discovery.js +73 -0
- package/dist/dashboard/page.js +122 -122
- package/dist/dashboard/panels.js +91 -91
- package/dist/goals/command.js +2 -2
- package/dist/loop/claims.js +1 -1
- package/dist/loop/decision.js +2 -2
- package/dist/loop/prd.js +1 -1
- package/dist/prd/command.js +17 -17
- package/dist/quality/types.js +1 -1
- package/dist/retrofit/plan.js +2 -0
- package/dist/retrofit/planners/claude.js +14 -14
- package/dist/retrofit/planners/qwen.js +73 -0
- package/dist/retrofit/preserve.js +2 -2
- package/dist/retrofit/skill-actions.js +1 -0
- package/dist/review/command.js +1 -1
- package/dist/routing/capability.js +1 -1
- package/dist/routing/router.js +1 -1
- package/dist/setup/command.js +9 -3
- package/docs/CAPABILITY-ROUTING.md +51 -51
- package/docs/DASHBOARD-EVOLUTION.md +33 -33
- package/docs/MIGRATING-TO-1.0.md +33 -33
- package/docs/MIGRATING-TO-1.1.md +27 -27
- package/docs/MIGRATING-TO-1.4.md +70 -70
- package/docs/PRODUCT-DIRECTION-2026-09-05.md +210 -210
- package/docs/PUBLISHING.md +114 -114
- package/docs/VERIFIED-PROJECTS-VALIDATION.md +29 -29
- package/docs/VERIFIED-PROJECTS.md +167 -167
- package/docs/community-outreach-2026-08-20.md +85 -0
- package/docs/launch-copy-2026-08-21.md +193 -0
- package/docs/superpowers/plans/2026-06-28-baustein-e-context-layer.md +981 -981
- package/docs/superpowers/plans/2026-06-29-baustein-f-routing.md +258 -258
- package/docs/superpowers/plans/2026-06-29-baustein-g-loop-observability.md +1006 -1006
- package/docs/superpowers/plans/2026-06-29-baustein-h-loop-robustness.md +374 -374
- package/docs/superpowers/plans/2026-06-30-baustein-i-visual-design-verification.md +450 -450
- package/docs/superpowers/plans/2026-07-02-baustein-k-zero-to-100-bootstrap.md +1024 -1024
- package/docs/superpowers/plans/2026-07-02-baustein-m-flow-smoke-proofs.md +574 -574
- package/docs/superpowers/plans/2026-08-13-gauntlet-quality-loop.md +537 -537
- package/docs/superpowers/plans/2026-08-16-artifact-backed-output-compaction.md +329 -329
- package/docs/superpowers/plans/2026-09-05-verified-projects.md +83 -83
- package/docs/superpowers/specs/2026-06-28-baustein-e-context-layer-design.md +146 -146
- package/docs/superpowers/specs/2026-06-29-baustein-f-routing-design.md +106 -106
- package/docs/superpowers/specs/2026-06-29-baustein-g-loop-observability-design.md +186 -186
- package/docs/superpowers/specs/2026-06-29-baustein-h-loop-robustness-design.md +113 -113
- package/docs/superpowers/specs/2026-06-30-baustein-i-visual-design-verification-design.md +98 -98
- package/docs/superpowers/specs/2026-07-02-baustein-k-zero-to-100-bootstrap-design.md +200 -200
- package/docs/superpowers/specs/2026-07-02-baustein-m-flow-smoke-proofs-design.md +155 -155
- package/docs/superpowers/specs/2026-08-13-gauntlet-quality-loop-design.md +422 -422
- package/docs/superpowers/specs/2026-08-16-artifact-backed-output-compaction-design.md +166 -166
- package/gemini-extension.json +6 -6
- package/hooks/hooks.json +19 -19
- package/package.json +87 -87
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: yoke-retrofit
|
|
3
|
-
description: Use when asked to "retrofit", "yoke this project", or set up the Yoke harness in a project — runs the shared setup wizard and configures the same behavior for Claude, Codex, and Gemini.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Yoke Retrofit
|
|
7
|
-
|
|
8
|
-
Set up or update Yoke through the shared `yoke setup` contract.
|
|
9
|
-
|
|
10
|
-
1. Inspect the project and identify the current host (`claude`, `codex`, or `gemini`).
|
|
11
|
-
2. Ask these setup questions one at a time and give a direct recommendation:
|
|
12
|
-
- target agents (recommend the current host; use `all` for deliberately cross-agent projects),
|
|
13
|
-
- code-graph tool,
|
|
14
|
-
- autonomous loop on/off,
|
|
15
|
-
- default runner (recommend the current host),
|
|
16
|
-
- decision mode: `auto` or `critical`.
|
|
17
|
-
3. Recommend the code graph based on this project:
|
|
18
|
-
- **Serena** is LSP-accurate and best for large typed codebases or systematic symbol refactors where a missed reference is costly. It needs a language server per language.
|
|
19
|
-
- **graphify** is fast and multimodal, and is best for exploration, migration, onboarding, or mixed code and document repositories. Its graph is an index and can become stale.
|
|
20
|
-
4. Apply the answers without a second round of prompts:
|
|
21
|
-
`yoke setup . --yes --host=<host> --agent=<agents> --code-graph=<choice> --runner=<runner> --decision-policy=<auto|critical> --loop|--no-loop`.
|
|
22
|
-
A human who runs `yoke setup .` directly receives the same five terminal questions.
|
|
23
|
-
5. Show the generated report and backup paths. Existing files are backed up under `.yoke/backup/`; settings are merged where supported.
|
|
24
|
-
6. If an old generated `CLAUDE.md` or `GEMINI.md` contained project-specific instructions, restore them inside its `<!-- yoke:preserve:start -->` / `<!-- yoke:preserve:end -->` block. Preserve blocks survive every later retrofit.
|
|
25
|
-
|
|
26
|
-
The generated harness includes the provider-neutral `yoke-workflow` skill. It owns the planning questions, approved-plan handoff, autonomous stories, and critical-decision resume flow.
|
|
1
|
+
---
|
|
2
|
+
name: yoke-retrofit
|
|
3
|
+
description: Use when asked to "retrofit", "yoke this project", or set up the Yoke harness in a project — runs the shared setup wizard and configures the same behavior for Claude, Codex, and Gemini.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Yoke Retrofit
|
|
7
|
+
|
|
8
|
+
Set up or update Yoke through the shared `yoke setup` contract.
|
|
9
|
+
|
|
10
|
+
1. Inspect the project and identify the current host (`claude`, `codex`, or `gemini`).
|
|
11
|
+
2. Ask these setup questions one at a time and give a direct recommendation:
|
|
12
|
+
- target agents (recommend the current host; use `all` for deliberately cross-agent projects),
|
|
13
|
+
- code-graph tool,
|
|
14
|
+
- autonomous loop on/off,
|
|
15
|
+
- default runner (recommend the current host),
|
|
16
|
+
- decision mode: `auto` or `critical`.
|
|
17
|
+
3. Recommend the code graph based on this project:
|
|
18
|
+
- **Serena** is LSP-accurate and best for large typed codebases or systematic symbol refactors where a missed reference is costly. It needs a language server per language.
|
|
19
|
+
- **graphify** is fast and multimodal, and is best for exploration, migration, onboarding, or mixed code and document repositories. Its graph is an index and can become stale.
|
|
20
|
+
4. Apply the answers without a second round of prompts:
|
|
21
|
+
`yoke setup . --yes --host=<host> --agent=<agents> --code-graph=<choice> --runner=<runner> --decision-policy=<auto|critical> --loop|--no-loop`.
|
|
22
|
+
A human who runs `yoke setup .` directly receives the same five terminal questions.
|
|
23
|
+
5. Show the generated report and backup paths. Existing files are backed up under `.yoke/backup/`; settings are merged where supported.
|
|
24
|
+
6. If an old generated `CLAUDE.md` or `GEMINI.md` contained project-specific instructions, restore them inside its `<!-- yoke:preserve:start -->` / `<!-- yoke:preserve:end -->` block. Preserve blocks survive every later retrofit.
|
|
25
|
+
|
|
26
|
+
The generated harness includes the provider-neutral `yoke-workflow` skill. It owns the planning questions, approved-plan handoff, autonomous stories, and critical-decision resume flow.
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: yoke-workflow
|
|
3
|
-
description: Use when the user asks Yoke to plan and build a feature, run stories autonomously, continue a Yoke loop, or only interrupt for major decisions.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Yoke Workflow
|
|
7
|
-
|
|
8
|
-
Provide the same interaction contract in Claude, Codex, and Gemini.
|
|
9
|
-
|
|
10
|
-
1. Read `.yoke/config.yaml`. If it is missing, offer `yoke setup . --host=<current-agent>` and run the setup flow before planning.
|
|
11
|
-
2. Plan before starting the loop. Inspect the project, then ask one focused question at a time only where the answer changes product behavior, scope, architecture, security, data ownership, external cost, or an irreversible choice. Include a recommended answer. Resolve routine implementation details yourself.
|
|
12
|
-
3. Summarize the agreed design in `.yoke/plan.md`, including goals, non-goals, constraints, and decisions. Use the `authoring-prd` skill to turn it into small stories with testable acceptance criteria. Run `yoke prd check .`.
|
|
13
|
-
4. Ask once for approval of the complete plan and story set. Do not begin implementation before that approval.
|
|
14
|
-
5. If `loop.enabled` is true, run the stories without routine follow-up questions using the configured runner. Prefer `yoke loop run . --max=5 --isolate`, report status after each batch, and continue until complete or genuinely blocked.
|
|
15
|
-
6. Respect `loop.decisionPolicy`:
|
|
16
|
-
- `auto`: choose the most suitable option from the plan, current code, and established conventions. Record the interpretation and continue.
|
|
17
|
-
- `critical`: routine ambiguity is still resolved automatically. If the loop reports a pending critical decision, run `yoke loop decision .`, present its options and recommendation to the user, ask exactly that question, then run `yoke loop answer . --choice=<id> --rationale="<answer>"`. The answer command records the decision and resumes the same story.
|
|
18
|
-
7. Never ask whether to run tests, review, commit, or continue to the next approved story. Those are part of the approved workflow.
|
|
19
|
-
|
|
20
|
-
The user's configured commit identity is authoritative. Do not add an AI co-author unless `commit.allowCoAuthors` explicitly permits it.
|
|
1
|
+
---
|
|
2
|
+
name: yoke-workflow
|
|
3
|
+
description: Use when the user asks Yoke to plan and build a feature, run stories autonomously, continue a Yoke loop, or only interrupt for major decisions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Yoke Workflow
|
|
7
|
+
|
|
8
|
+
Provide the same interaction contract in Claude, Codex, and Gemini.
|
|
9
|
+
|
|
10
|
+
1. Read `.yoke/config.yaml`. If it is missing, offer `yoke setup . --host=<current-agent>` and run the setup flow before planning.
|
|
11
|
+
2. Plan before starting the loop. Inspect the project, then ask one focused question at a time only where the answer changes product behavior, scope, architecture, security, data ownership, external cost, or an irreversible choice. Include a recommended answer. Resolve routine implementation details yourself.
|
|
12
|
+
3. Summarize the agreed design in `.yoke/plan.md`, including goals, non-goals, constraints, and decisions. Use the `authoring-prd` skill to turn it into small stories with testable acceptance criteria. Run `yoke prd check .`.
|
|
13
|
+
4. Ask once for approval of the complete plan and story set. Do not begin implementation before that approval.
|
|
14
|
+
5. If `loop.enabled` is true, run the stories without routine follow-up questions using the configured runner. Prefer `yoke loop run . --max=5 --isolate`, report status after each batch, and continue until complete or genuinely blocked.
|
|
15
|
+
6. Respect `loop.decisionPolicy`:
|
|
16
|
+
- `auto`: choose the most suitable option from the plan, current code, and established conventions. Record the interpretation and continue.
|
|
17
|
+
- `critical`: routine ambiguity is still resolved automatically. If the loop reports a pending critical decision, run `yoke loop decision .`, present its options and recommendation to the user, ask exactly that question, then run `yoke loop answer . --choice=<id> --rationale="<answer>"`. The answer command records the decision and resumes the same story.
|
|
18
|
+
7. Never ask whether to run tests, review, commit, or continue to the next approved story. Those are part of the approved workflow.
|
|
19
|
+
|
|
20
|
+
The user's configured commit identity is authoritative. Do not add an AI co-author unless `commit.allowCoAuthors` explicitly permits it.
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { spawnSync } from 'node:child_process'
|
|
2
|
-
import { resolve } from 'node:path'
|
|
3
|
-
import { pathToFileURL } from 'node:url'
|
|
4
|
-
|
|
5
|
-
function rtkCheck(command) {
|
|
6
|
-
const result = spawnSync('rtk', ['hook', 'check', command], { encoding: 'utf8', timeout: 3000 })
|
|
7
|
-
return result.status === 0 ? result.stdout.trim() : ''
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function rewriteHookInput(input, check = rtkCheck) {
|
|
11
|
-
if (input?.tool_name !== 'Bash' && input?.toolName !== 'Bash') return null
|
|
12
|
-
const toolInput = input.tool_input ?? input.toolInput
|
|
13
|
-
const command = toolInput?.command
|
|
14
|
-
if (typeof command !== 'string' || command.trim() === '') return null
|
|
15
|
-
const rewritten = check(command)
|
|
16
|
-
if (!rewritten || rewritten === command) return null
|
|
17
|
-
return {
|
|
18
|
-
hookSpecificOutput: {
|
|
19
|
-
hookEventName: 'PreToolUse',
|
|
20
|
-
updatedInput: { ...toolInput, command: rewritten },
|
|
21
|
-
},
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async function main() {
|
|
26
|
-
let raw = ''
|
|
27
|
-
for await (const chunk of process.stdin) raw += chunk
|
|
28
|
-
try {
|
|
29
|
-
const output = rewriteHookInput(JSON.parse(raw))
|
|
30
|
-
if (output) process.stdout.write(JSON.stringify(output))
|
|
31
|
-
} catch {
|
|
32
|
-
// Compression is an optimization. Malformed input must never block Codex.
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
if (process.argv[1] && pathToFileURL(resolve(process.argv[1])).href === import.meta.url) await main()
|
|
2
|
+
import { resolve } from 'node:path'
|
|
3
|
+
import { pathToFileURL } from 'node:url'
|
|
4
|
+
|
|
5
|
+
function rtkCheck(command) {
|
|
6
|
+
const result = spawnSync('rtk', ['hook', 'check', command], { encoding: 'utf8', timeout: 3000 })
|
|
7
|
+
return result.status === 0 ? result.stdout.trim() : ''
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function rewriteHookInput(input, check = rtkCheck) {
|
|
11
|
+
if (input?.tool_name !== 'Bash' && input?.toolName !== 'Bash') return null
|
|
12
|
+
const toolInput = input.tool_input ?? input.toolInput
|
|
13
|
+
const command = toolInput?.command
|
|
14
|
+
if (typeof command !== 'string' || command.trim() === '') return null
|
|
15
|
+
const rewritten = check(command)
|
|
16
|
+
if (!rewritten || rewritten === command) return null
|
|
17
|
+
return {
|
|
18
|
+
hookSpecificOutput: {
|
|
19
|
+
hookEventName: 'PreToolUse',
|
|
20
|
+
updatedInput: { ...toolInput, command: rewritten },
|
|
21
|
+
},
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async function main() {
|
|
26
|
+
let raw = ''
|
|
27
|
+
for await (const chunk of process.stdin) raw += chunk
|
|
28
|
+
try {
|
|
29
|
+
const output = rewriteHookInput(JSON.parse(raw))
|
|
30
|
+
if (output) process.stdout.write(JSON.stringify(output))
|
|
31
|
+
} catch {
|
|
32
|
+
// Compression is an optimization. Malformed input must never block Codex.
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (process.argv[1] && pathToFileURL(resolve(process.argv[1])).href === import.meta.url) await main()
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Pure BeforeTool argument adapter. Never evaluates or executes tool commands.
|
|
3
|
-
import { readFileSync } from 'node:fs'
|
|
4
|
-
|
|
5
|
-
const record = value => value !== null && typeof value === 'object' && !Array.isArray(value)
|
|
6
|
-
try {
|
|
7
|
-
const event = JSON.parse(readFileSync(0, 'utf8'))
|
|
8
|
-
if (!record(event) || typeof event.tool_name !== 'string' ||
|
|
9
|
-
(event.hook_event_name !== undefined && event.hook_event_name !== 'BeforeTool')) throw new Error('event')
|
|
10
|
-
let response = {}
|
|
11
|
-
if (event.tool_name === 'run_shell_command') {
|
|
12
|
-
if (!record(event.tool_input) || typeof event.tool_input.command !== 'string' || !event.tool_input.command.trim() || event.tool_input.command.includes('\0')) throw new Error('command')
|
|
13
|
-
const command = event.tool_input.command
|
|
14
|
-
// Restrict rewriting to simple supported invocations. Leave shell syntax,
|
|
15
|
-
// quoted executables, assignments and existing RTK wrappers untouched.
|
|
16
|
-
if (!/[;&|<>`$\r\n()]/u.test(command) && /^\s*(?:git|rg|npm|npx|cargo|pytest|go|docker|kubectl)\s/u.test(command)) {
|
|
17
|
-
const rewritten = command.trimStart().replace(/^rg\s/u, 'grep ')
|
|
18
|
-
response = { hookSpecificOutput: { tool_input: { ...event.tool_input, command: `rtk ${rewritten}` } } }
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
process.stdout.write(JSON.stringify(response) + '\n')
|
|
22
|
-
} catch {
|
|
23
|
-
process.stderr.write('Invalid Gemini BeforeTool hook input\n')
|
|
24
|
-
process.exitCode = 2
|
|
25
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Pure BeforeTool argument adapter. Never evaluates or executes tool commands.
|
|
3
|
+
import { readFileSync } from 'node:fs'
|
|
4
|
+
|
|
5
|
+
const record = value => value !== null && typeof value === 'object' && !Array.isArray(value)
|
|
6
|
+
try {
|
|
7
|
+
const event = JSON.parse(readFileSync(0, 'utf8'))
|
|
8
|
+
if (!record(event) || typeof event.tool_name !== 'string' ||
|
|
9
|
+
(event.hook_event_name !== undefined && event.hook_event_name !== 'BeforeTool')) throw new Error('event')
|
|
10
|
+
let response = {}
|
|
11
|
+
if (event.tool_name === 'run_shell_command') {
|
|
12
|
+
if (!record(event.tool_input) || typeof event.tool_input.command !== 'string' || !event.tool_input.command.trim() || event.tool_input.command.includes('\0')) throw new Error('command')
|
|
13
|
+
const command = event.tool_input.command
|
|
14
|
+
// Restrict rewriting to simple supported invocations. Leave shell syntax,
|
|
15
|
+
// quoted executables, assignments and existing RTK wrappers untouched.
|
|
16
|
+
if (!/[;&|<>`$\r\n()]/u.test(command) && /^\s*(?:git|rg|npm|npx|cargo|pytest|go|docker|kubectl)\s/u.test(command)) {
|
|
17
|
+
const rewritten = command.trimStart().replace(/^rg\s/u, 'grep ')
|
|
18
|
+
response = { hookSpecificOutput: { tool_input: { ...event.tool_input, command: `rtk ${rewritten}` } } }
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
process.stdout.write(JSON.stringify(response) + '\n')
|
|
22
|
+
} catch {
|
|
23
|
+
process.stderr.write('Invalid Gemini BeforeTool hook input\n')
|
|
24
|
+
process.exitCode = 2
|
|
25
|
+
}
|
package/canon/tools/graphify.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# Tool: graphify (code-graph)
|
|
2
|
-
|
|
3
|
-
MIT, multimodal code/doc graph. Wired as an MCP server for all three agents (stdio). Prefer symbol/graph lookups over reading whole files. Caveat: heuristic edges (INFERRED/AMBIGUOUS) and a static index that can go stale — rebuild on significant changes.
|
|
1
|
+
# Tool: graphify (code-graph)
|
|
2
|
+
|
|
3
|
+
MIT, multimodal code/doc graph. Wired as an MCP server for all three agents (stdio). Prefer symbol/graph lookups over reading whole files. Caveat: heuristic edges (INFERRED/AMBIGUOUS) and a static index that can go stale — rebuild on significant changes.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
# Tool: Playwright MCP (browser / dogfooding)
|
|
2
|
-
|
|
3
|
-
Microsoft Playwright MCP, Apache-2.0. Wired as an MCP server for all three agents — the only browser tool with native MCP parity across Claude/Codex/Gemini. Used for QA, dogfooding user flows, screenshots, and deploy verification.
|
|
1
|
+
# Tool: Playwright MCP (browser / dogfooding)
|
|
2
|
+
|
|
3
|
+
Microsoft Playwright MCP, Apache-2.0. Wired as an MCP server for all three agents — the only browser tool with native MCP parity across Claude/Codex/Gemini. Used for QA, dogfooding user flows, screenshots, and deploy verification.
|
package/canon/tools/rtk.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
# Tool: rtk (token compression)
|
|
2
|
-
|
|
3
|
-
Per-agent wiring (generated by Baustein B):
|
|
4
|
-
|
|
5
|
-
- **Claude Code:** PreToolUse hook auto-rewrites commands (`git status` → `rtk git status`). On Windows this needs WSL; otherwise fall back to instruction mode (this file injected into CLAUDE.md telling the agent to prefix commands with `rtk`).
|
|
6
|
-
- **Codex CLI:** inject `RTK.md` / AGENTS.md instruction.
|
|
7
|
-
- **Gemini CLI:** no hook system — register rtk as an MCP tool or inject the GEMINI.md instruction.
|
|
1
|
+
# Tool: rtk (token compression)
|
|
2
|
+
|
|
3
|
+
Per-agent wiring (generated by Baustein B):
|
|
4
|
+
|
|
5
|
+
- **Claude Code:** PreToolUse hook auto-rewrites commands (`git status` → `rtk git status`). On Windows this needs WSL; otherwise fall back to instruction mode (this file injected into CLAUDE.md telling the agent to prefix commands with `rtk`).
|
|
6
|
+
- **Codex CLI:** inject `RTK.md` / AGENTS.md instruction.
|
|
7
|
+
- **Gemini CLI:** no hook system — register rtk as an MCP tool or inject the GEMINI.md instruction.
|
package/canon/tools/serena.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
# Tool: Serena (code-graph, LSP-accurate)
|
|
2
|
-
|
|
3
|
-
MIT, MCP-first. The alternative to graphify, selected via `yoke retrofit --code-graph=serena`. Serena uses real language servers (LSP) for symbol-accurate, cross-file retrieval and refactoring (`find_symbol`, `find_referencing_symbols`, rename/move) — no static index that goes stale, so it will not miss a reference.
|
|
4
|
-
|
|
5
|
-
Wired as an MCP server for all three agents. Best for large, strongly-typed codebases (TypeScript, Python, Go) doing systematic refactoring, where missing a caller is costly.
|
|
6
|
-
|
|
1
|
+
# Tool: Serena (code-graph, LSP-accurate)
|
|
2
|
+
|
|
3
|
+
MIT, MCP-first. The alternative to graphify, selected via `yoke retrofit --code-graph=serena`. Serena uses real language servers (LSP) for symbol-accurate, cross-file retrieval and refactoring (`find_symbol`, `find_referencing_symbols`, rename/move) — no static index that goes stale, so it will not miss a reference.
|
|
4
|
+
|
|
5
|
+
Wired as an MCP server for all three agents. Best for large, strongly-typed codebases (TypeScript, Python, Go) doing systematic refactoring, where missing a caller is costly.
|
|
6
|
+
|
|
7
7
|
Caveat: needs one language server per language (can be fiddly on Windows for exotic languages) and requires `uv`. The launch command is a best-effort template — adjust to your install, e.g. `uvx --from git+https://github.com/oraios/serena serena-mcp-server`.
|
|
8
8
|
|
|
9
9
|
Yoke disables Serena's automatic web-dashboard launch in generated MCP configurations. The
|
package/dist/agents/contracts.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export const AgentSchema = z.enum(['claude', 'codex', 'gemini']);
|
|
2
|
+
export const AgentSchema = z.enum(['claude', 'codex', 'gemini', 'qwen']);
|
|
3
3
|
export const PermissionProfileSchema = z.enum(['safe', 'unsafe', 'read-only']);
|
|
4
4
|
export const ModelSelectionSchema = z.object({
|
|
5
5
|
model: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/).optional(),
|
package/dist/agents/host.js
CHANGED
|
@@ -7,12 +7,16 @@ export function detectHostAgent(env = process.env) {
|
|
|
7
7
|
return 'claude';
|
|
8
8
|
if (env.GEMINI_CLI)
|
|
9
9
|
return 'gemini';
|
|
10
|
+
if (env.QWEN_CLI)
|
|
11
|
+
return 'qwen';
|
|
10
12
|
if (env.CODEX_HOME)
|
|
11
13
|
return 'codex';
|
|
12
14
|
if (env.CLAUDE_CONFIG_DIR)
|
|
13
15
|
return 'claude';
|
|
14
16
|
if (env.GEMINI_CLI_HOME)
|
|
15
17
|
return 'gemini';
|
|
18
|
+
if (env.QWEN_CLI_HOME)
|
|
19
|
+
return 'qwen';
|
|
16
20
|
return undefined;
|
|
17
21
|
}
|
|
18
22
|
export function resolveRunnerAgent(config, explicit, host) {
|
package/dist/agents/providers.js
CHANGED
|
@@ -17,6 +17,13 @@ const argsFor = (agent, permissions) => {
|
|
|
17
17
|
// Automatic review already selects workspace-write and conflicts with --sandbox.
|
|
18
18
|
return ['exec', '--approve-for-me', '--json'];
|
|
19
19
|
}
|
|
20
|
+
// Qwen CLI is a Gemini fork with similar arguments
|
|
21
|
+
if (agent === 'qwen') {
|
|
22
|
+
if (permissions === 'unsafe')
|
|
23
|
+
return ['--yolo', '--output-format', 'stream-json'];
|
|
24
|
+
const approval = permissions === 'read-only' ? 'plan' : 'auto_edit';
|
|
25
|
+
return ['--approval-mode', approval, '--sandbox', '--output-format', 'stream-json'];
|
|
26
|
+
}
|
|
20
27
|
if (permissions === 'unsafe')
|
|
21
28
|
return ['--yolo', '--output-format', 'stream-json'];
|
|
22
29
|
const approval = permissions === 'read-only' ? 'plan' : 'auto_edit';
|
|
@@ -30,6 +37,12 @@ export function buildProviderInvocation(agent, prompt, cwd, permissions = 'safe'
|
|
|
30
37
|
throw new Error('Gemini does not support the reasoningEffort selection');
|
|
31
38
|
if (agent === 'gemini' && parsedSelection.nativeMultiAgent === true)
|
|
32
39
|
throw new Error('Gemini does not support enabling the nativeMultiAgent selection');
|
|
40
|
+
if (agent === 'qwen' && parsedSelection.bare)
|
|
41
|
+
throw new Error('Qwen does not support the bare startup selection');
|
|
42
|
+
if (agent === 'qwen' && parsedSelection.reasoningEffort)
|
|
43
|
+
throw new Error('Qwen does not support the reasoningEffort selection');
|
|
44
|
+
if (agent === 'qwen' && parsedSelection.nativeMultiAgent === true)
|
|
45
|
+
throw new Error('Qwen does not support enabling the nativeMultiAgent selection');
|
|
33
46
|
const args = argsFor(agent, permissions);
|
|
34
47
|
if (output.schemaFile !== undefined || output.jsonSchema !== undefined) {
|
|
35
48
|
if (agent === 'codex' && output.schemaFile && output.jsonSchema === undefined) {
|
package/dist/agents/telemetry.js
CHANGED
|
@@ -45,6 +45,10 @@ export function parseProviderResult(agent, output) {
|
|
|
45
45
|
if (event.type === 'message' && event.role === 'assistant' && typeof event.content === 'string')
|
|
46
46
|
fragments.push(event.content);
|
|
47
47
|
break;
|
|
48
|
+
case 'qwen':
|
|
49
|
+
if (event.type === 'message' && event.role === 'assistant' && typeof event.content === 'string')
|
|
50
|
+
fragments.push(event.content);
|
|
51
|
+
break;
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
const joined = parseJson(fragments.join(''));
|
|
@@ -130,6 +134,35 @@ export function parseProviderTelemetry(agent, lines) {
|
|
|
130
134
|
if (aggregateCached !== undefined)
|
|
131
135
|
source.cached_input_tokens = aggregateCached;
|
|
132
136
|
}
|
|
137
|
+
if (agent === 'qwen' && modelEntries.length > 0) {
|
|
138
|
+
reportedModels = modelEntries.map(([name]) => name);
|
|
139
|
+
model = firstModel?.[0];
|
|
140
|
+
const fields = {
|
|
141
|
+
input_tokens: ['input_tokens', 'inputTokens', 'promptTokenCount', 'input'],
|
|
142
|
+
output_tokens: ['output_tokens', 'outputTokens', 'candidatesTokenCount', 'output'],
|
|
143
|
+
cached_input_tokens: ['cached_input_tokens', 'cachedInputTokens', 'cachedContentTokenCount', 'cached'],
|
|
144
|
+
reasoning_output_tokens: ['reasoning_output_tokens', 'reasoningOutputTokens', 'thoughtsTokenCount', 'thoughts'],
|
|
145
|
+
};
|
|
146
|
+
const totals = {};
|
|
147
|
+
for (const [field, aliases] of Object.entries(fields)) {
|
|
148
|
+
const aggregate = aliases.map(key => finite(usage?.[key])).find(value => value !== undefined);
|
|
149
|
+
if (aggregate !== undefined) {
|
|
150
|
+
totals[field] = aggregate;
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
const values = modelEntries.map(([, value]) => {
|
|
154
|
+
const entry = isRecord(value) ? value : {};
|
|
155
|
+
const tokens = isRecord(entry.tokens) ? entry.tokens : entry;
|
|
156
|
+
return aliases.map(key => finite(tokens[key])).find(value => value !== undefined);
|
|
157
|
+
});
|
|
158
|
+
if (values.every(value => value !== undefined))
|
|
159
|
+
totals[field] = values.reduce((sum, value) => sum + value, 0);
|
|
160
|
+
}
|
|
161
|
+
source = { ...totals, ...usage };
|
|
162
|
+
const aggregateCached = finite(usage?.cached_input_tokens ?? usage?.cached);
|
|
163
|
+
if (aggregateCached !== undefined)
|
|
164
|
+
source.cached_input_tokens = aggregateCached;
|
|
165
|
+
}
|
|
133
166
|
const inValue = finite(source?.input_tokens ?? source?.inputTokens ?? source?.prompt_tokens ?? source?.promptTokenCount ?? source?.input);
|
|
134
167
|
const cachedValue = finite(source?.cached_input_tokens ?? source?.cache_read_input_tokens ?? source?.cachedInputTokens ?? source?.cachedContentTokenCount ?? source?.cached);
|
|
135
168
|
const cacheWriteValue = finite(source?.cache_write_input_tokens ?? source?.cache_creation_input_tokens ?? source?.cacheWriteInputTokens ?? source?.cacheWrite);
|
package/dist/canon/manifest.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { parse } from 'yaml';
|
|
3
3
|
import { readFileSync } from 'node:fs';
|
|
4
|
-
export const AgentSchema = z.enum(['claude', 'codex', 'gemini']);
|
|
4
|
+
export const AgentSchema = z.enum(['claude', 'codex', 'gemini', 'qwen']);
|
|
5
5
|
export const InvocationSchema = z.enum(['auto', 'manual']);
|
|
6
6
|
export const SkillEntrySchema = z.object({
|
|
7
7
|
id: z.string().min(1),
|
package/dist/cli.js
CHANGED
|
@@ -104,7 +104,7 @@ export function main(argv) {
|
|
|
104
104
|
switch (cmd) {
|
|
105
105
|
case 'setup': {
|
|
106
106
|
const targetDir = rest.find(a => !a.startsWith('-')) ?? '.';
|
|
107
|
-
const valid = ['claude', 'codex', 'gemini'];
|
|
107
|
+
const valid = ['claude', 'codex', 'gemini', 'qwen'];
|
|
108
108
|
const hostArg = rest.find(a => a.startsWith('--host='))?.slice('--host='.length);
|
|
109
109
|
if (hostArg && !valid.includes(hostArg)) {
|
|
110
110
|
console.error(`Invalid --host value: ${hostArg}`);
|
|
@@ -226,7 +226,7 @@ export function main(argv) {
|
|
|
226
226
|
}
|
|
227
227
|
if (sub === 'run' || sub === 'resume') {
|
|
228
228
|
const provider = value('runner') ?? 'codex';
|
|
229
|
-
if (!['codex', 'claude', 'gemini'].includes(provider))
|
|
229
|
+
if (!['codex', 'claude', 'gemini', 'qwen'].includes(provider))
|
|
230
230
|
throw new Error('Unknown runner');
|
|
231
231
|
return runProjectGoal(targetDir, { provider: provider, selection: { model: value('model') } }).then(goal => {
|
|
232
232
|
console.log(JSON.stringify(goal));
|
|
@@ -269,7 +269,7 @@ export function main(argv) {
|
|
|
269
269
|
const targetDir = rest.find(a => !a.startsWith('-')) ?? '.';
|
|
270
270
|
const loop = rest.includes('--loop');
|
|
271
271
|
const agentArg = rest.find(a => a.startsWith('--agent='))?.slice('--agent='.length);
|
|
272
|
-
const all = ['claude', 'codex', 'gemini'];
|
|
272
|
+
const all = ['claude', 'codex', 'gemini', 'qwen'];
|
|
273
273
|
const agents = !agentArg || agentArg === 'all'
|
|
274
274
|
? (agentArg === 'all' ? all : undefined)
|
|
275
275
|
: agentArg.split(',').filter((a) => all.includes(a));
|
|
@@ -468,10 +468,10 @@ export function main(argv) {
|
|
|
468
468
|
return 1;
|
|
469
469
|
}
|
|
470
470
|
const runnerArg = rest.find(a => a.startsWith('--runner='))?.slice('--runner='.length);
|
|
471
|
-
const valid = ['claude', 'codex', 'gemini'];
|
|
471
|
+
const valid = ['claude', 'codex', 'gemini', 'qwen'];
|
|
472
472
|
const agent = runnerArg && valid.includes(runnerArg) ? runnerArg : undefined;
|
|
473
473
|
if (runnerArg && !agent) {
|
|
474
|
-
console.error(`Invalid --runner value: ${runnerArg} (expected claude|codex|gemini)`);
|
|
474
|
+
console.error(`Invalid --runner value: ${runnerArg} (expected claude|codex|gemini|qwen)`);
|
|
475
475
|
return 1;
|
|
476
476
|
}
|
|
477
477
|
const isolate = rest.includes('--isolate') ? true : rest.includes('--no-isolate') ? false : undefined;
|
|
@@ -534,7 +534,7 @@ export function main(argv) {
|
|
|
534
534
|
const idea = rest.find(a => a.startsWith('--idea='))?.slice('--idea='.length);
|
|
535
535
|
const loop = rest.includes('--loop');
|
|
536
536
|
const agentArg = rest.find(a => a.startsWith('--agent='))?.slice('--agent='.length);
|
|
537
|
-
const all = ['claude', 'codex', 'gemini'];
|
|
537
|
+
const all = ['claude', 'codex', 'gemini', 'qwen'];
|
|
538
538
|
const agents = !agentArg || agentArg === 'all'
|
|
539
539
|
? (agentArg === 'all' ? all : undefined)
|
|
540
540
|
: agentArg.split(',').filter((a) => all.includes(a));
|
|
@@ -553,7 +553,7 @@ export function main(argv) {
|
|
|
553
553
|
const targetDir = rest.slice(1).find(a => !a.startsWith('-')) ?? '.';
|
|
554
554
|
if (sub === 'assess') {
|
|
555
555
|
const runner = rest.find(a => a.startsWith('--runner='))?.slice('--runner='.length);
|
|
556
|
-
if (runner && !['codex', 'claude', 'gemini'].includes(runner)) {
|
|
556
|
+
if (runner && !['codex', 'claude', 'gemini', 'qwen'].includes(runner)) {
|
|
557
557
|
console.error('Invalid planning runner');
|
|
558
558
|
return 1;
|
|
559
559
|
}
|
|
@@ -565,10 +565,10 @@ export function main(argv) {
|
|
|
565
565
|
console.error('usage: yoke prd draft [dir] --idea="..." [--runner=<claude|codex|gemini>] [--force] [--timeout=<minutes>]');
|
|
566
566
|
return 1;
|
|
567
567
|
}
|
|
568
|
-
const valid = ['claude', 'codex', 'gemini'];
|
|
568
|
+
const valid = ['claude', 'codex', 'gemini', 'qwen'];
|
|
569
569
|
const runnerArg = rest.find(a => a.startsWith('--runner='))?.slice('--runner='.length);
|
|
570
570
|
if (runnerArg && !valid.includes(runnerArg)) {
|
|
571
|
-
console.error(`Invalid --runner value: ${runnerArg} (expected claude|codex|gemini)`);
|
|
571
|
+
console.error(`Invalid --runner value: ${runnerArg} (expected claude|codex|gemini|qwen)`);
|
|
572
572
|
return 1;
|
|
573
573
|
}
|
|
574
574
|
const force = rest.includes('--force');
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { opendir, lstat, realpath } from 'node:fs/promises';
|
|
2
|
+
import { delimiter, dirname, join, parse, resolve } from 'node:path';
|
|
3
|
+
import { autoRegisterProject, listProjects } from './registry.js';
|
|
4
|
+
const skip = new Set(['node_modules', 'vendor', 'dist', 'build', 'coverage', 'bench', 'fixtures']);
|
|
5
|
+
export function discoveryRoots() {
|
|
6
|
+
const configured = process.env.YOKE_PROJECT_ROOTS?.split(delimiter).filter(Boolean);
|
|
7
|
+
const candidates = configured ?? [dirname(process.cwd()), ...listProjects().filter(p => !p.error).map(p => dirname(p.root))];
|
|
8
|
+
const roots = [...new Set(candidates.map(p => resolve(p)))].filter(p => p !== parse(p).root);
|
|
9
|
+
return roots.filter(p => !roots.some(other => other !== p && p.startsWith(other + (process.platform === 'win32' ? '\\' : '/'))));
|
|
10
|
+
}
|
|
11
|
+
/** Incremental traversal keeps directory IO out of the HTTP request path. */
|
|
12
|
+
export function startProjectDiscovery(roots = discoveryRoots) {
|
|
13
|
+
let stopped = false;
|
|
14
|
+
let active;
|
|
15
|
+
let queue = [];
|
|
16
|
+
let visited = new Set();
|
|
17
|
+
let current;
|
|
18
|
+
const scan = async () => {
|
|
19
|
+
if (!queue.length && !current) {
|
|
20
|
+
queue = roots();
|
|
21
|
+
visited = new Set();
|
|
22
|
+
}
|
|
23
|
+
let budget = 500;
|
|
24
|
+
while (!stopped && budget-- > 0 && (current || queue.length)) {
|
|
25
|
+
if (!current) {
|
|
26
|
+
const path = queue.shift();
|
|
27
|
+
try {
|
|
28
|
+
if ((await lstat(path)).isSymbolicLink())
|
|
29
|
+
continue;
|
|
30
|
+
const canonical = await realpath(path);
|
|
31
|
+
const key = process.platform === 'win32' ? canonical.toLowerCase() : canonical;
|
|
32
|
+
if (visited.has(key))
|
|
33
|
+
continue;
|
|
34
|
+
visited.add(key);
|
|
35
|
+
autoRegisterProject(canonical);
|
|
36
|
+
current = await opendir(canonical);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
try {
|
|
43
|
+
const entry = await current.read();
|
|
44
|
+
if (!entry) {
|
|
45
|
+
await current.close();
|
|
46
|
+
current = undefined;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (entry.isDirectory() && !entry.isSymbolicLink() && !entry.name.startsWith('.') && !skip.has(entry.name.toLowerCase()))
|
|
50
|
+
queue.push(join(current.path, entry.name));
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
try {
|
|
54
|
+
await current?.close();
|
|
55
|
+
}
|
|
56
|
+
catch { /* Already closed. */ }
|
|
57
|
+
current = undefined;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
const tick = () => {
|
|
62
|
+
if (!active && !stopped)
|
|
63
|
+
active = scan().catch(() => { }).finally(() => { active = undefined; });
|
|
64
|
+
return active ?? Promise.resolve();
|
|
65
|
+
};
|
|
66
|
+
const timer = setInterval(() => { void tick(); }, 5000);
|
|
67
|
+
timer.unref();
|
|
68
|
+
void tick();
|
|
69
|
+
return { tick, get pending() { return queue.length + (current ? 1 : 0); }, async close() { stopped = true; clearInterval(timer); await active; try {
|
|
70
|
+
await current?.close();
|
|
71
|
+
}
|
|
72
|
+
catch { /* Already closed. */ } } };
|
|
73
|
+
}
|