harnessed 4.7.0 → 4.9.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 (44) hide show
  1. package/bin/harnessed-inject-state.mjs +35 -4
  2. package/dist/cli.mjs +190 -85
  3. package/dist/cli.mjs.map +1 -1
  4. package/dist/index.mjs +1 -1
  5. package/dist/index.mjs.map +1 -1
  6. package/manifests/optional/perturn-inject.yaml +49 -0
  7. package/messages/zh-Hans.json +16 -2
  8. package/package.json +1 -1
  9. package/workflows/auto/SKILL.zh-Hans.md +129 -0
  10. package/workflows/disciplines/doc-discipline.zh-Hans.yaml +49 -0
  11. package/workflows/disciplines/karpathy.yaml +5 -5
  12. package/workflows/disciplines/karpathy.zh-Hans.yaml +47 -0
  13. package/workflows/disciplines/operational.yaml +6 -6
  14. package/workflows/disciplines/operational.zh-Hans.yaml +79 -0
  15. package/workflows/disciplines/output-style.yaml +7 -7
  16. package/workflows/disciplines/output-style.zh-Hans.yaml +62 -0
  17. package/workflows/disciplines/priority.yaml +2 -2
  18. package/workflows/disciplines/priority.zh-Hans.yaml +28 -0
  19. package/workflows/discuss/auto/SKILL.zh-Hans.md +75 -0
  20. package/workflows/discuss/phase/SKILL.zh-Hans.md +73 -0
  21. package/workflows/discuss/strategic/SKILL.zh-Hans.md +78 -0
  22. package/workflows/discuss/subtask/SKILL.zh-Hans.md +79 -0
  23. package/workflows/plan/architecture/SKILL.zh-Hans.md +74 -0
  24. package/workflows/plan/auto/SKILL.zh-Hans.md +75 -0
  25. package/workflows/plan/phase/SKILL.zh-Hans.md +76 -0
  26. package/workflows/research/SKILL.zh-Hans.md +81 -0
  27. package/workflows/retro/SKILL.zh-Hans.md +71 -0
  28. package/workflows/role-prompts.zh-Hans.yaml +501 -0
  29. package/workflows/ship/auto/SKILL.zh-Hans.md +46 -0
  30. package/workflows/ship/preflight/SKILL.zh-Hans.md +38 -0
  31. package/workflows/task/auto/SKILL.zh-Hans.md +80 -0
  32. package/workflows/task/clarify/SKILL.zh-Hans.md +79 -0
  33. package/workflows/task/code/SKILL.zh-Hans.md +85 -0
  34. package/workflows/task/deliver/SKILL.zh-Hans.md +113 -0
  35. package/workflows/task/test/SKILL.zh-Hans.md +90 -0
  36. package/workflows/verify/auto/SKILL.zh-Hans.md +89 -0
  37. package/workflows/verify/code-review/SKILL.zh-Hans.md +71 -0
  38. package/workflows/verify/design/SKILL.zh-Hans.md +74 -0
  39. package/workflows/verify/multispec/SKILL.zh-Hans.md +88 -0
  40. package/workflows/verify/paranoid/SKILL.zh-Hans.md +74 -0
  41. package/workflows/verify/progress/SKILL.zh-Hans.md +69 -0
  42. package/workflows/verify/qa/SKILL.zh-Hans.md +76 -0
  43. package/workflows/verify/security/SKILL.zh-Hans.md +70 -0
  44. package/workflows/verify/simplify/SKILL.zh-Hans.md +70 -0
