harnessed 4.9.1 → 4.10.1

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 (64) hide show
  1. package/README.md +43 -6
  2. package/bin/harnessed-inject-state.mjs +103 -2
  3. package/dist/cli.mjs +1758 -1419
  4. package/dist/cli.mjs.map +1 -1
  5. package/dist/index.mjs +1 -1
  6. package/dist/index.mjs.map +1 -1
  7. package/manifests/skill-packs/frontend-design.yaml +1 -1
  8. package/manifests/skill-packs/gstack.yaml +1 -1
  9. package/manifests/skill-packs/ui-ux-pro-max.yaml +1 -1
  10. package/package.json +1 -1
  11. package/workflows/auto/SKILL.md +26 -12
  12. package/workflows/auto/SKILL.zh-Hans.md +25 -10
  13. package/workflows/discuss/auto/SKILL.md +15 -12
  14. package/workflows/discuss/auto/SKILL.zh-Hans.md +12 -8
  15. package/workflows/discuss/phase/SKILL.md +15 -12
  16. package/workflows/discuss/phase/SKILL.zh-Hans.md +12 -8
  17. package/workflows/discuss/strategic/SKILL.md +15 -12
  18. package/workflows/discuss/strategic/SKILL.zh-Hans.md +12 -8
  19. package/workflows/discuss/subtask/SKILL.md +15 -12
  20. package/workflows/discuss/subtask/SKILL.zh-Hans.md +12 -8
  21. package/workflows/plan/architecture/SKILL.md +14 -12
  22. package/workflows/plan/architecture/SKILL.zh-Hans.md +11 -8
  23. package/workflows/plan/auto/SKILL.md +26 -12
  24. package/workflows/plan/auto/SKILL.zh-Hans.md +25 -10
  25. package/workflows/plan/phase/SKILL.md +14 -12
  26. package/workflows/plan/phase/SKILL.zh-Hans.md +11 -8
  27. package/workflows/research/SKILL.md +14 -12
  28. package/workflows/research/SKILL.zh-Hans.md +11 -8
  29. package/workflows/retro/SKILL.md +14 -12
  30. package/workflows/retro/SKILL.zh-Hans.md +11 -8
  31. package/workflows/role-prompts.yaml +34 -0
  32. package/workflows/role-prompts.zh-Hans.yaml +33 -0
  33. package/workflows/ship/auto/SKILL.md +29 -0
  34. package/workflows/ship/auto/SKILL.zh-Hans.md +28 -0
  35. package/workflows/ship/preflight/SKILL.md +17 -0
  36. package/workflows/ship/preflight/SKILL.zh-Hans.md +16 -0
  37. package/workflows/task/auto/SKILL.md +26 -12
  38. package/workflows/task/auto/SKILL.zh-Hans.md +25 -10
  39. package/workflows/task/clarify/SKILL.md +15 -12
  40. package/workflows/task/clarify/SKILL.zh-Hans.md +12 -8
  41. package/workflows/task/code/SKILL.md +14 -12
  42. package/workflows/task/code/SKILL.zh-Hans.md +11 -8
  43. package/workflows/task/deliver/SKILL.md +14 -12
  44. package/workflows/task/deliver/SKILL.zh-Hans.md +11 -8
  45. package/workflows/task/test/SKILL.md +14 -12
  46. package/workflows/task/test/SKILL.zh-Hans.md +11 -8
  47. package/workflows/verify/auto/SKILL.md +26 -12
  48. package/workflows/verify/auto/SKILL.zh-Hans.md +25 -10
  49. package/workflows/verify/code-review/SKILL.md +14 -12
  50. package/workflows/verify/code-review/SKILL.zh-Hans.md +11 -8
  51. package/workflows/verify/design/SKILL.md +14 -12
  52. package/workflows/verify/design/SKILL.zh-Hans.md +11 -8
  53. package/workflows/verify/multispec/SKILL.md +14 -12
  54. package/workflows/verify/multispec/SKILL.zh-Hans.md +11 -8
  55. package/workflows/verify/paranoid/SKILL.md +14 -12
  56. package/workflows/verify/paranoid/SKILL.zh-Hans.md +11 -8
  57. package/workflows/verify/progress/SKILL.md +14 -12
  58. package/workflows/verify/progress/SKILL.zh-Hans.md +11 -8
  59. package/workflows/verify/qa/SKILL.md +14 -12
  60. package/workflows/verify/qa/SKILL.zh-Hans.md +11 -8
  61. package/workflows/verify/security/SKILL.md +14 -12
  62. package/workflows/verify/security/SKILL.zh-Hans.md +11 -8
  63. package/workflows/verify/simplify/SKILL.md +14 -12
  64. package/workflows/verify/simplify/SKILL.zh-Hans.md +11 -8
