harnessed 4.14.1 → 4.15.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 (54) hide show
  1. package/dist/cli.mjs +5 -3
  2. package/dist/cli.mjs.map +1 -1
  3. package/dist/index.mjs +1 -1
  4. package/dist/index.mjs.map +1 -1
  5. package/manifests/skill-packs/gstack.yaml +18 -2
  6. package/package.json +1 -1
  7. package/workflows/auto/SKILL.md +1 -1
  8. package/workflows/auto/SKILL.zh-Hans.md +1 -1
  9. package/workflows/capabilities.yaml +5 -1
  10. package/workflows/plan/architecture/SKILL.md +1 -1
  11. package/workflows/plan/architecture/SKILL.zh-Hans.md +1 -1
  12. package/workflows/plan/auto/SKILL.md +1 -1
  13. package/workflows/plan/auto/SKILL.zh-Hans.md +1 -1
  14. package/workflows/plan/phase/SKILL.md +1 -1
  15. package/workflows/plan/phase/SKILL.zh-Hans.md +1 -1
  16. package/workflows/research/SKILL.md +1 -1
  17. package/workflows/research/SKILL.zh-Hans.md +1 -1
  18. package/workflows/retro/SKILL.md +1 -1
  19. package/workflows/retro/SKILL.zh-Hans.md +1 -1
  20. package/workflows/ship/auto/SKILL.md +1 -1
  21. package/workflows/ship/auto/SKILL.zh-Hans.md +1 -1
  22. package/workflows/ship/preflight/SKILL.md +1 -1
  23. package/workflows/ship/preflight/SKILL.zh-Hans.md +1 -1
  24. package/workflows/task/auto/SKILL.md +1 -1
  25. package/workflows/task/auto/SKILL.zh-Hans.md +1 -1
  26. package/workflows/task/code/SKILL.md +1 -1
  27. package/workflows/task/code/SKILL.zh-Hans.md +1 -1
  28. package/workflows/task/deliver/SKILL.md +6 -1
  29. package/workflows/task/deliver/SKILL.zh-Hans.md +6 -1
  30. package/workflows/task/deliver/workflow.yaml +4 -0
  31. package/workflows/task/test/SKILL.md +1 -1
  32. package/workflows/task/test/SKILL.zh-Hans.md +1 -1
  33. package/workflows/verify/auto/SKILL.md +1 -1
  34. package/workflows/verify/auto/SKILL.zh-Hans.md +1 -1
  35. package/workflows/verify/code-review/SKILL.md +1 -1
  36. package/workflows/verify/code-review/SKILL.zh-Hans.md +1 -1
  37. package/workflows/verify/design/SKILL.md +1 -1
  38. package/workflows/verify/design/SKILL.zh-Hans.md +1 -1
  39. package/workflows/verify/eval-review/SKILL.md +1 -1
  40. package/workflows/verify/eval-review/SKILL.zh-Hans.md +1 -1
  41. package/workflows/verify/multispec/SKILL.md +1 -1
  42. package/workflows/verify/multispec/SKILL.zh-Hans.md +1 -1
  43. package/workflows/verify/paranoid/SKILL.md +1 -1
  44. package/workflows/verify/paranoid/SKILL.zh-Hans.md +1 -1
  45. package/workflows/verify/progress/SKILL.md +1 -1
  46. package/workflows/verify/progress/SKILL.zh-Hans.md +1 -1
  47. package/workflows/verify/qa/SKILL.md +1 -1
  48. package/workflows/verify/qa/SKILL.zh-Hans.md +1 -1
  49. package/workflows/verify/security/SKILL.md +1 -1
  50. package/workflows/verify/security/SKILL.zh-Hans.md +1 -1
  51. package/workflows/verify/simplify/SKILL.md +1 -1
  52. package/workflows/verify/simplify/SKILL.zh-Hans.md +1 -1
  53. package/workflows/verify/validate-phase/SKILL.md +1 -1
  54. package/workflows/verify/validate-phase/SKILL.zh-Hans.md +1 -1
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  // package.json
2
2
  var package_default = {
3
- version: "4.14.1"};
3
+ version: "4.15.0"};
4
4
 
5
5
  // src/index.ts
6
6
  var VERSION = package_default.version;
