harnessed 5.0.5 → 5.0.6

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 (60) hide show
  1. package/CHANGELOG.md +3183 -0
  2. package/README-en.md +10 -1
  3. package/README-zh.md +10 -1
  4. package/README.md +10 -1
  5. package/bin/harnessed-check-docs.mjs +1 -0
  6. package/bin/harnessed-inject-state.mjs +57 -9
  7. package/bin/harnessed-stop-hook.mjs +51 -9
  8. package/bin/harnessed-update-reminder-worker.mjs +3 -1
  9. package/bin/harnessed-update-reminder.mjs +3 -1
  10. package/dist/cli.mjs +1952 -432
  11. package/dist/cli.mjs.map +1 -1
  12. package/dist/index.mjs +1 -1
  13. package/dist/index.mjs.map +1 -1
  14. package/manifests/optional/codegraph.yaml +2 -0
  15. package/manifests/skill-packs/gsd.yaml +5 -3
  16. package/manifests/skill-packs/mattpocock-skills.yaml +3 -3
  17. package/manifests/tools/playwright-cli.yaml +4 -0
  18. package/messages/en.json +1 -0
  19. package/messages/zh-Hans.json +3 -2
  20. package/package.json +3 -1
  21. package/workflows/auto/SKILL.md +1 -1
  22. package/workflows/auto/SKILL.zh-Hans.md +1 -1
  23. package/workflows/defaults.yaml +12 -0
  24. package/workflows/discuss/phase/SKILL.md +1 -1
  25. package/workflows/discuss/phase/SKILL.zh-Hans.md +1 -1
  26. package/workflows/discuss/subtask/SKILL.md +1 -1
  27. package/workflows/discuss/subtask/SKILL.zh-Hans.md +1 -1
  28. package/workflows/plan/ai-integration/SKILL.md +39 -0
  29. package/workflows/plan/ai-integration/SKILL.zh-Hans.md +38 -0
  30. package/workflows/plan/ai-integration/workflow.yaml +12 -0
  31. package/workflows/plan/auto/workflow.yaml +22 -2
  32. package/workflows/plan/phase/SKILL.md +2 -2
  33. package/workflows/plan/phase/SKILL.zh-Hans.md +2 -2
  34. package/workflows/plan/secure/SKILL.md +39 -0
  35. package/workflows/plan/secure/SKILL.zh-Hans.md +38 -0
  36. package/workflows/plan/secure/workflow.yaml +12 -0
  37. package/workflows/plan/spec/SKILL.md +39 -0
  38. package/workflows/plan/spec/SKILL.zh-Hans.md +38 -0
  39. package/workflows/plan/spec/workflow.yaml +12 -0
  40. package/workflows/plan/ui/SKILL.md +39 -0
  41. package/workflows/plan/ui/SKILL.zh-Hans.md +38 -0
  42. package/workflows/plan/ui/workflow.yaml +12 -0
  43. package/workflows/role-prompts.yaml +36 -6
  44. package/workflows/role-prompts.zh-Hans.yaml +36 -6
  45. package/workflows/ship/auto/SKILL.md +2 -1
  46. package/workflows/ship/auto/SKILL.zh-Hans.md +2 -1
  47. package/workflows/task/clarify/SKILL.md +2 -2
  48. package/workflows/task/clarify/SKILL.zh-Hans.md +2 -2
  49. package/workflows/task/code/SKILL.md +1 -1
  50. package/workflows/task/code/SKILL.zh-Hans.md +1 -1
  51. package/workflows/task/deliver/SKILL.md +1 -1
  52. package/workflows/task/deliver/SKILL.zh-Hans.md +1 -1
  53. package/workflows/task/test/SKILL.md +1 -1
  54. package/workflows/task/test/SKILL.zh-Hans.md +1 -1
  55. package/workflows/verify/auto/SKILL.md +1 -1
  56. package/workflows/verify/auto/SKILL.zh-Hans.md +1 -1
  57. package/workflows/verify/design/SKILL.md +1 -1
  58. package/workflows/verify/design/SKILL.zh-Hans.md +1 -1
  59. package/workflows/verify/progress/SKILL.md +1 -1
  60. package/workflows/verify/progress/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: "5.0.5"};