@@ -52,16 +52,19 @@ Sister `workflows/judgments/stage-routing.yaml`:
52
52
 
53
53
  ## 如何调用
54
54
 
55
- CC-native 编排。**不要** pipe 到 `harnessed run verify-paranoid` —— 那是 CI/headless 路径(in-process
56
- SDK spawn,会阻塞 session、绕过 Agent Teams,在 Claude Code 内部调用时还会挂死)。
55
+ 下面这套编号序列**就是** state machine —— 用 Bash 执行。**不要**从上方 Overview 自行演绎等价流程:
56
+ freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 spawn-ready prompt;**你**用
57
+ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 round-trip 能回到用户)。
57
58
 
58
- 改用 `/verify-paranoid` slash command(由 `harnessed setup` 生成于 `~/.claude/commands/verify-paranoid.md`)。
59
- 它以 CC-native 方式驱动:`harnessed gates` 决定哪些 sub fire,`harnessed prompt <sub>` 给出每个
60
- spawn-ready prompt,然后用 CC-native subagent(Task / Agent 工具)逐个 spawn 已 fire 的 sub,
61
- 每个结果用 `harnessed checkpoint` 记录。完整 state-machine 步骤见 `~/.claude/commands/verify-paranoid.md`;
62
- 若该文件不存在,自行按 gates → prompt → spawn → checkpoint 同序执行。
59
+ **不要** pipe 到 `harnessed run verify-paranoid` —— 那是 CI/headless 路径(in-process SDK spawn,在 Claude
60
+ Code 内部会阻塞 session)。
63
61
 
64
- <!-- harnessed-generated:v4.9.1 -->
62
+ 1. Bash: `harnessed prompt verify-paranoid --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)。
64
+ 3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
65
+ 4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete verify-paranoid --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
66
+
67
+ <!-- harnessed-generated:v4.9.3 -->
65
68
 
66
69
  ## 参考资料
67
70
 
@@ -48,18 +48,20 @@ verify-progress-always trigger)。无 skip 条件 — verify-work 起点必跑
48
48
 
49
49
  ## How to invoke
50
50
 
51
- Orchestrated CC-natively. Do NOT pipe to `harnessed run verify-progress` — that is the CI/headless
52
- path (an in-process SDK spawn that blocks the session, bypasses Agent Teams, and hangs when
53
- invoked from inside a Claude Code session).
54
-
55
- Run the `/verify-progress` slash command instead (generated by `harnessed setup` at
56
- `~/.claude/commands/verify-progress.md`). It drives the stage natively: `harnessed gates` → which
57
- subs fire, `harnessed prompt <sub>` → each spawn-ready prompt, then a CC-native subagent
58
- (Task / Agent tool) per fired sub, recording each outcome with `harnessed checkpoint`. The
59
- full state-machine steps live in `~/.claude/commands/verify-progress.md`; if that file is absent,
60
- follow that same gates → prompt → spawn → checkpoint sequence yourself.
61
-
62
- <!-- harnessed-generated:v4.9.1 -->
51
+ The numbered sequence below **is** the state machine — execute it with Bash. Do NOT improvise
52
+ an equivalent flow from the Overview above: freelancing bypasses the engine (no ledger, no
53
+ evidence guard). harnessed gives you the spawn-ready prompt; YOU spawn the subagent with a
54
+ CC-native Task / Agent tool (keeps the session responsive + lets clarification round-trips reach the user).
55
+
56
+ Do NOT pipe to `harnessed run verify-progress` — that is the CI/headless path (in-process SDK spawn
57
+ that blocks the session inside Claude Code).
58
+
59
+ 1. Bash: `harnessed prompt verify-progress --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
60
+ 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
+ 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.
62
+ 4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete verify-progress --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.
63
+
64
+ <!-- harnessed-generated:v4.9.3 -->
63
65
 
64
66
  ## References
65
67
 
@@ -47,16 +47,19 @@ verify-progress-always trigger)。无 skip 条件 — verify-work 起点必跑
47
47
 
48
48
  ## 如何调用
49
49
 