@@ -1 +1 @@
1
- {"version":3,"sources":["../package.json","../src/index.ts"],"names":[],"mappings":";AAAA,IAAA,eAAA,GAAA;AAAA,EAEE,OAAA,EAAW,QAkGb,CAAA;;;AC/FO,IAAM,UAAU,eAAA,CAAI","file":"index.mjs","sourcesContent":["{\n \"name\": \"harnessed\",\n \"version\": \"4.14.1\",\n \"description\": \"AI coding harness package manager + composition orchestrator\",\n \"type\": \"module\",\n \"license\": \"Apache-2.0\",\n \"author\": \"easyinplay\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/easyinplay/harnessed.git\"\n },\n \"homepage\": \"https://github.com/easyinplay/harnessed#readme\",\n \"bugs\": \"https://github.com/easyinplay/harnessed/issues\",\n \"keywords\": [\n \"claude-code\",\n \"ai-harness\",\n \"package-manager\",\n \"composition\",\n \"skill-pack\",\n \"mcp\",\n \"orchestrator\"\n ],\n \"engines\": {\n \"node\": \">=22.0.0\"\n },\n \"packageManager\": \"pnpm@10.12.0\",\n \"bin\": {\n \"harnessed\": \"./dist/cli.mjs\",\n \"harnessed-inject-state\": \"./bin/harnessed-inject-state.mjs\"\n },\n \"main\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.mjs\",\n \"default\": \"./dist/index.mjs\"\n },\n \"./schemas\": {\n \"types\": \"./dist/schemas/index.d.ts\",\n \"import\": \"./dist/schemas/index.mjs\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"files\": [\n \"dist\",\n \"bin\",\n \"manifests\",\n \"messages\",\n \"workflows\",\n \"routing\",\n \"config-templates\",\n \"schemas\",\n \"README.md\",\n \"LICENSE\",\n \"NOTICE\",\n \"THIRD-PARTY-NOTICES.md\"\n ],\n \"scripts\": {\n \"dev\": \"tsup --watch\",\n \"build\": \"tsc --noEmit && tsup\",\n \"build:schema\": \"node ./scripts/build-schema.mjs\",\n \"validate:schema\": \"node ./scripts/validate-schema.mjs\",\n \"typecheck\": \"tsc --noEmit\",\n \"test\": \"vitest run --passWithNoTests\",\n \"test:watch\": \"vitest\",\n \"test:coverage\": \"vitest run --coverage --passWithNoTests\",\n \"bench\": \"vitest bench --run\",\n \"lint\": \"biome check .\",\n \"lint:fix\": \"biome check --write .\",\n \"format\": \"biome format --write .\"\n },\n \"dependencies\": {\n \"@anthropic-ai/claude-agent-sdk\": \"0.3.142\",\n \"@clack/prompts\": \"^0.10.1\",\n \"@sinclair/typebox\": \"^0.34.49\",\n \"ajv\": \"^8.20.0\",\n \"ajv-errors\": \"^3.0.0\",\n \"ajv-formats\": \"^3.0.1\",\n \"commander\": \"^13.0.0\",\n \"diff\": \"^9.0.0\",\n \"expr-eval\": \"^2.0.2\",\n \"picocolors\": \"^1.1.1\",\n \"proper-lockfile\": \"^4.1.2\",\n \"yaml\": \"^2.9.0\"\n },\n \"devDependencies\": {\n \"@biomejs/biome\": \"^2.0.0\",\n \"@types/node\": \"^22.10.0\",\n \"@types/proper-lockfile\": \"^4.1.4\",\n \"@vitest/coverage-v8\": \"^4.0.0\",\n \"tsup\": \"^8.3.0\",\n \"typescript\": \"^5.6.0\",\n \"vitest\": \"^4.0.0\"\n },\n \"pnpm\": {\n \"onlyBuiltDependencies\": [\n \"esbuild\"\n ]\n }\n}\n","// Main library entry — re-exports public APIs.\n// phase 1.1 batch 1: skeleton only; schema validator wired in batch 2 (T3+).\n\nimport pkg from '../package.json' with { type: 'json' }\n\nexport const VERSION = pkg.version\n"]}
1
+ {"version":3,"sources":["../package.json","../src/index.ts"],"names":[],"mappings":";AAAA,IAAA,eAAA,GAAA;AAAA,EAEE,OAAA,EAAW,QAkGb,CAAA;;;AC/FO,IAAM,UAAU,eAAA,CAAI","file":"index.mjs","sourcesContent":["{\n \"name\": \"harnessed\",\n \"version\": \"4.15.0\",\n \"description\": \"AI coding harness package manager + composition orchestrator\",\n \"type\": \"module\",\n \"license\": \"Apache-2.0\",\n \"author\": \"easyinplay\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://github.com/easyinplay/harnessed.git\"\n },\n \"homepage\": \"https://github.com/easyinplay/harnessed#readme\",\n \"bugs\": \"https://github.com/easyinplay/harnessed/issues\",\n \"keywords\": [\n \"claude-code\",\n \"ai-harness\",\n \"package-manager\",\n \"composition\",\n \"skill-pack\",\n \"mcp\",\n \"orchestrator\"\n ],\n \"engines\": {\n \"node\": \">=22.0.0\"\n },\n \"packageManager\": \"pnpm@10.12.0\",\n \"bin\": {\n \"harnessed\": \"./dist/cli.mjs\",\n \"harnessed-inject-state\": \"./bin/harnessed-inject-state.mjs\"\n },\n \"main\": \"./dist/index.mjs\",\n \"types\": \"./dist/index.d.ts\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.mjs\",\n \"default\": \"./dist/index.mjs\"\n },\n \"./schemas\": {\n \"types\": \"./dist/schemas/index.d.ts\",\n \"import\": \"./dist/schemas/index.mjs\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"files\": [\n \"dist\",\n \"bin\",\n \"manifests\",\n \"messages\",\n \"workflows\",\n \"routing\",\n \"config-templates\",\n \"schemas\",\n \"README.md\",\n \"LICENSE\",\n \"NOTICE\",\n \"THIRD-PARTY-NOTICES.md\"\n ],\n \"scripts\": {\n \"dev\": \"tsup --watch\",\n \"build\": \"tsc --noEmit && tsup\",\n \"build:schema\": \"node ./scripts/build-schema.mjs\",\n \"validate:schema\": \"node ./scripts/validate-schema.mjs\",\n \"typecheck\": \"tsc --noEmit\",\n \"test\": \"vitest run --passWithNoTests\",\n \"test:watch\": \"vitest\",\n \"test:coverage\": \"vitest run --coverage --passWithNoTests\",\n \"bench\": \"vitest bench --run\",\n \"lint\": \"biome check .\",\n \"lint:fix\": \"biome check --write .\",\n \"format\": \"biome format --write .\"\n },\n \"dependencies\": {\n \"@anthropic-ai/claude-agent-sdk\": \"0.3.142\",\n \"@clack/prompts\": \"^0.10.1\",\n \"@sinclair/typebox\": \"^0.34.49\",\n \"ajv\": \"^8.20.0\",\n \"ajv-errors\": \"^3.0.0\",\n \"ajv-formats\": \"^3.0.1\",\n \"commander\": \"^13.0.0\",\n \"diff\": \"^9.0.0\",\n \"expr-eval\": \"^2.0.2\",\n \"picocolors\": \"^1.1.1\",\n \"proper-lockfile\": \"^4.1.2\",\n \"yaml\": \"^2.9.0\"\n },\n \"devDependencies\": {\n \"@biomejs/biome\": \"^2.0.0\",\n \"@types/node\": \"^22.10.0\",\n \"@types/proper-lockfile\": \"^4.1.4\",\n \"@vitest/coverage-v8\": \"^4.0.0\",\n \"tsup\": \"^8.3.0\",\n \"typescript\": \"^5.6.0\",\n \"vitest\": \"^4.0.0\"\n },\n \"pnpm\": {\n \"onlyBuiltDependencies\": [\n \"esbuild\"\n ]\n }\n}\n","// Main library entry — re-exports public APIs.\n// phase 1.1 batch 1: skeleton only; schema validator wired in batch 2 (T3+).\n\nimport pkg from '../package.json' with { type: 'json' }\n\nexport const VERSION = pkg.version\n"]}
@@ -18,11 +18,27 @@ spec:
18
18
  install_type: git