3
+ version: "5.0.6"};
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,OA6Gb,CAAA;;;AC1GO,IAAM,UAAU,eAAA,CAAI","file":"index.mjs","sourcesContent":["{\n \"name\": \"harnessed\",\n \"version\": \"5.0.5\",\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 \"README-en.md\",\n \"README-zh.md\",\n \"LICENSE\",\n \"NOTICE\",\n \"THIRD-PARTY-NOTICES.md\"\n ],\n \"scripts\": {\n \"dev\": \"tsup --watch\",\n \"build\": \"tsc --noEmit && tsup && node ./scripts/build-hooks.mjs\",\n \"build:hooks\": \"node ./scripts/build-hooks.mjs\",\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 \"test:codex-live\": \"node ./scripts/codex-live/run.mjs\",\n \"bench\": \"vitest bench --run\",\n \"bench:runtime\": \"node scripts/benchmark-runtime.mjs\",\n \"test:runtime-channels\": \"node scripts/runtime-channel-smoke.mjs\",\n \"test:docs\": \"node --test tests/docs/install-channels.contract.mjs\",\n \"lint\": \"biome check .\",\n \"lint:fix\": \"biome check --write .\",\n \"format\": \"biome format --write .\",\n \"build:binary\": \"bun scripts/build-binary.mjs\"\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 \"smol-toml\": \"^1.9.1\",\n \"undici\": \"^8.12.1\",\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 \"esbuild\": \"0.27.7\",\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,OA+Gb,CAAA;;;AC5GO,IAAM,UAAU,eAAA,CAAI","file":"index.mjs","sourcesContent":["{\n \"name\": \"harnessed\",\n \"version\": \"5.0.6\",\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 \"CHANGELOG.md\",\n \"README.md\",\n \"README-en.md\",\n \"README-zh.md\",\n \"LICENSE\",\n \"NOTICE\",\n \"THIRD-PARTY-NOTICES.md\"\n ],\n \"scripts\": {\n \"dev\": \"tsup --watch\",\n \"build\": \"tsc --noEmit && tsup && node ./scripts/build-hooks.mjs\",\n \"prepack\": \"npm run build\",\n \"build:hooks\": \"node ./scripts/build-hooks.mjs\",\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 \"test:codex-live\": \"node ./scripts/codex-live/run.mjs\",\n \"bench\": \"vitest bench --run\",\n \"bench:runtime\": \"node scripts/benchmark-runtime.mjs\",\n \"test:runtime-channels\": \"node scripts/runtime-channel-smoke.mjs\",\n \"test:docs\": \"node --test tests/docs/install-channels.contract.mjs\",\n \"lint\": \"biome check .\",\n \"lint:fix\": \"biome check --write .\",\n \"format\": \"biome format --write .\",\n \"build:binary\": \"bun scripts/build-binary.mjs\"\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 \"smol-toml\": \"^1.9.1\",\n \"undici\": \"^8.12.1\",\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 \"esbuild\": \"0.27.7\",\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"]}
@@ -41,6 +41,8 @@ spec:
41
41
  timeout_ms: 10000
42
42
  expected_exit_code: 0
43
43
  uninstall:
44
+ # Upstream 1.6.0 documents this command as removing agent wiring and the CLI
45
+ # itself, including npm-global packages, standalone bundles, and launchers.
44
46
  cmd: "codegraph uninstall --yes"
45
47
  upstream_health:
46
48
  stability: stable
@@ -44,9 +44,8 @@ spec:
44
44
  && test -f ~/.claude/agents/gsd-verifier.md
45
45
  timeout_ms: 10000
46
46
  uninstall:
47
- cmd: "npx --yes @opengsd/gsd-core@latest --uninstall --claude"
48
- cleanup_paths:
49
- - ~/.claude/skills/gsd-plan-phase
47
+ cmd: "npx --yes @opengsd/gsd-core@latest --claude --global --uninstall"
48
+ cleanup_paths: []
50
49
  # GSD 1.18.0 on Codex installs skills under ~/.agents/skills; retain the legacy
51
50
  # ~/.codex/skills path for existing installs. Probe files, not empty directories.
52
51
  harness_overrides:
@@ -78,6 +77,9 @@ spec:
78
77
  agents/gsd-verifier.toml;
79
78
  do test -f "$GSD_VERIFY_ROOT/$GSD_VERIFY_RESOURCE" && test -r "$GSD_VERIFY_ROOT/$GSD_VERIFY_RESOURCE" && test -s "$GSD_VERIFY_ROOT/$GSD_VERIFY_RESOURCE" || exit 1; done
80
79
  timeout_ms: 10000
80
+ uninstall:
81
+ cmd: "npx --yes @opengsd/gsd-core@latest --codex --global --uninstall"
82
+ cleanup_paths: []
81
83
  upstream_health:
82
84
  stability: stable
83
85
  # 4.32.3 re-sync (2026-07-15) — gsd-core 1.7.0 GA 已发(npm latest=1.7.0,
@@ -69,9 +69,9 @@ spec:
69
69
  cmd: "test -f ~/.claude/skills/tdd/SKILL.md || test -f ~/.agents/skills/tdd/SKILL.md || test -f ~/.claude/skills/diagnosing-bugs/SKILL.md || test -f ~/.agents/skills/diagnosing-bugs/SKILL.md"
70
70
  timeout_ms: 5000
71
71
  uninstall:
72
- cmd: "rm -rf ~/.claude/skills/mattpocock-skills"
73
- cleanup_paths:
74
- - ~/.claude/skills/mattpocock-skills
72
+ # Skill removal is receipt-driven; upstream installs a flat set of names.
73
+ cmd: "true"
74
+ cleanup_paths: []
75
75
  upstream_health:
76
76
  stability: stable
77
77
  last_check: "2026-09-10"
@@ -61,6 +61,10 @@ spec:
61
61
  expected_exit_code: 0
62
62
  uninstall:
63
63
  cmd: "npm uninstall -g @playwright/cli"
64
+ # Playwright CLI 0.1.22 has no uninstall-browser command. Its ms-playwright
65
+ # cache is shared by every Playwright installation on the host, so harnessed
66
+ # deliberately leaves browser binaries in place rather than deleting data it
67
+ # cannot safely attribute to this component.
64
68
  upstream_health:
65
69
  stability: unstable
66
70
  last_check: "2026-10-23"
package/messages/en.json CHANGED
@@ -7,6 +7,7 @@
7
7
  "setup.step_a_complete": "Step A: {{count}} workflows installed to {{path}}",
8
8
  "setup.step_a_render.complete": " generated {{count}}/{{total}} command files",
9
9
  "setup.step_a_render.warnings_header": " [A.5] warnings — some capability cmds could not be fully resolved:",
10
+ "setup.command_warning": " [A.6] {{message}}",
10
11
  "setup.step_c.created": " [C] created {{path}} + enabled Agent Teams",
