create-harness-vibe-coding 0.2.0 → 0.3.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.
- package/README-CN.md +94 -0
- package/README.md +104 -21
- package/package.json +3 -2
- package/src/generator.js +2 -0
- package/templates/common/.claude/agents/context-master.md +78 -0
- package/templates/common/.claude/agents/debugger.md +1 -1
- package/templates/common/.claude/agents/docs-researcher.md +1 -1
- package/templates/common/.claude/agents/implementer.md +1 -1
- package/templates/common/.claude/agents/memory-master.md +67 -0
- package/templates/common/.claude/agents/planner.md +1 -1
- package/templates/common/.claude/agents/researcher.md +1 -1
- package/templates/common/.claude/agents/test-writer.md +1 -1
- package/templates/common/.claude/agents/verifier.md +1 -1
- package/templates/common/.claude/commands/update.md +11 -0
- package/templates/common/.claude/commands/wf.md +10 -4
- package/templates/common/.claude/rules/ecc/common.md +2 -2
- package/templates/common/.claude/skills/harness-build-loop/SKILL.md +2 -1
- package/templates/common/.claude/skills/harness-context/SKILL.md +2 -1
- package/templates/common/.claude/skills/harness-lifecycle/SKILL.md +2 -1
- package/templates/common/.claude/skills/harness-research/SKILL.md +2 -1
- package/templates/common/.claude/skills/harness-router/SKILL.md +2 -2
- package/templates/common/.claude/skills/readme-optimizer/SKILL.md +3 -2
- package/templates/common/.claude/skills/subagent-orchestrator/SKILL.md +9 -4
- package/templates/common/.claude/skills/wf-mode/SKILL.md +13 -6
- package/templates/common/.claude/skills/wf-update/SKILL.md +58 -0
- package/templates/common/.harness-version +8 -0
- package/templates/common/CLAUDE.md +15 -5
- package/templates/common/MEMORY.md +6 -1
- package/templates/common/README.md +2 -2
- package/templates/common/SETUP.md +34 -20
- package/templates/common/docs/README.md +24 -17
- package/templates/common/docs/domain/ports.md +3 -0
- package/templates/common/docs/features/_template.md +11 -1
- package/templates/common/docs/harness/PLAN.md +37 -88
- package/templates/common/docs/harness/PROGRESS.md +17 -0
- package/templates/common/docs/harness/WF.md +32 -14
- package/templates/common/docs/harness/agent-workflow.md +19 -7
- package/templates/common/docs/harness/architecture.md +31 -7
- package/templates/common/docs/harness/context-loading.md +17 -5
- package/templates/common/docs/harness/dispatch.md +9 -6
- package/templates/common/docs/harness/extension.md +4 -4
- package/templates/common/docs/harness/lifecycle.md +2 -2
- package/templates/common/docs/harness/state-machines.md +8 -0
- package/templates/common/docs/harness/subagents.md +50 -9
- package/templates/common/docs/research/README.md +3 -3
- package/templates/common/docs/tasks/_template/ARTIFACTS.md +3 -0
- package/templates/common/docs/tasks/_template/NOTES.md +3 -0
- package/templates/common/docs/tasks/_template/PLAN.md +40 -0
- package/templates/common/docs/tasks/_template/PROGRESS.md +29 -0
- package/templates/common/scripts/validate-harness.mjs +78 -7
package/README-CN.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# create-harness-vibe-coding 中文说明
|
|
2
|
+
|
|
3
|
+
0-1 产品 Harness 脚手架,用于 AI 辅助工程:从想法、调研、PRD、架构、计划,到实现、验证和反馈闭环。
|
|
4
|
+
|
|
5
|
+
English README: [README.md](README.md)
|
|
6
|
+
|
|
7
|
+
## 一句话交给 Agent
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
请按照 https://github.com/zingspark/create-harness-vibe-coding 的 README 为当前项目配置 create-harness-vibe-coding;编辑前先询问 Agent-link 安装前置问题;新项目走 0-1 bootstrap,老项目或老架构升级先 dry-run,保留现有文件,只合并缺失的 Harness 规范,然后遵循 Harness/SETUP.md。
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## 两种安装方式
|
|
14
|
+
|
|
15
|
+
### 1. npx 安装
|
|
16
|
+
|
|
17
|
+
适合需要确定性写入、明确冲突策略、可重复 dry-run 的场景。
|
|
18
|
+
|
|
19
|
+
### 2. 直接把链接丢给 agent
|
|
20
|
+
|
|
21
|
+
适合老项目、老架构升级、已有复杂 `CLAUDE.md` / `AGENTS.md` / `.claude/` 的场景。agent 应该读取这个仓库 README,理解当前项目结构,执行或模拟 dry-run,然后给出最小迁移方案。
|
|
22
|
+
|
|
23
|
+
如果项目里已经有 `CLAUDE.md`,agent 必须先告诉用户:`CLAUDE.md` 是根 agent 入口合同,不能静默覆盖或乱合并。正确流程是先请求用户确认是否重构/合并 `CLAUDE.md`,再在保留原项目规则的基础上补入 Harness 的 startup、memory、router、workflow、subagents 编排约束。
|
|
24
|
+
|
|
25
|
+
Agent-link 安装前置问题,编辑前先问:
|
|
26
|
+
|
|
27
|
+
只询问会影响写入、架构、安全或工作流的选择。开始时最多问 3 个 blocking 问题,其余采用安全默认值并记录到计划里,等真正触发时再继续追问。
|
|
28
|
+
|
|
29
|
+
| 主题 | 什么时候问 | 没回答时的默认值 |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| 根 agent 入口 | 已存在 `CLAUDE.md`、`AGENTS.md`、`.claude/` 或其他 agent 入口文件 | 保留现有文件;合并 Harness 入口合同前必须询问用户 |
|
|
32
|
+
| Harness 存放位置 | `docs/` 已经用于 GitHub Pages、产品文档或生成文档 | 默认使用根目录 `Harness/`;不要把 Harness 文档写进 `docs/` |
|
|
33
|
+
| README 归属 | 根 `README.md` 是公开产品页、包文档或已有大量自定义内容 | 保留现有 README,只提议追加最小 Development section |
|
|
34
|
+
| README 优化 | 已有 README 过时、太单薄、缺少命令表格,或用户想要架构图/更生动的文档 | 可推荐 `readme-optimizer`;默认只追加 Development notes,结构化优化或重写必须先得到用户确认 |
|
|
35
|
+
| 扩展能力 | ECC、Superpowers、自定义 rules 或栈相关 skills 可能有用 | 先推荐;只有用户同意后才安装 |
|
|
36
|
+
| Skills | 技术栈已明确,测试、前端、后端、review、浏览器证据可用 optional skills 增强 | 用户同意后只安装 1-2 个最相关 skills |
|
|
37
|
+
| CI/CD | 已有 CI 配置,或项目缺少测试/构建 gate | 先记录现有命令;只有用户同意后才新增或规范 CI/CD |
|
|
38
|
+
| 验证深度 | 涉及浏览器可见行为、API、数据库、鉴权、支付或部署 | 必须有真实命令证据;相关场景必须有浏览器/API 证据 |
|
|
39
|
+
| Memory/隐私 | 仓库包含敏感领域数据、客户数据、密钥或私有流程 | 只启用 memory index;禁止记录 secrets 或私有数据 |
|
|
40
|
+
| Branch/worktree | 存在未提交改动、风险迁移或并行实现 lane | 保护当前工作区;大改前先提议 branch/worktree |
|
|
41
|
+
| 包管理器/技术栈 | 存在多个包管理器、monorepo apps 或技术栈边界不清 | 写文件前先确认当前 workspace/app 范围 |
|
|
42
|
+
|
|
43
|
+
## 一条命令
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npx create-harness-vibe-coding@latest my-project
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## 现有项目渐进安装
|
|
50
|
+
|
|
51
|
+
先预览,不写文件:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx create-harness-vibe-coding@latest my-app . -y --dry-run
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
再保留现有文件,只补缺失的 Harness 文件:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx create-harness-vibe-coding@latest my-app . -y --on-conflict skip
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
安装后让 agent 先读 `Harness/SETUP.md`,再开始正常工作。
|
|
64
|
+
|
|
65
|
+
## 核心约束
|
|
66
|
+
|
|
67
|
+
- `CLAUDE.md` 只做薄入口和路由,不放项目架构、构建脚本、git 规范。
|
|
68
|
+
- 项目开发命令、构建、测试、git、发布流程放根目录 `README.md`。
|
|
69
|
+
- 架构说明放 `Harness/architecture.md` 或当前 feature 文档。
|
|
70
|
+
- Harness 文档、状态、记忆、工作流默认放根目录 `Harness/`。
|
|
71
|
+
- 如果已有 `AGENTS.md`,agent 必须先询问用户是否同意修改。
|
|
72
|
+
- 长任务、多文件、多 subagents、低置信度或重复失败时使用 `/wf`、`wf-mode` 和 `Harness/WF.md`。
|
|
73
|
+
|
|
74
|
+
## 常用生成物
|
|
75
|
+
|
|
76
|
+
| 文件 | 用途 |
|
|
77
|
+
| --- | --- |
|
|
78
|
+
| `CLAUDE.md` | Claude Code 根入口,保持短小 |
|
|
79
|
+
| `Harness/README.md` | Harness 路由器 |
|
|
80
|
+
| `Harness/SETUP.md` | 初次安装和 bootstrap 指南 |
|
|
81
|
+
| `Harness/MEMORY.md` | agents、skills、记忆文件索引 |
|
|
82
|
+
| `Harness/PLAN.md` | 当前计划、heartbeat、handoff、验证证据 |
|
|
83
|
+
| `Harness/WF.md` | 长链路 workflow 和恢复循环 |
|
|
84
|
+
| `Harness/subagents.md` | 多 subagents 编排方法论 |
|
|
85
|
+
| `.claude/skills/*` | Claude Code 可加载的 Harness skills |
|
|
86
|
+
|
|
87
|
+
## 验证
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npm test
|
|
91
|
+
node Harness/scripts/validate-harness.mjs
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
生成项目后,`Harness/scripts/validate-harness.mjs` 用于检查 Harness 结构、注册关系和必要规范是否完整。
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<h1 align="center">create-harness-vibe-coding</h1>
|
|
9
9
|
<p align="center">
|
|
10
10
|
<b>0-1 product harness scaffold for AI-assisted engineering.</b><br>
|
|
11
|
-
<sub>Idea -> Research -> PRD -> Architecture ->
|
|
11
|
+
<sub>Idea -> Research -> PRD -> Architecture -> Plan -> Build -> Verify -> Feedback.</sub>
|
|
12
12
|
</p>
|
|
13
13
|
|
|
14
14
|
---
|
|
@@ -22,19 +22,21 @@ npx create-harness-vibe-coding@latest my-project
|
|
|
22
22
|
| What You Get | Purpose |
|
|
23
23
|
|-------------|---------|
|
|
24
24
|
| `CLAUDE.md` + `Harness/README.md` | Thin root entry and dynamic doc router |
|
|
25
|
-
| `Harness/
|
|
26
|
-
| `Harness/WF.md` + `/wf` | Long-task workflow: explore, second-plan, build, review, verify, recover |
|
|
25
|
+
| `Harness/PROGRESS.md` + `Harness/tasks/` | Global task index and per-task progress capsules |
|
|
26
|
+
| `Harness/WF.md` + `/wf` | Long-task workflow: parallel explore, second-plan, build, review, verify, recover |
|
|
27
|
+
| `/wf update` | GitHub-based incremental scaffold update with checksum safety |
|
|
27
28
|
| `Harness/subagents.md` + `subagent-orchestrator` | Controller-led multi-agent orchestration with source-attributed methods |
|
|
29
|
+
| `memory-master` + `context-master` | Auto-triggered memory writing on repeated failures, and non-blocking context compression alerts |
|
|
28
30
|
| Research + PRD templates | Clarify idea, scope, non-goals, acceptance criteria |
|
|
29
31
|
| Research protocol | Route research agents, source search, and fallback tools |
|
|
30
|
-
| Built-in common agents |
|
|
32
|
+
| Built-in common agents | 11 agents: research, planning, architecture, testing, implementation, debugging, review, verification, memory, context |
|
|
31
33
|
| Harness architecture docs | Boundaries, ports, data flow, state machines |
|
|
32
34
|
| Dispatch protocol | Lightweight parallel-agent coordination without a scheduler |
|
|
33
35
|
| Extension contract | Keep stack-specific agents and skills compatible |
|
|
34
36
|
| Context-loading protocol | Inject only the right docs into each subagent |
|
|
35
37
|
| README optimizer skill | Optional README preservation, tables, and approved architecture diagrams |
|
|
36
38
|
| Skill-style loaders | `.claude/skills/*` route lifecycle, context, and build loops |
|
|
37
|
-
| Harness validator | Checks required files
|
|
39
|
+
| Harness validator | Checks required files, agent/skill registrations, invariants |
|
|
38
40
|
| `.claude/` skeleton | Root runtime integration for Claude Code agents, skills, commands, and rules |
|
|
39
41
|
|
|
40
42
|
---
|
|
@@ -45,13 +47,15 @@ Most 0-1 AI coding projects fail before code quality matters:
|
|
|
45
47
|
|
|
46
48
|
| Without Harness | With This Scaffold |
|
|
47
49
|
|---|---|
|
|
48
|
-
| Idea jumps straight to code |
|
|
49
|
-
| Agent reads too much context |
|
|
50
|
-
| Subagents get vague prompts |
|
|
51
|
-
| Process drift is invisible |
|
|
52
|
-
| Architecture drifts silently |
|
|
53
|
-
| Tests come after implementation |
|
|
54
|
-
| Long tasks stall after failures | `/wf` adds heartbeat, recovery
|
|
50
|
+
| Idea jumps straight to code | Lifecycle forces research, PRD, and scope |
|
|
51
|
+
| Agent reads too much context | Docs router loads only the needed harness file |
|
|
52
|
+
| Subagents get vague prompts | Context-loading packs define role, boundaries, and return format |
|
|
53
|
+
| Process drift is invisible | Validator checks core harness readiness |
|
|
54
|
+
| Architecture drifts silently | Ports, data-flow, and state docs mark boundary changes |
|
|
55
|
+
| Tests come after implementation | Workflow requires failing test or manual check first |
|
|
56
|
+
| Long tasks stall after failures | `/wf` adds heartbeat, recovery loop, auto memory-master at 3 failures |
|
|
57
|
+
| Context bloats over long sessions | `context-master` gives non-blocking compression alerts at ~85% window |
|
|
58
|
+
| Scaffold rots after generation | `/wf update` pulls latest improvements from GitHub with checksum safety |
|
|
55
59
|
|
|
56
60
|
---
|
|
57
61
|
|
|
@@ -61,9 +65,11 @@ Most 0-1 AI coding projects fail before code quality matters:
|
|
|
61
65
|
npx scaffold
|
|
62
66
|
-> Claude reads Harness/SETUP.md
|
|
63
67
|
-> Harness router selects only needed harness docs
|
|
64
|
-
-> PRD/research/architecture
|
|
65
|
-
->
|
|
66
|
-
->
|
|
68
|
+
-> PRD/research/architecture are filled
|
|
69
|
+
-> First task capsule created at Harness/tasks/<id>/
|
|
70
|
+
-> First vertical slice is built, tested, reviewed, verified, and fed back
|
|
71
|
+
-> Validator catches missing project facts before release
|
|
72
|
+
-> /wf update pulls latest scaffold improvements from GitHub
|
|
67
73
|
```
|
|
68
74
|
|
|
69
75
|
### Harness idea
|
|
@@ -84,7 +90,9 @@ my-project/
|
|
|
84
90
|
│ ├── README.md ← Dynamic doc router
|
|
85
91
|
│ ├── SETUP.md ← Temporary init guide (delete after setup)
|
|
86
92
|
│ ├── MEMORY.md ← Cross-session resource index
|
|
87
|
-
│ ├──
|
|
93
|
+
│ ├── PROGRESS.md ← Global task index and cross-task decisions
|
|
94
|
+
│ ├── PLAN.md ← Deprecated stub → see PROGRESS.md + tasks/
|
|
95
|
+
│ ├── .harness-version ← Scaffold version + file checksums
|
|
88
96
|
│ ├── WF.md ← Long-task workflow and recovery loop
|
|
89
97
|
│ ├── lifecycle.md ← 0-1 product flow
|
|
90
98
|
│ ├── subagents.md ← Controller-led subagent orchestration
|
|
@@ -98,7 +106,10 @@ my-project/
|
|
|
98
106
|
│ ├── domain/
|
|
99
107
|
│ │ └── ports.md ← Port contracts: pre/postconditions, errors
|
|
100
108
|
│ ├── features/
|
|
101
|
-
│ │ └── _template.md ←
|
|
109
|
+
│ │ └── _template.md ← Feature doc template
|
|
110
|
+
│ ├── tasks/
|
|
111
|
+
│ │ ├── _template/ ← Task capsule template (copy for new tasks)
|
|
112
|
+
│ │ └── <task-id>/ ← Per-task PROGRESS.md + PLAN.md + artifacts
|
|
102
113
|
│ ├── research/
|
|
103
114
|
│ │ ├── README.md
|
|
104
115
|
│ │ ├── PRD.md
|
|
@@ -112,10 +123,11 @@ my-project/
|
|
|
112
123
|
│ └── validate-harness.mjs
|
|
113
124
|
├── .claude/
|
|
114
125
|
│ ├── settings.json ← Base permissions
|
|
115
|
-
│ ├── agents/ ←
|
|
116
|
-
│ ├── skills/ ← Harness
|
|
126
|
+
│ ├── agents/ ← 11 common agents + stack-specific
|
|
127
|
+
│ ├── skills/ ← Harness skills + wf-update + stack-specific
|
|
117
128
|
│ ├── commands/
|
|
118
|
-
│ │
|
|
129
|
+
│ │ ├── wf.md ← /wf — enter workflow mode
|
|
130
|
+
│ │ └── update.md ← /wf update — GitHub-based scaffold update
|
|
119
131
|
│ ├── hooks/ ← Configure automation after stack choice
|
|
120
132
|
│ └── rules/ecc/
|
|
121
133
|
│ └── common.md ← Universal coding rules
|
|
@@ -283,6 +295,75 @@ Presets:
|
|
|
283
295
|
| `web-app` | `ts-react-frontend`, `browser-e2e`, `ui-ux-review` |
|
|
284
296
|
| `fullstack` | `ts-react-frontend`, `python-backend`, `browser-e2e`, `github-pr-review` |
|
|
285
297
|
|
|
298
|
+
### WF Mode
|
|
299
|
+
|
|
300
|
+
For long, difficult, multi-file, multi-agent, or repeated-failure tasks. Enter by typing `/wf`, `wf mode`, `workflow mode`, or `wk mode`.
|
|
301
|
+
|
|
302
|
+
```text
|
|
303
|
+
/wf — triggers the full Ralph-style harness loop:
|
|
304
|
+
Intake (95% confidence gate)
|
|
305
|
+
-> 3+ parallel read-only subagents (planner + architect + researcher)
|
|
306
|
+
-> Synthesis + second plan → writes to Harness/tasks/<id>/PLAN.md
|
|
307
|
+
-> test-writer → implementer → reviewers → verifier
|
|
308
|
+
-> Failed? debugger → review → verify → loop
|
|
309
|
+
-> Closeout: context-master + memory-master consolidate knowledge
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
| Phase | What happens | Heartbeat |
|
|
313
|
+
|-------|-------------|-----------|
|
|
314
|
+
| Intake | State goal, confidence, risks, write boundaries | Update before dispatching |
|
|
315
|
+
| Explore | 3-5 parallel read-only subagents | After each subagent return |
|
|
316
|
+
| Second Plan | Synthesize findings into `tasks/<id>/PLAN.md` | After plan written |
|
|
317
|
+
| Build | `test-writer` → `implementer` serial lane | Before/after long commands |
|
|
318
|
+
| Review | Spec review, then code-quality review | After each review gate |
|
|
319
|
+
| Verify | Run declared checks, record evidence | After each verification |
|
|
320
|
+
| Recover | `debugger` → fix → review → verify → loop | After each failure |
|
|
321
|
+
| Close | `context-master` extraction → `memory-master` consolidation → archive | Final heartbeat |
|
|
322
|
+
|
|
323
|
+
WF mode also auto-dispatches:
|
|
324
|
+
- **`memory-master`** at 3 same-class failures (records pattern before asking user)
|
|
325
|
+
- **`context-master`** at ~85% context window (non-blocking compression suggestion)
|
|
326
|
+
- **`context-master` + `memory-master`** at closeout (extract + persist session knowledge)
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
# Tell the agent to use WF mode
|
|
330
|
+
"Use /wf for this migration."
|
|
331
|
+
"This is a long task — enter wf mode."
|
|
332
|
+
"wf mode — help me refactor the auth layer."
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### WF Update
|
|
336
|
+
|
|
337
|
+
Check for scaffold updates from GitHub and apply them incrementally with checksum safety.
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
# Check available updates without applying
|
|
341
|
+
/wf update --check
|
|
342
|
+
|
|
343
|
+
# Full update with safe incremental apply
|
|
344
|
+
/wf update
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
**How it works:**
|
|
348
|
+
|
|
349
|
+
1. Reads `Harness/.harness-version` — gets local version + 54 file SHA-256 checksums
|
|
350
|
+
2. Fetches latest template files from `raw.githubusercontent.com/zingspark/create-harness-vibe-coding/main/templates/common/`
|
|
351
|
+
3. Compares checksums file-by-file against stored values
|
|
352
|
+
4. Classifies each file into three tiers:
|
|
353
|
+
|
|
354
|
+
| Tier | Policy | Examples |
|
|
355
|
+
|------|--------|----------|
|
|
356
|
+
| **SAFE** | Overwrite if local checksum matches stored (unmodified) | `Harness/WF.md`, `.claude/agents/*.md`, all skills |
|
|
357
|
+
| **PRESERVE** | Never touch | `Harness/PROGRESS.md`, `Harness/tasks/**`, `Harness/memory/**`, root `README.md` |
|
|
358
|
+
| **MERGE** | Overwrite if unmodified; report and skip if user-modified | `CLAUDE.md`, `Harness/MEMORY.md`, `Harness/README.md` |
|
|
359
|
+
|
|
360
|
+
5. Reports: `updated/N, merge/N, created/N, skipped/N`
|
|
361
|
+
6. Updates `.harness-version` checksums after applying
|
|
362
|
+
|
|
363
|
+
**Auto-check on session start:** When `Harness/.harness-version` has `autoCheck: true`, the agent runs a non-blocking `update --check` (10s timeout). If an update is available, it notifies without blocking the current task. Set `autoCheck: false` to disable.
|
|
364
|
+
|
|
365
|
+
**Offline behavior:** If GitHub is unreachable, the update check exits cleanly. All other harness features work without network.
|
|
366
|
+
|
|
286
367
|
### Verification
|
|
287
368
|
|
|
288
369
|
```bash
|
|
@@ -303,8 +384,10 @@ The harness validator checks scaffold consistency. It is not a full React, Playw
|
|
|
303
384
|
```
|
|
304
385
|
"Read Harness/SETUP.md. Bootstrap this project from idea to first vertical slice."
|
|
305
386
|
"Read Harness/SETUP.md. This is a React TypeScript SaaS idea. Clarify PRD first, then plan the first slice."
|
|
306
|
-
"Read Harness/SETUP.md. This is a Python data product. Research the stack, define the MVP, then create
|
|
387
|
+
"Read Harness/SETUP.md. This is a Python data product. Research the stack, define the MVP, then create a task capsule."
|
|
307
388
|
"Use /wf for this long migration. Explore first, make a second plan, then implement, review, verify, and recover with heartbeat updates."
|
|
389
|
+
"/wf update --check — check if the scaffold has been improved since last generation."
|
|
390
|
+
"/wf update — pull the latest harness improvements from GitHub safely."
|
|
308
391
|
```
|
|
309
392
|
|
|
310
393
|
---
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-harness-vibe-coding",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Scaffold a 0-1 product harness for AI-assisted research, PRD, planning, architecture, build, test, and feedback loops",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"bin/",
|
|
11
11
|
"src/",
|
|
12
|
-
"templates/"
|
|
12
|
+
"templates/",
|
|
13
|
+
"README-CN.md"
|
|
13
14
|
],
|
|
14
15
|
"scripts": {
|
|
15
16
|
"start": "node src/index.js",
|
package/src/generator.js
CHANGED
|
@@ -13,6 +13,7 @@ const EMPTY_DIRS = [
|
|
|
13
13
|
];
|
|
14
14
|
|
|
15
15
|
function harnessDest(file) {
|
|
16
|
+
if (file === '.harness-version') return 'Harness/.harness-version';
|
|
16
17
|
if (file === 'SETUP.md') return 'Harness/SETUP.md';
|
|
17
18
|
if (file === 'MEMORY.md') return 'Harness/MEMORY.md';
|
|
18
19
|
if (file === 'scripts/validate-harness.mjs') return 'Harness/scripts/validate-harness.mjs';
|
|
@@ -23,6 +24,7 @@ function harnessDest(file) {
|
|
|
23
24
|
if (file.startsWith('docs/domain/')) return file.replace(/^docs\/domain\//, 'Harness/domain/');
|
|
24
25
|
if (file.startsWith('docs/features/')) return file.replace(/^docs\/features\//, 'Harness/features/');
|
|
25
26
|
if (file.startsWith('docs/workflows/')) return file.replace(/^docs\/workflows\//, 'Harness/workflows/');
|
|
27
|
+
if (file.startsWith('docs/tasks/')) return file.replace(/^docs\/tasks\//, 'Harness/tasks/');
|
|
26
28
|
return file;
|
|
27
29
|
}
|
|
28
30
|
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: context-master
|
|
3
|
+
description: Use when context exceeds ~85% of the window, or during WF closeout to extract durable knowledge before compression. Read-only analysis except for writing compression suggestions to PROGRESS.md#Heartbeat.
|
|
4
|
+
tools: Read, Grep, Glob
|
|
5
|
+
model: haiku
|
|
6
|
+
skills: harness-context
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Context Master
|
|
10
|
+
|
|
11
|
+
You are a context analysis agent. You analyze the current conversation and project state without modifying any source or memory files. Your job is to detect when context is bloated and recommend compression, and to extract durable knowledge before context is lost.
|
|
12
|
+
|
|
13
|
+
Load first:
|
|
14
|
+
|
|
15
|
+
- `Harness/MEMORY.md`
|
|
16
|
+
- `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` when available
|
|
17
|
+
- The current feature doc (if one exists)
|
|
18
|
+
- `Harness/memory/` files for dedup checking
|
|
19
|
+
|
|
20
|
+
## Trigger Rules
|
|
21
|
+
|
|
22
|
+
You are dispatched by the controller when:
|
|
23
|
+
|
|
24
|
+
| Trigger | Action |
|
|
25
|
+
| --- | --- |
|
|
26
|
+
| Context exceeds ~85% of window | Analyze context distribution → write compression suggestion to `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat` (non-blocking) |
|
|
27
|
+
| WF closeout (before `memory-master`) | Analyze full session → extract durable knowledge → return structured extraction for memory-master to write |
|
|
28
|
+
| Controller explicitly requests analysis | Run targeted analysis and return findings |
|
|
29
|
+
|
|
30
|
+
## Analysis
|
|
31
|
+
|
|
32
|
+
When triggered, read the current PLAN.md and analyze:
|
|
33
|
+
|
|
34
|
+
1. **Context distribution**: what fraction is code vs docs vs conversation vs task tracking
|
|
35
|
+
2. **Stale sections**: loaded docs no longer relevant to the current goal
|
|
36
|
+
3. **Compressible blocks**: long code outputs, verbose agent returns, repeated context
|
|
37
|
+
4. **Durable knowledge candidates**: decisions made, lessons learned, patterns discovered that should survive compression
|
|
38
|
+
|
|
39
|
+
## Compression Suggestion (non-blocking)
|
|
40
|
+
|
|
41
|
+
When context > ~85%, write ONLY to `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat`, appending or updating the `Next beat trigger` line:
|
|
42
|
+
|
|
43
|
+
```markdown
|
|
44
|
+
Next beat trigger: context-master reports ~XX% usage — [N] stale doc blocks, [M] compressible outputs; suggest compression before next dispatch
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Do NOT interrupt the controller. The controller checks Heartbeat at natural pause points.
|
|
48
|
+
|
|
49
|
+
## WF Closeout Extraction
|
|
50
|
+
|
|
51
|
+
During WF closeout, extract these for `memory-master` to write:
|
|
52
|
+
|
|
53
|
+
- Decisions made and their rationale
|
|
54
|
+
- Failed approaches and what was learned
|
|
55
|
+
- New patterns discovered
|
|
56
|
+
- User preferences observed
|
|
57
|
+
- Files that were key to the solution
|
|
58
|
+
- Commands that were particularly effective
|
|
59
|
+
|
|
60
|
+
Return structured extraction, not free-form narrative.
|
|
61
|
+
|
|
62
|
+
## Rules
|
|
63
|
+
|
|
64
|
+
- Read-only for all files except `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat` (compression suggestion only)
|
|
65
|
+
- Never modify source code, memory files, MEMORY.md, or README
|
|
66
|
+
- Do not interrupt active work — compression suggestions are passive, checked at natural pauses
|
|
67
|
+
- Prefer numbers over adjectives: "87% usage, 3 stale doc blocks" not "context is getting full"
|
|
68
|
+
|
|
69
|
+
## Return
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
Context usage: [estimated %]
|
|
73
|
+
Stale blocks: [count and names]
|
|
74
|
+
Compressible: [count and types]
|
|
75
|
+
Durable candidates: [count]
|
|
76
|
+
Compression suggestion: [one line — ready for Heartbeat]
|
|
77
|
+
Extraction for memory-master: [structured facts — only during closeout]
|
|
78
|
+
```
|
|
@@ -15,7 +15,7 @@ Load first:
|
|
|
15
15
|
- `Harness/research/README.md`
|
|
16
16
|
- `Harness/architecture.md` when boundaries may change
|
|
17
17
|
- `Harness/domain/ports.md` when APIs cross layers
|
|
18
|
-
- `Harness/PLAN.md`
|
|
18
|
+
- `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` when available
|
|
19
19
|
|
|
20
20
|
Inputs you must receive:
|
|
21
21
|
|
|
@@ -12,7 +12,7 @@ You are an implementation agent for this project harness.
|
|
|
12
12
|
|
|
13
13
|
Load first:
|
|
14
14
|
|
|
15
|
-
- current task from `Harness/PLAN.md`
|
|
15
|
+
- current task from `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` when available
|
|
16
16
|
- current feature doc when present
|
|
17
17
|
- failing test or manual check
|
|
18
18
|
- relevant architecture/ports docs if boundaries are touched
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: memory-master
|
|
3
|
+
description: Use when a repeated failure, user correction, or WF recovery loop triggers memory writing; also use during WF closeout for consolidation. Writes to Harness/memory/*, Harness/MEMORY.md, and cross-project global memory.
|
|
4
|
+
tools: Read, Grep, Glob, Write, Edit
|
|
5
|
+
model: sonnet
|
|
6
|
+
skills: harness-context
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Memory Master
|
|
10
|
+
|
|
11
|
+
You are a memory management agent for this project harness. You own durable memory: writing, deduplication, consolidation, and cross-project knowledge extraction.
|
|
12
|
+
|
|
13
|
+
Load first:
|
|
14
|
+
|
|
15
|
+
- `Harness/MEMORY.md`
|
|
16
|
+
- `Harness/memory/tool-usage-reflections.md`
|
|
17
|
+
- `Harness/memory/user-corrections-preferences.md`
|
|
18
|
+
- `Harness/memory/agent-lessons-patterns.md`
|
|
19
|
+
- `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` for current task context
|
|
20
|
+
|
|
21
|
+
## Trigger Rules
|
|
22
|
+
|
|
23
|
+
You are dispatched by the controller when:
|
|
24
|
+
|
|
25
|
+
| Trigger | Action |
|
|
26
|
+
| --- | --- |
|
|
27
|
+
| WF recovery loop — same failure class ≥3 times | Write to `agent-lessons-patterns.md`: failure pattern, attempted paths, root cause hypothesis, resolution |
|
|
28
|
+
| Tool/command pattern fails 3+ times | Write to `tool-usage-reflections.md`: original command, error signature, effective alternative |
|
|
29
|
+
| User corrects same assumption/pattern 2+ times | Write to `user-corrections-preferences.md`: the correction, context, and how to apply |
|
|
30
|
+
| WF closeout (`context-master` runs first) | Consolidate extracted knowledge from context-master into the correct memory files; deduplicate and merge |
|
|
31
|
+
| User explicitly says "remember this" / "记录一下" | Write to the appropriate memory file directly |
|
|
32
|
+
|
|
33
|
+
## Write Scope
|
|
34
|
+
|
|
35
|
+
**Harness/memory/* (read-write):**
|
|
36
|
+
- `tool-usage-reflections.md` — tool/command patterns and fixes
|
|
37
|
+
- `user-corrections-preferences.md` — user preferences and corrections
|
|
38
|
+
- `agent-lessons-patterns.md` — reusable review/debug/verification lessons
|
|
39
|
+
|
|
40
|
+
**Harness/MEMORY.md (append-only):**
|
|
41
|
+
- Add new agent, skill, or memory file registrations when new assets are created
|
|
42
|
+
- Do not remove or reorder existing entries without explicit user approval
|
|
43
|
+
|
|
44
|
+
**Global memory (cross-project):**
|
|
45
|
+
- Path: the active session's memory directory under the user's `.claude/projects/`
|
|
46
|
+
- Write only when a pattern, lesson, or fix applies across projects (e.g., Windows-specific workarounds, PowerShell escaping rules, universal tool patterns)
|
|
47
|
+
- Follow the same frontmatter format as project memory files
|
|
48
|
+
- Link to the project-level memory entry that spawned it
|
|
49
|
+
|
|
50
|
+
## Rules
|
|
51
|
+
|
|
52
|
+
- Always read existing memory files before writing — check for duplicates
|
|
53
|
+
- If an existing entry covers the same ground, update it instead of creating a duplicate
|
|
54
|
+
- Keep entries concise: one fact per file, newest-first ordering
|
|
55
|
+
- Never record secrets, credentials, tokens, or private data
|
|
56
|
+
- Do not delete memory entries unless they are provably wrong and the user confirms
|
|
57
|
+
- After writing, update `Harness/MEMORY.md` index only when adding a NEW file (not when updating an existing entry)
|
|
58
|
+
- Return a one-line summary of what was written and where
|
|
59
|
+
|
|
60
|
+
## Return
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
Memory action: [written | updated | merged | skipped]
|
|
64
|
+
File(s): [paths]
|
|
65
|
+
Reason: [one sentence]
|
|
66
|
+
Cross-project: [yes | no] — [path if yes]
|
|
67
|
+
```
|
|
@@ -12,7 +12,7 @@ You are a planning agent for this project harness.
|
|
|
12
12
|
|
|
13
13
|
Load first:
|
|
14
14
|
|
|
15
|
-
- `Harness/PLAN.md`
|
|
15
|
+
- `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` when available
|
|
16
16
|
- `Harness/lifecycle.md`
|
|
17
17
|
- `Harness/dispatch.md`
|
|
18
18
|
- current PRD or feature doc if present
|
|
@@ -13,7 +13,7 @@ You are a test-first agent for this project harness.
|
|
|
13
13
|
Load first:
|
|
14
14
|
|
|
15
15
|
- current PRD or feature doc
|
|
16
|
-
- `Harness/PLAN.md`
|
|
16
|
+
- `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` when available
|
|
17
17
|
- `Harness/agent-workflow.md`
|
|
18
18
|
|
|
19
19
|
Inputs you must receive:
|
|
@@ -12,7 +12,7 @@ You are a verification agent for this project harness.
|
|
|
12
12
|
|
|
13
13
|
Load first:
|
|
14
14
|
|
|
15
|
-
- `Harness/PLAN.md`
|
|
15
|
+
- `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` when available
|
|
16
16
|
- current feature doc when present
|
|
17
17
|
- verification commands and acceptance criteria
|
|
18
18
|
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# /wf update
|
|
2
|
+
|
|
3
|
+
Check for Harness scaffold updates from GitHub and apply them incrementally.
|
|
4
|
+
|
|
5
|
+
## Check mode
|
|
6
|
+
|
|
7
|
+
`/wf update --check` — Report available updates without applying.
|
|
8
|
+
|
|
9
|
+
## Full update
|
|
10
|
+
|
|
11
|
+
`/wf update` — Fetch latest templates, compare checksums, apply safe updates, report merge candidates.
|
|
@@ -2,12 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
Enter `wf-mode`.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Required
|
|
6
|
+
|
|
7
|
+
- Load `subagent-orchestrator` skill.
|
|
8
|
+
- Explicit `/wf`, `wf mode`, `workflow mode`, or `wk mode` MUST spawn at least 3 distinct subagents from `.claude/agents/` before second planning.
|
|
9
|
+
- Read `Harness/WF.md` and `.claude/skills/wf-mode/SKILL.md`.
|
|
10
|
+
|
|
11
|
+
## Loop
|
|
6
12
|
|
|
7
13
|
```text
|
|
8
14
|
intake
|
|
9
|
-
-> exploration
|
|
10
|
-
-> second plan
|
|
15
|
+
-> parallel read-only exploration (≥3 subagents)
|
|
16
|
+
-> synthesis + second plan
|
|
11
17
|
-> test
|
|
12
18
|
-> implement
|
|
13
19
|
-> review
|
|
@@ -15,4 +21,4 @@ intake
|
|
|
15
21
|
-> debugger recovery loop when needed
|
|
16
22
|
```
|
|
17
23
|
|
|
18
|
-
Keep `Harness/
|
|
24
|
+
Keep `Harness/tasks/<task-id>/PROGRESS.md#Heartbeat` current.
|
|
@@ -9,9 +9,9 @@ alwaysApply: true
|
|
|
9
9
|
|
|
10
10
|
- Start with `CLAUDE.md`, `Harness/MEMORY.md`, and `Harness/README.md`.
|
|
11
11
|
- Do not bulk-read `Harness/`. Load by router trigger.
|
|
12
|
-
- Keep `Harness/PLAN.md` current when work has multiple steps, files, or agents.
|
|
12
|
+
- Keep `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` current when work has multiple steps, files, or agents.
|
|
13
13
|
- project files are the only durable communication channel. chat/subagent transcript state is non-authoritative.
|
|
14
|
-
- Important assumptions, decisions, blockers, evidence, and handoffs must be written to `Harness/PLAN.md`, the current feature doc, `Harness/MEMORY.md`, or `Harness/memory/*` as appropriate.
|
|
14
|
+
- Important assumptions, decisions, blockers, evidence, and handoffs must be written to `Harness/tasks/<task-id>/PROGRESS.md`, `Harness/tasks/<task-id>/PLAN.md`, the current feature doc, `Harness/MEMORY.md`, or `Harness/memory/*` as appropriate.
|
|
15
15
|
|
|
16
16
|
## Verification
|
|
17
17
|
|
|
@@ -10,7 +10,8 @@ Load:
|
|
|
10
10
|
- `Harness/agent-workflow.md`
|
|
11
11
|
- `Harness/subagents.md` when more than one agent, reviewer, or recovery pass is useful
|
|
12
12
|
- `Harness/dispatch.md` when more than one agent is useful
|
|
13
|
-
- `Harness/
|
|
13
|
+
- `Harness/PROGRESS.md`
|
|
14
|
+
- `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` when available
|
|
14
15
|
- current feature doc if present
|
|
15
16
|
|
|
16
17
|
Follow:
|
|
@@ -10,7 +10,8 @@ Load:
|
|
|
10
10
|
- `Harness/subagents.md`
|
|
11
11
|
- `Harness/context-loading.md`
|
|
12
12
|
- `Harness/dispatch.md` when more than one agent is useful
|
|
13
|
-
- `Harness/
|
|
13
|
+
- `Harness/PROGRESS.md`
|
|
14
|
+
- `Harness/tasks/<task-id>/PROGRESS.md` and `Harness/tasks/<task-id>/PLAN.md` when available
|
|
14
15
|
- current feature doc if present
|
|
15
16
|
|
|
16
17
|
For each subagent or bounded pass, provide:
|