19
19
  install:
20
20
  method: git-clone-with-setup
21
- cmd: "rm -rf ~/.claude/skills/gstack && git clone https://github.com/garrytan/gstack.git ~/.claude/skills/gstack && cd ~/.claude/skills/gstack && bash ./setup.sh"
21
+ # v4.14.2 — 上游脚本 setup.sh → setup 改名 + repo 布局改为根级 skill dirs
22
+ # (office-hours/SKILL.md,原 skills/office-hours.md 已不存在;本机 v1.52+ 实证)。
23
+ # clone 保持无 flag 的 `git clone <url> <dest>` 形状 — extractGitCloneTarget
24
+ # 与 git-clone-idempotent 回归测试锁定该相邻性(--single-branch 会使解析错位)。
25
+ cmd: "rm -rf ~/.claude/skills/gstack && git clone https://github.com/garrytan/gstack.git ~/.claude/skills/gstack && cd ~/.claude/skills/gstack && bash ./setup"
22
26
  git_ref: 14fc0866d9ac9d09d25adcac7b4437c0a235902b
23
27
  idempotent_check: "test -d ~/.claude/skills/gstack/.git"
28
+ # v4.14.2 — 用户指正: gstack 官方支持 10 agents(README § Other AI Agents),
29
+ # codex 走 `./setup --host codex`,skills 装到 ~/.codex/skills/gstack-*/。
30
+ harness_overrides:
31
+ codex:
32
+ install:
33
+ method: git-clone-with-setup
34
+ cmd: "rm -rf ~/gstack && git clone https://github.com/garrytan/gstack.git ~/gstack && cd ~/gstack && bash ./setup --host codex"
35
+ git_ref: 14fc0866d9ac9d09d25adcac7b4437c0a235902b
36
+ idempotent_check: "ls ~/.codex/skills 2>/dev/null | grep -q '^gstack-'"
37
+ verify:
38
+ cmd: "ls ~/.codex/skills | grep -q '^gstack-'"
39
+ timeout_ms: 10000
24
40
  verify:
25
- cmd: "test -f ~/.claude/skills/gstack/skills/office-hours.md"
41
+ cmd: "test -f ~/.claude/skills/gstack/office-hours/SKILL.md"
26
42
  timeout_ms: 5000
27
43
  uninstall:
28
44
  cmd: "rm -rf ~/.claude/skills/gstack"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harnessed",
