harnessed 2.0.1 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +246 -47
- package/dist/cli.mjs +416 -98
- 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/capabilities.yaml +468 -0
- package/workflows/defaults.yaml +71 -4
- package/workflows/disciplines/karpathy.yaml +47 -0
- package/workflows/disciplines/language.yaml +38 -0
- package/workflows/disciplines/operational.yaml +61 -0
- package/workflows/disciplines/output-style.yaml +62 -0
- package/workflows/disciplines/priority.yaml +28 -0
- package/workflows/disciplines/protocols.yaml +70 -0
- package/workflows/discuss/auto/.gitkeep +0 -0
- package/workflows/discuss/auto/SKILL.md +63 -0
- package/workflows/discuss/auto/workflow.yaml +40 -0
- package/workflows/discuss/phase/SKILL.md +61 -0
- package/workflows/discuss/phase/workflow.yaml +35 -0
- package/workflows/discuss/strategic/SKILL.md +66 -0
- package/workflows/discuss/strategic/workflow.yaml +47 -0
- package/workflows/discuss/subtask/SKILL.md +67 -0
- package/workflows/discuss/subtask/workflow.yaml +33 -0
- package/workflows/judgments/stage-routing.yaml +93 -0
- package/workflows/judgments/web-design-routing.yaml +37 -0
- package/workflows/judgments/web-search-routing.yaml +52 -0
- package/workflows/judgments/web-testing-routing.yaml +50 -0
- package/workflows/plan/architecture/SKILL.md +62 -0
- package/workflows/plan/architecture/workflow.yaml +33 -0
- package/workflows/plan/auto/.gitkeep +0 -0
- package/workflows/plan/auto/SKILL.md +63 -0
- package/workflows/plan/auto/workflow.yaml +41 -0
- package/workflows/plan/phase/SKILL.md +64 -0
- package/workflows/plan/phase/workflow.yaml +37 -0
- package/workflows/research/SKILL.md +6 -2
- package/workflows/research/workflow.yaml +34 -3
- package/workflows/retro/SKILL.md +68 -0
- package/workflows/retro/workflow.yaml +40 -0
- package/workflows/task/auto/.gitkeep +0 -0
- package/workflows/task/auto/SKILL.md +68 -0
- package/workflows/task/auto/workflow.yaml +57 -0
- package/workflows/task/clarify/SKILL.md +83 -0
- package/workflows/task/clarify/workflow.yaml +39 -0
- package/workflows/task/code/SKILL.md +89 -0
- package/workflows/task/code/workflow.yaml +55 -0
- package/workflows/task/deliver/SKILL.md +118 -0
- package/workflows/task/deliver/workflow.yaml +77 -0
- package/workflows/task/test/SKILL.md +93 -0
- package/workflows/task/test/workflow.yaml +44 -0
- package/workflows/verify/auto/.gitkeep +0 -0
- package/workflows/verify/auto/SKILL.md +77 -0
- package/workflows/verify/auto/workflow.yaml +74 -0
- package/workflows/verify/code-review/SKILL.md +69 -0
- package/workflows/verify/code-review/workflow.yaml +32 -0
- package/workflows/verify/design/SKILL.md +72 -0
- package/workflows/verify/design/workflow.yaml +33 -0
- package/workflows/verify/multispec/SKILL.md +86 -0
- package/workflows/verify/multispec/workflow.yaml +58 -0
- package/workflows/verify/paranoid/SKILL.md +71 -0
- package/workflows/verify/paranoid/workflow.yaml +30 -0
- package/workflows/verify/progress/SKILL.md +67 -0
- package/workflows/verify/progress/workflow.yaml +44 -0
- package/workflows/verify/qa/SKILL.md +73 -0
- package/workflows/verify/qa/workflow.yaml +31 -0
- package/workflows/verify/security/SKILL.md +67 -0
- package/workflows/verify/security/workflow.yaml +31 -0
- package/workflows/verify/simplify/SKILL.md +67 -0
- package/workflows/verify/simplify/workflow.yaml +31 -0
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# harnessed
|
|
2
2
|
|
|
3
3
|
> AI coding harness 包管理器 + composition orchestrator
|
|
4
|
-
>
|
|
4
|
+
> 把三层栈协作方法论 (gstack 决策 + GSD 项目经理 + superpowers 资深工程师 + karpathy 心法 + mattpocock 招式) 机器化为可执行 engine
|
|
5
5
|
|
|
6
6
|
[](https://npmjs.com/package/harnessed)
|
|
7
7
|
[](./LICENSE)
|
|
@@ -21,24 +21,99 @@
|
|
|
21
21
|
|
|
22
22
|
- **三层栈机器化** — `gstack 决策` + `GSD 项目经理` + `superpowers 资深工程师` + `karpathy 4 心法` + `mattpocock 23 招式`,5 支柱 100% capture
|
|
23
23
|
- **不 vendor 上游** — manifest describe install/check;上游升级用户 re-install 即获最新版
|
|
24
|
-
- **Composition Skill** — 自家 workflow skill
|
|
24
|
+
- **Composition Skill** — 自家 workflow skill 当指挥棒,调度多个上游协同。**4 master orchestrator + 18 sub-workflow + 2 standalone = 24 namespace-layered workflow**,完整 4-stage 机器化 (`/discuss /plan /task /verify` 4 master + 三层栈 18 sub + `/research /retro` 2 standalone)
|
|
25
|
+
- **L0 Discipline Substrate** — 全局 cross-stage 行为基准 (karpathy 心法 + output-style + language + operational + priority + protocols),applied universally
|
|
25
26
|
- **包管理器思维** — install dependency graph 自动解析, doctor 健康检查, install-base 一键装齐
|
|
26
|
-
- **统一入口** — 用户面对 `/plan
|
|
27
|
+
- **统一入口** — 用户面对 `/discuss /plan /task /verify` 等 master slash command,不需学每家上游术语;sub command 显式调用单 stage (例如 `/discuss-strategic` 只跑战略层澄清)
|
|
27
28
|
|
|
28
29
|
---
|
|
29
30
|
|
|
30
31
|
## 📦 快速安装
|
|
31
32
|
|
|
32
33
|
```bash
|
|
33
|
-
npm install -g harnessed
|
|
34
|
+
npm install -g harnessed && harnessed setup
|
|
34
35
|
```
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
---
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
## 📐 4-stage 流程图
|
|
40
|
+
|
|
41
|
+
```mermaid
|
|
42
|
+
graph TD
|
|
43
|
+
RS([⓪ /research — 前置多源调研 可选]):::optional
|
|
44
|
+
subgraph Discuss[① Discuss 战略澄清]
|
|
45
|
+
DM[/discuss master/]
|
|
46
|
+
DS[discuss-strategic]
|
|
47
|
+
DP[discuss-phase]
|
|
48
|
+
DT[discuss-subtask]
|
|
49
|
+
DM --> DS & DP & DT
|
|
50
|
+
end
|
|
51
|
+
subgraph Plan[② Plan 任务规划]
|
|
52
|
+
PM[/plan master/]
|
|
53
|
+
PA[plan-architecture]
|
|
54
|
+
PP[plan-phase]
|
|
55
|
+
PM --> PA & PP
|
|
56
|
+
end
|
|
57
|
+
subgraph Task[③ Task 执行]
|
|
58
|
+
TM[/task master/]
|
|
59
|
+
TC[task-clarify]
|
|
60
|
+
TCo[task-code]
|
|
61
|
+
TT[task-test]
|
|
62
|
+
TD[task-deliver]
|
|
63
|
+
TM --> TC --> TCo --> TT --> TD
|
|
64
|
+
end
|
|
65
|
+
subgraph Verify[④ Verify 验证]
|
|
66
|
+
VMs[/verify master/]
|
|
67
|
+
VP[verify-progress]
|
|
68
|
+
VC[verify-code-review]
|
|
69
|
+
VPa[verify-paranoid]
|
|
70
|
+
VQ[verify-qa]
|
|
71
|
+
VS[verify-security]
|
|
72
|
+
VD[verify-design]
|
|
73
|
+
VSi[verify-simplify]
|
|
74
|
+
VM[verify-multispec]
|
|
75
|
+
VMs --> VP & VC & VPa & VQ & VS & VD & VSi & VM
|
|
76
|
+
end
|
|
77
|
+
RT([⑤ /retro — 里程碑总结 可选]):::optional
|
|
78
|
+
RS --> Discuss
|
|
79
|
+
Discuss --> Plan --> Task --> Verify
|
|
80
|
+
Verify --> RT
|
|
81
|
+
classDef optional stroke-dasharray:5 5,fill:#f5f5f5,color:#666
|
|
40
82
|
```
|
|
41
83
|
|
|
84
|
+
> 虚框 = 可选 standalone (`/research` 战略前调研 / `/retro` 里程碑后总结);实框 = 主流程 4-stage cadence。
|
|
85
|
+
|
|
86
|
+
### 24 workflow 总览表
|
|
87
|
+
|
|
88
|
+
| Slash cmd | Stage | Type | Capability / Upstream | Brief |
|
|
89
|
+
|-----------|-------|------|----------------------|-------|
|
|
90
|
+
| `/discuss` | ① Discuss | Master | masterOrchestrator | 3 sub 并行 gate-eval (chain-isolation 铁律) |
|
|
91
|
+
| `/discuss-strategic` | ① Discuss | Sub | gstack `/office-hours` + `/plan-ceo-review` | 战略层 — 新功能 / 新 milestone / 产品方向强制治理 |
|
|
92
|
+
| `/discuss-phase` | ① Discuss | Sub | GSD `/gsd-discuss-phase` | Phase 层 — ≥2 open decisions / 灰色地带澄清 |
|
|
93
|
+
| `/discuss-subtask` | ① Discuss | Sub | superpowers brainstorming + `/grill-with-docs` | 子任务层 — ≥2 approach / 核心算法 / API contract |
|
|
94
|
+
| `/plan` | ② Plan | Master | masterOrchestrator | 串行 invoke 2 sub (architecture conditional → phase always) |
|
|
95
|
+
| `/plan-architecture` | ② Plan | Sub | gstack `/plan-eng-review` | 架构层 — 复杂架构强制治理关卡 |
|
|
96
|
+
| `/plan-phase` | ② Plan | Sub | GSD `/gsd-plan-phase` + planning-with-files `/plan` | 计划层 — 持久化 `task_plan.md` + `progress.md` |
|
|
97
|
+
| `/task` | ③ Task | Master | masterOrchestrator | 串行 invoke 4 sub per subtask (clarify → code → test → deliver) |
|
|
98
|
+
| `/task-clarify` | ③ Task | Sub | superpowers brainstorming + `/grill-with-docs` conditional | 子任务起步澄清 gate |
|
|
99
|
+
| `/task-code` | ③ Task | Sub | karpathy 4 心法 + `/zoom-out` / `/improve-codebase-architecture` / `/diagnose` conditional | 子任务编码 + 跨 session progress.md 同步 |
|
|
100
|
+
| `/task-test` | ③ Task | Sub | superpowers TDD red-green-refactor + `/diagnose` conditional | 核心逻辑 TDD 强制 (alias mattpocock `/tdd`) |
|
|
101
|
+
| `/task-deliver` | ③ Task | Sub | `ralph-loop` SDK wrapper + Agent Teams conditional | 至 verbatim `COMPLETE` + R20.10 max_iter fallback |
|
|
102
|
+
| `/verify` | ④ Verify | Master | masterOrchestrator | 7 sub 按场景 conditional dispatch |
|
|
103
|
+
| `/verify-progress` | ④ Verify | Sub | GSD `/gsd-verify-work` + `/gsd-progress` | 必跑串行起点 — UAT 验收 + 状态同步 |
|
|
104
|
+
| `/verify-code-review` | ④ Verify | Sub | `code-review` 多 subagent fan-out | 高置信度 finding 并行 |
|
|
105
|
+
| `/verify-paranoid` | ④ Verify | Sub | gstack `/review` (Paranoid Staff Engineer) | 关键模块 PR 前强制 |
|
|
106
|
+
| `/verify-qa` | ④ Verify | Sub | gstack `/qa` + playwright-cli / `@playwright/test` / webapp-testing | 端到端 QA (has_ui_changes conditional) |
|
|
107
|
+
| `/verify-security` | ④ Verify | Sub | gstack `/cso` | OWASP / auth / secrets (has_auth_or_secrets conditional) |
|
|
108
|
+
| `/verify-design` | ④ Verify | Sub | gstack `/design-review` + ui-ux-pro-max + frontend-design | 设计系统一致性 (has_design_changes conditional) |
|
|
109
|
+
| `/verify-simplify` | ④ Verify | Sub | `code-simplifier` | 末尾串行简化 |
|
|
110
|
+
| `/verify-multispec` | ④ Verify | Sub | 4-specialist Agent Team Pattern C | 关键发布 / 大重构 PR 升级 (互相 SendMessage 质询) |
|
|
111
|
+
| `/research` | Standalone | Standalone | Tavily / Exa MCP + ctx7 + GSD `/gsd-discuss-phase` | 多源调研 (Stage ① alternate) |
|
|
112
|
+
| `/retro` | Standalone | Standalone | gstack `/retro` + planning-with-files RETROSPECTIVE.md | 项目 / 里程碑结束总结 |
|
|
113
|
+
|
|
114
|
+
> Master orchestrator 自动 gate-route 到合适的 sub (chain-isolation 铁律 — 不 fire 的 sub 透明声明跳过)。
|
|
115
|
+
> 直接调用 sub 也可绕过 master 单跑某 stage,例如 `/discuss-strategic "新功能 X"`。
|
|
116
|
+
|
|
42
117
|
---
|
|
43
118
|
|
|
44
119
|
## 🚩 命令一览
|
|
@@ -60,65 +135,201 @@ npx harnessed@latest <command>
|
|
|
60
135
|
|
|
61
136
|
### 参数 (Flags)
|
|
62
137
|
|
|
138
|
+
> 所有命令默认 **apply (immediate write)**,无需加 flag。高级用户可加 `--dry-run` 预览。
|
|
139
|
+
|
|
63
140
|
| Flag | 说明 |
|
|
64
141
|
| ---- | ---- |
|
|
65
|
-
| `--
|
|
66
|
-
| `--
|
|
67
|
-
| `--non-interactive` | CI / 脚本场景;必须配合 `--apply` 或 `--dry-run` |
|
|
142
|
+
| `--dry-run` | 预览不写盘 (高级用户 opt-in) |
|
|
143
|
+
| `--non-interactive` | CI / 脚本场景 |
|
|
68
144
|
| `--system` | L4 全局装允许 (否则降级 L1 npx ephemeral) |
|
|
69
145
|
| `--yes` | uninstall 跳过交互 confirm |
|
|
70
146
|
| `--full-diff` | 展开 > 200 行的 diff 折叠 |
|
|
71
147
|
| `--no-color` | 强制 nocolor (即使 TTY) |
|
|
72
148
|
|
|
149
|
+
> `--apply` flag 仍保留为向后兼容 alias (no-op, 旧脚本不破)。
|
|
150
|
+
|
|
73
151
|
---
|
|
74
152
|
|
|
75
153
|
## ⚡ 使用流程
|
|
76
154
|
|
|
77
|
-
|
|
155
|
+
4-stage 三层栈方法论 — 推荐 4 个 master orchestrator 串行驱动:
|
|
78
156
|
|
|
79
157
|
```
|
|
80
|
-
|
|
158
|
+
/discuss → /plan → /task → /verify
|
|
159
|
+
① ② ③ ④
|
|
81
160
|
```
|
|
82
161
|
|
|
83
|
-
| Stage |
|
|
84
|
-
| ---- | ---- | ---- |
|
|
85
|
-
| ① **Discuss** | gstack `/office-hours` + GSD `/gsd-discuss-phase`
|
|
86
|
-
| ② **Plan** | GSD `/gsd-plan-phase` + planning-with-files |
|
|
87
|
-
| ③ **
|
|
88
|
-
| ④ **Verify** | GSD `/gsd-verify-work` + code-review + gstack `/review`
|
|
162
|
+
| Stage | Master | 主要 sub-workflow | 上游协同 |
|
|
163
|
+
| ---- | ---- | ---- | ---- |
|
|
164
|
+
| ① **Discuss** | `/discuss` | strategic / phase / subtask (3 并行) | gstack `/office-hours` + GSD `/gsd-discuss-phase` + superpowers brainstorming |
|
|
165
|
+
| ② **Plan** | `/plan` | architecture (conditional) → phase | gstack `/plan-eng-review` + GSD `/gsd-plan-phase` + planning-with-files |
|
|
166
|
+
| ③ **Task** | `/task` | clarify → code → test → deliver (4 串行 per subtask) | karpathy 心法 + mattpocock 招式 + superpowers TDD + `ralph-loop` |
|
|
167
|
+
| ④ **Verify** | `/verify` | progress → 5 parallel conditional → simplify (+ multispec critical) | GSD `/gsd-verify-work` + code-review + gstack `/review` / `/qa` / `/cso` / `/design-review` + code-simplifier |
|
|
89
168
|
|
|
90
169
|
实操示例:
|
|
91
170
|
|
|
92
171
|
```bash
|
|
93
172
|
# 1. 装 workflow 上游 (一行装齐 gstack + GSD + superpowers + planning-with-files)
|
|
94
|
-
harnessed
|
|
173
|
+
harnessed setup
|
|
95
174
|
|
|
96
|
-
# 2. 在 Claude Code 内跑
|
|
97
|
-
/
|
|
175
|
+
# 2. 在 Claude Code 内跑 4-stage cadence
|
|
176
|
+
/discuss "新功能 X" # 战略 + Phase + 子任务 3 层澄清
|
|
177
|
+
/plan "新功能 X" # 架构 (conditional) + 计划 (任务图持久化)
|
|
178
|
+
/task "subtask-1: API contract" # 4 sub 串行 per subtask
|
|
179
|
+
/verify "phase-1" # 7 sub conditional
|
|
98
180
|
|
|
99
181
|
# 3. 中断后恢复 (任何时候)
|
|
100
182
|
harnessed resume
|
|
101
183
|
```
|
|
102
184
|
|
|
185
|
+
> 也可直接调 sub 绕过 master 单跑某一层,例如 `/verify-paranoid` 只跑 Paranoid Staff Engineer 审查。
|
|
186
|
+
|
|
103
187
|
📊 详细 mermaid + 各 stage 完整说明:[docs/WORKFLOW.md](./docs/WORKFLOW.md)
|
|
104
188
|
|
|
105
189
|
---
|
|
106
190
|
|
|
107
|
-
## 🗂️
|
|
191
|
+
## 🗂️ 架构 (4-stage namespace-layered)
|
|
192
|
+
|
|
193
|
+
### 1. 目录结构
|
|
108
194
|
|
|
109
195
|
```
|
|
110
196
|
harnessed/
|
|
111
|
-
├── manifests/
|
|
112
|
-
|
|
113
|
-
│
|
|
114
|
-
├──
|
|
115
|
-
├──
|
|
116
|
-
├──
|
|
117
|
-
|
|
118
|
-
├──
|
|
119
|
-
|
|
197
|
+
├── manifests/ # L1: 上游描述层 (NOT vendored)
|
|
198
|
+
├── workflows/ # L6: composition skill (4-stage 指挥棒)
|
|
199
|
+
│ ├── discuss/ # Stage ① 3 layer (strategic + phase + subtask)
|
|
200
|
+
│ │ ├── auto/ # /discuss master gate-route
|
|
201
|
+
│ │ ├── strategic/ # /discuss-strategic (gstack /office-hours + /plan-ceo-review)
|
|
202
|
+
│ │ ├── phase/ # /discuss-phase (GSD /gsd-discuss-phase)
|
|
203
|
+
│ │ └── subtask/ # /discuss-subtask (superpowers brainstorming)
|
|
204
|
+
│ ├── plan/ # Stage ② (architecture + phase 任务图)
|
|
205
|
+
│ ├── task/ # Stage ③ (clarify + code + test + deliver)
|
|
206
|
+
│ ├── verify/ # Stage ④ (progress + code-review + paranoid + qa + cso + design + simplify + multispec)
|
|
207
|
+
│ ├── research/ # standalone Stage ① alternate
|
|
208
|
+
│ ├── retro/ # standalone post-④ milestone close
|
|
209
|
+
│ ├── capabilities.yaml # L5a: ~70 entry, 7 category SoT
|
|
210
|
+
│ ├── defaults.yaml # ralph_max_iterations per workflow phase
|
|
211
|
+
│ ├── judgments/ # L5a: 三层栈判据 + parallelism + tdd + fallback + rules-routing
|
|
212
|
+
│ │ ├── strategic-gate.yaml
|
|
213
|
+
│ │ ├── phase-gate.yaml
|
|
214
|
+
│ │ ├── subtask-gate.yaml
|
|
215
|
+
│ │ ├── parallelism-gate.yaml # L5b execution mechanism routing
|
|
216
|
+
│ │ ├── tdd-gate.yaml
|
|
217
|
+
│ │ ├── fallback.yaml # 3 铁律: skip_with_transparency + override + chain_isolation
|
|
218
|
+
│ │ ├── web-design-routing.yaml # UI 设计工具路由
|
|
219
|
+
│ │ ├── web-testing-routing.yaml # E2E / 浏览器测试工具路由
|
|
220
|
+
│ │ ├── web-search-routing.yaml # 网页搜索 / 文档抓取路由
|
|
221
|
+
│ │ └── stage-routing.yaml # master orchestrator sub-stage 路由
|
|
222
|
+
│ └── disciplines/ # L0: 全局 cross-stage 行为基准
|
|
223
|
+
│ ├── karpathy.yaml # 4 心法 + ≤200L
|
|
224
|
+
│ ├── output-style.yaml # BLUF + no-emoji + no-em-dash
|
|
225
|
+
│ ├── language.yaml # zh-Hans default + English preserve
|
|
226
|
+
│ ├── operational.yaml # biome preempt + A7 + commit safety
|
|
227
|
+
│ ├── priority.yaml # skill conflict 仲裁
|
|
228
|
+
│ └── protocols.yaml # cc-handoff design doc 自包含
|
|
229
|
+
├── routing/ # L4: routing engine SSOT (decision_rules.yaml)
|
|
230
|
+
├── schemas/ # L3: JSON Schema (IDE / CI consume)
|
|
231
|
+
├── src/ # L4: TS engine (workflow + routing + cli + installers + checkpoint + audit + state)
|
|
232
|
+
├── tests/ # vitest unit + integration + dogfood (R8.1 dogfood-first)
|
|
233
|
+
├── scripts/ # CI gate (check-workflow-schema, transparency-verdict, state-archive)
|
|
234
|
+
├── .planning/ # project memory (STATE + ROADMAP + REQUIREMENTS + per-phase + milestones)
|
|
235
|
+
└── docs/adr/ # 架构决策记录
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### 2. 逻辑分层 (8 层)
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
┌────────────────────────────────────────────────────────────┐
|
|
242
|
+
│ L7 User-facing slash cmd + harnessed CLI │
|
|
243
|
+
│ /discuss /plan /task /verify (master) + 14 sub + /research /retro
|
|
244
|
+
│ + direct gstack invoke (30+ optional): /office-hours /review /qa /...
|
|
245
|
+
├────────────────────────────────────────────────────────────┤
|
|
246
|
+
│ L6 Workflow orchestration (workflows/<stage>/<sub>/) │
|
|
247
|
+
├────────────────────────────────────────────────────────────┤
|
|
248
|
+
│ L5b Execution Mechanism (orthogonal): subagent / Agent Teams │
|
|
249
|
+
│ / 主 session + ralph-loop wrapper │
|
|
250
|
+
│ parallelism-gate.yaml: 默认 subagent → escalate 5 触发 │
|
|
251
|
+
│ Pattern A 全栈三路 / B 对立假设 / C 多维度审查 │
|
|
252
|
+
├────────────────────────────────────────────────────────────┤
|
|
253
|
+
│ L5a Capability + Judgment + Defaults SoT │
|
|
254
|
+
│ capabilities.yaml (7 category) + judgments/ (10 file) + │
|
|
255
|
+
│ defaults.yaml │
|
|
256
|
+
├────────────────────────────────────────────────────────────┤
|
|
257
|
+
│ L4 Runtime engine (workflow / routing / handlers) │
|
|
258
|
+
├────────────────────────────────────────────────────────────┤
|
|
259
|
+
│ L3 TypeBox schema + CI gate │
|
|
260
|
+
├────────────────────────────────────────────────────────────┤
|
|
261
|
+
│ L2 Installer + Manifest engine │
|
|
262
|
+
├────────────────────────────────────────────────────────────┤
|
|
263
|
+
│ L1 Upstream components (NOT vendored) │
|
|
264
|
+
├────────────────────────────────────────────────────────────┤
|
|
265
|
+
│ L0 Discipline Substrate (全局生效) │
|
|
266
|
+
│ karpathy 心法 + output-style + language + operational + │
|
|
267
|
+
│ priority + protocols (applied universally to L1-L7) │
|
|
268
|
+
└────────────────────────────────────────────────────────────┘
|
|
120
269
|
```
|
|
121
270
|
|
|
271
|
+
### 3. Cross-cutting Capabilities (capabilities.yaml 7 category, ~83 entry)
|
|
272
|
+
|
|
273
|
+
```
|
|
274
|
+
behavioral (6): karpathy-guidelines + output-style + language + operational + priority + protocols
|
|
275
|
+
tool-slash-cmd (~60): gstack 30+ optional + gsd 10+ + mattpocock 12 高频 + 等
|
|
276
|
+
tool-mcp (3): chrome-devtools-mcp / tavily-mcp / exa-mcp
|
|
277
|
+
tool-cli (2): ctx7 / gws
|
|
278
|
+
tool-plugin (2): planning-with-files / @playwright/test
|
|
279
|
+
tool-bundled (3): ralph-loop / webapp-testing / playwright-cli
|
|
280
|
+
agent-platform (3): agent-teams-create / send-message / shutdown
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### 4. 数据流示例 (用户调用 `/discuss "新功能 X"`)
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
[L7] User invokes /discuss "新功能 X"
|
|
287
|
+
↓
|
|
288
|
+
[L6] workflows/discuss/auto/workflow.yaml master orchestrator
|
|
289
|
+
↓
|
|
290
|
+
[L5a] judgments.strategic-gate.fires + phase-gate.fires + subtask-gate.fires (3-way 并行 eval)
|
|
291
|
+
↓
|
|
292
|
+
[L4] judgmentResolver.ts (4-level ref split) + exprBuilder.ts (expr-eval evaluate)
|
|
293
|
+
↓
|
|
294
|
+
[L0] discipline.priority-hierarchy 仲裁工具冲突 / output-style 格式化输出
|
|
295
|
+
↓
|
|
296
|
+
[fires=true sub] → invoke sub-workflow (/discuss-strategic / /discuss-phase / /discuss-subtask)
|
|
297
|
+
↓ for each sub:
|
|
298
|
+
├─ behavioral_layer: karpathy-guidelines (always-on)
|
|
299
|
+
├─ tools_available: planning-with-files / ctx7 / mattpocock by-condition
|
|
300
|
+
├─ parallelism: judgments.parallelism-gate.<route>.fires (L5b mechanism)
|
|
301
|
+
└─ phase invocations execute via capability template interpolation
|
|
302
|
+
↓
|
|
303
|
+
[fallback.yaml chain-isolation] 三层独立判断, 不串行依赖
|
|
304
|
+
[Skip 透明声明] 不 fire 的 sub → "⚠️ 跳过 <sub>, 因为 <reason>"
|
|
305
|
+
↓
|
|
306
|
+
planning-with-files /plan (cross-cutting tool) → write artifacts to .planning/<phase-id>/
|
|
307
|
+
↓
|
|
308
|
+
[L4] state.ts writeCurrentWorkflow (proper-lockfile) + audit.append (12-field JSONL)
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
### 5. 抉择路由矩阵 (rules-based, codified in judgments + capabilities)
|
|
312
|
+
|
|
313
|
+
| 场景 | Default → Escalate |
|
|
314
|
+
|------|---------------------|
|
|
315
|
+
| 并行机制 | subagent → Agent Teams Pattern A/B/C (5 触发) |
|
|
316
|
+
| UI 设计主方案 | ui-ux-pro-max → frontend-design (用户明示风格) |
|
|
317
|
+
| E2E 浏览器探查 | playwright-cli (Bash 一行 token 省) |
|
|
318
|
+
| E2E commit-able TS | @playwright/test 默认 |
|
|
319
|
+
| E2E Python 后端联动 | webapp-testing |
|
|
320
|
+
| 性能 / a11y / 内存诊断 | chrome-devtools-mcp |
|
|
321
|
+
| Web 搜索 (关键词) | Tavily MCP 默认 |
|
|
322
|
+
| Web 搜索 (描述式 / 学术) | Exa MCP |
|
|
323
|
+
| 库 API 文档 | ctx7 CLI |
|
|
324
|
+
| GitHub URL | gh CLI |
|
|
325
|
+
| 单 URL 抓取 | WebFetch 内置 |
|
|
326
|
+
| Gmail / Drive / Calendar | gws CLI |
|
|
327
|
+
| 架构审查 (复杂) | gstack /plan-eng-review |
|
|
328
|
+
| TDD 强制 (核心算法) | superpowers TDD OR mattpocock /tdd |
|
|
329
|
+
| 关键模块 PR | gstack /review |
|
|
330
|
+
| 大重构 PR 多维度审查 | 4-specialist Agent Team Pattern C |
|
|
331
|
+
| 跨 session hand-off | discipline.protocols self-contained design doc |
|
|
332
|
+
|
|
122
333
|
---
|
|
123
334
|
|
|
124
335
|
## ❓ FAQ
|
|
@@ -131,7 +342,7 @@ harnessed/
|
|
|
131
342
|
需要,但**用户感知 = 一行命令**:
|
|
132
343
|
|
|
133
344
|
```bash
|
|
134
|
-
harnessed
|
|
345
|
+
harnessed setup --apply # 自动装齐 gstack + GSD + superpowers + planning-with-files,24 workflow skill 一并落到 ~/.claude/skills/
|
|
135
346
|
```
|
|
136
347
|
|
|
137
348
|
类比 `brew install <formula>` 装全套依赖 — 你不需要单独 `brew install` 每个依赖项。
|
|
@@ -166,7 +377,7 @@ harnessed install plan-feature # 自动装齐 gstack + GSD + superpowers + plan
|
|
|
166
377
|
| Orchestration | GSD | 高层 phase 任务图 + 依赖分析 |
|
|
167
378
|
| Persistence | planning-with-files | 持久化 `task_plan.md` / `progress.md` / `findings.md` |
|
|
168
379
|
|
|
169
|
-
`/plan
|
|
380
|
+
`/discuss /plan /task /verify` 4 个 master 把 4 阶段串起来,每个 master 内部再 delegate 到对应 sub。每个阶段做不同事,输出喂给下一阶段。**没有合并**。
|
|
170
381
|
|
|
171
382
|
</details>
|
|
172
383
|
|
|
@@ -177,7 +388,7 @@ harnessed install plan-feature # 自动装齐 gstack + GSD + superpowers + plan
|
|
|
177
388
|
|
|
178
389
|
看 `workflows/<name>/SKILL.md` frontmatter 的 `pause` 字段:
|
|
179
390
|
|
|
180
|
-
- `pause: human_review` → 阻塞等用户 approve (governance gate / final lock,如 `
|
|
391
|
+
- `pause: human_review` → 阻塞等用户 approve (governance gate / final lock,如 `/discuss-strategic` gstack `/office-hours` + `/plan-architecture` `/plan-eng-review` 锁定关卡)
|
|
181
392
|
- 无 `pause` → 自动 chain 到下一 phase
|
|
182
393
|
|
|
183
394
|
每个 phase 输出写到 `.harnessed/checkpoints/`,session 中断后 `harnessed resume` 从最近 checkpoint 继续。
|
|
@@ -193,25 +404,13 @@ harnessed install plan-feature # 自动装齐 gstack + GSD + superpowers + plan
|
|
|
193
404
|
|
|
194
405
|
- `npx harnessed@latest setup` 跑的是 **Node.js CLI** (`bin/harnessed`)
|
|
195
406
|
- setup 装的 **workflow skills** (markdown) 进 `~/.claude/skills/`,由 Claude Code 运行时加载
|
|
196
|
-
- `/plan
|
|
407
|
+
- `/discuss` / `/plan` / `/task` / `/verify` 等是 CC 内的 slash command,触发 skill 执行
|
|
197
408
|
- CLI 和 CC skill 共享 `.harnessed/checkpoints/` 状态目录
|
|
198
409
|
|
|
199
410
|
</details>
|
|
200
411
|
|
|
201
412
|
---
|
|
202
413
|
|
|
203
|
-
## 📚 文档导航
|
|
204
|
-
|
|
205
|
-
- [docs/WORKFLOW.md](./docs/WORKFLOW.md) — 4-stage workflow mermaid + 各 stage 详解
|
|
206
|
-
- [docs/INSTALLER-CONTRACT.md](./docs/INSTALLER-CONTRACT.md) — installer 6 条用户视角硬契约
|
|
207
|
-
- [docs/MAINTAINER-ONBOARDING.md](./docs/MAINTAINER-ONBOARDING.md) — 30 分钟跑通 dev 环境
|
|
208
|
-
- [docs/adr/](./docs/adr/) — 架构决策记录 (ADR 0001-0023)
|
|
209
|
-
- [CHANGELOG.md](./CHANGELOG.md) — 完整版本历史
|
|
210
|
-
- [CONTRIBUTING.md](./CONTRIBUTING.md) — 贡献指南
|
|
211
|
-
- [SECURITY.md](./SECURITY.md) — 漏洞披露通道
|
|
212
|
-
|
|
213
|
-
---
|
|
214
|
-
|
|
215
414
|
## License
|
|
216
415
|
|
|
217
416
|
[Apache-2.0](./LICENSE) — 见 [NOTICE](./NOTICE) (含 Harness Inc. 商标 disclaimer)
|