harnessed 4.9.0 → 4.10.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 (61) hide show
  1. package/README.md +40 -4
  2. package/bin/harnessed-inject-state.mjs +103 -2
  3. package/dist/cli.mjs +1717 -1418
  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/package.json +1 -1
  8. package/workflows/auto/SKILL.md +26 -12
  9. package/workflows/auto/SKILL.zh-Hans.md +25 -12
  10. package/workflows/discuss/auto/SKILL.md +12 -8
  11. package/workflows/discuss/auto/SKILL.zh-Hans.md +11 -8
  12. package/workflows/discuss/phase/SKILL.md +12 -8
  13. package/workflows/discuss/phase/SKILL.zh-Hans.md +11 -8
  14. package/workflows/discuss/strategic/SKILL.md +12 -8
  15. package/workflows/discuss/strategic/SKILL.zh-Hans.md +11 -8
  16. package/workflows/discuss/subtask/SKILL.md +12 -8
  17. package/workflows/discuss/subtask/SKILL.zh-Hans.md +11 -8
  18. package/workflows/plan/architecture/SKILL.md +11 -8
  19. package/workflows/plan/architecture/SKILL.zh-Hans.md +10 -8
  20. package/workflows/plan/auto/SKILL.md +26 -11
  21. package/workflows/plan/auto/SKILL.zh-Hans.md +25 -11
  22. package/workflows/plan/phase/SKILL.md +11 -8
  23. package/workflows/plan/phase/SKILL.zh-Hans.md +10 -8
  24. package/workflows/research/SKILL.md +11 -37
  25. package/workflows/research/SKILL.zh-Hans.md +10 -37
  26. package/workflows/retro/SKILL.md +11 -8
  27. package/workflows/retro/SKILL.zh-Hans.md +10 -8
  28. package/workflows/role-prompts.yaml +34 -0
  29. package/workflows/role-prompts.zh-Hans.yaml +33 -0
  30. package/workflows/ship/auto/SKILL.md +29 -0
  31. package/workflows/ship/auto/SKILL.zh-Hans.md +28 -0
  32. package/workflows/ship/preflight/SKILL.md +17 -0
  33. package/workflows/ship/preflight/SKILL.zh-Hans.md +16 -0
  34. package/workflows/task/auto/SKILL.md +26 -11
  35. package/workflows/task/auto/SKILL.zh-Hans.md +27 -13
  36. package/workflows/task/clarify/SKILL.md +12 -8
  37. package/workflows/task/clarify/SKILL.zh-Hans.md +12 -9
  38. package/workflows/task/code/SKILL.md +11 -8
  39. package/workflows/task/code/SKILL.zh-Hans.md +11 -9
  40. package/workflows/task/deliver/SKILL.md +11 -8
  41. package/workflows/task/deliver/SKILL.zh-Hans.md +11 -9
  42. package/workflows/task/test/SKILL.md +11 -8
  43. package/workflows/task/test/SKILL.zh-Hans.md +11 -9
  44. package/workflows/verify/auto/SKILL.md +26 -11
  45. package/workflows/verify/auto/SKILL.zh-Hans.md +25 -11
  46. package/workflows/verify/code-review/SKILL.md +11 -8
  47. package/workflows/verify/code-review/SKILL.zh-Hans.md +10 -8
  48. package/workflows/verify/design/SKILL.md +11 -8
  49. package/workflows/verify/design/SKILL.zh-Hans.md +11 -9
  50. package/workflows/verify/multispec/SKILL.md +11 -8
  51. package/workflows/verify/multispec/SKILL.zh-Hans.md +11 -9
  52. package/workflows/verify/paranoid/SKILL.md +11 -8
  53. package/workflows/verify/paranoid/SKILL.zh-Hans.md +11 -9
  54. package/workflows/verify/progress/SKILL.md +11 -8
  55. package/workflows/verify/progress/SKILL.zh-Hans.md +11 -9
  56. package/workflows/verify/qa/SKILL.md +11 -8
  57. package/workflows/verify/qa/SKILL.zh-Hans.md +11 -9
  58. package/workflows/verify/security/SKILL.md +11 -8
  59. package/workflows/verify/security/SKILL.zh-Hans.md +11 -9
  60. package/workflows/verify/simplify/SKILL.md +11 -8
  61. package/workflows/verify/simplify/SKILL.zh-Hans.md +11 -9
@@ -49,17 +49,20 @@ Sister `workflows/judgments/stage-routing.yaml`:
49
49
 
50
50
  ## How to invoke
51
51
 
52
- Use the Bash tool to run:
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).
53
56
 
