harnessed 3.0.0 → 3.0.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  # harnessed
2
2
 
3
3
  > AI coding harness 包管理器 + composition orchestrator
4
- > CLAUDE.md 三层栈协作规则机器化为可执行 engine
4
+ > 把三层栈协作方法论 (gstack 决策 + GSD 项目经理 + superpowers 资深工程师 + karpathy 心法 + mattpocock 招式) 机器化为可执行 engine
5
5
 
6
6
  [![npm](https://img.shields.io/npm/v/harnessed?label=npm&color=blue)](https://npmjs.com/package/harnessed)
7
7
  [![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](./LICENSE)
@@ -17,46 +17,76 @@
17
17
 
18
18
  ---
19
19
 
20
- ## 🎯 关键差异化 (v3.0)
20
+ ## 🎯 关键差异化
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 (v3.0 重构)** — 自家 workflow skill 当指挥棒,调度多个上游协同。v3.0 把 v2.0 的 4 个 monolithic workflow 拆成 **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 (v3.0 NEW)** — 全局 cross-stage 行为基准 (karpathy 心法 + output-style + language + operational + priority + protocols),applied universally to L1-L7
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
26
26
  - **包管理器思维** — install dependency graph 自动解析, doctor 健康检查, install-base 一键装齐
27
27
  - **统一入口** — 用户面对 `/discuss /plan /task /verify` 等 master slash command,不需学每家上游术语;sub command 显式调用单 stage (例如 `/discuss-strategic` 只跑战略层澄清)
28
28
 
29
29
  ---
30
30
 
31
- ## 🆕 v3.0 highlight — 4-stage namespace-layered architecture
31
+ ## 📦 快速安装
32
+
33
+ ```bash
34
+ npm install -g harnessed && harnessed setup
35
+ ```
36
+
37
+ > Windows PowerShell 5.x 不支持 `&&` 链接,需改 `;` 或分两行 (`npm install -g harnessed; harnessed setup`)。bash / zsh / PowerShell 7+ / cmd.exe 都正常。
32
38
 
33
- v3.0 是对 v2.0 4-workflow **breaking refactor**,把 4 monolithic skill 重组为 **24 namespace-layered skill**,1:1 对位 `~/.claude/CLAUDE.md` 4-stage cadence
39
+ 🤖 **或让 AI 帮你装** 复制 [INSTALL-WITH-AI.md](./INSTALL-WITH-AI.md) 整段粘贴进 Claude Code (或任何 AI 助手),AI 自动处理 OS / 权限 / PATH / corepack 等 edge case
34
40
 
35
- ### 4-stage 流程图 (mermaid)
41
+ ---
42
+
43
+ ## 📐 4-stage 流程图
36
44
 
37
45
  ```mermaid
38
- graph LR
39
- subgraph Discuss[Discuss 战略澄清]
40
- DS[discuss-strategic] & DP[discuss-phase] & DT[discuss-subtask]
46
+ graph TD
47
+ RS([ /research — 前置多源调研 可选]):::optional
48
+ subgraph Discuss[ Discuss 战略澄清]
41
49
  DM[/discuss master/]
50
+ DS[discuss-strategic]
51
+ DP[discuss-phase]
52
+ DT[discuss-subtask]
53
+ DM --> DS & DP & DT
42
54
  end
43
- subgraph Plan[Plan 任务规划]
44
- PA[plan-architecture] & PP[plan-phase]
55
+ subgraph Plan[Plan 任务规划]
45
56
  PM[/plan master/]
57
+ PA[plan-architecture]
58
+ PP[plan-phase]
59
+ PM --> PA & PP
46
60
  end
47
- subgraph Task[Task 执行]
48
- TC[task-clarify] & TCo[task-code] & TT[task-test] & TD[task-deliver]
61
+ subgraph Task[Task 执行]
49
62
  TM[/task master/]
63
+ TC[task-clarify]
64
+ TCo[task-code]
65
+ TT[task-test]
66
+ TD[task-deliver]
67
+ TM --> TC --> TCo --> TT --> TD
50
68
  end
51
- subgraph Verify[Verify 验证]
52
- VP[verify-progress] & VC[verify-code-review] & VPa[verify-paranoid]
53
- VQ[verify-qa] & VS[verify-security] & VD[verify-design]
54
- VSi[verify-simplify] & VM[verify-multispec]
69
+ subgraph Verify[Verify 验证]
55
70
  VMs[/verify master/]
71
+ VP[verify-progress]
72
+ VC[verify-code-review]
73
+ VPa[verify-paranoid]
74
+ VQ[verify-qa]
75
+ VS[verify-security]
76
+ VD[verify-design]
77
+ VSi[verify-simplify]
78
+ VM[verify-multispec]
79
+ VMs --> VP & VC & VPa & VQ & VS & VD & VSi & VM
56
80
  end
81
+ RT([⑤ /retro — 里程碑总结 可选]):::optional
82
+ RS --> Discuss
57
83
  Discuss --> Plan --> Task --> Verify
84
+ Verify --> RT
85
+ classDef optional stroke-dasharray:5 5,fill:#f5f5f5,color:#666
58
86
  ```
59
87
 
88
+ > 虚框 = 可选 standalone (`/research` 战略前调研 / `/retro` 里程碑后总结);实框 = 主流程 4-stage cadence。
89
+
60
90
  ### 24 workflow 总览表
61
91
 
62
92
  | Slash cmd | Stage | Type | Capability / Upstream | Brief |
@@ -73,7 +103,7 @@ graph LR
73
103
  | `/task-code` | ③ Task | Sub | karpathy 4 心法 + `/zoom-out` / `/improve-codebase-architecture` / `/diagnose` conditional | 子任务编码 + 跨 session progress.md 同步 |
74
104
  | `/task-test` | ③ Task | Sub | superpowers TDD red-green-refactor + `/diagnose` conditional | 核心逻辑 TDD 强制 (alias mattpocock `/tdd`) |
75
105
  | `/task-deliver` | ③ Task | Sub | `ralph-loop` SDK wrapper + Agent Teams conditional | 至 verbatim `COMPLETE` + R20.10 max_iter fallback |
76
- | `/verify` | ④ Verify | Master | masterOrchestrator | 7 sub CLAUDE.md verbatim conditional dispatch |
106
+ | `/verify` | ④ Verify | Master | masterOrchestrator | 7 sub 按场景 conditional dispatch |
77
107
  | `/verify-progress` | ④ Verify | Sub | GSD `/gsd-verify-work` + `/gsd-progress` | 必跑串行起点 — UAT 验收 + 状态同步 |
78
108
  | `/verify-code-review` | ④ Verify | Sub | `code-review` 多 subagent fan-out | 高置信度 finding 并行 |
79
109
  | `/verify-paranoid` | ④ Verify | Sub | gstack `/review` (Paranoid Staff Engineer) | 关键模块 PR 前强制 |
@@ -90,49 +120,6 @@ graph LR
90
120
 
91
121
  ---
92
122
 
93
- ## 🔄 Migrating from v2.0 to v3.0
94
-
95
- v3.0 是 **breaking refactor**。v2.0 的 3 个 monolithic slash cmd 全部 DROP,改用 v3 namespace-layered 等价物:
96
-
97
- | v2.0 (DROPPED) | v3.0 (NEW) |
98
- |----------------|------------|
99
- | `/plan-feature` | `/plan` (master, 自动 gate-route) OR `/plan-phase` (直接 sub) |
100
- | `/execute-task` | `/task` (master, 串行 4 sub) OR `/task-{clarify,code,test,deliver}` (单 stage) |
101
- | `/verify-work` | `/verify` (master, 7 sub conditional) OR `/verify-{progress,code-review,paranoid,qa,security,design,simplify,multispec}` (单维度) |
102
-
103
- `/research` (v2.0 NEW) 不变,schema bump v2 → v3 但 phases verbatim 保留。
104
-
105
- ### 升级步骤
106
-
107
- ```bash
108
- # 1. 升级 npm package
109
- npm install -g harnessed@3
110
-
111
- # 2. 重新 setup — v3 把 24 个 workflow skill 装到 ~/.claude/skills/
112
- harnessed setup --apply
113
-
114
- # 3. (可选) 手动清理 v2 残留 skill dir (per K12 mitigation)
115
- rm -rf ~/.claude/skills/plan-feature ~/.claude/skills/execute-task ~/.claude/skills/verify-work
116
- ```
117
-
118
- > v2.0 SHIPPED & ARCHIVED 2026-05-19 (17/20 phases 85%);v3.0 v1.0-RC2 minor STARTING;v1.0 GA target 2026-05-22~23 — 详 [.planning/STATE.md](./.planning/STATE.md)。
119
-
120
- ---
121
-
122
- ## 📦 快速安装
123
-
124
- ```bash
125
- npm install -g harnessed
126
- ```
127
-
128
- 或不全局安装 (ephemeral 模式):
129
-
130
- ```bash
131
- npx harnessed@latest <command>
132
- ```
133
-
134
- ---
135
-
136
123
  ## 🚩 命令一览
137
124
 
138
125
  ### 主命令
@@ -152,21 +139,24 @@ npx harnessed@latest <command>
152
139
 
153
140
  ### 参数 (Flags)
154
141
 
142
+ > 所有命令默认 **apply (immediate write)**,无需加 flag。高级用户可加 `--dry-run` 预览。
143
+
155
144
  | Flag | 说明 |
156
145
  | ---- | ---- |
157
- | `--apply` | 显式执行 (默认 dry-run) |
158
- | `--dry-run` | 永不写盘 (即使加 `--apply` 也优先 dry-run) |
159
- | `--non-interactive` | CI / 脚本场景;必须配合 `--apply` 或 `--dry-run` |
146
+ | `--dry-run` | 预览不写盘 (高级用户 opt-in) |
147
+ | `--non-interactive` | CI / 脚本场景 |
160
148
  | `--system` | L4 全局装允许 (否则降级 L1 npx ephemeral) |
161
149
  | `--yes` | uninstall 跳过交互 confirm |
162
150
  | `--full-diff` | 展开 > 200 行的 diff 折叠 |
163
151
  | `--no-color` | 强制 nocolor (即使 TTY) |
164
152
 
153
+ > `--apply` flag 仍保留为向后兼容 alias (no-op, 旧脚本不破)。
154
+
165
155
  ---
166
156
 
167
157
  ## ⚡ 使用流程
168
158
 
169
- v3.0 4-stage 三层栈方法论 — 推荐 4 个 master orchestrator 串行驱动:
159
+ 4-stage 三层栈方法论 — 推荐 4 个 master orchestrator 串行驱动:
170
160
 
171
161
  ```
172
162
  /discuss → /plan → /task → /verify
@@ -184,7 +174,7 @@ v3.0 4-stage 三层栈方法论 — 推荐 4 个 master orchestrator 串行驱
184
174
 
185
175
  ```bash
186
176
  # 1. 装 workflow 上游 (一行装齐 gstack + GSD + superpowers + planning-with-files)
187
- harnessed setup --apply
177
+ harnessed setup
188
178
 
189
179
  # 2. 在 Claude Code 内跑 4-stage cadence
190
180
  /discuss "新功能 X" # 战略 + Phase + 子任务 3 层澄清
@@ -202,7 +192,7 @@ harnessed resume
202
192
 
203
193
  ---
204
194
 
205
- ## 🗂️ 架构 (v3.0 — 4-stage namespace-layered)
195
+ ## 🗂️ 架构 (4-stage namespace-layered)
206
196
 
207
197
  ### 1. 目录结构
208
198
 
@@ -229,11 +219,11 @@ harnessed/
229
219
  │ │ ├── parallelism-gate.yaml # L5b execution mechanism routing
230
220
  │ │ ├── tdd-gate.yaml
231
221
  │ │ ├── fallback.yaml # 3 铁律: skip_with_transparency + override + chain_isolation
232
- │ │ ├── web-design-routing.yaml # rules/web-design.md codify
233
- │ │ ├── web-testing-routing.yaml # rules/web-testing.md codify
234
- │ │ ├── web-search-routing.yaml # rules/web-search.md codify
222
+ │ │ ├── web-design-routing.yaml # UI 设计工具路由
223
+ │ │ ├── web-testing-routing.yaml # E2E / 浏览器测试工具路由
224
+ │ │ ├── web-search-routing.yaml # 网页搜索 / 文档抓取路由
235
225
  │ │ └── stage-routing.yaml # master orchestrator sub-stage 路由
236
- │ └── disciplines/ # L0: NEW v3.0 global cross-stage behavioral norms
226
+ │ └── disciplines/ # L0: 全局 cross-stage 行为基准
237
227
  │ ├── karpathy.yaml # 4 心法 + ≤200L
238
228
  │ ├── output-style.yaml # BLUF + no-emoji + no-em-dash
239
229
  │ ├── language.yaml # zh-Hans default + English preserve
@@ -246,7 +236,7 @@ harnessed/
246
236
  ├── tests/ # vitest unit + integration + dogfood (R8.1 dogfood-first)
247
237
  ├── scripts/ # CI gate (check-workflow-schema, transparency-verdict, state-archive)
248
238
  ├── .planning/ # project memory (STATE + ROADMAP + REQUIREMENTS + per-phase + milestones)
249
- └── docs/adr/ # 架构决策记录 (ADR 0001-0032)
239
+ └── docs/adr/ # 架构决策记录
250
240
  ```
251
241
 
252
242
  ### 2. 逻辑分层 (8 层)
@@ -276,21 +266,21 @@ harnessed/
276
266
  ├────────────────────────────────────────────────────────────┤
277
267
  │ L1 Upstream components (NOT vendored) │
278
268
  ├────────────────────────────────────────────────────────────┤
279
- │ L0 Discipline Substrate (NEW v3.0 — 全局生效)
269
+ │ L0 Discipline Substrate (全局生效)
280
270
  │ karpathy 心法 + output-style + language + operational + │
281
271
  │ priority + protocols (applied universally to L1-L7) │
282
272
  └────────────────────────────────────────────────────────────┘
283
273
  ```
284
274
 
285
- ### 3. Cross-cutting Capabilities (capabilities.yaml 7 category, ~70 entry)
275
+ ### 3. Cross-cutting Capabilities (capabilities.yaml 7 category, ~83 entry)
286
276
 
287
277
  ```
288
- behavioral (1): karpathy-guidelines (4 心法 always-on)
289
- tool-slash-cmd (40+): gstack 30+ optional + gsd 10+ + mattpocock 12 高频
290
- tool-mcp (4): chrome-devtools-mcp / tavily-mcp / exa-mcp / playwright-mcp
291
- tool-cli (3): ctx7 / playwright-cli / gws
278
+ behavioral (6): karpathy-guidelines + output-style + language + operational + priority + protocols
279
+ tool-slash-cmd (~60): gstack 30+ optional + gsd 10+ + mattpocock 12 高频 + 等
280
+ tool-mcp (3): chrome-devtools-mcp / tavily-mcp / exa-mcp
281
+ tool-cli (2): ctx7 / gws
292
282
  tool-plugin (2): planning-with-files / @playwright/test
293
- tool-bundled (2): ralph-loop / webapp-testing
283
+ tool-bundled (3): ralph-loop / webapp-testing / playwright-cli
294
284
  agent-platform (3): agent-teams-create / send-message / shutdown
295
285
  ```
296
286
 
@@ -324,35 +314,25 @@ planning-with-files /plan (cross-cutting tool) → write artifacts to .planning/
324
314
 
325
315
  ### 5. 抉择路由矩阵 (rules-based, codified in judgments + capabilities)
326
316
 
327
- | 场景 | Rule source | Default → Escalate |
328
- |------|------------|---------------------|
329
- | 并行机制 | rules/agent-teams.md | subagent → Agent Teams Pattern A/B/C (5 触发) |
330
- | UI 设计主方案 | rules/web-design.md | ui-ux-pro-max → frontend-design (用户明示风格) |
331
- | E2E 浏览器探查 | rules/web-testing.md | playwright-cli (Bash 一行 token 省) |
332
- | E2E commit-able TS | rules/web-testing.md | @playwright/test 默认 |
333
- | E2E Python 后端联动 | rules/web-testing.md | webapp-testing |
334
- | 性能/a11y/内存 | rules/web-testing.md | chrome-devtools-mcp |
335
- | Web 搜索 (关键词) | rules/web-search.md | Tavily MCP 默认 |
336
- | Web 搜索 (描述式/学术) | rules/web-search.md | Exa MCP |
337
- | 库 API 文档 | rules/context7.md | ctx7 CLI |
338
- | GitHub URL | rules/web-search.md | gh CLI |
339
- | 单 URL 抓取 | rules/web-search.md | WebFetch 内置 |
340
- | Gmail/Drive/Calendar | rules/google-workspace.md | gws CLI |
341
- | 架构审查 (复杂) | CLAUDE.md Stage ② | gstack /plan-eng-review |
342
- | TDD 强制 (核心算法) | CLAUDE.md Stage ③ | superpowers TDD OR mattpocock /tdd |
343
- | 关键模块 PR | CLAUDE.md Stage ④ | gstack /review |
344
- | 大重构 PR multi-dim | CLAUDE.md Stage + Pattern C | 4-spec Agent Team |
345
- | 跨 CC 协议 | rules/cc-handoff.md | discipline.protocols self-contained design doc |
346
-
347
- ### v3.0 superset commitment
348
-
349
- harnessed v3.0 是 user 个人 `~/.claude/CLAUDE.md` + Obsidian doc + `~/.claude/rules/` 的 **machine-codified superset**:
350
- - ✅ 4-stage cadence verbatim 机器化 (20 workflows)
351
- - ✅ 三层栈判据 + fallback 3 铁律 (judgments/ 10 file)
352
- - ✅ Pattern A/B/C Agent Teams routing (L5b mechanism)
353
- - ✅ Rules-based tool routing (4 NEW judgments + capabilities)
354
- - ✅ Global discipline (L0 substrate, 6 yaml)
355
- - ✅ harnessed > user manual via: auto gate-route + Pure bundled + cross-session memory + ADR audit + Token cost estimation + real-time discipline enforcement
317
+ | 场景 | Default → Escalate |
318
+ |------|---------------------|
319
+ | 并行机制 | subagent → Agent Teams Pattern A/B/C (5 触发) |
320
+ | UI 设计主方案 | ui-ux-pro-max → frontend-design (用户明示风格) |
321
+ | E2E 浏览器探查 | playwright-cli (Bash 一行 token 省) |
322
+ | E2E commit-able TS | @playwright/test 默认 |
323
+ | E2E Python 后端联动 | webapp-testing |
324
+ | 性能 / a11y / 内存诊断 | chrome-devtools-mcp |
325
+ | Web 搜索 (关键词) | Tavily MCP 默认 |
326
+ | Web 搜索 (描述式 / 学术) | Exa MCP |
327
+ | 库 API 文档 | ctx7 CLI |
328
+ | GitHub URL | gh CLI |
329
+ | 单 URL 抓取 | WebFetch 内置 |
330
+ | Gmail / Drive / Calendar | gws CLI |
331
+ | 架构审查 (复杂) | gstack /plan-eng-review |
332
+ | TDD 强制 (核心算法) | superpowers TDD OR mattpocock /tdd |
333
+ | 关键模块 PR | gstack /review |
334
+ | 大重构 PR 多维度审查 | 4-specialist Agent Team Pattern C |
335
+ | 跨 session hand-off | discipline.protocols self-contained design doc |
356
336
 
357
337
  ---
358
338
 
@@ -401,7 +381,7 @@ harnessed setup --apply # 自动装齐 gstack + GSD + superpowers + planning-wi
401
381
  | Orchestration | GSD | 高层 phase 任务图 + 依赖分析 |
402
382
  | Persistence | planning-with-files | 持久化 `task_plan.md` / `progress.md` / `findings.md` |
403
383
 
404
- v3.0 `/discuss /plan /task /verify` 4 个 master 把 4 阶段串起来,每个 master 内部再 delegate 到对应 sub。每个阶段做不同事,输出喂给下一阶段。**没有合并**。
384
+ `/discuss /plan /task /verify` 4 个 master 把 4 阶段串起来,每个 master 内部再 delegate 到对应 sub。每个阶段做不同事,输出喂给下一阶段。**没有合并**。
405
385
 
406
386
  </details>
407
387
 
@@ -428,25 +408,13 @@ v3.0 `/discuss /plan /task /verify` 4 个 master 把 4 阶段串起来,每个 ma
428
408
 
429
409
  - `npx harnessed@latest setup` 跑的是 **Node.js CLI** (`bin/harnessed`)
430
410
  - setup 装的 **workflow skills** (markdown) 进 `~/.claude/skills/`,由 Claude Code 运行时加载
431
- - `/discuss` / `/plan` / `/task` / `/verify` (v3.0) 等是 CC 内的 slash command,触发 skill 执行
411
+ - `/discuss` / `/plan` / `/task` / `/verify` 等是 CC 内的 slash command,触发 skill 执行
432
412
  - CLI 和 CC skill 共享 `.harnessed/checkpoints/` 状态目录
433
413
 
434
414
  </details>
435
415
 
436
416
  ---
437
417
 
438
- ## 📚 文档导航
439
-
440
- - [docs/WORKFLOW.md](./docs/WORKFLOW.md) — 4-stage workflow mermaid + 各 stage 详解
441
- - [docs/INSTALLER-CONTRACT.md](./docs/INSTALLER-CONTRACT.md) — installer 6 条用户视角硬契约
442
- - [docs/MAINTAINER-ONBOARDING.md](./docs/MAINTAINER-ONBOARDING.md) — 30 分钟跑通 dev 环境
443
- - [docs/adr/](./docs/adr/) — 架构决策记录 (ADR 0001-0023)
444
- - [CHANGELOG.md](./CHANGELOG.md) — 完整版本历史
445
- - [CONTRIBUTING.md](./CONTRIBUTING.md) — 贡献指南
446
- - [SECURITY.md](./SECURITY.md) — 漏洞披露通道
447
-
448
- ---
449
-
450
418
  ## License
451
419
 
452
420
  [Apache-2.0](./LICENSE) — 见 [NOTICE](./NOTICE) (含 Harness Inc. 商标 disclaimer)