harnessed 3.9.14 → 3.9.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +3085 -3156
- package/dist/cli.mjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/workflows/defaults.yaml +0 -20
- package/workflows/execute-task/SKILL.md +0 -84
- package/workflows/execute-task/workflow.yaml +0 -93
- package/workflows/plan-feature/SKILL.md +0 -98
- package/workflows/plan-feature/workflow.yaml +0 -81
- package/workflows/verify-work/SKILL.md +0 -90
- package/workflows/verify-work/workflow.yaml +0 -141
package/dist/index.mjs
CHANGED
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../package.json","../src/index.ts"],"names":[],"mappings":";AAAA,IAAA,eAAA,GAAA;AAAA,EAEE,OAAA,EAAW,QAgGb,CAAA;;;AC7FO,IAAM,UAAU,eAAA,CAAI","file":"index.mjs","sourcesContent":["{\n \"name\": \"harnessed\",\n \"version\": \"3.9.
|
|
1
|
+
{"version":3,"sources":["../package.json","../src/index.ts"],"names":[],"mappings":";AAAA,IAAA,eAAA,GAAA;AAAA,EAEE,OAAA,EAAW,QAgGb,CAAA;;;AC7FO,IAAM,UAAU,eAAA,CAAI","file":"index.mjs","sourcesContent":["{\n \"name\": \"harnessed\",\n \"version\": \"3.9.16\",\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 },\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 \"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"]}
|
package/package.json
CHANGED
package/workflows/defaults.yaml
CHANGED
|
@@ -9,26 +9,6 @@ schema_version: harnessed.defaults.v1
|
|
|
9
9
|
# Per-workflow per-phase ralph-loop iteration ceiling
|
|
10
10
|
# Values balance: completion guarantee vs DoS prevention; sister ADR 0011 v0.2.0 ralph-loop SDK pattern
|
|
11
11
|
ralph_max_iterations:
|
|
12
|
-
# v2 legacy (Phase 2.3 W1.2 SHIPPED, deprecated v3.0 per D-04 release-notes-only migration)
|
|
13
|
-
execute-task:
|
|
14
|
-
01-clarify: 5
|
|
15
|
-
02-code: 20
|
|
16
|
-
03-test: 15
|
|
17
|
-
04-deliver: 20
|
|
18
|
-
|
|
19
|
-
plan-feature:
|
|
20
|
-
01-gstack-decision: 1
|
|
21
|
-
02-brainstorm: 5
|
|
22
|
-
03-gsd-discuss: 3
|
|
23
|
-
04-gsd-plan: 3
|
|
24
|
-
05-persist: 5
|
|
25
|
-
|
|
26
|
-
verify-work:
|
|
27
|
-
01-gsd-verify-work: 3
|
|
28
|
-
02-code-review: 5
|
|
29
|
-
03-gstack-review: 3
|
|
30
|
-
04-code-simplifier: 5
|
|
31
|
-
|
|
32
12
|
# v3 standalone (research v3 schema bump + retro NEW per Phase 3.4 W1.1+W1.2)
|
|
33
13
|
research:
|
|
34
14
|
01-fan-out: 3
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: execute-task
|
|
3
|
-
description: |
|
|
4
|
-
execute-task workflow v2 — 4-phase chain (brainstorming → karpathy + mattpocock route → TDD + diagnose → ralph-loop COMPLETE)
|
|
5
|
-
triggered by harnessed CLI `harnessed execute-task --task <text>`.
|
|
6
|
-
v2 delta (Phase v2.0-2.4 W1.1): schema_version: harnessed.workflow.v2 + ralph-loop 真接 SDK wrapper +
|
|
7
|
-
tdd-gate conditional + mattpocock route by condition (grill-with-docs / zoom-out / diagnose) +
|
|
8
|
-
explicit max_iterations_exceeded fallback (R20.10 NOT silent abort).
|
|
9
|
-
trigger_phrases:
|
|
10
|
-
# forward-looking documentation — auto-invocation 实装推 Phase 2.3 extension category (B-28).
|
|
11
|
-
# Current enforced entry surface is the CLI subcommand below; these phrases are
|
|
12
|
-
# documentation-only hints for the eventual GSD orchestration agent.
|
|
13
|
-
- "execute this task"
|
|
14
|
-
- "implement this feature"
|
|
15
|
-
- "execute-task workflow"
|
|
16
|
-
- "跑 execute-task"
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
# execute-task workflow (v2)
|
|
20
|
-
|
|
21
|
-
## Overview
|
|
22
|
-
|
|
23
|
-
4-phase chain mapping the user's CLAUDE.md Execute-phase discipline onto the harnessed
|
|
24
|
-
runtime (ADR 0011 — SDK + ralph-loop integration; v2 schema upgrade T2.4.W1.1):
|
|
25
|
-
|
|
26
|
-
| phase | id | upstream | model (intel CD-2 § 第 4 条) | v2 wiring |
|
|
27
|
-
| ----- | -- | -------- | ---------------------------- | --------- |
|
|
28
|
-
| 1 | `01-clarify` | `superpowers brainstorming` | opus | `capability: superpowers-brainstorming` + `gate: judgments.subtask-gate.brainstorming.fires` |
|
|
29
|
-
| 2 | `02-code` | `karpathy` 心法 always-on | sonnet | `on[]` route to tdd-gate / grill-with-docs / zoom-out (D-09 + D-13) |
|
|
30
|
-
| 3 | `03-test` | `superpowers TDD` | sonnet | `capability: tdd` + `on[]` route to diagnose on test_fail (D-13 + D-09) |
|
|
31
|
-
| 4 | `04-deliver` | `ralph-loop` | haiku | `capability: ralph-loop` + `args: {completion_promise: COMPLETE}` + `gate/parallelism: judgments.parallelism-gate.*` + `fallback.max_iterations_exceeded: emit_warning_and_halt` (R20.10) |
|
|
32
|
-
|
|
33
|
-
v2 schema fields per `src/workflow/schema/workflow.ts` (T2.4.W0.1 16th surface — harnessed.workflow.v2):
|
|
34
|
-
- `capability: '{{ capabilities.<name>.cmd }}'` template interpolation (D-10 capability abstraction)
|
|
35
|
-
- `gate: judgments.<file>.<gate>.fires` 4-level ref (pre-resolved by T2.3.W0.4 judgmentResolver)
|
|
36
|
-
- `on: [{if, invoke|action}]` conditional clause (D-09 mattpocock route by condition)
|
|
37
|
-
- `args: {completion_promise, max_iterations}` ralph-loop SDK params (R20.10 verbatim COMPLETE gate)
|
|
38
|
-
- `parallelism: judgments.parallelism-gate.<route>.fires` (D-11 subagent / Agent Teams / main session route)
|
|
39
|
-
- `fallback.max_iterations_exceeded: {action, message, exit_code}` (R20.10 acceptance c "explicit NOT silent")
|
|
40
|
-
|
|
41
|
-
Per-phase models load from `workflows/execute-task/workflow.yaml` (v3 SoT post
|
|
42
|
-
v3.4.4 Phase 6 — v2 phases.yaml deleted); runWorkflow spawns each phase as a
|
|
43
|
-
sub-agent via `@anthropic-ai/claude-agent-sdk` 0.3.142+
|
|
44
|
-
(`AgentDefinition` 5-字段 unpack — ADR 0011 § 4). ralph-loop SDK wrapper at 04-deliver
|
|
45
|
-
reuses sister Phase 2.2 v0.2.0 ship: `src/workflow/lib/ralphLoop.ts` (54L) + `sdkSpawn.ts` (91L)
|
|
46
|
-
+ 4-layer dual-signal `isComplete` (NOT 重写 — per RESEARCH § 3.1).
|
|
47
|
-
|
|
48
|
-
## CLI invocation (the only enforced entry — B-28)
|
|
49
|
-
|
|
50
|
-
```bash
|
|
51
|
-
# Dry-run preview — arbitrate-only, never spawns SDK.
|
|
52
|
-
harnessed execute-task --task "<text>" --dry-run --non-interactive
|
|
53
|
-
|
|
54
|
-
# Apply path — real SDK spawn + ralph-loop COMPLETE round-trip.
|
|
55
|
-
harnessed execute-task --task "<text>" --apply
|
|
56
|
-
|
|
57
|
-
# `--model-tier inherit` escape hatch (B-10) — override per-phase models with
|
|
58
|
-
# SDK 'inherit' (parent-thread model resolution).
|
|
59
|
-
harnessed execute-task --task "<text>" --apply --model-tier inherit
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
H1 gate: `--non-interactive` requires `--apply` or `--dry-run` (exit 2 otherwise);
|
|
63
|
-
sibling install-base.ts L51-56 + research.ts L37-43 pattern.
|
|
64
|
-
|
|
65
|
-
EngineResult three-state → exit code mapping:
|
|
66
|
-
- `0` — ok (ralph-loop returned verbatim `<promise>COMPLETE</promise>` round-trip)
|
|
67
|
-
- `1` — ok:false {phase: arbitrate|install|spawn|verbatim} (typed error)
|
|
68
|
-
- `2` — aborted {reason} (max-iter exceeded OR usage/config error)
|
|
69
|
-
|
|
70
|
-
## Forward-looking note
|
|
71
|
-
|
|
72
|
-
The `trigger_phrases:` frontmatter is currently **documentation purpose only** —
|
|
73
|
-
auto-invocation by the GSD orchestration agent (skill auto-discovery) is deferred
|
|
74
|
-
to Phase 2.3 extension category. In Phase 2.2 the only enforced entry surface is
|
|
75
|
-
the CLI subcommand above (B-28 single-entry contract).
|
|
76
|
-
|
|
77
|
-
## References
|
|
78
|
-
|
|
79
|
-
- ADR 0011 — execute-task SDK + ralph-loop integration (phase 2.2 W6 — finalize)
|
|
80
|
-
- `.planning/intel/omc-comparison.md` § CD-2 — per-phase model tier defaults
|
|
81
|
-
- `src/cli/execute-task.ts` — CLI implementation (T5.1)
|
|
82
|
-
- `workflows/execute-task/workflow.yaml` — 4-phase config (v3 SoT; v3.4.4 Phase 6 ship — v2 phases.yaml deleted)
|
|
83
|
-
- `src/workflow/lib/sdkSpawn.ts` — SDK query() consumer (T4.1)
|
|
84
|
-
- `src/workflow/lib/ralphLoop.ts` — verbatim COMPLETE round-trip
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
# workflows/execute-task/workflow.yaml — v3.4.4 Phase 4 Commit 1 NEW (Path A)
|
|
2
|
-
# Former v2 `phases.yaml` (74L) deleted v3.4.4 Phase 6 Wave 3c — this v3
|
|
3
|
-
# workflow.yaml is now the single SoT. Authored fresh per HANDOFF-v3.4.4 L745
|
|
4
|
-
# Path A decision + PHASE-4-SPEC L101-180 verbatim.
|
|
5
|
-
#
|
|
6
|
-
# 4-phase chain mirrors v2 verbatim:
|
|
7
|
-
# 01-clarify superpowers-brainstorming opus gate: subtask-gate.brainstorming.fires
|
|
8
|
-
# 02-code karpathy 心法 + on[] sonnet conditional: tdd / grill-with-docs / zoom-out
|
|
9
|
-
# 03-test superpowers TDD sonnet on: test_fail → diagnose
|
|
10
|
-
# 04-deliver ralph-loop haiku args.completion_promise=COMPLETE + fallback
|
|
11
|
-
#
|
|
12
|
-
# v2 → v3 字段 delta (PHASE-4-SPEC L13 + L116-178):
|
|
13
|
-
# BUMP `schema_version: harnessed.workflow.v3` (sister Phase 3.3 W0.5 WorkflowSchemaV3)
|
|
14
|
-
# ADD `disciplines_applied: [6 basename]` (D-09 L0 Discipline Substrate, Pattern A A.1 strict Literal Union)
|
|
15
|
-
# ADD `tools_available: [7 capabilities.yaml entry name]` (D-05 Contract C1 cross-validate)
|
|
16
|
-
# KEEP phases verbatim from former v2 phases.yaml (Path A1 — coexisted through Phase 5; v2 deleted Phase 6 Wave 3c)
|
|
17
|
-
#
|
|
18
|
-
# Per-phase model tier (intel CD-2 § 第 4 条) preserved verbatim from v2:
|
|
19
|
-
# opus / sonnet / sonnet / haiku
|
|
20
|
-
# Override via CLI: `--model-tier inherit` (B-10 escape hatch).
|
|
21
|
-
#
|
|
22
|
-
# Sister refs:
|
|
23
|
-
# - .planning/v3.4.4/PHASE-4-SPEC.md L101-180 (NEW yaml shape verbatim)
|
|
24
|
-
# - workflows/execute-task/phases.yaml (former v2 SoT — DELETED v3.4.4 Phase 6 Wave 3c; this workflow.yaml is sole SoT)
|
|
25
|
-
# - workflows/research/workflow.yaml (v3 standalone shape reference)
|
|
26
|
-
# - workflows/verify/simplify/workflow.yaml (v3 sub-workflow shape reference)
|
|
27
|
-
# - workflows/capabilities.yaml (7 capability refs: superpowers-brainstorming/tdd/grill-with-docs/zoom-out/diagnose/ralph-loop/planning-with-files)
|
|
28
|
-
# - workflows/defaults.yaml ralph_max_iterations.execute-task.{01..04}
|
|
29
|
-
# - workflows/disciplines/{karpathy,output-style,language,operational,priority,protocols}.yaml (L0 substrate)
|
|
30
|
-
# - src/workflow/schema/workflow.ts WorkflowSchemaV3 (Phase 3.3 W0.5 SHIPPED 122L)
|
|
31
|
-
|
|
32
|
-
schema_version: harnessed.workflow.v3
|
|
33
|
-
workflow: execute-task
|
|
34
|
-
description: |
|
|
35
|
-
子任务执行 workflow — 4-phase chain (brainstorming → karpathy + mattpocock route by
|
|
36
|
-
condition → TDD + diagnose → ralph-loop COMPLETE) triggered by harnessed CLI
|
|
37
|
-
`harnessed execute-task --task <text>` OR universal `harnessed run execute-task`.
|
|
38
|
-
|
|
39
|
-
disciplines_applied: [karpathy, output-style, language, operational, priority, protocols]
|
|
40
|
-
tools_available: [superpowers-brainstorming, tdd, grill-with-docs, zoom-out, diagnose, ralph-loop, planning-with-files]
|
|
41
|
-
|
|
42
|
-
phases:
|
|
43
|
-
- id: 01-clarify
|
|
44
|
-
name: brainstorming
|
|
45
|
-
upstream: superpowers brainstorming
|
|
46
|
-
capability: '{{ capabilities.superpowers-brainstorming.cmd }}'
|
|
47
|
-
model: opus
|
|
48
|
-
max_iterations: '{{ defaults.ralph_max_iterations.execute-task.01-clarify }}'
|
|
49
|
-
gate: judgments.subtask-gate.brainstorming.fires
|
|
50
|
-
|
|
51
|
-
- id: 02-code
|
|
52
|
-
name: code (karpathy 心法 always-on + mattpocock conditional route)
|
|
53
|
-
upstream: karpathy
|
|
54
|
-
model: sonnet
|
|
55
|
-
max_iterations: '{{ defaults.ralph_max_iterations.execute-task.02-code }}'
|
|
56
|
-
on:
|
|
57
|
-
- if: 'judgments.tdd-gate.tdd-strongly-suggested.fires'
|
|
58
|
-
invoke: '{{ capabilities.tdd.cmd }}'
|
|
59
|
-
- if: 'phase.spec_ambiguous == true'
|
|
60
|
-
invoke: '{{ capabilities.grill-with-docs.cmd }}'
|
|
61
|
-
- if: 'phase.unfamiliar_module == true'
|
|
62
|
-
invoke: '{{ capabilities.zoom-out.cmd }}'
|
|
63
|
-
|
|
64
|
-
- id: 03-test
|
|
65
|
-
name: test (conditional TDD + diagnose on fail)
|
|
66
|
-
upstream: superpowers TDD
|
|
67
|
-
capability: '{{ capabilities.tdd.cmd }}'
|
|
68
|
-
model: sonnet
|
|
69
|
-
max_iterations: '{{ defaults.ralph_max_iterations.execute-task.03-test }}'
|
|
70
|
-
on:
|
|
71
|
-
- if: 'test_fail == true'
|
|
72
|
-
invoke: '{{ capabilities.diagnose.cmd }}'
|
|
73
|
-
|
|
74
|
-
- id: 04-deliver
|
|
75
|
-
name: deliver (ralph-loop COMPLETE gate + max-iter fallback)
|
|
76
|
-
upstream: ralph-loop
|
|
77
|
-
capability: '{{ capabilities.ralph-loop.cmd }}'
|
|
78
|
-
model: haiku
|
|
79
|
-
args:
|
|
80
|
-
completion_promise: COMPLETE
|
|
81
|
-
max_iterations: '{{ defaults.ralph_max_iterations.execute-task.04-deliver }}'
|
|
82
|
-
gate: judgments.parallelism-gate.fires
|
|
83
|
-
parallelism: judgments.parallelism-gate.ralph-loop-wrapper.fires
|
|
84
|
-
on:
|
|
85
|
-
- if: 'subtask.lines >= 20 and subtask.type != "single_command_query"'
|
|
86
|
-
invoke: '{{ capabilities.ralph-loop.cmd }}'
|
|
87
|
-
- if: 'subtask.lines < 20 or subtask.type == "single_command_query"'
|
|
88
|
-
action: skip
|
|
89
|
-
fallback:
|
|
90
|
-
max_iterations_exceeded:
|
|
91
|
-
action: emit_warning_and_halt
|
|
92
|
-
message: '⚠️ ralph-loop max-iterations ({{ args.max_iterations }}) exceeded for execute-task 04-deliver. Sub-task likely incomplete — see workflow engine catch handler for manual options.'
|
|
93
|
-
exit_code: 1
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: plan-feature
|
|
3
|
-
description: |
|
|
4
|
-
plan-feature workflow v2 — 5-phase 三层栈 composition (gstack governance gate →
|
|
5
|
-
superpowers brainstorm → GSD /gsd-discuss-phase → GSD /gsd-plan-phase →
|
|
6
|
-
planning-with-files Claude Code plugin slash cmd `/plan` 持久化 task_plan.md +
|
|
7
|
-
progress.md + findings.md). schema_version: harnessed.workflow.v2 with
|
|
8
|
-
capability template interpolation + 4-level gate refs + conditional `on` clauses.
|
|
9
|
-
Triggered by harnessed CLI `harnessed plan-feature --task <text>` or slash command
|
|
10
|
-
`/plan-feature` after `harnessed setup`.
|
|
11
|
-
trigger_phrases:
|
|
12
|
-
- "plan this feature"
|
|
13
|
-
- "design new feature"
|
|
14
|
-
- "plan-feature workflow"
|
|
15
|
-
- "跑 plan-feature"
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
# plan-feature workflow (v2)
|
|
19
|
-
|
|
20
|
-
## Overview
|
|
21
|
-
|
|
22
|
-
5-phase chain mapping the user's CLAUDE.md Discuss + Plan discipline onto the harnessed
|
|
23
|
-
runtime, upgraded to `harnessed.workflow.v2` schema (Phase v2.0-2.4 W1 T2.4.W1.3 —
|
|
24
|
-
D-15 + Q-AUDIT-5a Option A: planning-with-files = Claude Code plugin slash cmd
|
|
25
|
-
`/plan` 真接, **NOT** npm SDK call, **NOT** fs.writeFile self-impl).
|
|
26
|
-
|
|
27
|
-
| phase | id | upstream | model | capability / invokes | gate / on |
|
|
28
|
-
| ----- | -- | -------- | ----- | -------------------- | --------- |
|
|
29
|
-
| 1 | `01-gstack-decision` | gstack | opus | `{{ capabilities.gstack-office-hours.cmd }}` / `{{ gstack_prefix }}office-hours` | `gate: judgments.strategic-gate.office-hours.fires` |
|
|
30
|
-
| 2 | `02-brainstorm` | superpowers | sonnet | `{{ capabilities.superpowers-brainstorming.cmd }}` | `on: judgments.subtask-gate.brainstorming.fires → invoke` |
|
|
31
|
-
| 3 | `03-gsd-discuss` | gsd | sonnet | `{{ capabilities.gsd-discuss-phase.cmd }}` | `on: judgments.phase-gate.gsd-discuss-phase.fires → invoke` |
|
|
32
|
-
| 4 | `04-gsd-plan` | gsd | sonnet | `invokes: gsd-plan-phase` (literal — v2.x patch followup capabilities entry) | — |
|
|
33
|
-
| 5 | `05-persist` | planning-with-files | haiku | `{{ capabilities.planning-with-files.cmd }}` / `invokes: /plan` | `on: phase.scope_days > 1 or phase.is_critical_module → invoke` |
|
|
34
|
-
|
|
35
|
-
Per-phase config loads from `workflows/plan-feature/workflow.yaml`; engine.runRouting
|
|
36
|
-
spawns each phase as a sub-agent via `@anthropic-ai/claude-agent-sdk` 0.3.142+.
|
|
37
|
-
|
|
38
|
-
### v1 → v2 字段 delta
|
|
39
|
-
|
|
40
|
-
- ADD `schema_version: harnessed.workflow.v2` (T2.4.W0.1 16th surface — first .v2)
|
|
41
|
-
- ADD `description` root field (workflow purpose summary)
|
|
42
|
-
- ADD `phase.capability: '{{ capabilities.<name>.cmd }}'` template interpolation (D-10)
|
|
43
|
-
- ADD `phase.gate: judgments.<file>.<trigger>.fires` 4-level ref (D-04, pre-resolved by `judgmentResolver`)
|
|
44
|
-
- ADD `phase.on: [{if, invoke|action}]` conditional clause (D-09)
|
|
45
|
-
- ADD `phase.artifacts_expected: [...]` 3-file persistence list (D-15)
|
|
46
|
-
- CHANGE `max_iterations` 改用 `{{ defaults.ralph_max_iterations.plan-feature.<phase> }}` jinja ref (T2.3.W1.2 ship)
|
|
47
|
-
- KEEP `invokes: '/plan'` literal at 05-persist (Q-AUDIT-5a anti-pattern guard)
|
|
48
|
-
|
|
49
|
-
### Phase 1 governance gate
|
|
50
|
-
|
|
51
|
-
Phase 1 (gstack governance) uses workflow-level `on_veto: halt_workflow` — any
|
|
52
|
-
CEO/EM/Designer/Paranoid/QA/CSO veto halts the entire workflow before proceeding
|
|
53
|
-
to brainstorm or planning (D-04 PUSH 任 1 phase 转换前 read = vetoed → 全 halt).
|
|
54
|
-
|
|
55
|
-
### Phase 5 planning-with-files plugin 真接 (Q-AUDIT-5a LOCKED Option A)
|
|
56
|
-
|
|
57
|
-
05-persist invokes the **Claude Code plugin** slash command `/plan`. Requires
|
|
58
|
-
the `planning-with-files` Claude Code plugin to be installed via the Claude Code
|
|
59
|
-
plugin marketplace. The plugin generates 3 markdown files in
|
|
60
|
-
`.planning/<phase-id>/`:
|
|
61
|
-
|
|
62
|
-
- `task_plan.md` — 主计划 (task 列表 + 文件路径 + 依赖顺序 + 验收标准)
|
|
63
|
-
- `progress.md` — 跨 session 进度跟踪
|
|
64
|
-
- `findings.md` — 调研发现 / 知识沉淀
|
|
65
|
-
|
|
66
|
-
Q-AUDIT-5a rejected alternatives (anti-pattern guard verified by
|
|
67
|
-
`tests/workflow/plan-feature-v2.test.ts`):
|
|
68
|
-
|
|
69
|
-
- (b) plugin script direct spawn — Windows PowerShell 跨平台不友好
|
|
70
|
-
- (c) `fs.writeFile` self-implementation — duplicates plugin functionality, breaks
|
|
71
|
-
multi-IDE compatibility (sister .continue / .factory / .gemini / .codebuddy /
|
|
72
|
-
.cursor structure 已就绪)
|
|
73
|
-
|
|
74
|
-
## CLI invocation
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
# Dry-run preview — arbitrate-only, never spawns SDK.
|
|
78
|
-
harnessed plan-feature --task "<text>" --dry-run --non-interactive
|
|
79
|
-
|
|
80
|
-
# Apply path — real SDK spawn + 5-phase chain.
|
|
81
|
-
harnessed plan-feature --task "<text>" --apply
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
## Forward-looking note
|
|
85
|
-
|
|
86
|
-
The `trigger_phrases:` frontmatter is active after `harnessed setup` copies this
|
|
87
|
-
SKILL.md to `<claude-home>/skills/plan-feature/` — Claude Code then loads the slash
|
|
88
|
-
command `/plan-feature` automatically (Gap B fix — v1.0.2).
|
|
89
|
-
|
|
90
|
-
## References
|
|
91
|
-
|
|
92
|
-
- ADR 0011 — SDK + ralph-loop integration
|
|
93
|
-
- `workflows/plan-feature/workflow.yaml` — 5-phase config (v2 schema)
|
|
94
|
-
- `workflows/capabilities.yaml` — capability manifest (35 entry baseline)
|
|
95
|
-
- `workflows/judgments/{strategic-gate,phase-gate,subtask-gate}.yaml` — gate refs
|
|
96
|
-
- `workflows/defaults.yaml` — ralph_max_iterations.plan-feature.* values
|
|
97
|
-
- `docs/WORKFLOW.md` — 4-stage workflow mermaid + gap analysis
|
|
98
|
-
- `.planning/phase-v2.0-2.2/RESEARCH.md` § 5.3 — D-15 实装路径 reframe
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
# workflows/plan-feature/workflow.yaml — Phase v2.0-2.4 W1 T2.4.W1.3 (D-15 + Q-AUDIT-5a LOCKED)
|
|
2
|
-
# 5-phase 三层栈 composition: gstack governance → superpowers brainstorm → GSD discuss/plan → planning-with-files plugin /plan persist
|
|
3
|
-
# v1 → v2 delta (sister L1-40):
|
|
4
|
-
# ADD `schema_version: harnessed.workflow.v2` (T2.4.W0.1 16th surface)
|
|
5
|
-
# ADD `description` root field (workflow purpose)
|
|
6
|
-
# ADD `capability: '{{ capabilities.<name>.cmd }}'` 各 phase (D-10 template interpolation)
|
|
7
|
-
# ADD `gate: judgments.<file>.<trigger>.fires` 01-gstack-decision (D-04 gate reference)
|
|
8
|
-
# ADD `on: [{if, invoke}]` 02-brainstorm + 03-gsd-discuss (D-09 conditional clause)
|
|
9
|
-
# ADD `artifacts_expected: [...]` 05-persist (D-15 planning-with-files 3 file 持久化)
|
|
10
|
-
# ADD `max_iterations: '{{ defaults.ralph_max_iterations.plan-feature.<phase> }}'` (T2.3.W1.2 ship)
|
|
11
|
-
# KEEP `invokes: '/plan'` literal at 05-persist (Q-AUDIT-5a Claude Code plugin slash cmd, NOT npm SDK NOT fs.writeFile)
|
|
12
|
-
# Q-AUDIT-5a anti-pattern guard (verified by tests/workflow/plan-feature-v2.test.ts):
|
|
13
|
-
# - NO npm SDK call (no `import` / `require` planning-with-files — yaml syntax natively absent)
|
|
14
|
-
# - NO fs.writeFile self-impl (no `fs.writeFile` / `writeFile` reference — anti-pattern reviewer guard)
|
|
15
|
-
# - YES `invokes: '/plan'` literal at 05-persist (plugin slash cmd 真接 path a)
|
|
16
|
-
# - YES `capability: '{{ capabilities.planning-with-files.cmd }}'` template ref (resolve to /plan via capabilities.yaml L317)
|
|
17
|
-
# 04-gsd-plan phase: `gsd-plan-phase` 在 capabilities.yaml 中暂未单独 entry — 沿袭 v1 L32 literal pattern (D-08 v2.x patch followup
|
|
18
|
-
# 添加 gsd-plan-phase capability entry; v2.0 baseline 不阻塞 ship per T2.4.W1.3 Implementation Tasks #4-#5 scope)
|
|
19
|
-
|
|
20
|
-
schema_version: harnessed.workflow.v2
|
|
21
|
-
workflow: plan-feature
|
|
22
|
-
description: |
|
|
23
|
-
plan-feature 5-phase 三层栈 workflow — gstack governance gate (CEO/EM/Designer/Paranoid/QA/CSO)
|
|
24
|
-
→ superpowers brainstorm 子任务级澄清 → GSD /gsd-discuss-phase 灰色澄清 → GSD /gsd-plan-phase
|
|
25
|
-
Wave A/B/C planning → planning-with-files Claude Code plugin slash cmd `/plan` 持久化 3 file
|
|
26
|
-
(task_plan.md + progress.md + findings.md) 在 .planning/<phase-id>/.
|
|
27
|
-
Phase 1 gstack governance veto halts the entire workflow (D-04 PUSH) — engine-level
|
|
28
|
-
on_veto wiring lives in runtime, NOT yaml v2 root schema (WorkflowSchemaV2 strict
|
|
29
|
-
additionalProperties:false per T2.4.W0.1 + STRIDE T-2.2-02).
|
|
30
|
-
|
|
31
|
-
phases:
|
|
32
|
-
- id: 01-gstack-decision
|
|
33
|
-
name: gstack-decision (governance gate — CEO/EM/Designer/Paranoid/QA/CSO)
|
|
34
|
-
upstream: gstack
|
|
35
|
-
capability: '{{ capabilities.gstack-office-hours.cmd }}'
|
|
36
|
-
invokes: '{{ gstack_prefix }}office-hours'
|
|
37
|
-
model: opus
|
|
38
|
-
gate: judgments.strategic-gate.office-hours.fires
|
|
39
|
-
max_iterations: '{{ defaults.ralph_max_iterations.plan-feature.01-gstack-decision }}'
|
|
40
|
-
|
|
41
|
-
- id: 02-brainstorm
|
|
42
|
-
name: brainstorm (子任务级澄清 multi-approach)
|
|
43
|
-
upstream: superpowers
|
|
44
|
-
capability: '{{ capabilities.superpowers-brainstorming.cmd }}'
|
|
45
|
-
model: sonnet
|
|
46
|
-
on:
|
|
47
|
-
- if: judgments.subtask-gate.brainstorming.fires
|
|
48
|
-
invoke: '{{ capabilities.superpowers-brainstorming.cmd }}'
|
|
49
|
-
max_iterations: '{{ defaults.ralph_max_iterations.plan-feature.02-brainstorm }}'
|
|
50
|
-
|
|
51
|
-
- id: 03-gsd-discuss
|
|
52
|
-
name: gsd-discuss (orchestration — phase 灰色澄清 4-question batch)
|
|
53
|
-
upstream: gsd
|
|
54
|
-
capability: '{{ capabilities.gsd-discuss-phase.cmd }}'
|
|
55
|
-
model: sonnet
|
|
56
|
-
on:
|
|
57
|
-
- if: judgments.phase-gate.gsd-discuss-phase.fires
|
|
58
|
-
invoke: '{{ capabilities.gsd-discuss-phase.cmd }}'
|
|
59
|
-
max_iterations: '{{ defaults.ralph_max_iterations.plan-feature.03-gsd-discuss }}'
|
|
60
|
-
|
|
61
|
-
- id: 04-gsd-plan
|
|
62
|
-
name: gsd-plan (orchestration — Wave A research + Wave B planner + Wave C checker)
|
|
63
|
-
upstream: gsd
|
|
64
|
-
invokes: 'gsd-plan-phase'
|
|
65
|
-
model: sonnet
|
|
66
|
-
max_iterations: '{{ defaults.ralph_max_iterations.plan-feature.04-gsd-plan }}'
|
|
67
|
-
|
|
68
|
-
- id: 05-persist
|
|
69
|
-
name: persist (planning-with-files plugin /plan — Manus-style markdown persistence)
|
|
70
|
-
upstream: planning-with-files
|
|
71
|
-
capability: '{{ capabilities.planning-with-files.cmd }}'
|
|
72
|
-
invokes: '/plan'
|
|
73
|
-
model: haiku
|
|
74
|
-
on:
|
|
75
|
-
- if: phase.scope_days > 1 or phase.is_critical_module == true
|
|
76
|
-
action: invoke
|
|
77
|
-
artifacts_expected:
|
|
78
|
-
- task_plan.md
|
|
79
|
-
- progress.md
|
|
80
|
-
- findings.md
|
|
81
|
-
max_iterations: '{{ defaults.ralph_max_iterations.plan-feature.05-persist }}'
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: verify-work
|
|
3
|
-
description: |
|
|
4
|
-
verify-work workflow v2 — Stage ④ Verify 9-phase composition per CLAUDE.md verbatim
|
|
5
|
-
(gsd-verify-work + gsd-progress 必跑串行 → code-review 多 agent 并行 fan-out → gstack /review
|
|
6
|
-
关键模块强制 → 可选 /qa /cso /design-review conditional → code-simplifier 末尾串行 →
|
|
7
|
-
关键发布/大重构 PR 升级 4-specialist Agent Team Pattern C 多维度审查 互相质询)。
|
|
8
|
-
schema_version: harnessed.workflow.v2 with capability template interpolation + parallelism
|
|
9
|
-
gate refs + conditional `on` clauses. Triggered by harnessed CLI `harnessed verify-work
|
|
10
|
-
--phase <num>` or slash command `/verify-work` after `harnessed setup`.
|
|
11
|
-
trigger_phrases:
|
|
12
|
-
- "verify work"
|
|
13
|
-
- "verify-work workflow"
|
|
14
|
-
- "Stage 4 verify"
|
|
15
|
-
- "跑 verify-work"
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
# verify-work workflow (v2)
|
|
19
|
-
|
|
20
|
-
## Overview
|
|
21
|
-
|
|
22
|
-
9-phase chain mapping the user's CLAUDE.md Stage ④ Verify discipline onto the harnessed
|
|
23
|
-
runtime, fully `harnessed.workflow.v2` schema (Phase v2.0-2.4 W2 T2.4.W2.2 — D-12
|
|
24
|
-
Q-AUDIT-2 amend + R20.12 + R20.11 + R20.14).
|
|
25
|
-
|
|
26
|
-
| phase | id | upstream | model | capability / invokes | gate / on / parallelism |
|
|
27
|
-
| ----- | -- | -------- | ----- | -------------------- | ----------------------- |
|
|
28
|
-
| 1 | `01-gsd-verify-work` | gsd | sonnet | `{{ capabilities.gsd-verify-work.cmd }}` | serial — `max_iterations: 3` |
|
|
29
|
-
| 2 | `02-gsd-progress` | gsd | haiku | `{{ capabilities.gsd-progress.cmd }}` | serial — `max_iterations: 2` |
|
|
30
|
-
| 3 | `03-code-review-parallel` | mattpocock-skills | sonnet | `{{ capabilities.code-review.cmd }}` | `parallelism: judgments.parallelism-gate.subagent-default.fires` |
|
|
31
|
-
| 4 | `04-gstack-review-conditional` | gstack | opus | `{{ capabilities.gstack-review.cmd }}` | `on: phase.is_critical_module → invoke / else skip` |
|
|
32
|
-
| 5 | `05-qa-conditional` | gstack | sonnet | `{{ capabilities.gstack-qa.cmd }}` | `on: phase.has_ui_changes → invoke / else skip` |
|
|
33
|
-
| 6 | `06-cso-conditional` | gstack | opus | `{{ capabilities.gstack-cso.cmd }}` | `on: phase.has_auth_or_secrets → invoke / else skip` |
|
|
34
|
-
| 7 | `07-design-review-conditional` | gstack | sonnet | `{{ capabilities.gstack-design-review.cmd }}` | `on: phase.has_design_changes → invoke / else skip` |
|
|
35
|
-
| 8 | `08-code-simplifier` | mattpocock-skills | sonnet | `{{ capabilities.code-simplifier.cmd }}` | serial 末尾 — `max_iterations: 5` |
|
|
36
|
-
| 9 | `09-agent-team-multispecialist` | claude-platform | opus | `{{ capabilities.agent-teams-create.cmd }}` | `parallelism: judgments.parallelism-gate.agent-teams-upgrade.fires`; `on: is_major_release OR is_large_refactor → invoke` |
|
|
37
|
-
|
|
38
|
-
Per-phase config loads from `workflows/verify-work/workflow.yaml`; engine.runRouting
|
|
39
|
-
spawns each phase as a sub-agent via `@anthropic-ai/claude-agent-sdk` 0.3.142+.
|
|
40
|
-
|
|
41
|
-
## Phase 9 Pattern C 4-specialist Agent Team (D-11 + R20.11)
|
|
42
|
-
|
|
43
|
-
The Agent Team upgrade phase (`09-agent-team-multispecialist`) follows the
|
|
44
|
-
bundled Agent Teams Pattern C 多维度审查 — 4 teammate
|
|
45
|
-
(code-review + gstack-review + gstack-cso + gstack-qa) 互相 SendMessage 质询
|
|
46
|
-
findings 是否真问题 (NOT fire-and-forget subagent fan-out)。Token estimate
|
|
47
|
-
`team_cost < 2 × subagent_cost` is a prereq (bundled cost guideline; engine-level
|
|
48
|
-
check, NOT yaml schema scope). Cleanup mandatory: `SendMessage shutdown_request`
|
|
49
|
-
+ `TeamDelete` after round-trip complete (bundled cleanup discipline).
|
|
50
|
-
|
|
51
|
-
Trigger condition: `phase.is_major_release == true OR phase.is_large_refactor
|
|
52
|
-
== true`. 常规 PR / 单点任务**不触发** Pattern C — code-review fan-out (phase 3)
|
|
53
|
-
+ gstack-review conditional (phase 4) 已够用且更省 token (per CLAUDE.md "Verify
|
|
54
|
-
阶段" 末段 "关键发布 / 大重构 PR" 限定语)。
|
|
55
|
-
|
|
56
|
-
## R20.16 chain_isolation 实装 (3 铁律 fallback)
|
|
57
|
-
|
|
58
|
-
每个 conditional phase (4-7, 9) 都实装 `on: [{if: ..., action: invoke}, {if:
|
|
59
|
-
..., action: skip}]` — skip 04-gstack-review **不**级联跳过 06-cso-conditional,
|
|
60
|
-
等等。验证脚本 `node scripts/check-workflow-schema.mjs` 严格 schema 校验 +
|
|
61
|
-
runtime engine 独立判 condition。
|
|
62
|
-
|
|
63
|
-
## CLI invocation
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
# Dry-run preview — arbitrate-only, never spawns SDK.
|
|
67
|
-
harnessed verify-work --phase <num> --dry-run --non-interactive
|
|
68
|
-
|
|
69
|
-
# Apply path — real SDK spawn + 9-phase chain (conditional phases evaluate by phase fact context).
|
|
70
|
-
harnessed verify-work --phase <num> --apply
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## Forward-looking note
|
|
74
|
-
|
|
75
|
-
The `trigger_phrases:` frontmatter is active after `harnessed setup` copies this
|
|
76
|
-
SKILL.md to `<claude-home>/skills/verify-work/` — Claude Code then loads the slash
|
|
77
|
-
command `/verify-work` automatically (Gap B fix — v1.0.2 sister mechanism).
|
|
78
|
-
|
|
79
|
-
## References
|
|
80
|
-
|
|
81
|
-
- D-12 (Q-AUDIT-2 amend) — verify-work 7+ phase 完整 4-stage 重定
|
|
82
|
-
- R20.12 — verify-work full scope acceptance
|
|
83
|
-
- R20.11 — 4-specialist Agent Team upgrade
|
|
84
|
-
- R20.14 — special-purpose /qa /cso /design-review conditional
|
|
85
|
-
- R20.7 — D-08 verify-work NEW 2 之一
|
|
86
|
-
- R20.16 — fallback 3 铁律 chain_isolation
|
|
87
|
-
- `workflows/capabilities.yaml` — gsd-verify-work / gsd-progress / code-review / gstack-{review,qa,cso,design-review} / code-simplifier / agent-teams-create entries
|
|
88
|
-
- `workflows/judgments/parallelism-gate.yaml` — subagent-default + agent-teams-upgrade.fires
|
|
89
|
-
- `workflows/defaults.yaml` — ralph_max_iterations.verify-work.* values
|
|
90
|
-
- `docs/WORKFLOW.md` — 4-stage workflow mermaid + Stage ④ Verify 章节
|