3
- "version": "4.14.1",
3
+ "version": "4.15.0",
4
4
  "description": "AI coding harness package manager + composition orchestrator",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -122,7 +122,7 @@ that blocks the session, bypasses Agent Teams, and hangs inside Claude Code).
122
122
  - **If the entry has `is_master: true`** (a stage master — e.g. `/auto` firing `plan`/`task`/`verify`): do NOT prompt+spawn it. RECURSE: run that master’s own `harnessed gates <sub> --task "<spec>" --skip-sub clarify` → `harnessed checkpoint start <sub> --plan '<json>'` → repeat this loop for ITS fired subs.
123
123
  - **Else (leaf sub):**
124
124
  a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → parse `{prompt, max_iterations, model}`.
125
- b. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations).
125
+ b. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
126
126
  c. If the output contains `STATUS: NEEDS_CLARIFICATION` + questions: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
127
127
  d. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete <sub> --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it, or pass `--force` only to deliberately override.
128
128
  e. If the sub cannot reach COMPLETE (max_iterations exhausted / unrecoverable error): Bash `harnessed checkpoint fail <sub> --summary "<why>"`, then STOP and report to the user.
@@ -120,7 +120,7 @@ session、绕过 Agent Teams,在 Claude Code 内部调用时会挂死)。
120
120
  - **若该项 `is_master: true`**(本身是 stage master —— 如 `/auto` fire `plan`/`task`/`verify`):**不要**直接 prompt+spawn。RECURSE:跑该 master 自己的 `harnessed gates <sub> --task "<spec>" --skip-sub clarify` → `harnessed checkpoint start <sub> --plan '<json>'` → 对它的 fired subs 重复本循环。
121
121
  - **否则(leaf sub):**
122
122
  a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → 解析 `{prompt, max_iterations, model}`。
123
- b. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。
123
+ b. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
124
124
  c. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn 同一 sub。
125
125
  d. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete <sub> --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它,或仅在刻意覆盖时传 `--force`。
126
126
  e. 若 sub 无法达到 COMPLETE(max_iterations 耗尽 / 不可恢复错误):Bash `harnessed checkpoint fail <sub> --summary "<why>"`,然后 STOP 并向用户报告。
@@ -494,6 +494,10 @@ capabilities:
494
494
  # D-10: ralph-loop 真接 SDK wrapper (NOT mock reference; sister Phase 2.2 v0.2.0 ship)
495
495
  # v3.4.2: ralph-loop is a claude-plugins-official plugin; cmd is the bare `/ralph-loop`
496
496
  # (verified: ralph-loop@claude-plugins-official in installed_plugins.json).
497
+ # v4.15.0 (ADR 0036 amends D-10 interactive surface): 三级偏好链 — plugin 优先
498
+ # (fail-closed verbatim match + 硬 max-iterations) → 未装时 native `/goal` gate
499
+ # (CC 2.1.139+ / Codex 双平台内置) → self-loop 兜底。链条语义由各 workflow SKILL.md
500
+ # 指令文本承载(不加 schema 字段);SDK 路径 ralphLoopWrap 不参与该链。
497
501
  ralph-loop:
498
502
  impl: plugin
499
503
  install_type: plugin
@@ -501,7 +505,7 @@ capabilities:
501
505
  cmd: /ralph-loop
502
506
  since: v2.0
503
507
  category: tool-bundled-skill
504
- description: Sub-task completion gate (verbatim COMPLETE; max-iterations fallback)
508
+ description: Sub-task completion gate (plugin preferred; native /goal fallback on CC 2.1.139+ & Codex; self-loop last resort)
505
509
  sdk_ref: src/workflow/lib/ralphLoop.ts
506
510
  fires_when:
507
511
  - subtask.completion_required == true
@@ -63,7 +63,7 @@ Do NOT pipe to `harnessed run plan-architecture` — that is the CI/headless pat
63
63
  that blocks the session inside Claude Code).
64
64
 
65
65
  1. Bash: `harnessed prompt plan-architecture --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
66
- 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations).
66
+ 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
67
67
  3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
68
68
  4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete plan-architecture --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it before treating the sub as done.
69
69
 
@@ -62,7 +62,7 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
62
62
  Code 内部会阻塞 session)。
63
63
 
64
64
  1. Bash: `harnessed prompt plan-architecture --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
65
- 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,自循环:spawn → 检查 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。
65
+ 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
66
66
  3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
67
67
  4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete plan-architecture --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
68
68
 
@@ -71,7 +71,7 @@ that blocks the session, bypasses Agent Teams, and hangs inside Claude Code).
71
71
  - **If the entry has `is_master: true`** (a stage master — e.g. `/auto` firing `plan`/`task`/`verify`): do NOT prompt+spawn it. RECURSE: run that master’s own `harnessed gates <sub> --task "<spec>" --skip-sub clarify` → `harnessed checkpoint start <sub> --plan '<json>'` → repeat this loop for ITS fired subs.
72
72
  - **Else (leaf sub):**
73
73
  a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → parse `{prompt, max_iterations, model}`.
74
- b. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations).
74
+ b. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
75
75
  c. If the output contains `STATUS: NEEDS_CLARIFICATION` + questions: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