54
- ```bash
55
- echo "$ARGUMENTS" | harnessed run verify-security --task-stdin
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).
57
59
 
58
- If `$ARGUMENTS` is empty, run `harnessed run verify-security` (no stdin pipe).
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.
59
64
 
60
- After completion, the Bash output prints a `Next:` hint on stderr suggesting the next stage. Decide whether to invoke based on conversation context — the hint is informational, not prescriptive.
61
-
62
- <!-- harnessed-generated:v3.4.4 -->
65
+ <!-- harnessed-generated:v4.9.3 -->
63
66
 
64
67
  ## References
65
68
 
@@ -47,19 +47,21 @@ Sister `workflows/judgments/stage-routing.yaml`:
47
47
  - ✅ **触发**: auth flow / session / credentials / API keys / SQL injection 路径 / OWASP top 10 area
48
48
  - ❌ **跳过**: docs / 纯 UI styling / 内部 refactor / non-security PR
49
49
 
50
- ## 调用方式
50
+ ## 如何调用
51
51
 
52
- 使用 Bash 工具运行:
52
+ 下面这套编号序列**就是** state machine —— 用 Bash 执行。**不要**从上方 Overview 自行演绎等价流程:
53
+ freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 spawn-ready prompt;**你**用
54
+ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 round-trip 能回到用户)。
53
55
 
54
- ```bash
55
- echo "$ARGUMENTS" | harnessed run verify-security --task-stdin
56
- ```
56
+ **不要** pipe 到 `harnessed run verify-security` —— 那是 CI/headless 路径(in-process SDK spawn,在 Claude
57
+ Code 内部会阻塞 session)。
57
58
 
58
- 若 `$ARGUMENTS` 为空,则运行 `harnessed run verify-security`(不接管道输入)。
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。
59
63
 
60
- 完成后,Bash 输出会在 stderr 打印 `Next:` 提示,建议下一阶段。是否调用取决于对话上下文 — 该提示仅供参考,非强制指令。
61
-
62
- <!-- harnessed-generated:v3.4.4 -->
64
+ <!-- harnessed-generated:v4.9.3 -->
63
65
 
64
66
  ## 参考资料
65
67
 
@@ -49,17 +49,20 @@ Sister `workflows/judgments/stage-routing.yaml`:
49
49
 
50
50
  ## How to invoke
51
51
 
52
- Use the Bash tool to run:
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).
53
56
 
54
- ```bash
55
- echo "$ARGUMENTS" | harnessed run verify-simplify --task-stdin
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).
57
59
 
58
- If `$ARGUMENTS` is empty, run `harnessed run verify-simplify` (no stdin pipe).
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.
59
64
 
60
- After completion, the Bash output prints a `Next:` hint on stderr suggesting the next stage. Decide whether to invoke based on conversation context — the hint is informational, not prescriptive.
61
-
62
- <!-- harnessed-generated:v3.4.4 -->
65
+ <!-- harnessed-generated:v4.9.3 -->
63
66
 
64
67
  ## References
65
68
 
@@ -47,19 +47,21 @@ Sister `workflows/judgments/stage-routing.yaml`:
47
47
  - ✅ **触发**: verify chain 末尾步骤 (所有其他 verify sub 已 ship,准备 code 简化收尾)
48
48
  - ❌ **跳过**: verify chain 中间步骤 (避免过早简化干扰后续 review)
49
49
 
50
- ## 调用方式
50
+ ## 如何调用
51
51
 
52
- 使用 Bash 工具运行:
52
+ 下面这套编号序列**就是** state machine —— 用 Bash 执行。**不要**从上方 Overview 自行演绎等价流程:
53
+ freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 spawn-ready prompt;**你**用
54
+ CC-native Task / Agent 工具 spawn subagent(保持 session 响应 + 让澄清 round-trip 能回到用户)。
53
55
 
54
- ```bash
55
- echo "$ARGUMENTS" | harnessed run verify-simplify --task-stdin
56
- ```
56
+ **不要** pipe 到 `harnessed run verify-simplify` —— 那是 CI/headless 路径(in-process SDK spawn,在 Claude
57
+ Code 内部会阻塞 session)。
57
58
 
58
- 若 `$ARGUMENTS` 为空,则运行 `harnessed run verify-simplify`(不接管道输入)。
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。
59
63
 
60
- 完成后,Bash 输出会在 stderr 打印 `Next:` 提示,建议下一阶段。是否调用取决于对话上下文 — 该提示仅供参考,非强制指令。
61
-
62
- <!-- harnessed-generated:v3.4.4 -->
64
+ <!-- harnessed-generated:v4.9.3 -->
63
65
 
64
66
  ## 参考资料
65
67