11
12
  "setup.step_c.already_enabled": " [C] Agent Teams already enabled ({{path}})",
12
13
  "setup.step_c.enabled_backup": " [C] enabled Agent Teams in {{path}} (backup saved → {{backupPath}})",
@@ -7,14 +7,15 @@
7
7
  "setup.step_a_complete": "Step A: {{count}} workflows installed to {{path}}",
8
8
  "setup.step_a_render.complete": "",
9
9
  "setup.step_a_render.warnings_header": " warnings — some capability cmds could not be fully resolved:",
10
+ "setup.command_warning": " [A.6] {{message}}",
10
11
  "setup.step_c.created": "",
11
12
  "setup.step_c.already_enabled": "",
12
13
  "setup.step_c.enabled_backup": "",
13
- "setup.step_c.skipped": "",
14
+ "setup.step_c.skipped": " [C] Agent Teams 启用已跳过:{{message}}",
14
15
  "setup.step_d.created": "",
15
16
  "setup.step_d.already_set": "",
16
17
  "setup.step_d.enabled_backup": "",
17
- "setup.step_d.skipped": "",
18
+ "setup.step_d.skipped": " [D] 用户语言写入已跳过:{{message}}",
18
19
  "setup.step_b_complete": "Upstream components: {{installed}} installed / {{already}} already-installed / {{skipped}} skipped / {{failed}} failed [{{seconds}}s]",
19
20
  "setup.complete": "setup complete — {{skills}} workflows + {{manifests}} base manifests",
20
21
  "setup.mcp_hint": "Run /mcp in Claude Code to verify MCP server connections.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harnessed",
3
- "version": "5.0.5",
3
+ "version": "5.0.6",
4
4
  "description": "AI coding harness package manager + composition orchestrator",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -51,6 +51,7 @@
51
51
  "routing",
52
52
  "config-templates",
53
53
  "schemas",
54
+ "CHANGELOG.md",
54
55
  "README.md",
55
56
  "README-en.md",
56
57
  "README-zh.md",
@@ -61,6 +62,7 @@
61
62
  "scripts": {
62
63
  "dev": "tsup --watch",
63
64
  "build": "tsc --noEmit && tsup && node ./scripts/build-hooks.mjs",
65
+ "prepack": "npm run build",
64
66
  "build:hooks": "node ./scripts/build-hooks.mjs",
65
67
  "build:schema": "node ./scripts/build-schema.mjs",
66
68
  "validate:schema": "node ./scripts/validate-schema.mjs",
@@ -125,7 +125,7 @@ Do NOT pipe to `harnessed run auto` — that is the CI/headless path ({{ host.ha
125
125
  {{ host.teams_step_note.skill }}
126
126
  {{ host.teams_teardown_note }}
127
127
  5. Otherwise, for each fired sub in `order` (serial subs sequentially, parallel subs concurrently):
128
- - **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 facts <sub> --out .harnessed-facts.json` (fill the nulls) → `harnessed gates <sub> --task "<spec>" --context-file .harnessed-facts.json --skip-sub discuss` → `harnessed checkpoint start <sub> --plan '<json>'` → repeat this loop for ITS fired subs.
128
+ - **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 facts <sub> --out .harnessed-facts.json` (fill the nulls) → `harnessed gates <sub> --task "<spec>" --context-file .harnessed-facts.json --skip-sub discuss` → `harnessed checkpoint start <sub> --plan '<json>'` → repeat this loop for ITS fired subs. The nested `checkpoint start` expands that parent entry inside the existing root ledger; it must not replace the root workflow owner, timestamps, checkpoint path, or sibling entries.
129
129
  - **Else (leaf sub):**
130
130
  a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → parse `{prompt, max_iterations, model}`.
131
131
  b. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
@@ -123,7 +123,7 @@ Sister `workflows/capabilities.yaml`:
123
123
  {{ host.teams_step_note.skill }}
124
124
  {{ host.teams_teardown_note }}
125
125
  5. 否则,对 `order` 里每个 fired sub(serial 串行、parallel 并发):
126
- - **若该项 `is_master: true`**(本身是 stage master —— 如 `/auto` fire `plan`/`task`/`verify`):**不要**直接 prompt+spawn。RECURSE:跑该 master 自己的 `harnessed facts <sub> --out .harnessed-facts.json`(填完 null)→ `harnessed gates <sub> --task "<spec>" --context-file .harnessed-facts.json --skip-sub discuss` → `harnessed checkpoint start <sub> --plan '<json>'` → 对它的 fired subs 重复本循环。
126
+ - **若该项 `is_master: true`**(本身是 stage master —— 如 `/auto` fire `plan`/`task`/`verify`):**不要**直接 prompt+spawn。RECURSE:跑该 master 自己的 `harnessed facts <sub> --out .harnessed-facts.json`(填完 null)→ `harnessed gates <sub> --task "<spec>" --context-file .harnessed-facts.json --skip-sub discuss` → `harnessed checkpoint start <sub> --plan '<json>'` → 对它的 fired subs 重复本循环。nested `checkpoint start` 会在现有 root ledger 内展开 parent entry;不得替换 root workflow owner、时间戳、checkpoint path 或 sibling entries。
127
127
  - **否则(leaf sub):**
128
128
  a. Bash: `harnessed prompt <sub> --task "<spec>" --json` → 解析 `{prompt, max_iterations, model}`。
129
129
  b. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
@@ -45,6 +45,18 @@ ralph_max_iterations:
45
45
  plan-architecture:
46
46
  01-plan-eng-review: 3
47
47
 
48
+ plan-spec:
49
+ 01-spec-phase: 5
50
+
51
+ plan-ui:
52
+ 01-ui-phase: 5
53
+
54
+ plan-secure:
55
+ 01-secure-phase: 5
56
+
57
+ plan-ai-integration:
58
+ 01-ai-integration-phase: 5
59
+
48
60
  plan-phase:
49
61
  01-gsd-plan: 5
50
62
  02-persist: 5
@@ -5,7 +5,7 @@ description: |
5
5
  implementation decisions / 跨 phase API contract 不清 / phase scope > 1 day / 灰色地带)。
6
6
  schema_version: harnessed.workflow.v3 with disciplines_applied (6 default) + tools_available
7
7
  (gsd-discuss-phase + planning-with-files) + 2 phases (01-gsd-discuss + 02-persist findings.md
8
- + knowledge.md)。Triggered by harnessed CLI `harnessed discuss-phase --phase <num>` or slash
8
+ + knowledge.md)。Triggered by headless CLI `harnessed run discuss-phase` or slash
9
9
  command `/discuss-phase` after `harnessed setup`.
10
10
  trigger_phrases:
11
11
  - "discuss phase"
@@ -5,7 +5,7 @@ description: |
5
5
  实现决策 / 跨 phase API contract 不清 / phase scope > 1 天 / 灰色地带)。
6
6
  schema_version: harnessed.workflow.v3 with disciplines_applied (6 default) + tools_available
7
7
  (gsd-discuss-phase + planning-with-files) + 2 phases(01-gsd-discuss + 02-persist findings.md
8
- + knowledge.md)。Triggered by harnessed CLI `harnessed discuss-phase --phase <num>` or slash
8
+ + knowledge.md)。Triggered by headless CLI `harnessed run discuss-phase` or slash
9
9
  command `/discuss-phase` after `harnessed setup`.