76
76
  d. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete <sub> --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it, or pass `--force` only to deliberately override.
77
77
  e. If the sub cannot reach COMPLETE (max_iterations exhausted / unrecoverable error): Bash `harnessed checkpoint fail <sub> --summary "<why>"`, then STOP and report to the user.
@@ -70,7 +70,7 @@ session、绕过 Agent Teams,在 Claude Code 内部调用时会挂死)。
70
70
  - **若该项 `is_master: true`**(本身是 stage master —— 如 `/auto` fire `plan`/`task`/`verify`):**不要**直接 prompt+spawn。RECURSE:跑该 master 自己的 `harnessed gates <sub> --task "<spec>" --skip-sub clarify` → `harnessed checkpoint start <sub> --plan '<json>'` → 对它的 fired subs 重复本循环。
71
71
  - **否则(leaf sub):**
72
72
  a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → 解析 `{prompt, max_iterations, model}`。
73
- b. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。
73
+ b. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
74
74
  c. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn 同一 sub。
75
75
  d. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete <sub> --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它,或仅在刻意覆盖时传 `--force`。
76
76
  e. 若 sub 无法达到 COMPLETE(max_iterations 耗尽 / 不可恢复错误):Bash `harnessed checkpoint fail <sub> --summary "<why>"`,然后 STOP 并向用户报告。
@@ -65,7 +65,7 @@ Do NOT pipe to `harnessed run plan-phase` — that is the CI/headless path (in-p
65
65
  that blocks the session inside Claude Code).
66
66
 
67
67
  1. Bash: `harnessed prompt plan-phase --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
68
- 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations).
68
+ 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
69
69
  3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
70
70
  4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete plan-phase --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it before treating the sub as done.
71
71
 
@@ -64,7 +64,7 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
64
64
  Code 内部会阻塞 session)。
65
65
 
66
66
  1. Bash: `harnessed prompt plan-phase --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
67
- 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,自循环:spawn → 检查 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。
67
+ 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
68
68
  3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
69
69
  4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete plan-phase --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
70
70
 
@@ -48,7 +48,7 @@ Do NOT pipe to `harnessed run research` — that is the CI/headless path (in-pro
48
48
  that blocks the session inside Claude Code).
49
49
 
50
50
  1. Bash: `harnessed prompt research --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
51
- 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations).
51
+ 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
52
52
  3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
53
53
  4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete research --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it before treating the sub as done.
54
54
 
@@ -47,7 +47,7 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
47
47
  Code 内部会阻塞 session)。
48
48
 
49
49
  1. Bash: `harnessed prompt research --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
50
- 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,自循环:spawn → 检查 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。
50
+ 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
51
51
  3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
52
52
  4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete research --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
53
53
 
@@ -58,7 +58,7 @@ Do NOT pipe to `harnessed run retro` — that is the CI/headless path (in-proces
58
58
  that blocks the session inside Claude Code).
59
59
 
60
60
  1. Bash: `harnessed prompt retro --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
61
- 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations).
61
+ 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
62
62
  3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
63
63
  4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete retro --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it before treating the sub as done.
64
64
 
@@ -57,7 +57,7 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
57
57
  Code 内部会阻塞 session)。
58
58
 
59
59
  1. Bash: `harnessed prompt retro --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
60
- 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,自循环:spawn → 检查 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。
60
+ 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
61
61
  3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
62
62
  4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete retro --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
63
63
 
@@ -65,7 +65,7 @@ that blocks the session, bypasses Agent Teams, and hangs inside Claude Code).
65
65
  - **If the entry has `is_master: true`** (a stage master — e.g. `/auto` firing `plan`/`task`/`verify`): do NOT prompt+spawn it. RECURSE: run that master’s own `harnessed gates <sub> --task "<spec>" --skip-sub clarify` → `harnessed checkpoint start <sub> --plan '<json>'` → repeat this loop for ITS fired subs.
66
66
  - **Else (leaf sub):**
67
67
  a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → parse `{prompt, max_iterations, model}`.
68
- b. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations).
68
+ b. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
69
69
  c. If the output contains `STATUS: NEEDS_CLARIFICATION` + questions: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
70
70
  d. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete <sub> --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it, or pass `--force` only to deliberately override.
71
71
  e. If the sub cannot reach COMPLETE (max_iterations exhausted / unrecoverable error): Bash `harnessed checkpoint fail <sub> --summary "<why>"`, then STOP and report to the user.
@@ -63,7 +63,7 @@ session、绕过 Agent Teams,在 Claude Code 内部调用时会挂死)。
63
63
  - **若该项 `is_master: true`**(本身是 stage master —— 如 `/auto` fire `plan`/`task`/`verify`):**不要**直接 prompt+spawn。RECURSE:跑该 master 自己的 `harnessed gates <sub> --task "<spec>" --skip-sub clarify` → `harnessed checkpoint start <sub> --plan '<json>'` → 对它的 fired subs 重复本循环。