50
- CC-native 编排。**不要** pipe 到 `harnessed run verify-progress` —— 那是 CI/headless 路径(in-process
51
- SDK spawn,会阻塞 session、绕过 Agent Teams,在 Claude Code 内部调用时还会挂死)。
50
+ 下面这套编号序列**就是** state machine —— 用 Bash 执行。**不要**从上方 Overview 自行演绎等价流程:
51
+ freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 spawn-ready prompt;**你**用
52
+ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 round-trip 能回到用户)。
52
53
 
53
- 改用 `/verify-progress` slash command(由 `harnessed setup` 生成于 `~/.claude/commands/verify-progress.md`)。
54
- 它以 CC-native 方式驱动:`harnessed gates` 决定哪些 sub fire,`harnessed prompt <sub>` 给出每个
55
- spawn-ready prompt,然后用 CC-native subagent(Task / Agent 工具)逐个 spawn 已 fire 的 sub,
56
- 每个结果用 `harnessed checkpoint` 记录。完整 state-machine 步骤见 `~/.claude/commands/verify-progress.md`;
57
- 若该文件不存在,自行按 gates → prompt → spawn → checkpoint 同序执行。
54
+ **不要** pipe 到 `harnessed run verify-progress` —— 那是 CI/headless 路径(in-process SDK spawn,在 Claude
55
+ Code 内部会阻塞 session)。
58
56
 
59
- <!-- harnessed-generated:v4.9.1 -->
57
+ 1. Bash: `harnessed prompt verify-progress --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
58
+ 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)。
59
+ 3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
60
+ 4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete verify-progress --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
61
+
62
+ <!-- harnessed-generated:v4.9.3 -->
60
63
 
61
64
  ## 参考资料
62
65
 
@@ -54,18 +54,20 @@ Sister `workflows/judgments/stage-routing.yaml`:
54
54
 
55
55
  ## How to invoke
56
56
 
57
- Orchestrated CC-natively. Do NOT pipe to `harnessed run verify-qa` — that is the CI/headless
58
- path (an in-process SDK spawn that blocks the session, bypasses Agent Teams, and hangs when
59
- invoked from inside a Claude Code session).
60
-
61
- Run the `/verify-qa` slash command instead (generated by `harnessed setup` at
62
- `~/.claude/commands/verify-qa.md`). It drives the stage natively: `harnessed gates` → which
63
- subs fire, `harnessed prompt <sub>` → each spawn-ready prompt, then a CC-native subagent
64
- (Task / Agent tool) per fired sub, recording each outcome with `harnessed checkpoint`. The
65
- full state-machine steps live in `~/.claude/commands/verify-qa.md`; if that file is absent,
66
- follow that same gates → prompt → spawn → checkpoint sequence yourself.
67
-
68
- <!-- harnessed-generated:v4.9.1 -->
57
+ The numbered sequence below **is** the state machine — execute it with Bash. Do NOT improvise
58
+ an equivalent flow from the Overview above: freelancing bypasses the engine (no ledger, no
59
+ evidence guard). harnessed gives you the spawn-ready prompt; YOU spawn the subagent with a
60
+ CC-native Task / Agent tool (keeps the session responsive + lets clarification round-trips reach the user).
61
+
62
+ Do NOT pipe to `harnessed run verify-qa` — that is the CI/headless path (in-process SDK spawn
63
+ that blocks the session inside Claude Code).
64
+
65
+ 1. Bash: `harnessed prompt verify-qa --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).
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
+ 4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete verify-qa --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
+
70
+ <!-- harnessed-generated:v4.9.3 -->
69
71
 
70
72
  ## References
71
73
 
@@ -54,16 +54,19 @@ Sister `workflows/judgments/stage-routing.yaml`:
54
54
 
55
55
  ## 如何调用
56
56
 
57
- CC-native 编排。**不要** pipe 到 `harnessed run verify-qa` —— 那是 CI/headless 路径(in-process
58
- SDK spawn,会阻塞 session、绕过 Agent Teams,在 Claude Code 内部调用时还会挂死)。
57
+ 下面这套编号序列**就是** state machine —— 用 Bash 执行。**不要**从上方 Overview 自行演绎等价流程:
58
+ freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 spawn-ready prompt;**你**用
59
+ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 round-trip 能回到用户)。
59
60
 