@@ -0,0 +1,28 @@
1
+ # workflows/disciplines/priority.yaml
2
+ # 优先级仲裁 — bundled discipline (7-tier hierarchy: gstack > gsd > superpowers > planning-with-files > karpathy > mattpocock > parallel)
3
+ # Phase v3.0-3.3 W0.4 ship per D-09
4
+ # Snapshot of CLAUDE.md as of v3.0 ship date (K7 mitigation, verbatim)
5
+
6
+ schema_version: harnessed.discipline.v1
7
+ discipline: priority
8
+ enforcement_layer: workflow
9
+ auto_enforce: true
10
+
11
+ priority_hierarchy:
12
+ - gstack # 决策层 最高优先
13
+ - gsd # 整体 orchestration
14
+ - superpowers # 子任务执行质量
15
+ - planning-with-files # 计划持久化
16
+ - karpathy # 编码行为
17
+ - mattpocock # 招式 by-demand
18
+ - parallel # subagent / Agent Teams / ralph-loop 执行机制
19
+
20
+ rules:
21
+ - id: multi-capability-arbitration
22
+ description: |
23
+ 多 capability fires_when 同时 true → 按 priority_hierarchy order 选最高
24
+ e.g., gstack /office-hours + GSD /gsd-discuss-phase 同 fire → gstack 先跑
25
+ enforcement: warn
26
+ trigger: capabilities.fired_count > 1
27
+ check_method: heuristic
28
+ # NEW src/discipline/enforcement/before-spawn.ts hook — sort fired capabilities by tier rank
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: discuss
3
+ description: |
4
+ Stage ① Discuss 主控编排器 — 3 个子工作流并行门控评估(chain-isolation 铁律)。
5
+ 战略层 / Phase 层 / 子任务层独立判断 gate, 可能 3 个全跑 / 1-2 个 / 全跳 + 透明声明。
6
+ schema_version: harnessed.workflow.v3 with delegates_to (3 sub: strategic + phase + subtask, mode parallel)
7
+ + disciplines_applied (6 default) + tools_available (planning-with-files)。
8
+ Triggered by slash command `/discuss`
9
+ (bare per ADR 0030 namespace policy D-02 LOCK) after `harnessed setup`.
10
+ trigger_phrases:
11
+ - "discuss"
12
+ - "讨论澄清"
13
+ - "新功能澄清"
14
+ - "stage 1 discuss"
15
+ - "三层澄清"
16
+ ---
17
+
18
+ # discuss 主控编排器 (v3)
19
+
20
+ ## 概述
21
+
22
+ 4-stage cadence Stage ① 主控编排器,委托给 3 个独立子工作流
23
+ (打包三层独立澄清:战略层 / phase 层 / 子任务层):
24
+
25
+ | 子工作流 | gate ref | mode | 触发时机 |
26
+ | --- | -------- | ---- | ---------- |
27
+ | `strategic` | `judgments.stage-routing.discuss-strategic-delegate.fires` | parallel | new_project / new_milestone / new_feature / is_major_release |
28
+ | `phase` | `judgments.stage-routing.discuss-phase-delegate.fires` | parallel | open_decisions ≥ 2 / cross_phase_data_flow / scope_days > 1 |
29
+ | `subtask` | `judgments.stage-routing.discuss-subtask-delegate.fires` | parallel | approaches ≥ 2 / core_algorithm / has_api_contract / error_cost=high |
30
+
31
+ 引擎运行时通过 `runMasterOrchestrator` 以
32
+ T3.5.W0.1(sister sub-workflow `runWorkflow` SDK pattern,并行 fan-out 通过
33
+ subagent 默认方式 — Path A `query()` 并行 OR Path B sub-shell 兜底,per
34
+ T3.5.W2.1 dogfood cycle decision LOCK)生成 3 个子工作流阶段。
35
+
36
+ ## Chain-isolation 铁律(sister CLAUDE.md "Fallback 三条铁律")
37
+
38
+ - 拿不准 → 倾向跳过, 但在响应里**透明声明**: "这次跳过了 X, 因为 Y。如果你认为需要请明说"
39
+ - 用户明示 → 覆盖判据 (用户说 "先 brainstorm" / "跑 office-hours" / "讨论一下" 时无条件激活)
40
+ - **链式互不前置**: 跳过战略层 ≠ 必须跳过 phase 层; 每层独立判断 (防止 "上层没跑下层不敢跑" 的死板)
41
+
42
+ ## 能力引用
43
+
44
+ Sister `workflows/capabilities.yaml`:
45
+ - `planning-with-files` — Bucket 4 核心能力(impl: claude-code-plugin, cmd: /plan,discuss 汇入 findings.md)
46
+ - sub `strategic` upstream → `gstack-office-hours` + `gstack-plan-ceo-review`
47
+ - sub `phase` upstream → `gsd-discuss-phase`
48
+ - sub `subtask` upstream → `superpowers-brainstorming` + `grill-with-docs` + `grill-me`
49
+
50
+ ## 调用方式
51
+
52
+ - Slash command: `/discuss <text>`(bare per ADR 0030 namespace policy D-02 LOCK,`harnessed setup` 后可用)
53
+
54
+ ## 如何调用
55
+
56
+ 使用 Bash 工具运行:
57
+
58
+ ```bash
59
+ echo "$ARGUMENTS" | harnessed run discuss --task-stdin
60
+ ```
61
+
62
+ 若 `$ARGUMENTS` 为空,运行 `harnessed run discuss`(不带 stdin pipe)。
63
+
64
+ 执行完成后,Bash 输出会在 stderr 打印 `Next:` 提示,建议下一个阶段。请根据对话上下文决定是否调用——该提示仅供参考,非强制指令。
65
+
66
+ <!-- harnessed-generated:v3.4.4 -->
67
+
68
+ ## 参考资料
69
+
70
+ - D-01 主控编排器委托模式
71
+ - D-02 bare slash cmd 约定(ADR 0030 namespace policy LOCK)
72
+ - D-04 Stage ① Discuss 三层独立判
73
+ - workflows/judgments/stage-routing.yaml — discuss-{strategic,phase,subtask}-delegate triggers
74
+ - workflows/discuss/{strategic,phase,subtask}/workflow.yaml — 3 个子工作流 Phase 3.4 已发布
75
+ - workflows/judgments/fallback.yaml — 链式互不前置 chain-isolation 铁律
@@ -0,0 +1,73 @@
1
+ ---
2
+ name: discuss-phase
3
+ description: |
4
+ Stage ①.b Phase 层 discuss 子工作流 — GSD /gsd-discuss-phase 灰色澄清(≥2 个开放
5
+ 实现决策 / 跨 phase API contract 不清 / phase scope > 1 天 / 灰色地带)。
6
+ schema_version: harnessed.workflow.v3 with disciplines_applied (6 default) + tools_available
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
9
+ command `/discuss-phase` after `harnessed setup`.
10
+ trigger_phrases:
11
+ - "discuss phase"
12
+ - "phase 层澄清"
13
+ - "gsd discuss phase"
14
+ - "灰色地带澄清"
15
+ - "跑 discuss-phase"
16
+ ---
17
+
18
+ # discuss-phase 工作流 (v3)
19
+
20
+ ## 概述
21
+
22
+ 2 阶段子工作流,将 CLAUDE.md "Stage ①.b Phase 层 — GSD /gsd-discuss-phase 灰色澄清"
23
+ 映射到 harnessed 运行时(Phase v3.0-3.4 W0.2 — D-04 Stage ① Discuss 三层 + Pattern A
24
+ 子工作流发布)。
25
+
26
+ | 阶段 | id | upstream | model | 能力 / 调用 | 门控 / 产物 |
27
+ | ----- | -- | -------- | ----- | -------------------- | ---------------- |
28
+ | 1 | `01-gsd-discuss` | gsd | sonnet | `{{ capabilities.gsd-discuss-phase.cmd }}` | `gate: judgments.phase-gate.gsd-discuss-phase.fires` |
29
+ | 2 | `02-persist` | planning-with-files | haiku | `{{ capabilities.planning-with-files.cmd }}` + `invokes: /plan` | `artifacts_expected: [findings.md, knowledge.md]` |
30
+
31
+ ## 能力引用
32
+
33
+ Sister `workflows/capabilities.yaml` 条目:
34
+ - `gsd-discuss-phase` — Bucket 2(impl: gsd, cmd: /gsd-discuss-phase)
35
+ - `planning-with-files` — Bucket 4(impl: claude-code-plugin, cmd: /plan)
36
+
37
+ ## 门控引用
38
+
39
+ Sister `workflows/judgments/phase-gate.yaml`:
40
+ - `gsd-discuss-phase.fires` — `phase.open_decisions >= 2 or phase.has_cross_phase_data_flow == true or phase.scope_days > 1`
41
+
42
+ ## 调用方式
43
+
44
+ - Slash command: `/discuss-phase <num>`(`harnessed setup` 后可用)
45
+
46
+ ## 路由规则
47
+
48
+ 跳过条件(sister CLAUDE.md "Phase 层 ❌ 跳过"):
49
+ - 单一明确子任务
50
+ - 跟前 phase 同 module 同 pattern
51
+ - < 1 天工作量
52
+ - bug 修复且已有最小复现
53
+
54
+ ## 如何调用
55
+
56
+ 使用 Bash 工具运行:
57
+
58
+ ```bash
59
+ echo "$ARGUMENTS" | harnessed run discuss-phase --task-stdin
60
+ ```
61
+
62
+ 若 `$ARGUMENTS` 为空,运行 `harnessed run discuss-phase`(不带 stdin pipe)。
63
+
64
+ 执行完成后,Bash 输出会在 stderr 打印 `Next:` 提示,建议下一个阶段。请根据对话上下文决定是否调用——该提示仅供参考,非强制指令。
65
+
66
+ <!-- harnessed-generated:v3.4.4 -->
67
+
68
+ ## 参考资料
69
+
70
+ - D-04 Stage ① Discuss 三层(战略层 / phase 层 / 子任务层)
71
+ - workflows/capabilities.yaml — gsd-discuss-phase / planning-with-files
72
+ - workflows/judgments/phase-gate.yaml — gsd-discuss-phase trigger
73
+ - workflows/defaults.yaml — ralph_max_iterations.discuss-phase.* values (W2.2 backfill)
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: discuss-strategic
3
+ description: |
4
+ Stage ①.a 战略层 discuss 子工作流 — gstack /office-hours + /plan-ceo-review 新功能 / 新
5
+ milestone / 新产品方向启动前强制治理关卡(打包 gstack governance gate,新功能前必跑)。
6
+ schema_version: harnessed.workflow.v3 with disciplines_applied (6 default) + tools_available
7
+ (gstack-office-hours + gstack-plan-ceo-review + planning-with-files) + 3 phases(gate
8
+ judgments.strategic-gate.* fires + planning-with-files /plan findings.md 持久化)。
9
+ Triggered by slash command
10
+ `/discuss-strategic` after `harnessed setup`.
11
+ trigger_phrases:
12
+ - "discuss strategic"
13
+ - "战略层澄清"
14
+ - "office hours"
15
+ - "新功能启动"
16
+ - "跑 discuss-strategic"
17
+ ---
18
+
19
+ # discuss-strategic 工作流 (v3)
20
+
21
+ ## 概述
22
+
23
+ 3 阶段子工作流,将 CLAUDE.md "Stage ①.a 战略层 — 新功能启动前强制 🔒"
24
+ 映射到 harnessed 运行时(Phase v3.0-3.4 W0.1 — D-04 Stage ① Discuss 三层 + D-12 gstack
25
+ 治理关卡 + Pattern A 子工作流发布)。
26
+
27
+ | 阶段 | id | upstream | model | 能力 / 调用 | 门控 / 产物 |
28
+ | ----- | -- | -------- | ----- | -------------------- | ---------------- |
29
+ | 1 | `01-office-hours` | gstack | opus | `{{ capabilities.gstack-office-hours.cmd }}` | `gate: judgments.strategic-gate.office-hours.fires` |
30
+ | 2 | `02-plan-ceo-review` | gstack | opus | `{{ capabilities.gstack-plan-ceo-review.cmd }}` | `gate: judgments.strategic-gate.plan-ceo-review.fires` |
31
+ | 3 | `03-persist` | planning-with-files | haiku | `{{ capabilities.planning-with-files.cmd }}` + `invokes: /plan` | `artifacts_expected: [findings.md]` |
32
+
33
+ ## 能力引用
34
+
35
+ Sister `workflows/capabilities.yaml` 条目:
36
+ - `gstack-office-hours` — Bucket 3 治理关卡(impl: gstack, cmd: /office-hours)
37
+ - `gstack-plan-ceo-review` — Bucket 3 治理关卡(impl: gstack, cmd: /plan-ceo-review)
38
+ - `planning-with-files` — Bucket 4 核心能力(impl: claude-code-plugin, cmd: /plan)
39
+
40
+ ## 门控引用
41
+
42
+ Sister `workflows/judgments/strategic-gate.yaml`:
43
+ - `office-hours.fires` — `phase.type in ['new_project', 'new_milestone', 'new_feature']`
44
+ - `plan-ceo-review.fires` — `phase.type == 'new_project' or phase.is_major_release == true`
45
+
46
+ ## 调用方式
47
+
48
+ - Slash command: `/discuss-strategic <text>`(`harnessed setup` 后可用)
49
+
50
+ ## 路由规则
51
+
52
+ 跳过条件(sister CLAUDE.md "战略层 ❌ 跳过"):
53
+ - bug 修复 / 技术债 / 实现细节
54
+ - scope 已在历史 `.planning/` 或 design doc 定义
55
+ - continuing 已有 phase 的执行
56
+ - 用户已给明确 ticket / spec
57
+
58
+ ## 如何调用
59
+
60
+ 使用 Bash 工具运行:
61
+
62
+ ```bash
63
+ echo "$ARGUMENTS" | harnessed run discuss-strategic --task-stdin
64
+ ```
65
+
66
+ 若 `$ARGUMENTS` 为空,运行 `harnessed run discuss-strategic`(不带 stdin pipe)。
67
+
68
+ 执行完成后,Bash 输出会在 stderr 打印 `Next:` 提示,建议下一个阶段。请根据对话上下文决定是否调用——该提示仅供参考,非强制指令。
69
+
70
+ <!-- harnessed-generated:v3.4.4 -->
71
+
72
+ ## 参考资料
73
+
74
+ - D-04 Stage ① Discuss 三层(战略层 / phase 层 / 子任务层)
75
+ - D-12 gstack 治理关卡强制
76
+ - workflows/capabilities.yaml — gstack-office-hours / gstack-plan-ceo-review / planning-with-files
77
+ - workflows/judgments/strategic-gate.yaml — office-hours / plan-ceo-review triggers
78
+ - workflows/defaults.yaml — ralph_max_iterations.discuss-strategic.* values (W2.2 backfill)
@@ -0,0 +1,79 @@
1
+ ---
2
+ name: discuss-subtask
3
+ description: |
4
+ Stage ①.c 子任务层 discuss 子工作流 — superpowers brainstorming(≥2 种方案 / 核心算法 /
5
+ API contract / 错误成本高)。schema_version: harnessed.workflow.v3 with disciplines_applied (6
6
+ default) + tools_available (superpowers-brainstorming + grill-with-docs + grill-me) + 1 phase
7
+ (01-brainstorm,含 spec_ambiguous + no_docs 条件调用 invokes_tools)。Triggered by
8
+ harnessed CLI `harnessed discuss-subtask --task <text>` or slash command `/discuss-subtask`
9
+ after `harnessed setup`.
10
+ trigger_phrases:
11
+ - "discuss subtask"
12
+ - "子任务澄清"
13
+ - "brainstorm"
14
+ - "多 approach 探索"
15
+ - "跑 discuss-subtask"
16
+ ---
17
+
18
+ # discuss-subtask 工作流 (v3)
19
+
20
+ ## 概述
21
+
22
+ 1 阶段子工作流,将 CLAUDE.md "Stage ①.c 子任务层 — superpowers brainstorming"
23
+ 映射到 harnessed 运行时(Phase v3.0-3.4 W0.3 — D-04 Stage ① Discuss 三层 + D-05
24
+ phase.invokes_tools 条件触发 + Pattern A 子工作流发布)。
25
+
26
+ | 阶段 | id | upstream | model | 能力 / invokes_tools | 门控 |
27
+ | ----- | -- | -------- | ----- | -------------------------- | ---- |
28
+ | 1 | `01-brainstorm` | superpowers | opus | `{{ capabilities.superpowers-brainstorming.cmd }}` + conditional `invokes_tools[grill-with-docs, grill-me]` | `gate: judgments.subtask-gate.brainstorming.fires` |
29
+
30
+ ## 能力引用
31
+
32
+ Sister `workflows/capabilities.yaml` 条目:
33
+ - `superpowers-brainstorming` — Bucket 4(impl: superpowers, cmd: superpowers:brainstorming)
34
+ - `grill-with-docs` — Bucket 1 mattpocock(impl: mattpocock-skills, cmd: /grill-with-docs)
35
+ - `grill-me` — Bucket 1 mattpocock(impl: mattpocock-skills, cmd: /grill-me)
36
+
37
+ ## 门控引用
38
+
39
+ Sister `workflows/judgments/subtask-gate.yaml`:
40
+ - `brainstorming.fires` — `subtask.approaches >= 2 or subtask.core_algorithm == true or subtask.has_api_contract == true or subtask.error_cost == 'high'`
41
+
42
+ ## 条件工具调用(D-05 invokes_tools)
43
+
44
+ - `phase.spec_ambiguous == true` → 触发 `grill-with-docs`
45
+ - `phase.spec_ambiguous == true AND phase.no_docs == true` → 触发 `grill-me`
46
+
47
+ ## 调用方式
48
+
49
+ - Slash command: `/discuss-subtask <text>`(`harnessed setup` 后可用)
50
+
51
+ ## 路由规则
52
+
53
+ 跳过条件(sister CLAUDE.md "子任务层 ❌ 跳过"):
54
+ - 常规 CRUD / 跟现有模式一致
55
+ - 单一明显实现(< 20 行 / 一个文件)
56
+ - 标准库直接调用
57
+ - bug 修复且已知根因
58
+
59
+ ## 如何调用
60
+
61
+ 使用 Bash 工具运行:
62
+
63
+ ```bash
64
+ echo "$ARGUMENTS" | harnessed run discuss-subtask --task-stdin
65
+ ```
66
+
67
+ 若 `$ARGUMENTS` 为空,运行 `harnessed run discuss-subtask`(不带 stdin pipe)。
68
+
69
+ 执行完成后,Bash 输出会在 stderr 打印 `Next:` 提示,建议下一个阶段。请根据对话上下文决定是否调用——该提示仅供参考,非强制指令。
70
+
71
+ <!-- harnessed-generated:v3.4.4 -->
72
+
73
+ ## 参考资料
74
+
75
+ - D-04 Stage ① Discuss 三层(战略层 / phase 层 / 子任务层)
76
+ - D-05 phase.invokes_tools 条件触发(NEW v3)
77
+ - workflows/capabilities.yaml — superpowers-brainstorming / grill-with-docs / grill-me
78
+ - workflows/judgments/subtask-gate.yaml — brainstorming trigger
79
+ - workflows/defaults.yaml — ralph_max_iterations.discuss-subtask.* values (W2.2 backfill)
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: plan-architecture
3
+ description: |
4
+ Stage ②.a 架构层 plan 子工作流 — gstack /plan-eng-review(复杂架构强制治理关卡;
5
+ 打包的 plan-stage 节奏:复杂架构阶段前必须执行)。schema_version:
6
+ harnessed.workflow.v3 with disciplines_applied (6 default) + tools_available
7
+ [plan-eng-review] + 1 phase (01-plan-eng-review) + gate literal expr
8
+ `phase.is_complex_architecture == true`。Triggered by harnessed CLI `harnessed
9
+ plan-architecture --module <name>` or slash command `/plan-architecture` after
10
+ `harnessed setup`.
11
+ trigger_phrases:
12
+ - "plan architecture"
13
+ - "架构审查"
14
+ - "plan eng review"
15
+ - "复杂架构"
16
+ - "跑 plan-architecture"
17
+ ---
18
+
19
+ # plan-architecture 工作流 (v3)
20
+
21
+ ## 概述
22
+
23
+ 1 阶段子工作流,将 CLAUDE.md "⚠️ 复杂架构前 — plan-eng-review" 映射到 harnessed
24
+ 运行时(Phase v3.0-3.4 W0.4 — D-04 Stage ② Plan 二层 + D-12 gstack 治理关卡 + Pattern A
25
+ sub-workflow ship)。
26
+
27
+ | phase | id | upstream | model | capability | gate |
28
+ | ----- | -- | -------- | ----- | ---------- | ---- |
29
+ | 1 | `01-plan-eng-review` | gstack | opus | `{{ capabilities.plan-eng-review.cmd }}` | `gate: phase.is_complex_architecture == true` (literal expr) |
30
+
31
+ ## 能力引用
32
+
33
+ Sister `workflows/capabilities.yaml` 条目:
34
+ - `plan-eng-review` — Bucket 7 gstack 33 optional (impl: gstack, cmd: /plan-eng-review)
35
+ - Pattern A E.2 LOCK:无 `gstack-` 前缀,遵循 CLAUDE.md gstack skill 路由约定
36
+
37
+ ## 门控引用
38
+
39
+ 内联 literal expr `phase.is_complex_architecture == true` — sister capability
40
+ `fires_when` 子句原文。W2.2 backfill 可加 `judgments/phase-gate.yaml`
41
+ trigger `is-complex-architecture` 重构 ref。
42
+
43
+ ## 调用方式
44
+
45
+ - Slash command:`/plan-architecture <name>`(`harnessed setup` 后生效)
46
+
47
+ ## 路由规则
48
+
49
+ 触发条件(sister CLAUDE.md "⚠️ 复杂架构前"):
50
+ - 涉及多模块跨界设计(≥3 模块协同)
51
+ - 新引入核心抽象(新 framework / 新数据模型 / 新协议)
52
+ - 性能 / scaling 关键路径
53
+ - 引入显著技术债 / migration 风险
54
+
55
+ ## 如何调用
56
+
57
+ 使用 Bash 工具运行:
58
+
59
+ ```bash
60
+ echo "$ARGUMENTS" | harnessed run plan-architecture --task-stdin
61
+ ```
62
+
63
+ 若 `$ARGUMENTS` 为空,运行 `harnessed run plan-architecture`(不带 stdin pipe)。
64
+
65
+ 完成后,Bash 输出会在 stderr 打印 `Next:` 提示,建议下一阶段。是否调用由对话上下文决定——该提示仅供参考,非强制指令。
66
+
67
+ <!-- harnessed-generated:v3.4.4 -->
68
+
69
+ ## 参考文档
70
+
71
+ - D-04 Stage ② Plan 二层(架构 / 计划)
72
+ - D-12 gstack 治理关卡(复杂架构强制)
73
+ - workflows/capabilities.yaml — plan-eng-review (Bucket 7)
74
+ - workflows/defaults.yaml — ralph_max_iterations.plan-architecture.* values (W2.2 backfill)
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: plan
3
+ description: |
4
+ Stage ② Plan 主控编排器 — 串行 invoke 2 个子工作流(architecture 条件触发 → phase 始终触发)。
5
+ 复杂架构 gstack /plan-eng-review 锁定架构后再 GSD /gsd-plan-phase + planning-with-files 持久化
6
+ task_plan.md。schema_version: harnessed.workflow.v3 with delegates_to (2 sub: architecture
7
+ serial order 1 + phase serial order 2) + disciplines_applied (6 default) + tools_available
8
+ (planning-with-files + plan-eng-review + gsd-plan-phase)。
9
+ Triggered by slash command `/plan`
10
+ (bare per ADR 0030 namespace policy D-02 LOCK) after `harnessed setup`.
11
+ trigger_phrases:
12
+ - "plan"
13
+ - "计划阶段"
14
+ - "stage 2 plan"
15
+ - "持久化计划"
16
+ - "task_plan"
17
+ ---
18
+
19
+ # plan 主控编排器 (v3)
20
+
21
+ ## 概述
22
+
23
+ 4-stage cadence Stage ② 主控编排器,委派给 2 个串行子工作流
24
+ (打包的 Plan 阶段节奏 + D-06 planning-with-files 横切工具):
25
+
26
+ | order | sub | gate ref | mode | when fires |
27
+ | ----- | --- | -------- | ---- | ---------- |
28
+ | 1 | `architecture` | `judgments.stage-routing.plan-architecture-delegate.fires` | serial | phase.is_complex_architecture == true |
29
+ | 2 | `phase` | (unconditional — plan-phase always fires when stage=='plan') | serial | always |
30
+
31
+ 引擎运行时通过 `runMasterOrchestrator` 按 T3.5.W0.1 顺序派发 2 个子工作流阶段:
32
+ order 1(architecture 条件触发)必须完成后,order 2 才启动
33
+ (phase 无条件,GSD plan-phase + planning-with-files `/plan` task_plan.md 持久化)。
34
+ K9 invariant 强制:每个 serial mode 委派必须携带显式 `order`。
35
+
36
+ ## 能力引用
37
+
38
+ Sister `workflows/capabilities.yaml`:
39
+ - `planning-with-files` — Bucket 4 核心 capability (impl: claude-code-plugin, cmd: /plan)
40
+ - `plan-eng-review` — Bucket 7 gstack 33 optional (impl: gstack, cmd: /plan-eng-review)
41
+ - `gsd-plan-phase` — Bucket 2 special-purpose (impl: gsd, cmd: /gsd-plan-phase)
42
+ - sub `architecture` upstream → `plan-eng-review`
43
+ - sub `phase` upstream → `gsd-plan-phase` + `planning-with-files`
44
+
45
+ ## 路由规则(sister CLAUDE.md "Plan 阶段")
46
+
47
+ - **复杂架构必须先跑** `/plan-eng-review` 锁定架构后再进入 plan-phase (sister CLAUDE.md "⚠️")
48
+ - 普通 phase 跳过 architecture sub(gate `phase.is_complex_architecture == false`)
49
+ - **禁止在规划阶段直接使用** `superpowers:writing-plans` 输出大文档(除非用户明确要求)
50
+
51
+ ## 调用方式
52
+
53
+ - Slash command:`/plan <text>`(bare per ADR 0030 namespace policy D-02 LOCK,`harnessed setup` 后生效)
54
+
55
+ ## 如何调用
56
+
57
+ 使用 Bash 工具运行:
58
+
59
+ ```bash
60
+ echo "$ARGUMENTS" | harnessed run plan --task-stdin
61
+ ```
62
+
63
+ 若 `$ARGUMENTS` 为空,运行 `harnessed run plan`(不带 stdin pipe)。
64
+
65
+ 完成后,Bash 输出会在 stderr 打印 `Next:` 提示,建议下一阶段。是否调用由对话上下文决定——该提示仅供参考,非强制指令。
66
+
67
+ <!-- harnessed-generated:v3.4.4 -->
68
+
69
+ ## 参考文档
70
+
71
+ - D-01 主控编排器委派模式
72
+ - D-02 bare slash cmd 约定(ADR 0030 namespace policy LOCK)
73
+ - D-06 planning-with-files 横切工具(NOT 独立 sub-workflow)
74
+ - workflows/judgments/stage-routing.yaml — plan-{architecture,phase}-delegate triggers
75
+ - workflows/plan/{architecture,phase}/workflow.yaml — 2 sub-workflow Phase 3.4 SHIPPED
@@ -0,0 +1,76 @@
1
+ ---
2
+ name: plan-phase
3
+ description: |
4
+ Stage ②.b 计划层 plan 子工作流 — GSD /gsd-plan-phase Wave A research + Wave B planner +
5
+ Wave C plan-checker + planning-with-files Claude Code plugin /plan 持久化 task_plan.md +
6
+ progress.md(打包的 Plan-stage 节奏:GSD + planning-with-files)。Stage ② 铁律:
7
+ dual capability (GSD orchestration + planning-with-files plugin)。schema_version:
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`.
11
+ trigger_phrases:
12
+ - "plan phase"
13
+ - "计划层 phase"
14
+ - "gsd plan phase"
15
+ - "持久化计划"
16
+ - "跑 plan-phase"
17
+ ---
18
+
19
+ # plan-phase 工作流 (v3)
20
+
21
+ ## 概述
22
+
23
+ 2 阶段子工作流,将 CLAUDE.md "Plan 阶段 — GSD + planning-with-files" 映射到 harnessed
24
+ 运行时(Phase v3.0-3.4 W0.5 — D-04 Stage ② Plan 二层 + D-15 planning-with-files
25
+ claude-code-plugin /plan + Pattern A sub-workflow ship)。
26
+
27
+ | phase | id | upstream | model | capability / invokes | artifacts |
28
+ | ----- | -- | -------- | ----- | -------------------- | --------- |
29
+ | 1 | `01-gsd-plan` | gsd | sonnet | `{{ capabilities.gsd-plan-phase.cmd }}` | (Wave A research + Wave B planner + Wave C plan-checker) |
30
+ | 2 | `02-persist` | planning-with-files | haiku | `{{ capabilities.planning-with-files.cmd }}` + `invokes: /plan` | `artifacts_expected: [task_plan.md, progress.md]` |
31
+
32
+ ## 能力引用
33
+
34
+ Sister `workflows/capabilities.yaml` 条目:
35
+ - `gsd-plan-phase` — Bucket 2 (impl: gsd, cmd: /gsd-plan-phase)
36
+ - `planning-with-files` — Bucket 4 (impl: claude-code-plugin, cmd: /plan;
37
+ 需要通过 Claude Code plugin marketplace 安装 `planning-with-files` Claude Code 插件;
38
+ 输出:task_plan.md + progress.md + findings.md)
39
+
40
+ ## Stage ② 铁律 — dual capability
41
+
42
+ GSD `/gsd-plan-phase` 编排(Wave A research → Wave B planner → Wave C
43
+ plan-checker)→ planning-with-files `/plan` 持久化(插件真生成 task_plan.md +
44
+ progress.md,NOT fs.writeFile self-impl per D-15 Q-AUDIT-5a claude-code-plugin
45
+ reframe)。
46
+
47
+ ## 调用方式
48
+
49
+ - Slash command:`/plan-phase <num>`(`harnessed setup` 后生效)
50
+
51
+ ## 输出产物
52
+
53
+ - `task_plan.md` — 主任务清单 + 文件路径 + 依赖 + 验收标准
54
+ - `progress.md` — phase 进度跟踪 + cross-session 恢复
55
+ - (`findings.md` 由 discuss-* 子工作流产出,此处不重复)
56
+
57
+ ## 如何调用
58
+
59
+ 使用 Bash 工具运行:
60
+
61
+ ```bash
62
+ echo "$ARGUMENTS" | harnessed run plan-phase --task-stdin
63
+ ```
64
+
65
+ 若 `$ARGUMENTS` 为空,运行 `harnessed run plan-phase`(不带 stdin pipe)。
66
+
67
+ 完成后,Bash 输出会在 stderr 打印 `Next:` 提示,建议下一阶段。是否调用由对话上下文决定——该提示仅供参考,非强制指令。
68
+
69
+ <!-- harnessed-generated:v3.4.4 -->
70
+
71
+ ## 参考文档
72
+
73
+ - D-04 Stage ② Plan 二层(架构 / 计划)
74
+ - D-15 Q-AUDIT-5a planning-with-files claude-code-plugin reframe (NOT npm-sdk)
75
+ - workflows/capabilities.yaml — gsd-plan-phase / planning-with-files (Bucket 4)
76
+ - workflows/defaults.yaml — ralph_max_iterations.plan-phase.* values (W2.2 backfill)
@@ -0,0 +1,81 @@
1
+ ---
2
+ name: research
3
+ description: 多源调研工作流 — Tavily/Exa/ctx7 多源 fan-out + GSD discuss synth aggregate; harnessed v2.0 新增 per R20.7 (Stage ① Discuss 独立调用); schema bumped to harnessed.workflow.v3 in Phase v3.0-3.4 W1.1 (T3.4.W1.1) with disciplines_applied [6] + tools_available [tavily-mcp, exa-mcp, ctx7, gsd-discuss-phase], phases reuse v2 verbatim. Triggered by slash command `/research` after `harnessed setup`.
4
+ preamble-tier: 2
5
+ schema_version: harnessed.workflow.v3
6
+ ---
7
+
8
+ # research 工作流
9
+
10
+ harnessed v2.0 随附的多源调研工作流(Stage ① Discuss);
11
+ `workflow.yaml` schema 在 Phase v3.0-3.4 W1.1 中 bump 至 `harnessed.workflow.v3`
12
+ (T3.4.W1.1 — D-09 L0 Discipline Substrate + D-05 tools_available 交叉验证);
13
+ phases 内容(01-fan-out + 02-synth)原样沿用 v2 SHIPPED,未做更改。
14
+
15
+ ## 阶段 (2)
16
+
17
+ | # | Phase | Upstream | Capability | Model | Description |
18
+ |---|-------|----------|-----------|-------|-------------|
19
+ | 01 | `01-fan-out` | web-search | (route-by-subtask) | sonnet | 3 路并发调研 (Tavily MCP / Exa MCP / ctx7 CLI,遵循内置 web-search + context7 路由规则) |
20
+ | 02 | `02-synth` | gsd | `gsd-discuss-phase` | opus | GSD discuss-phase 聚合 + 去重 + 对账 |
21
+
22
+ ## Capability refs
23
+
24
+ Sister `workflows/capabilities.yaml` 条目:
25
+ - `tavily-mcp` (impl: mcp-server,默认关键词搜索)
26
+ - `exa-mcp` (impl: mcp-server,描述式 / 学术搜索)
27
+ - `ctx7` (impl: cli-tool,库 API 文档)
28
+ - `gsd-discuss-phase` (synth aggregate)
29
+
30
+ ## 调用方式
31
+ - Slash command: `/research <topic>`(`harnessed setup` 后可用)
32
+
33
+ ## 路由规则(内置 web-search 路由 — `workflows/judgments/web-search-routing.yaml`)
34
+ - 描述式查询("找一篇对比 X 和 Y 的博客")→ Exa MCP
35
+ - 学术 / 论文 → Exa MCP
36
+ - 库 / API 文档 → ctx7 CLI
37
+ - 关键词 / 时效内容 → Tavily MCP(默认)
38
+ - 抓整站 / 站点结构 → Tavily crawl/map
39
+
40
+ ## 如何调用
41
+
42
+ **优先路径**(master orchestrator):按当前 stage 规定的顺序依次调用各子工作流的 slash command。每个子命令安装在 `<claude-home>/commands/<sub-name>.md`(由 `harnessed setup` 安装),自带双路径兜底。
43
+
44
+ **兜底路径**(当上游未安装或无返回结果时):使用 Task 工具 spawn 一个通用 subagent,prompt 如下:
45
+
46
+ > You are a **Research analyst**.
47
+ >
48
+ > **Mission**: Multi-source investigation (docs / web search / codebase grep / library probe) producing a `findings.md` with citations, NOT speculation. Use `ctx7` for library docs, `tavily-mcp` / `exa-mcp` for web, `gh` CLI for GitHub artifacts, and codebase `Grep` for internal references.
49
+ >
50
+ > **Default-suspect mode**: assume the change is broken / risky / incomplete until proven otherwise. Cite `file:line` for every finding; do not generalize.
51
+ >
52
+ > **Review checklist**:
53
+ > 1. Resolve each unknown claim to a citable source (URL, file:line, or `ctx7` doc id)
54
+ >
55
+ > 2. Cite version explicitly when discussing library / framework APIs (training cutoff may be stale)
56
+ >
57
+ > 3. Capture conflicting sources side-by-side; do not silently pick one
58
+ >
59
+ > 4. Flag `OPEN: <question>` for items the user must decide; never paper over
60
+ >
61
+ > 5. Persist results to `.planning/<phase>/findings.md` for cross-session handoff
62
+ >
63
+ > **Output format**: structured report with severity-classified findings (verified / unverified / conflicting / open). One finding per line: `[severity] file:line — problem (one sentence); fix: suggested change`. If no findings, say so explicitly. No preamble, no end-of-report summary.
64
+
65
+ (Role prompt 自包含 — 即使上游 `specialist` user-skill / plugin 未安装也可正常运行。)
66
+
67
+ (`harnessed setup` 同时会在 `<claude-home>/commands/research.md` 安装一个 `research` Claude Code slash command,使 `/research` 成为真正的平台 slash command — 两个文件携带相同的双路径指令。之前 v3.4.x 中 `harnessed research --apply` CLI 的相关说明已移除;该子命令从未被实现。)
68
+
69
+ ## 如何调用
70
+
71
+ 使用 Bash 工具运行:
72
+
73
+ ```bash
74
+ echo "$ARGUMENTS" | harnessed run research --task-stdin
75
+ ```
76
+
77
+ 如果 `$ARGUMENTS` 为空,运行 `harnessed run research`(不带 stdin pipe)。
78
+
79
+ 完成后,Bash 输出会在 stderr 打印 `Next:` 提示,建议下一个阶段。根据对话上下文决定是否调用 — 该提示仅供参考,不作强制指引。
80
+
81
+ <!-- harnessed-generated:v3.4.4 -->