64
64
  - **否则(leaf sub):**
65
65
  a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → 解析 `{prompt, max_iterations, model}`。
66
- b. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。
66
+ b. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
67
67
  c. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn 同一 sub。
68
68
  d. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete <sub> --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它,或仅在刻意覆盖时传 `--force`。
69
69
  e. 若 sub 无法达到 COMPLETE(max_iterations 耗尽 / 不可恢复错误):Bash `harnessed checkpoint fail <sub> --summary "<why>"`,然后 STOP 并向用户报告。
@@ -50,7 +50,7 @@ Do NOT pipe to `harnessed run ship-preflight` — that is the CI/headless path (
50
50
  that blocks the session inside Claude Code).
51
51
 
52
52
  1. Bash: `harnessed prompt ship-preflight --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
53
- 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations).
53
+ 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
54
54
  3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
55
55
  4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete ship-preflight --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it before treating the sub as done.
56
56
 
@@ -47,7 +47,7 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
47
47
  Code 内部会阻塞 session)。
48
48
 
49
49
  1. Bash: `harnessed prompt ship-preflight --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
50
- 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,自循环:spawn → 检查 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。
50
+ 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
51
51
  3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
52
52
  4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete ship-preflight --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
53
53
 
@@ -76,7 +76,7 @@ that blocks the session, bypasses Agent Teams, and hangs inside Claude Code).
76
76
  - **If the entry has `is_master: true`** (a stage master — e.g. `/auto` firing `plan`/`task`/`verify`): do NOT prompt+spawn it. RECURSE: run that master’s own `harnessed gates <sub> --task "<spec>" --skip-sub clarify` → `harnessed checkpoint start <sub> --plan '<json>'` → repeat this loop for ITS fired subs.
77
77
  - **Else (leaf sub):**
78
78
  a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → parse `{prompt, max_iterations, model}`.
79
- b. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations).
79
+ b. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
80
80
  c. If the output contains `STATUS: NEEDS_CLARIFICATION` + questions: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
81
81
  d. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete <sub> --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it, or pass `--force` only to deliberately override.
82
82
  e. If the sub cannot reach COMPLETE (max_iterations exhausted / unrecoverable error): Bash `harnessed checkpoint fail <sub> --summary "<why>"`, then STOP and report to the user.
@@ -75,7 +75,7 @@ session、绕过 Agent Teams,在 Claude Code 内部调用时会挂死)。
75
75
  - **若该项 `is_master: true`**(本身是 stage master —— 如 `/auto` fire `plan`/`task`/`verify`):**不要**直接 prompt+spawn。RECURSE:跑该 master 自己的 `harnessed gates <sub> --task "<spec>" --skip-sub clarify` → `harnessed checkpoint start <sub> --plan '<json>'` → 对它的 fired subs 重复本循环。
76
76
  - **否则(leaf sub):**
77
77
  a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → 解析 `{prompt, max_iterations, model}`。
78
- b. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。
78
+ b. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
79
79
  c. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn 同一 sub。
80
80
  d. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete <sub> --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它,或仅在刻意覆盖时传 `--force`。
81
81
  e. 若 sub 无法达到 COMPLETE(max_iterations 耗尽 / 不可恢复错误):Bash `harnessed checkpoint fail <sub> --summary "<why>"`,然后 STOP 并向用户报告。
@@ -71,7 +71,7 @@ Do NOT pipe to `harnessed run task-code` — that is the CI/headless path (in-pr
71
71
  that blocks the session inside Claude Code).
72
72
 
73
73
  1. Bash: `harnessed prompt task-code --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
74
- 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations).
74
+ 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
75
75
  3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
76
76
  4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete task-code --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it before treating the sub as done.
77
77
 
@@ -69,7 +69,7 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
69
69
  Code 内部会阻塞 session)。
70
70
 
71
71
  1. Bash: `harnessed prompt task-code --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
72
- 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,自循环:spawn → 检查 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。
72
+ 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
73
73
  3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
74
74
  4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete task-code --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
75
75
 
@@ -43,6 +43,11 @@ ralph-loop SDK wrapper 保 completion-promise verbatim string `"COMPLETE"` — s
43
43
  LLM-as-judge). Sister capabilities.yaml `ralph-loop` entry impl `bundled-skill` +
44
44
  `sdk_ref: src/workflow/lib/ralphLoop.ts` (Phase 2.2 v0.2.0 ship)。
45
45
 
46
+ 交互面三级偏好链 (v4.15.0 / ADR 0036): ralph-loop plugin 优先 (fail-closed 逐字匹配 +
47
+ 硬 max-iterations) → 未装时 native `/goal` gate (Claude Code 2.1.139+ / Codex 双平台内置,
48
+ 条件句写 verbatim `<promise>COMPLETE</promise>` + turn 上界) → `/goal` 亦不可用时 self-loop
49
+ 兜底。SDK 路径 (ralphLoopWrap 硬上界) 不参与该链,始终 verbatim 匹配。
50
+
46
51
  ### Parallelism — ralph-loop 正交 wrapper