60
- 改用 `/verify-qa` slash command(由 `harnessed setup` 生成于 `~/.claude/commands/verify-qa.md`)。
61
- 它以 CC-native 方式驱动:`harnessed gates` 决定哪些 sub fire,`harnessed prompt <sub>` 给出每个
62
- spawn-ready prompt,然后用 CC-native subagent(Task / Agent 工具)逐个 spawn 已 fire 的 sub,
63
- 每个结果用 `harnessed checkpoint` 记录。完整 state-machine 步骤见 `~/.claude/commands/verify-qa.md`;
64
- 若该文件不存在,自行按 gates → prompt → spawn → checkpoint 同序执行。
61
+ **不要** pipe 到 `harnessed run verify-qa` —— 那是 CI/headless 路径(in-process SDK spawn,在 Claude
62
+ Code 内部会阻塞 session)。
65
63
 
66
- <!-- harnessed-generated:v4.9.1 -->
64
+ 1. Bash: `harnessed prompt verify-qa --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)。
66
+ 3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
67
+ 4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete verify-qa --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
68
+
69
+ <!-- harnessed-generated:v4.9.3 -->
67
70
 
68
71
  ## 参考资料
69
72
 
@@ -49,18 +49,20 @@ Sister `workflows/judgments/stage-routing.yaml`:
49
49
 
50
50
  ## How to invoke
51
51
 
52
- Orchestrated CC-natively. Do NOT pipe to `harnessed run verify-security` — that is the CI/headless
53
- path (an in-process SDK spawn that blocks the session, bypasses Agent Teams, and hangs when
54
- invoked from inside a Claude Code session).
55
-
56
- Run the `/verify-security` slash command instead (generated by `harnessed setup` at
57
- `~/.claude/commands/verify-security.md`). It drives the stage natively: `harnessed gates` → which
58
- subs fire, `harnessed prompt <sub>` → each spawn-ready prompt, then a CC-native subagent
59
- (Task / Agent tool) per fired sub, recording each outcome with `harnessed checkpoint`. The
60
- full state-machine steps live in `~/.claude/commands/verify-security.md`; if that file is absent,
61
- follow that same gates → prompt → spawn → checkpoint sequence yourself.
62
-
63
- <!-- harnessed-generated:v4.9.1 -->
52
+ The numbered sequence below **is** the state machine — execute it with Bash. Do NOT improvise
53
+ an equivalent flow from the Overview above: freelancing bypasses the engine (no ledger, no
54
+ evidence guard). harnessed gives you the spawn-ready prompt; YOU spawn the subagent with a
55
+ CC-native Task / Agent tool (keeps the session responsive + lets clarification round-trips reach the user).
56
+
57
+ Do NOT pipe to `harnessed run verify-security` — that is the CI/headless path (in-process SDK spawn
58
+ that blocks the session inside Claude Code).
59
+
60
+ 1. Bash: `harnessed prompt verify-security --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).
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
+ 4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete verify-security --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
+
65
+ <!-- harnessed-generated:v4.9.3 -->
64
66
 
65
67
  ## References
66
68
 
@@ -49,16 +49,19 @@ Sister `workflows/judgments/stage-routing.yaml`:
49
49
 
50
50
  ## 如何调用
51
51
 
52
- CC-native 编排。**不要** pipe 到 `harnessed run verify-security` —— 那是 CI/headless 路径(in-process
53
- SDK spawn,会阻塞 session、绕过 Agent Teams,在 Claude Code 内部调用时还会挂死)。
52
+ 下面这套编号序列**就是** state machine —— 用 Bash 执行。**不要**从上方 Overview 自行演绎等价流程:
53
+ freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 spawn-ready prompt;**你**用
54
+ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 round-trip 能回到用户)。
54
55
 
55
- 改用 `/verify-security` slash command(由 `harnessed setup` 生成于 `~/.claude/commands/verify-security.md`)。
56
- 它以 CC-native 方式驱动:`harnessed gates` 决定哪些 sub fire,`harnessed prompt <sub>` 给出每个
57
- spawn-ready prompt,然后用 CC-native subagent(Task / Agent 工具)逐个 spawn 已 fire 的 sub,
58
- 每个结果用 `harnessed checkpoint` 记录。完整 state-machine 步骤见 `~/.claude/commands/verify-security.md`;
59
- 若该文件不存在,自行按 gates → prompt → spawn → checkpoint 同序执行。
56
+ **不要** pipe 到 `harnessed run verify-security` —— 那是 CI/headless 路径(in-process SDK spawn,在 Claude
57
+ Code 内部会阻塞 session)。
60
58
 