10
10
  trigger_phrases:
11
11
  - "discuss phase"
@@ -5,7 +5,7 @@ description: |
5
5
  API contract / 错误成本高)。schema_version: harnessed.workflow.v3 with disciplines_applied (6
6
6
  default) + tools_available (superpowers-brainstorming + grill-with-docs + grill-me) + 1 phase
7
7
  (01-brainstorm with conditional invokes_tools for spec_ambiguous + no_docs)。Triggered by
8
- harnessed CLI `harnessed discuss-subtask --task <text>` or slash command `/discuss-subtask`
8
+ headless CLI `harnessed run discuss-subtask` or slash command `/discuss-subtask`
9
9
  after `harnessed setup`.
10
10
  trigger_phrases:
11
11
  - "discuss subtask"
@@ -5,7 +5,7 @@ description: |
5
5
  API contract / 错误成本高)。schema_version: harnessed.workflow.v3 with disciplines_applied (6
6
6
  default) + tools_available (superpowers-brainstorming + grill-with-docs + grill-me) + 1 phase
7
7
  (01-brainstorm,含 spec_ambiguous + no_docs 条件调用 invokes_tools)。Triggered by
8
- harnessed CLI `harnessed discuss-subtask --task <text>` or slash command `/discuss-subtask`
8
+ headless CLI `harnessed run discuss-subtask` or slash command `/discuss-subtask`
9
9
  after `harnessed setup`.
10
10
  trigger_phrases:
11
11
  - "discuss subtask"
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: plan-ai-integration
3
+ description: Run the conditional GSD ai-integration-phase AI-SPEC contract before plan-phase.
4
+ trigger_phrases: ["plan ai integration", "gsd ai integration phase"]
5
+ ---
6
+
7
+ # plan-ai-integration workflow
8
+
9
+ ## Overview
10
+
11
+ Run `harnessed prompt plan-ai-integration --task "$ARGUMENTS" --json`, execute `/gsd-ai-integration-phase`, then complete the registered checkpoint with verifiable output.
12
+
13
+ ## Invocation
14
+
15
+ Fires only when `phase.builds_ai_system == true`.
16
+
17
+ ## How to invoke
18
+
19
+ !`harnessed checkpoint intent plan-ai-integration`
20
+
21
+ > The banner above (when present) means this invocation is REGISTERED with the engine (an intent marker) — not yet compliant: the steps below (prompt → spawn → checkpoint complete) resolve it, and a per-turn `<workflow-intent>` reminder persists until they run.
22
+
23
+ The numbered sequence below **is** the state machine — execute it with Bash. Do NOT improvise
24
+ an equivalent flow from the Overview above: freelancing bypasses the engine (no ledger, no
25
+ evidence guard). harnessed gives you the spawn-ready prompt; YOU spawn the subagent with a
26
+ {{ host.native }} {{ host.spawn_subagent }} (keeps the session responsive + lets clarification round-trips reach the user).
27
+
28
+ Do NOT pipe to `harnessed run plan-ai-integration` — that is the CI/headless path ({{ host.harnessed_run_warning_note.execution_tail }}
29
+
30
+ 1. Bash: `harnessed prompt plan-ai-integration --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
31
+ 2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
32
+ - on return, write the subagent's final output to a file and run `harnessed checkpoint complete plan-ai-integration --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
33
+ - if it blocks, run `harnessed checkpoint fail plan-ai-integration --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
34
+ - respawn ONLY while none of those three has fired. Any one of them means stop: re-scope the subtask, fix the blocker, or escalate to the user. Never respawn past a stop directive.
35
+ 3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via {{ host.ask_user }}, append the answers to the spec, then re-spawn the same sub.
36
+ 4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete plan-ai-integration --result-file <path> --summary "<one-line>"`. Fail-CLOSED — it blocks unless every declared `artifacts_expected` file exists, the TDD boundary passes (non-empty evidence / both the red and green sides present / the test file was not deleted), and the result carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. `--force` records an audited override (`evidence_status=overridden`) — it does not silently pass.
37
+ 5. If the complete gate blocked: Bash `harnessed checkpoint fail plan-ai-integration --failing-tests <n>` to record the attempt. It prints `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP` once a stop condition is reached. Respawn ONLY while none of those three has fired; any one of them means STOP — re-scope the subtask, fix the blocker, or escalate to the user.
38
+
39
+ <!-- harnessed-generated:v4.12.0 -->
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: plan-ai-integration
3
+ description: 在 plan-phase 前按条件运行 GSD ai-integration-phase AI-SPEC 契约。
4
+ trigger_phrases: ["plan ai integration", "gsd ai integration phase"]
5
+ ---
6
+
7
+ # plan-ai-integration workflow
8
+
9
+ ## Overview
10
+
11
+ 运行 `harnessed prompt plan-ai-integration --task "$ARGUMENTS" --json`,执行 `/gsd-ai-integration-phase`,再用可验证输出完成已登记 checkpoint。
12
+
13
+ ## Invocation
14
+
15
+ 仅当 `phase.builds_ai_system == true` 时触发。
16
+
17
+ ## 如何调用
18
+
19
+ !`harnessed checkpoint intent plan-ai-integration`
20
+
21
+ > 上方 banner(如出现)表示本次调用已在引擎**登记**(intent 标记)——尚未合规:按下方步骤(prompt → spawn → checkpoint complete)完成即解除;在此之前每 turn 会持续注入 `<workflow-intent>` 提醒。
22
+
23
+ 下面这套编号序列**就是** state machine —— 用 Bash 执行。**不要**从上方 Overview 自行演绎等价流程:
24
+ freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 spawn-ready prompt;**你**用
25
+ {{ host.native }} {{ host.spawn_subagent.zh_tool }} spawn subagent(保持 session 响应 + 让澄清 round-trip 能回到用户)。
26
+
27
+ **不要** pipe 到 `harnessed run plan-ai-integration` —— 那是 CI/headless 路径({{ host.harnessed_run_warning_note.execution_tail }}
28
+
29
+ 1. Bash: `harnessed prompt plan-ai-integration --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
30
+ 2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
31
+ - subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete plan-ai-integration --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
32
+ - 若被拦下,跑 `harnessed checkpoint fail plan-ai-integration --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
33
+ - **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
34
+ 3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 {{ host.ask_user }} 原样转达,把答案 append 进 spec,再重 spawn。
35
+ 4. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete plan-ai-integration --result-file <path> --summary "<one-line>"`。fail-CLOSED —— 除非声明的 `artifacts_expected` 文件全部存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 / 测试文件未被删除)、且结果含逐字 `<promise>COMPLETE</promise>`(或结构化 COMPLETE 状态),否则拦下。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。`--force` 记录可审计的覆盖(`evidence_status=overridden`),不是静默放行。
36
+ 5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail plan-ai-integration --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
37
+
38
+ <!-- harnessed-generated:v4.12.0 -->
@@ -0,0 +1,12 @@
1
+ schema_version: harnessed.workflow.v3
2
+ workflow: plan-ai-integration
3
+ description: GSD ai-integration-phase AI-SPEC contract before ordinary phase planning.
4
+ disciplines_applied: [karpathy, output-style, language, operational, priority, protocols]
5
+ tools_available: [gsd-ai-integration-phase]
6
+ phases:
7
+ - id: 01-ai-integration-phase
8
+ name: gsd-ai-integration-phase
9
+ upstream: gsd
10
+ capability: '{{ capabilities.gsd-ai-integration-phase.cmd }}'
11
+ model: sonnet
12
+ gate: judgments.stage-phase-gate.gsd-ai-integration-phase.fires
@@ -1,6 +1,6 @@
1
1
  # workflows/plan/auto/workflow.yaml — Phase v3.0-3.5 W1 T3.5.W1.2
2
2
  #
3
- # Stage ② Plan master orchestrator — 串行 invoke 2 sub (architecture conditional → phase always)
3
+ # Stage ② Plan master orchestrator — serial design-contract gates, then phase always.
4
4
  # per bundled Plan-stage cadence + RESEARCH-workflows § Area 2。
5
5
  # planning-with-files /plan 是 D-06 cross-cutting tool (NOT 独立 sub-workflow per user clarification 2)。
6
6
  #
@@ -28,6 +28,10 @@ disciplines_applied: [karpathy, output-style, language, operational, priority, p
28
28
  tools_available:
29
29
  - planning-with-files
30
30
  - plan-eng-review
31
+ - gsd-spec-phase
32
+ - gsd-ui-phase
33
+ - gsd-secure-phase
34
+ - gsd-ai-integration-phase
31
35
  - gsd-plan-phase
32
36
 
33
37
  delegates_to:
@@ -35,6 +39,22 @@ delegates_to:
35
39
  gate: judgments.stage-routing.plan-architecture-delegate.fires
36
40
  mode: serial
37
41
  order: 1
38
- - sub: phase
42
+ - sub: spec
43
+ gate: judgments.stage-phase-gate.gsd-spec-phase.fires
39
44
  mode: serial
40
45
  order: 2
46
+ - sub: ui
47
+ gate: judgments.stage-phase-gate.gsd-ui-phase.fires
48
+ mode: serial
49
+ order: 3
50
+ - sub: secure
51
+ gate: judgments.stage-phase-gate.gsd-secure-phase.fires
52
+ mode: serial
53
+ order: 4
54
+ - sub: ai-integration
55
+ gate: judgments.stage-phase-gate.gsd-ai-integration-phase.fires
56
+ mode: serial
57
+ order: 5
58
+ - sub: phase
59
+ mode: serial
60
+ order: 6
@@ -6,8 +6,8 @@ description: |
6
6
  progress.md (bundled Plan-stage cadence: GSD + planning-with-files)。Stage ② 铁律:
7
7
  dual capability (GSD orchestration + planning-with-files plugin)。schema_version:
8
8
  harnessed.workflow.v3 with disciplines_applied (6 default) + tools_available [gsd-plan-phase,
9
- planning-with-files] + 2 phases (01-gsd-plan + 02-persist)。Triggered by harnessed CLI
10
- `harnessed plan-phase --phase <num>` or slash command `/plan-phase` after `harnessed setup`.
9
+ planning-with-files] + 2 phases (01-gsd-plan + 02-persist)。Triggered by headless CLI
10
+ `harnessed run plan-phase` or slash command `/plan-phase` after `harnessed setup`.
11
11
  trigger_phrases:
12
12
  - "plan phase"
13
13
  - "计划层 phase"
@@ -6,8 +6,8 @@ description: |
6
6
  progress.md(打包的 Plan-stage 节奏:GSD + planning-with-files)。Stage ② 铁律:
7
7
  dual capability (GSD orchestration + planning-with-files plugin)。schema_version:
8
8
  harnessed.workflow.v3 with disciplines_applied (6 default) + tools_available [gsd-plan-phase,
9
- planning-with-files] + 2 phases (01-gsd-plan + 02-persist)。Triggered by harnessed CLI
10
- `harnessed plan-phase --phase <num>` or slash command `/plan-phase` after `harnessed setup`.
9
+ planning-with-files] + 2 phases (01-gsd-plan + 02-persist)。Triggered by headless CLI
10
+ `harnessed run plan-phase` or slash command `/plan-phase` after `harnessed setup`.
11
11
  trigger_phrases:
12
12
  - "plan phase"
13
13
  - "计划层 phase"
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: plan-secure
3
+ description: Run the conditional GSD secure-phase threat-model contract before plan-phase.
4
+ trigger_phrases: ["plan secure", "gsd secure phase"]
5
+ ---
6
+
7
+ # plan-secure workflow
8
+
9
+ ## Overview
10
+
11
+ Run `harnessed prompt plan-secure --task "$ARGUMENTS" --json`, execute `/gsd-secure-phase`, then complete the registered checkpoint with verifiable output.
12
+
13
+ ## Invocation
14
+
15
+ Fires only when `phase.has_auth_or_secrets == true`.
16
+
17
+ ## How to invoke
18
+
19
+ !`harnessed checkpoint intent plan-secure`
20
+
21
+ > The banner above (when present) means this invocation is REGISTERED with the engine (an intent marker) — not yet compliant: the steps below (prompt → spawn → checkpoint complete) resolve it, and a per-turn `<workflow-intent>` reminder persists until they run.
22
+
23
+ The numbered sequence below **is** the state machine — execute it with Bash. Do NOT improvise
24
+ an equivalent flow from the Overview above: freelancing bypasses the engine (no ledger, no
25
+ evidence guard). harnessed gives you the spawn-ready prompt; YOU spawn the subagent with a
26
+ {{ host.native }} {{ host.spawn_subagent }} (keeps the session responsive + lets clarification round-trips reach the user).
27
+
28
+ Do NOT pipe to `harnessed run plan-secure` — that is the CI/headless path ({{ host.harnessed_run_warning_note.execution_tail }}
29
+
30
+ 1. Bash: `harnessed prompt plan-secure --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
31
+ 2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
32
+ - on return, write the subagent's final output to a file and run `harnessed checkpoint complete plan-secure --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
33
+ - if it blocks, run `harnessed checkpoint fail plan-secure --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
34
+ - respawn ONLY while none of those three has fired. Any one of them means stop: re-scope the subtask, fix the blocker, or escalate to the user. Never respawn past a stop directive.
35
+ 3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via {{ host.ask_user }}, append the answers to the spec, then re-spawn the same sub.
36
+ 4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete plan-secure --result-file <path> --summary "<one-line>"`. Fail-CLOSED — it blocks unless every declared `artifacts_expected` file exists, the TDD boundary passes (non-empty evidence / both the red and green sides present / the test file was not deleted), and the result carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. `--force` records an audited override (`evidence_status=overridden`) — it does not silently pass.
37
+ 5. If the complete gate blocked: Bash `harnessed checkpoint fail plan-secure --failing-tests <n>` to record the attempt. It prints `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP` once a stop condition is reached. Respawn ONLY while none of those three has fired; any one of them means STOP — re-scope the subtask, fix the blocker, or escalate to the user.
38
+
39
+ <!-- harnessed-generated:v4.12.0 -->
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: plan-secure
3
+ description: 在 plan-phase 前按条件运行 GSD secure-phase threat-model 契约。
4
+ trigger_phrases: ["plan secure", "gsd secure phase"]
5
+ ---
6
+
7
+ # plan-secure workflow
8
+
9
+ ## Overview
10
+
11
+ 运行 `harnessed prompt plan-secure --task "$ARGUMENTS" --json`,执行 `/gsd-secure-phase`,再用可验证输出完成已登记 checkpoint。
12
+
13
+ ## Invocation
14
+
15
+ 仅当 `phase.has_auth_or_secrets == true` 时触发。
16
+
17
+ ## 如何调用
18
+
19
+ !`harnessed checkpoint intent plan-secure`
20
+
21
+ > 上方 banner(如出现)表示本次调用已在引擎**登记**(intent 标记)——尚未合规:按下方步骤(prompt → spawn → checkpoint complete)完成即解除;在此之前每 turn 会持续注入 `<workflow-intent>` 提醒。
22
+
23
+ 下面这套编号序列**就是** state machine —— 用 Bash 执行。**不要**从上方 Overview 自行演绎等价流程:
24
+ freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 spawn-ready prompt;**你**用
25
+ {{ host.native }} {{ host.spawn_subagent.zh_tool }} spawn subagent(保持 session 响应 + 让澄清 round-trip 能回到用户)。
26
+
27
+ **不要** pipe 到 `harnessed run plan-secure` —— 那是 CI/headless 路径({{ host.harnessed_run_warning_note.execution_tail }}
28
+
29
+ 1. Bash: `harnessed prompt plan-secure --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
30
+ 2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
31
+ - subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete plan-secure --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
32
+ - 若被拦下,跑 `harnessed checkpoint fail plan-secure --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
33
+ - **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
34
+ 3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 {{ host.ask_user }} 原样转达,把答案 append 进 spec,再重 spawn。
35
+ 4. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete plan-secure --result-file <path> --summary "<one-line>"`。fail-CLOSED —— 除非声明的 `artifacts_expected` 文件全部存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 / 测试文件未被删除)、且结果含逐字 `<promise>COMPLETE</promise>`(或结构化 COMPLETE 状态),否则拦下。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。`--force` 记录可审计的覆盖(`evidence_status=overridden`),不是静默放行。
36
+ 5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail plan-secure --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
37
+
38
+ <!-- harnessed-generated:v4.12.0 -->
@@ -0,0 +1,12 @@
1
+ schema_version: harnessed.workflow.v3
2
+ workflow: plan-secure
3
+ description: GSD secure-phase threat-model contract before ordinary phase planning.
4
+ disciplines_applied: [karpathy, output-style, language, operational, priority, protocols]
5
+ tools_available: [gsd-secure-phase]
6
+ phases:
7
+ - id: 01-secure-phase
8
+ name: gsd-secure-phase
9
+ upstream: gsd
10
+ capability: '{{ capabilities.gsd-secure-phase.cmd }}'
11
+ model: sonnet
12
+ gate: judgments.stage-phase-gate.gsd-secure-phase.fires
@@ -0,0 +1,39 @@
1
+ ---
2
+ name: plan-spec
3
+ description: Run the conditional GSD spec-phase design contract before plan-phase.
4
+ trigger_phrases: ["plan spec", "gsd spec phase"]
5
+ ---
6
+
7
+ # plan-spec workflow
8
+
9
+ ## Overview
10
+
11
+ Run `harnessed prompt plan-spec --task "$ARGUMENTS" --json`, execute `/gsd-spec-phase`, then complete the registered checkpoint with verifiable output.
12
+
13
+ ## Invocation
14
+
15
+ Fires only when `phase.requires_spec == true`.
16
+
17
+ ## How to invoke
18
+
19
+ !`harnessed checkpoint intent plan-spec`
20
+
21
+ > The banner above (when present) means this invocation is REGISTERED with the engine (an intent marker) — not yet compliant: the steps below (prompt → spawn → checkpoint complete) resolve it, and a per-turn `<workflow-intent>` reminder persists until they run.
22
+
23
+ The numbered sequence below **is** the state machine — execute it with Bash. Do NOT improvise
24
+ an equivalent flow from the Overview above: freelancing bypasses the engine (no ledger, no
25
+ evidence guard). harnessed gives you the spawn-ready prompt; YOU spawn the subagent with a
26
+ {{ host.native }} {{ host.spawn_subagent }} (keeps the session responsive + lets clarification round-trips reach the user).
27
+
28
+ Do NOT pipe to `harnessed run plan-spec` — that is the CI/headless path ({{ host.harnessed_run_warning_note.execution_tail }}
29
+
30
+ 1. Bash: `harnessed prompt plan-spec --task "$ARGUMENTS" --json` → parse `{prompt, max_iterations, model}`.
31
+ 2. Spawn a {{ host.native }} subagent ({{ host.spawn_subagent }}) with that `prompt` and `model`, then drive delivery with harnessed's own completion gate:
32
+ - on return, write the subagent's final output to a file and run `harnessed checkpoint complete plan-spec --result-file <path>` — it is fail-closed on the declared artifacts, the TDD boundary, and the verbatim `<promise>COMPLETE</promise>`.
33
+ - if it blocks, run `harnessed checkpoint fail plan-spec --failing-tests <n>` to record the attempt; it prints BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP when a stop condition is reached.
34
+ - respawn ONLY while none of those three has fired. Any one of them means stop: re-scope the subtask, fix the blocker, or escalate to the user. Never respawn past a stop directive.
35
+ 3. If the output contains `STATUS: NEEDS_CLARIFICATION` + a question list: STOP, relay them verbatim via {{ host.ask_user }}, append the answers to the spec, then re-spawn the same sub.
36
+ 4. On `<promise>COMPLETE</promise>`: write the subagent’s final output to a file, then Bash `harnessed checkpoint complete plan-spec --result-file <path> --summary "<one-line>"`. Fail-CLOSED — it blocks unless every declared `artifacts_expected` file exists, the TDD boundary passes (non-empty evidence / both the red and green sides present / the test file was not deleted), and the result carries a verbatim `<promise>COMPLETE</promise>` (or a structured COMPLETE status). `--result <text>` is the inline variant; `--result-file` wins and is quoting-safe on Windows. `--force` records an audited override (`evidence_status=overridden`) — it does not silently pass.
37
+ 5. If the complete gate blocked: Bash `harnessed checkpoint fail plan-spec --failing-tests <n>` to record the attempt. It prints `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP` once a stop condition is reached. Respawn ONLY while none of those three has fired; any one of them means STOP — re-scope the subtask, fix the blocker, or escalate to the user.
38
+
39
+ <!-- harnessed-generated:v4.12.0 -->
@@ -0,0 +1,38 @@
1
+ ---
2
+ name: plan-spec
3
+ description: 在 plan-phase 前按条件运行 GSD spec-phase 设计契约。
4
+ trigger_phrases: ["plan spec", "gsd spec phase"]
5
+ ---
6
+
7
+ # plan-spec workflow
8
+
9
+ ## Overview
10
+
11
+ 运行 `harnessed prompt plan-spec --task "$ARGUMENTS" --json`,执行 `/gsd-spec-phase`,再用可验证输出完成已登记 checkpoint。
12
+
13
+ ## Invocation
14
+
15
+ 仅当 `phase.requires_spec == true` 时触发。
16
+
17
+ ## 如何调用
18
+
19
+ !`harnessed checkpoint intent plan-spec`
20
+
21
+ > 上方 banner(如出现)表示本次调用已在引擎**登记**(intent 标记)——尚未合规:按下方步骤(prompt → spawn → checkpoint complete)完成即解除;在此之前每 turn 会持续注入 `<workflow-intent>` 提醒。
22
+
23
+ 下面这套编号序列**就是** state machine —— 用 Bash 执行。**不要**从上方 Overview 自行演绎等价流程:
24
+ freestyle 会旁路引擎(无 ledger、无 evidence guard)。harnessed 给你 spawn-ready prompt;**你**用
25
+ {{ host.native }} {{ host.spawn_subagent.zh_tool }} spawn subagent(保持 session 响应 + 让澄清 round-trip 能回到用户)。
26
+
27
+ **不要** pipe 到 `harnessed run plan-spec` —— 那是 CI/headless 路径({{ host.harnessed_run_warning_note.execution_tail }}
28
+
29
+ 1. Bash: `harnessed prompt plan-spec --task "$ARGUMENTS" --json` → 解析 `{prompt, max_iterations, model}`。
30
+ 2. 用 {{ host.native }} subagent({{ host.spawn_subagent.zh_tool }})以该 `prompt` + `model` spawn,然后用 harnessed 自己的完成闸门驱动交付:
31
+ - subagent 返回后,把它的最终输出写入文件,跑 `harnessed checkpoint complete plan-spec --result-file <path>` —— 该命令对声明的产物、TDD boundary、逐字 `<promise>COMPLETE</promise>` 三者 fail-closed。
32
+ - 若被拦下,跑 `harnessed checkpoint fail plan-spec --failing-tests <n>` 记录本次尝试;命中停机条件时它会打印 BUDGET-EXHAUSTED / NO-PROGRESS / BREAK-LOOP。
33
+ - **仅当**这三者都未触发时才允许重 spawn。任一触发即停:重新收敛子任务范围、修掉阻塞点,或上报用户。绝不越过停机指令继续重 spawn。
34
+ 3. 若输出含 `STATUS: NEEDS_CLARIFICATION` + 问题列表:STOP,用 {{ host.ask_user }} 原样转达,把答案 append 进 spec,再重 spawn。
35
+ 4. 命中 `<promise>COMPLETE</promise>`:把 subagent 最终输出写入文件,再 Bash `harnessed checkpoint complete plan-spec --result-file <path> --summary "<one-line>"`。fail-CLOSED —— 除非声明的 `artifacts_expected` 文件全部存在、TDD boundary 通过(证据非空 / 红绿两侧齐全 / 测试文件未被删除)、且结果含逐字 `<promise>COMPLETE</promise>`(或结构化 COMPLETE 状态),否则拦下。`--result <text>` 是内联变体;`--result-file` 优先且在 Windows 上引号安全。`--force` 记录可审计的覆盖(`evidence_status=overridden`),不是静默放行。
36
+ 5. 若 complete 闸门拦下:Bash `harnessed checkpoint fail plan-spec --failing-tests <n>` 记录本次尝试。命中停机条件时会打印 `BUDGET-EXHAUSTED` / `NO-PROGRESS` / `BREAK-LOOP`。**仅当**三者都未触发时才允许重 spawn;任一触发即 STOP —— 重新收敛子任务范围、修掉阻塞点,或上报用户。
37
+
38
+ <!-- harnessed-generated:v4.12.0 -->
@@ -0,0 +1,12 @@
1
+ schema_version: harnessed.workflow.v3
2
+ workflow: plan-spec
3
+ description: GSD spec-phase design contract before ordinary phase planning.
4
+ disciplines_applied: [karpathy, output-style, language, operational, priority, protocols]
5
+ tools_available: [gsd-spec-phase]
6
+ phases:
7
+ - id: 01-spec-phase
8
+ name: gsd-spec-phase
9
+ upstream: gsd
10
+ capability: '{{ capabilities.gsd-spec-phase.cmd }}'
11
+ model: sonnet
12
+ gate: judgments.stage-phase-gate.gsd-spec-phase.fires