47
52
 
48
53
  `parallelism: judgments.parallelism-gate.ralph-loop-wrapper.fires` ref — per R20.10
@@ -93,7 +98,7 @@ Do NOT pipe to `harnessed run task-deliver` — that is the CI/headless path (in
93
98
  that blocks the session inside Claude Code).
94
99
 
95
100
  1. Bash: `harnessed prompt task-deliver --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
96
- 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations).
101
+ 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
97
102
  3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
98
103
  4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete task-deliver --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it before treating the sub as done.
99
104
 
@@ -43,6 +43,11 @@ ralph-loop SDK wrapper 保 completion-promise verbatim string `"COMPLETE"`——
43
43
  LLM-as-judge)。Sister capabilities.yaml `ralph-loop` entry impl `bundled-skill` +
44
44
  `sdk_ref: src/workflow/lib/ralphLoop.ts`(Phase 2.2 v0.2.0 ship)。
45
45
 
46
+ 交互面三级偏好链(v4.15.0 / ADR 0036):ralph-loop plugin 优先(fail-closed 逐字匹配 +
47
+ 硬 max-iterations)→ 未装时 native `/goal` gate(Claude Code 2.1.139+ / Codex 双平台内置,
48
+ 条件句写 verbatim `<promise>COMPLETE</promise>` + turn 上界)→ `/goal` 亦不可用时 self-loop
49
+ 兜底。SDK 路径(ralphLoopWrap 硬上界)不参与该链,始终 verbatim 匹配。
50
+
46
51
  ### Parallelism — ralph-loop 正交 wrapper
47
52
 
48
53
  `parallelism: judgments.parallelism-gate.ralph-loop-wrapper.fires` ref——遵循 R20.10
@@ -92,7 +97,7 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
92
97
  Code 内部会阻塞 session)。
93
98
 
94
99
  1. Bash: `harnessed prompt task-deliver --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
95
- 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,自循环:spawn → 检查 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。
100
+ 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
96
101
  3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
97
102
  4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete task-deliver --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
98
103
 
@@ -6,6 +6,10 @@
6
6
  # default fan-out OR Agent Teams 升级 (5 触发 OR-chain per bundled Agent Teams
7
7
  # routing + D-11)。02-progress-mark: planning-with-files /plan 更新 progress.md 标记完成。
8
8
  #
9
+ # v4.15.0 (ADR 0036) 交互面三级偏好链: ralph-loop plugin 优先 → 未装时 native /goal
10
+ # gate (CC 2.1.139+ / Codex) → self-loop 兜底。SDK 路径 (ralphLoopWrap 硬上界) 不变;
11
+ # defaults.ralph_max_iterations 插值语义不变(/goal 分支映射为条件句 turn 上界)。
12
+ #
9
13
  # Brief enforcement (W0.9 spec MUST include):
10
14
  # - ralph-loop completion_promise = COMPLETE (R20.10 verbatim acceptance string)
11
15
  # - parallelism-gate ref: judgments.parallelism-gate.ralph-loop-wrapper.fires
@@ -74,7 +74,7 @@ Do NOT pipe to `harnessed run task-test` — that is the CI/headless path (in-pr
74
74
  that blocks the session inside Claude Code).
75
75
 
76
76
  1. Bash: `harnessed prompt task-test --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
77
- 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations).
77
+ 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
78
78
  3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
79
79
  4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete task-test --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it before treating the sub as done.
80
80
 
@@ -73,7 +73,7 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
73
73
  Code 内部会阻塞 session)。
74
74
 
75
75
  1. Bash: `harnessed prompt task-test --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
76
- 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,自循环:spawn → 检查 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。
76
+ 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
77
77
  3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
78
78
  4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete task-test --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
79
79
 
@@ -83,7 +83,7 @@ that blocks the session, bypasses Agent Teams, and hangs inside Claude Code).
83
83
  - **If the entry has `is_master: true`** (a stage master — e.g. `/auto` firing `plan`/`task`/`verify`): do NOT prompt+spawn it. RECURSE: run that master’s own `harnessed gates <sub> --task "<spec>" --skip-sub clarify` → `harnessed checkpoint start <sub> --plan '<json>'` → repeat this loop for ITS fired subs.
84
84
  - **Else (leaf sub):**
85
85
  a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → parse `{prompt, max_iterations, model}`.
86
- b. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations).
86
+ b. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
87
87
  c. If the output contains `STATUS: NEEDS_CLARIFICATION` + questions: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
88
88
  d. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete <sub> --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it, or pass `--force` only to deliberately override.
89
89
  e. If the sub cannot reach COMPLETE (max_iterations exhausted / unrecoverable error): Bash `harnessed checkpoint fail <sub> --summary "<why>"`, then STOP and report to the user.
@@ -82,7 +82,7 @@ session、绕过 Agent Teams,在 Claude Code 内部调用时会挂死)。
82
82
  - **若该项 `is_master: true`**(本身是 stage master —— 如 `/auto` fire `plan`/`task`/`verify`):**不要**直接 prompt+spawn。RECURSE:跑该 master 自己的 `harnessed gates <sub> --task "<spec>" --skip-sub clarify` → `harnessed checkpoint start <sub> --plan '<json>'` → 对它的 fired subs 重复本循环。