61
- <!-- harnessed-generated:v4.9.1 -->
59
+ 1. Bash: `harnessed prompt verify-security --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)。
61
+ 3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
62
+ 4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete verify-security --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
63
+
64
+ <!-- harnessed-generated:v4.9.3 -->
62
65
 
63
66
  ## 参考资料
64
67
 
@@ -49,18 +49,20 @@ Sister `workflows/judgments/stage-routing.yaml`:
49
49
 
50
50
  ## How to invoke
51
51
 
52
- Orchestrated CC-natively. Do NOT pipe to `harnessed run verify-simplify` — that is the CI/headless
53
- path (an in-process SDK spawn that blocks the session, bypasses Agent Teams, and hangs when
54
- invoked from inside a Claude Code session).
55
-
56
- Run the `/verify-simplify` slash command instead (generated by `harnessed setup` at
57
- `~/.claude/commands/verify-simplify.md`). It drives the stage natively: `harnessed gates` → which
58
- subs fire, `harnessed prompt <sub>` → each spawn-ready prompt, then a CC-native subagent
59
- (Task / Agent tool) per fired sub, recording each outcome with `harnessed checkpoint`. The
60
- full state-machine steps live in `~/.claude/commands/verify-simplify.md`; if that file is absent,
61
- follow that same gates → prompt → spawn → checkpoint sequence yourself.
62
-
63
- <!-- harnessed-generated:v4.9.1 -->
52
+ The numbered sequence below **is** the state machine — execute it with Bash. Do NOT improvise
53
+ an equivalent flow from the Overview above: freelancing bypasses the engine (no ledger, no
54
+ evidence guard). harnessed gives you the spawn-ready prompt; YOU spawn the subagent with a
55
+ CC-native Task / Agent tool (keeps the session responsive + lets clarification round-trips reach the user).
56
+
57
+ Do NOT pipe to `harnessed run verify-simplify` — that is the CI/headless path (in-process SDK spawn
58
+ that blocks the session inside Claude Code).
59
+
60
+ 1. Bash: `harnessed prompt verify-simplify --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).
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
+ 4. On `<promise>COMPLETE</promise>`: Bash `harnessed checkpoint complete verify-simplify --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
+
65
+ <!-- harnessed-generated:v4.9.3 -->
64
66
 
65
67
  ## References
66
68
 
@@ -49,16 +49,19 @@ Sister `workflows/judgments/stage-routing.yaml`:
49
49
 
50
50
  ## 如何调用
51
51
 
52
- CC-native 编排。**不要** pipe 到 `harnessed run verify-simplify` —— 那是 CI/headless 路径(in-process
53
- SDK spawn,会阻塞 session、绕过 Agent Teams,在 Claude Code 内部调用时还会挂死)。
52
+ 下面这套编号序列**就是** state machine —— 用 Bash 执行。**不要**从上方 Overview 自行演绎等价流程:
53
+ freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 spawn-ready prompt;**你**用
54
+ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 round-trip 能回到用户)。
54
55
 
55
- 改用 `/verify-simplify` slash command(由 `harnessed setup` 生成于 `~/.claude/commands/verify-simplify.md`)。
56
- 它以 CC-native 方式驱动:`harnessed gates` 决定哪些 sub fire,`harnessed prompt <sub>` 给出每个
57
- spawn-ready prompt,然后用 CC-native subagent(Task / Agent 工具)逐个 spawn 已 fire 的 sub,
58
- 每个结果用 `harnessed checkpoint` 记录。完整 state-machine 步骤见 `~/.claude/commands/verify-simplify.md`;
59
- 若该文件不存在,自行按 gates → prompt → spawn → checkpoint 同序执行。
56
+ **不要** pipe 到 `harnessed run verify-simplify` —— 那是 CI/headless 路径(in-process SDK spawn,在 Claude
57
+ Code 内部会阻塞 session)。
60
58
 
61
- <!-- harnessed-generated:v4.9.1 -->
59
+ 1. Bash: `harnessed prompt verify-simplify --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)。
61
+ 3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 AskUserQuestion 原样转达,把答案 append 进 spec,再重 spawn。
62
+ 4. 命中 `<promise>COMPLETE</promise>`:Bash `harnessed checkpoint complete verify-simplify --summary "<one-line>"`。evidence guard 在此运行(fail-CLOSED):若声明的 `artifacts_expected` 文件缺失会 exit 非零 —— 重 spawn 产出它再算 done。
63
+
64
+ <!-- harnessed-generated:v4.9.3 -->
62
65
 
63
66
  ## 参考资料
64
67