83
83
  - **否则(leaf sub):**
84
84
  a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → 解析 `{prompt, max_iterations, model}`。
85
- b. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。
85
+ b. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
86
86
  c. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn 同一 sub。
87
87
  d. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete <sub> --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它,或仅在刻意覆盖时传 `--force`。
88
88
  e. 若 sub 无法达到 COMPLETE(max_iterations 耗尽 / 不可恢复错误):Bash `harnessed checkpoint fail <sub> --summary "<why>"`,然后 STOP 并向用户报告。
@@ -59,7 +59,7 @@ Do NOT pipe to `harnessed run verify-code-review` — that is the CI/headless pa
59
59
  that blocks the session inside Claude Code).
60
60
 
61
61
  1. Bash: `harnessed prompt verify-code-review --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
62
- 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations).
62
+ 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
63
63
  3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
64
64
  4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete verify-code-review --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it before treating the sub as done.
65
65
 
@@ -58,7 +58,7 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
58
58
  Code 内部会阻塞 session)。
59
59
 
60
60
  1. Bash: `harnessed prompt verify-code-review --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
61
- 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,自循环:spawn → 检查 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。
61
+ 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
62
62
  3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
63
63
  4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete verify-code-review --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
64
64
 
@@ -61,7 +61,7 @@ Do NOT pipe to `harnessed run verify-design` — that is the CI/headless path (i
61
61
  that blocks the session inside Claude Code).
62
62
 
63
63
  1. Bash: `harnessed prompt verify-design --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
64
- 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations).
64
+ 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
65
65
  3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
66
66
  4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete verify-design --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it before treating the sub as done.
67
67
 
@@ -60,7 +60,7 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
60
60
  Code 内部会阻塞 session)。
61
61
 
62
62
  1. Bash: `harnessed prompt verify-design --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
63
- 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,自循环:spawn → 检查 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。
63
+ 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
64
64
  3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
65
65
  4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete verify-design --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
66
66
 
@@ -53,7 +53,7 @@ Do NOT pipe to `harnessed run verify-eval-review` — that is the CI/headless pa
53
53
  that blocks the session inside Claude Code).
54
54
 
55
55
  1. Bash: `harnessed prompt verify-eval-review --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
56
- 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations).
56
+ 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
57
57
  3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
58
58
  4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete verify-eval-review --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it before treating the sub as done.
59
59
 
@@ -52,7 +52,7 @@ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 r
52
52
  Code 内部会阻塞 session)。
53
53
 
54
54
  1. Bash: `harnessed prompt verify-eval-review --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
55
- 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,自循环:spawn → 检查 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。
55
+ 2. 用 CC-native subagent(Task / Agent 工具)以该 `prompt` + `model` spawn,用 ralph-loop plugin 包裹:`/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`。若 plugin 未装,改用原生 goal gate(Claude Code 2.1.139+ / Codex):`/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"`,随后 spawn subagent,由 goal 评估器驱动重 spawn 直到目标清除。若 `/goal` 也不可用,自循环:spawn → 检查输出 `<promise>COMPLETE</promise>` → 把上轮输出 append 后重 spawn(至多 max_iterations)。goal 只在叶子 subtask 层设置 — `/goal` 每 session 单槽,嵌套 goal 会覆盖外层。
56
56
  3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
57
57
  4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete verify-eval-review --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
58
58
 
@@ -75,7 +75,7 @@ Do NOT pipe to `harnessed run verify-multispec` — that is the CI/headless path
75
75
  that blocks the session inside Claude Code).
76
76
 
77
77
  1. Bash: `harnessed prompt verify-multispec --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
78
- 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations).
78
+ 2. Spawn a CC-native subagent (Task / Agent tool) with that `prompt` + `model`, wrapped in the ralph-loop plugin: `/ralph-loop "<prompt>" --max-iterations <max_iterations> --completion-promise "COMPLETE"`. If the plugin is absent, use the native goal gate instead (Claude Code 2.1.139+ / Codex): `/goal "this subtask is delivered: the subagent's final output contains verbatim <promise>COMPLETE</promise>; or stop after <max_iterations> turns"` then spawn the subagent and let the goal evaluator drive re-spawns until it clears. If `/goal` is unavailable too, self-loop: spawn → check output for `<promise>COMPLETE</promise>` → re-spawn with prior output appended (up to max_iterations). Set the goal only at the leaf subtask level — `/goal` is single-slot per session and a nested goal overwrites the outer one.
79
79
  3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via AskUserQuestion, append the answers to the spec, then re-spawn the same sub.
80
80
  4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete verify-multispec --summary "<one-line>"`. The evidence guard runs here (fail-CLOSED): if a declared `artifacts_expected` file is missing it exits non-zero — re-spawn to produce it before treating the sub as done.
81
81