create-harness-vibe-coding 0.2.0 → 0.2.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-CN.md +94 -0
- package/package.json +3 -2
- package/templates/common/.claude/skills/harness-router/SKILL.md +1 -1
- package/templates/common/.claude/skills/subagent-orchestrator/SKILL.md +4 -1
- package/templates/common/.claude/skills/wf-mode/SKILL.md +4 -2
- package/templates/common/CLAUDE.md +2 -1
- package/templates/common/SETUP.md +10 -6
- package/templates/common/docs/README.md +3 -3
- package/templates/common/docs/domain/ports.md +3 -0
- package/templates/common/docs/harness/WF.md +16 -6
- package/templates/common/docs/harness/architecture.md +31 -7
- package/templates/common/docs/harness/state-machines.md +8 -0
- package/templates/common/docs/harness/subagents.md +38 -2
- package/templates/common/scripts/validate-harness.mjs +19 -0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-harness-vibe-coding",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
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",
|
|
@@ -8,7 +8,7 @@ description: Use at the start of any task, or when unsure which harness document
|
|
|
8
8
|
1. Read `Harness/README.md`.
|
|
9
9
|
2. Identify the current situation from "Load By Task".
|
|
10
10
|
3. Apply routing priority before loading extra files:
|
|
11
|
-
- `/wf`, long, difficult, uncertain, repeated-failure, migration, architecture-heavy, browser-visible, or broad multi-agent implementation work routes to `wf-mode` first.
|
|
11
|
+
- `/wf`, `wf mode`, `workflow mode`, `wk mode`, long, difficult, uncertain, repeated-failure, migration, architecture-heavy, browser-visible, or broad multi-agent implementation work routes to `wf-mode` first.
|
|
12
12
|
- Bounded subagent-only coordination routes to `subagent-orchestrator`.
|
|
13
13
|
4. Load only the listed primary doc(s). Let `wf-mode` decide when to load subagent docs.
|
|
14
14
|
5. If the task grows, update `Harness/PLAN.md` and use `harness-context`.
|
|
@@ -12,12 +12,15 @@ Load:
|
|
|
12
12
|
- `Harness/context-loading.md`
|
|
13
13
|
- `Harness/PLAN.md`
|
|
14
14
|
- `Harness/agent-workflow.md`
|
|
15
|
-
- `Harness/WF.md` when in `/wf`, wf mode
|
|
15
|
+
- `Harness/WF.md` when in `/wf`, `wf mode`, `workflow mode`, `wk mode`, or recovery loop
|
|
16
|
+
- `.claude/agents/` roster names before choosing roles
|
|
16
17
|
|
|
17
18
|
Follow:
|
|
18
19
|
|
|
19
20
|
- The main agent is the controller. It decomposes work, writes `Harness/PLAN.md`, integrates returns, and owns final verification.
|
|
20
21
|
- Use the efficiency ladder in `Harness/subagents.md`: solo pass -> single reviewer -> parallel read-only -> serial build lane -> isolated lanes.
|
|
22
|
+
- Explicit WF/WK mode requires at least 3 distinct agents from `.claude/agents/` before second planning.
|
|
23
|
+
- Prefer the built-in roles `planner`, `researcher`, `docs-researcher`, `architect`, `test-writer`, `implementer`, `reviewer`, `debugger`, and `verifier` before inventing custom roles.
|
|
21
24
|
- Every subagent dispatch needs a complete dispatch pack: role, goal, mode, read set, write set, forbidden scope, injected docs, dependencies, expected evidence, stop condition, and return format.
|
|
22
25
|
- Prefer parallel read-only exploration first. Run writing agents serially unless write sets are disjoint and isolated.
|
|
23
26
|
- Use two review gates after implementation: spec review first, then code-quality or architecture review.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: wf-mode
|
|
3
|
-
description: Use for /wf, wf mode, workflow mode, long difficult tasks, multi-file or multi-agent work, low-confidence decisions, repeated failures, migrations, architecture-heavy changes, browser-visible work, or any task that needs exploration -> second plan -> implementation -> review -> verification -> recovery.
|
|
3
|
+
description: Use for /wf, wf mode, workflow mode, wk mode, long difficult tasks, multi-file or multi-agent work, low-confidence decisions, repeated failures, migrations, architecture-heavy changes, browser-visible work, or any task that needs exploration -> second plan -> implementation -> review -> verification -> recovery.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# WF Mode
|
|
@@ -10,7 +10,7 @@ Load:
|
|
|
10
10
|
- `Harness/WF.md`
|
|
11
11
|
- `Harness/PLAN.md`
|
|
12
12
|
- `Harness/agent-workflow.md` when implementation, review, or verification starts
|
|
13
|
-
- `Harness/subagents.md`, `Harness/dispatch.md`, and `Harness/context-loading.md` only when coordinating subagents or bounded role passes
|
|
13
|
+
- `Harness/subagents.md`, `Harness/dispatch.md`, and `Harness/context-loading.md` immediately for explicit WF/WK mode; otherwise only when coordinating subagents or bounded role passes
|
|
14
14
|
- current feature doc when one exists
|
|
15
15
|
- `Harness/workflows/browser-e2e.md` when browser-visible behavior is affected and the workflow is installed
|
|
16
16
|
|
|
@@ -31,6 +31,8 @@ intake + 95% confidence gate
|
|
|
31
31
|
Rules:
|
|
32
32
|
|
|
33
33
|
- Update `Harness/PLAN.md#Heartbeat` before long commands, after failures, before handoff, and at closeout.
|
|
34
|
+
- Explicit `/wf`, `wf mode`, `workflow mode`, or `wk mode` MUST use `subagent-orchestrator` and spawn at least 3 distinct subagents from `.claude/agents/` before second planning.
|
|
35
|
+
- Use the 7:3 collaboration bias from `Harness/WF.md`: default to multi-agent collaboration for substantial work; use solo mode only for clearly small/local tasks outside explicit WF/WK mode.
|
|
34
36
|
- Use `subagent-orchestrator` and `Harness/subagents.md` when the task has broad reading, cross-layer impact, independent review needs, or repeated failures.
|
|
35
37
|
- If subagents are unavailable, emulate the same roles as separate bounded passes.
|
|
36
38
|
- Do not claim browser/UI acceptance without real-browser evidence from Chrome DevTools, CDP, Playwright, or documented manual browser checks.
|
|
@@ -10,7 +10,7 @@ Root entry for Claude Code. Keep this file short.
|
|
|
10
10
|
- `Harness/MEMORY.md` is the memory/resource router: agents, skills, durable memories, and cross-session lessons. Follow its registrations when selecting agents/skills or recording memory.
|
|
11
11
|
- `Harness/README.md` is the task router. For every request, check `Harness/README.md#Load By Task`; if a row matches, read and follow those docs before acting.
|
|
12
12
|
- If work spans more than one step, update `Harness/PLAN.md`.
|
|
13
|
-
- Use `/wf`, `wf-mode`, or `Harness/WF.md` for long, difficult, uncertain, multi-file, or repeated-failure work.
|
|
13
|
+
- Use `/wf`, `wf-mode`, `wf mode`, `workflow mode`, `wk mode`, or `Harness/WF.md` for long, difficult, uncertain, multi-file, or repeated-failure work.
|
|
14
14
|
- Use `subagent-orchestrator` and `Harness/subagents.md` when coordinating multiple subagents.
|
|
15
15
|
- Universal rules live in `.claude/rules/ecc/common.md`.
|
|
16
16
|
- Never bulk-read `Harness/`; route through `Harness/README.md` and `Harness/MEMORY.md`.
|
|
@@ -28,6 +28,7 @@ Root entry for Claude Code. Keep this file short.
|
|
|
28
28
|
- No features beyond what was asked.
|
|
29
29
|
- No abstractions for single-use code.
|
|
30
30
|
- No unrequested flexibility, configurability, or speculative error handling.
|
|
31
|
+
- Use explicit interfaces or state models only when they protect a real boundary, clarify ownership, or make verification/recovery simpler.
|
|
31
32
|
- If a simpler approach exists, say so and prefer the smallest change that satisfies the request.
|
|
32
33
|
- If the solution is growing faster than the problem, reduce scope before coding more.
|
|
33
34
|
|
|
@@ -39,7 +39,7 @@ Claude must follow this order:
|
|
|
39
39
|
4. Read `Harness/research/README.md`, then fill `Harness/research/research-results.md` with adopted/rejected research choices.
|
|
40
40
|
5. Fill minimum architecture: `Harness/architecture.md` and one port in `Harness/domain/ports.md`.
|
|
41
41
|
6. Create the first vertical-slice plan in `Harness/PLAN.md`.
|
|
42
|
-
7. Use `Harness/subagents.md`, `Harness/context-loading.md`, and `Harness/dispatch.md` when
|
|
42
|
+
7. Use `Harness/subagents.md`, `Harness/context-loading.md`, and `Harness/dispatch.md` when explicit WF/WK mode or any spawned subagents are involved.
|
|
43
43
|
8. Fill `Harness/data-flow.md` or `Harness/state-machines.md` only when the slice changes runtime flow, failure behavior, or state.
|
|
44
44
|
9. Implement only after a failing test or manual verification step is defined.
|
|
45
45
|
10. Run `node Harness/scripts/validate-harness.mjs --strict`.
|
|
@@ -116,11 +116,13 @@ The harness validator checks for specific structural invariants. When comparing
|
|
|
116
116
|
| `README.md` | Existing README is project-owned. Preserve by default; ask whether to append only Development notes or run `readme-optimizer` for a structure pass with tables/diagrams before broad edits |
|
|
117
117
|
| `Harness/MEMORY.md` | All 9 common agents registered under `## Agents`; all common harness skills registered under `## Skills`; all 3 `Harness/memory/` files registered under `## Memory Folder`; `Harness/memory/` folder usage guidance; `Project Resource Index` in title |
|
|
118
118
|
| `.claude/rules/ecc/common.md` | `## Context` section with the durable communication invariant (`project files are the only durable communication channel`); `## Memory` section with three reflection file entries; `## Security` section |
|
|
119
|
-
| `Harness/README.md` | `## Keyword Routing` heading; `## Load By Task` table with at minimum the rows: "Adding harness to existing project", "Need implementation plan", "Need parallel agents", "Need subagents", "Need durable memory or reflection"; `## Doc Map` with `memory/` and `subagents.md` entries; the durable communication invariant text; `Harness/README.md is the primary router` |
|
|
119
|
+
| `Harness/README.md` | `## Keyword Routing` heading; `## Load By Task` table with at minimum the rows: "Need WF mode", "Adding harness to existing project", "Need implementation plan", "Need parallel agents", "Need subagents", "Need durable memory or reflection"; WF routing keywords include `/wf`, `wf mode`, `workflow mode`, and `wk mode`; explicit WF/WK output says subagent docs load immediately; `## Doc Map` with `memory/` and `subagents.md` entries; the durable communication invariant text; `Harness/README.md is the primary router` |
|
|
120
|
+
| `Harness/WF.md` | `WF mode requires multi-subagent orchestration by default`; explicit `/wf`, `wf mode`, `workflow mode`, or `wk mode` requires at least 3 distinct `.claude/agents/` subagents before second planning; `7:3 collaboration bias`; `Heartbeat Protocol` |
|
|
120
121
|
| `Harness/extension.md` | `## Non-Invasive Extension Rules` section with the "Preserve existing" rule; `## Agent Contract` section; `## Registration` section |
|
|
121
122
|
| `Harness/dispatch.md` | The durable communication invariant; common agent entries for all 9 agents; `## Handoff Format` heading |
|
|
122
123
|
| `Harness/context-loading.md` | The durable communication invariant; `Harness/README.md is the primary router`; all 10 subagent context packs (Explorer Pass, Planner, Researcher, Docs Researcher, Architect, Test Writer, Implementer, Reviewer, Debugger, Verifier) |
|
|
123
|
-
| `Harness/subagents.md` | `## Source Attribution`; `Controller Role`; `Efficiency Ladder`; `Review Gates`; source markers for `npx skills find`, `dispatching-parallel-agents`, and `subagent-driven-development` |
|
|
124
|
+
| `Harness/subagents.md` | `## Source Attribution`; `## Built-in Agent Roster`; `## WF Default Fan-Out`; `Controller Role`; `Efficiency Ladder`; `Review Gates`; `7:3 collaboration bias`; source markers for `npx skills find`, `dispatching-parallel-agents`, and `subagent-driven-development` |
|
|
125
|
+
| `Harness/architecture.md` | `## 2. Interface Decoupling`; `## 3. State Design`; `Avoid speculative abstraction`; layer constraints derived from actual project facts |
|
|
124
126
|
| `Harness/PLAN.md` | `## Current Goal`, `## Phase`, `## Success Criteria`, `## Loaded Context`, `## Tasks`, `## Parallel Dispatch`, `## Subagent Synthesis`, `## Verification` headings |
|
|
125
127
|
| `Harness/SETUP.md` | Only meaningful for fresh projects. If the project has its own onboarding docs, skip this file entirely (it is temporary). If kept, ensure the "Existing Project Bootstrap Sequence" is present. |
|
|
126
128
|
| `Harness/workflows/browser-e2e.md` (if installed as optional) | `data-testid`, `accessible labels/roles`, and `inputs, buttons, filters, rows, empty/error/loading states` requirement |
|
|
@@ -134,7 +136,7 @@ The harness validator checks for specific structural invariants. When comparing
|
|
|
134
136
|
- `.claude/skills/harness-*/SKILL.md`, `.claude/skills/wf-mode/SKILL.md`, and `.claude/skills/subagent-orchestrator/SKILL.md` — core harness skills, WF mode, and subagent orchestration
|
|
135
137
|
- `.claude/rules/ecc/common.md` — universal rules (unless the project has custom rules in this file)
|
|
136
138
|
- `.claude/settings.json` — harness settings
|
|
137
|
-
- `Harness/lifecycle.md`, `Harness/subagents.md`, `Harness/agent-workflow.md`, `Harness/architecture.md`, `Harness/data-flow.md`, `Harness/state-machines.md` — harness runtime docs
|
|
139
|
+
- `Harness/WF.md`, `Harness/lifecycle.md`, `Harness/subagents.md`, `Harness/agent-workflow.md`, `Harness/architecture.md`, `Harness/data-flow.md`, `Harness/state-machines.md` — harness runtime docs
|
|
138
140
|
- `Harness/research/*.md` — research protocol and templates
|
|
139
141
|
- `Harness/domain/ports.md` — port contract template
|
|
140
142
|
- `AGENTS.md` — agent registry; if it already exists, ask for user consent before merging or replacing it
|
|
@@ -168,8 +170,10 @@ Each template doc contains `{{PLACEHOLDER}}` markers. Below is what every placeh
|
|
|
168
170
|
|
|
169
171
|
**`Harness/architecture.md`** — Layer structure. Derive from research-results:
|
|
170
172
|
- Fill the ASCII layer diagram with actual layer names. Do NOT add layers without a proven need.
|
|
171
|
-
- `
|
|
172
|
-
- `
|
|
173
|
+
- `Interface Decoupling`: document only real boundaries and ports. Do not add speculative factories, plugin systems, generic repositories, or config layers.
|
|
174
|
+
- `State Design`: name state owners, persistence level, legal transitions, and recovery behavior for long-running workflows.
|
|
175
|
+
- `Harness Core Components`: describe each core component (Runner, Permission Policy, Event Bus, State Store, Tool Registry) in project-specific terms.
|
|
176
|
+
- `Architectural Constraints`: add project-specific non-negotiables. Keep the domain/harness purity rules.
|
|
173
177
|
|
|
174
178
|
**`Harness/domain/ports.md`** — Cross-layer contracts. One driving port + one driven port from the first slice:
|
|
175
179
|
- `{{INBOUND_PORT_1}}`: the first inbound port (e.g., "CreateOrderPort").
|
|
@@ -51,7 +51,7 @@ Keywords are retrieval hints, not project facts.
|
|
|
51
51
|
|
|
52
52
|
Load the matching row only. Add adjacent docs only when the loaded doc directly names them.
|
|
53
53
|
|
|
54
|
-
Routing priority: if a request is long, difficult, uncertain, repeated-failure, migration, architecture-heavy, browser-visible, or broad multi-agent implementation work, choose the WF row first. `wf-mode` may then delegate subagent coordination to `subagent-orchestrator`.
|
|
54
|
+
Routing priority: if a request explicitly says `/wf`, `wf mode`, `workflow mode`, or `wk mode`, or is long, difficult, uncertain, repeated-failure, migration, architecture-heavy, browser-visible, or broad multi-agent implementation work, choose the WF row first. `wf-mode` may then delegate subagent coordination to `subagent-orchestrator`.
|
|
55
55
|
|
|
56
56
|
| When to Read | Keywords | Load | Output |
|
|
57
57
|
| --- | --- | --- | --- |
|
|
@@ -59,7 +59,7 @@ Routing priority: if a request is long, difficult, uncertain, repeated-failure,
|
|
|
59
59
|
| Need market/tech direction | research, market, competitor, stack, library, pricing, policy | [research/README.md](research/README.md), [research/research-results.md](research/research-results.md) | research protocol, adopted/rejected choices |
|
|
60
60
|
| Need MVP/spec | PRD, MVP, scope, requirement, acceptance, non-goal | [research/PRD.md](research/PRD.md) | one-page PRD with verifiable acceptance criteria |
|
|
61
61
|
| Need architecture or boundaries | architecture, boundary, layer, domain, port, adapter, dependency | [architecture.md](architecture.md), [domain/ports.md](domain/ports.md) | layer map, ports, constraints |
|
|
62
|
-
| Need WF mode | wf, /wf, workflow mode, long task, difficult, stuck, repeated failure | [WF.md](WF.md), [PLAN.md](PLAN.md) | exploration plan, second plan, heartbeat, recovery loop;
|
|
62
|
+
| Need WF mode | wf, /wf, wf mode, workflow mode, wk mode, long task, difficult, stuck, repeated failure | [WF.md](WF.md), [PLAN.md](PLAN.md) | exploration plan, second plan, heartbeat, recovery loop; explicit WF/WK loads subagent docs immediately |
|
|
63
63
|
| Adding harness to existing project | existing project, onboarding, migrate, bootstrap, preserve, conflict | [extension.md](extension.md), [PLAN.md](PLAN.md), root `README.md` and package/CI files | discovered project facts, preserved config, manual registration plan |
|
|
64
64
|
| README optimization | README, docs, quickstart, install docs, architecture diagram, command table, documentation polish | root `README.md`, `.claude/skills/readme-optimizer/SKILL.md`, [PLAN.md](PLAN.md), [architecture.md](architecture.md) as needed | approved README mode, preserved sections, proposed diff plan |
|
|
65
65
|
| Need implementation plan | plan, task, write set, verify, milestone, progress | [PLAN.md](PLAN.md), [agent-workflow.md](agent-workflow.md) | tasks, write set, verification commands |
|
|
@@ -77,7 +77,7 @@ Routing priority: if a request is long, difficult, uncertain, repeated-failure,
|
|
|
77
77
|
## Gates
|
|
78
78
|
|
|
79
79
|
- Move phases in order unless the user asks for a fast lane.
|
|
80
|
-
- Use `/wf` when a task is long, difficult, uncertain, multi-file, or repeatedly failing.
|
|
80
|
+
- Use `/wf`, `wf mode`, `workflow mode`, or `wk mode` when a task is long, difficult, uncertain, multi-file, or repeatedly failing.
|
|
81
81
|
- Do not code before the PRD has MVP, non-goals, and acceptance criteria.
|
|
82
82
|
- Do not cross a layer boundary without reading `domain/ports.md` and updating architecture or ports.
|
|
83
83
|
- Before adding failure paths, read `data-flow.md`.
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
## 1. Port Classification
|
|
12
12
|
|
|
13
|
+
Create a port only for a real boundary: external service, storage, SDK, process, browser/API boundary, permission boundary, or cross-layer dependency. Do not create a port only because an interface might be useful someday.
|
|
14
|
+
|
|
13
15
|
### 1.1 Driving Ports (Inbound — external calls application)
|
|
14
16
|
|
|
15
17
|
| Port | Definition Location | Purpose |
|
|
@@ -67,6 +69,7 @@ Fill in each port using the format below:
|
|
|
67
69
|
- {{INVARIANT_1}}
|
|
68
70
|
- {{INVARIANT_2}}
|
|
69
71
|
- New ports must be defined in `domain/ports`; adapters go in `infrastructure/`.
|
|
72
|
+
- Each port needs one clear owner and at least one real caller. Avoid speculative ports without a concrete adapter or testability need.
|
|
70
73
|
|
|
71
74
|
---
|
|
72
75
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# WF Mode - Long Task Workflow
|
|
2
2
|
|
|
3
|
-
Use this when work is long, difficult, uncertain, multi-file, multi-agent, or user-triggered with `/wf`, `wf mode`, or `
|
|
3
|
+
Use this when work is long, difficult, uncertain, multi-file, multi-agent, or user-triggered with `/wf`, `wf mode`, `workflow mode`, or `wk mode`.
|
|
4
4
|
|
|
5
5
|
This is a Ralph-style harness loop: keep moving through evidence, bounded exploration, second planning, implementation, review, verification, and recovery instead of stalling on the first obstacle.
|
|
6
6
|
|
|
@@ -8,18 +8,28 @@ This is a Ralph-style harness loop: keep moving through evidence, bounded explor
|
|
|
8
8
|
|
|
9
9
|
Enter WF mode when any of these are true:
|
|
10
10
|
|
|
11
|
-
- The user explicitly says `/wf`, `wf mode`, or asks for the full workflow.
|
|
11
|
+
- The user explicitly says `/wf`, `wf mode`, `workflow mode`, `wk mode`, or asks for the full workflow.
|
|
12
12
|
- The task needs more than one step, more than three files, or more than one subsystem.
|
|
13
13
|
- The task needs research, architecture judgment, browser/API validation, or migration planning.
|
|
14
14
|
- Confidence in intent, architecture, or implementation is below 95%.
|
|
15
15
|
- The same command, test, tool, or approach fails twice.
|
|
16
16
|
|
|
17
|
+
## Multi-Subagent Requirement
|
|
18
|
+
|
|
19
|
+
WF mode requires multi-subagent orchestration by default.
|
|
20
|
+
|
|
21
|
+
- Explicit `/wf`, `wf mode`, `workflow mode`, or `wk mode` MUST spawn at least 3 distinct subagents from `.claude/agents/` before second planning unless the runtime cannot spawn subagents.
|
|
22
|
+
- Use a 7:3 collaboration bias: prefer multi-agent collaboration for long, uncertain, cross-file, cross-layer, browser/API, migration, or repeated-failure work; reserve solo mode for clearly local, low-risk, one-file tasks outside explicit WF/WK mode.
|
|
23
|
+
- Default initial fan-out: `planner`, `researcher` or `docs-researcher`, and `architect`. Add `test-writer`, `reviewer`, `debugger`, or `verifier` when the phase needs them.
|
|
24
|
+
- Record every dispatch or bounded-pass fallback in `Harness/PLAN.md#Parallel Dispatch`.
|
|
25
|
+
- If subagents are unavailable, emulate the same roles as separate bounded passes and record why the fallback was used.
|
|
26
|
+
|
|
17
27
|
## WF Loop
|
|
18
28
|
|
|
19
29
|
```text
|
|
20
30
|
Intake
|
|
21
31
|
-> confidence gate
|
|
22
|
-
-> parallel
|
|
32
|
+
-> parallel planner / researcher / docs-researcher / architect subagents
|
|
23
33
|
-> synthesis
|
|
24
34
|
-> second plan
|
|
25
35
|
-> test-writer
|
|
@@ -36,15 +46,15 @@ Intake
|
|
|
36
46
|
2. State the goal, non-goals, confidence level, known risks, and write boundaries.
|
|
37
47
|
3. Ask up to three blocking questions only when the next action cannot reach 95% confidence.
|
|
38
48
|
4. Update `Harness/PLAN.md#Heartbeat` before dispatching agents or running long commands.
|
|
39
|
-
5. Load `Harness/subagents.md` before coordinating multiple agents.
|
|
49
|
+
5. Load `Harness/subagents.md` before coordinating multiple agents; explicit WF/WK mode always coordinates multiple roles.
|
|
40
50
|
|
|
41
51
|
## Exploration
|
|
42
52
|
|
|
43
|
-
Use parallel read-only
|
|
53
|
+
Use parallel read-only subagents first. Explicit WF/WK mode starts with at least three distinct `.claude/agents/` roles before the second plan. For automatic WF triggers, default to 3-5 active agents unless the task is clearly small enough for the solo exception.
|
|
44
54
|
|
|
45
55
|
| Agent | Purpose | Writes |
|
|
46
56
|
| --- | --- | --- |
|
|
47
|
-
|
|
|
57
|
+
| `planner` | map local project facts, commands, app entry points, existing docs, and initial decomposition | none |
|
|
48
58
|
| `researcher` | product, ecosystem, dependency, and external context | none unless returning a docs patch |
|
|
49
59
|
| `docs-researcher` | official docs, SDK/API versions, browser/tool limits | none unless returning a docs patch |
|
|
50
60
|
| `architect` | boundaries, ports, data flow, state impact, migration risks | none unless returning a docs patch |
|
|
@@ -41,9 +41,33 @@
|
|
|
41
41
|
|
|
42
42
|
---
|
|
43
43
|
|
|
44
|
-
## 2.
|
|
44
|
+
## 2. Interface Decoupling
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
Use interfaces or ports to protect real boundaries, not to create abstraction for its own sake.
|
|
47
|
+
|
|
48
|
+
- Define a port when code crosses a layer, process, network, storage, SDK, browser, or permission boundary.
|
|
49
|
+
- Keep domain and application logic independent from infrastructure adapters.
|
|
50
|
+
- Pass data through explicit contracts instead of reaching into another feature's internals.
|
|
51
|
+
- Prefer direct calls inside the same cohesive module when there is only one caller, one implementation, and no boundary to protect.
|
|
52
|
+
- Avoid speculative abstraction: do not add factories, plugin systems, service locators, generic repositories, or config layers until the feature has a concrete second use or a real testability/replacement need.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 3. State Design
|
|
57
|
+
|
|
58
|
+
State must have one owner, legal transitions, and observable recovery behavior.
|
|
59
|
+
|
|
60
|
+
- Identify durable state, runtime cache, derived UI state, external system state, and audit/event history separately.
|
|
61
|
+
- Name the owner of each state slice; do not let UI, application services, and infrastructure all mutate the same state directly.
|
|
62
|
+
- Model long-running workflows with explicit states, guards, and failure transitions in `Harness/state-machines.md`.
|
|
63
|
+
- Store resumable progress and recovery decisions in `Harness/PLAN.md#Heartbeat` or project-owned durable storage, not only in chat.
|
|
64
|
+
- Keep state minimal: derive values when cheap, persist only what must survive reload, retry, or handoff.
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 4. Harness Core Components
|
|
69
|
+
|
|
70
|
+
### 4.1 Runner / Loop
|
|
47
71
|
|
|
48
72
|
- **Responsibility**: Drives a task from input to completion: loading context, calling application use-cases, handling stop conditions.
|
|
49
73
|
- **Design Decision**:
|
|
@@ -51,28 +75,28 @@
|
|
|
51
75
|
- Stop conditions are explicitly modeled — Rationale: prevents agent loops from running indefinitely or silently half-completing
|
|
52
76
|
- **Does NOT handle**: Business rules, domain object creation details, external service implementations
|
|
53
77
|
|
|
54
|
-
###
|
|
78
|
+
### 4.2 Permission Policy
|
|
55
79
|
|
|
56
80
|
- **Responsibility**: Decides whether a given tool, file, network, or external action is allowed to execute.
|
|
57
81
|
- **Design Decision**:
|
|
58
82
|
- High-risk actions are denied by default, allow rules are explicitly declared — Rationale: the platform must first guarantee security boundaries
|
|
59
83
|
- **Does NOT handle**: Judging whether a business action is correct
|
|
60
84
|
|
|
61
|
-
###
|
|
85
|
+
### 4.3 Event Bus / Audit Trail
|
|
62
86
|
|
|
63
87
|
- **Responsibility**: Records task lifecycle, tool invocations, failures, human approvals, and final results.
|
|
64
88
|
- **Design Decision**:
|
|
65
89
|
- Events are append-only, audit records cannot be overwritten in place — Rationale: facilitates replay, debugging, and post-mortem analysis
|
|
66
90
|
- **Does NOT handle**: Saving final data on behalf of business systems
|
|
67
91
|
|
|
68
|
-
###
|
|
92
|
+
### 4.4 State / Checkpoint Store
|
|
69
93
|
|
|
70
94
|
- **Responsibility**: Saves recoverable state, context summaries, task progress, and interrupt points.
|
|
71
95
|
- **Design Decision**:
|
|
72
96
|
- State format must be serializable — Rationale: enables replay, resume, testing, and migration
|
|
73
97
|
- **Does NOT handle**: Long-term business database modeling
|
|
74
98
|
|
|
75
|
-
###
|
|
99
|
+
### 4.5 Tool Registry
|
|
76
100
|
|
|
77
101
|
- **Responsibility**: Registers callable tools along with their input/output contracts, permission labels, and error semantics.
|
|
78
102
|
- **Design Decision**:
|
|
@@ -81,7 +105,7 @@
|
|
|
81
105
|
|
|
82
106
|
---
|
|
83
107
|
|
|
84
|
-
##
|
|
108
|
+
## 5. Architectural Constraints (Non-Negotiable)
|
|
85
109
|
|
|
86
110
|
- `domain/` only defines business models, business invariants, and port protocols; does not import `harness/`, `infrastructure/`, or `interfaces/`.
|
|
87
111
|
- `harness/` may orchestrate workflows, security gates, auditing, and stop conditions, but must not determine business meaning.
|
|
@@ -10,6 +10,14 @@
|
|
|
10
10
|
|
|
11
11
|
Fill out each stateful component using this format:
|
|
12
12
|
|
|
13
|
+
Before defining states, name the state owner and persistence level. State that crosses agent handoff, retry, browser session, API workflow, or release boundary must have explicit transitions; temporary derived state should stay local and should not become a new state machine.
|
|
14
|
+
|
|
15
|
+
### State Ownership
|
|
16
|
+
|
|
17
|
+
| State Slice | Owner | Persistence | Notes |
|
|
18
|
+
| --- | --- | --- | --- |
|
|
19
|
+
| `{{STATE_SLICE}}` | `{{OWNER}}` | durable / runtime / derived / external | {{NOTES}} |
|
|
20
|
+
|
|
13
21
|
### State Enumeration
|
|
14
22
|
|
|
15
23
|
| State | Description | Entry Condition | Exit Condition |
|
|
@@ -34,6 +34,42 @@ The main agent is the controller. It owns:
|
|
|
34
34
|
|
|
35
35
|
Subagents provide bounded work. They do not own final scope, architecture, release claims, or user-facing decisions.
|
|
36
36
|
|
|
37
|
+
## Built-in Agent Roster
|
|
38
|
+
|
|
39
|
+
Use the installed roster under `.claude/agents/` before inventing ad hoc roles.
|
|
40
|
+
|
|
41
|
+
| Agent | Default Use |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| `planner` | decompose goals, map unknowns, define success criteria and write sets |
|
|
44
|
+
| `researcher` | local/external ecosystem context, comparable projects, current facts |
|
|
45
|
+
| `docs-researcher` | official docs, SDK/API behavior, browser/tool constraints |
|
|
46
|
+
| `architect` | boundaries, interface decoupling, state ownership, data flow, migration risk |
|
|
47
|
+
| `test-writer` | failing tests, manual check contracts, browser/API evidence plan |
|
|
48
|
+
| `implementer` | bounded code or doc changes after the second plan |
|
|
49
|
+
| `reviewer` | spec compliance, code quality, maintainability, security, missing tests |
|
|
50
|
+
| `debugger` | reproduced failures, root cause isolation, smallest safe fix |
|
|
51
|
+
| `verifier` | command execution, real browser/API checks, final evidence |
|
|
52
|
+
|
|
53
|
+
## WF Default Fan-Out
|
|
54
|
+
|
|
55
|
+
Explicit `/wf`, `wf mode`, `workflow mode`, or `wk mode` requires at least 3 distinct agents from `.claude/agents/` before second planning.
|
|
56
|
+
|
|
57
|
+
Default starter set:
|
|
58
|
+
|
|
59
|
+
- `planner` for decomposition and local map
|
|
60
|
+
- `architect` for boundaries, interfaces, and state impact
|
|
61
|
+
- `researcher` or `docs-researcher` depending whether the unknowns are project/ecosystem facts or official tool/API behavior
|
|
62
|
+
|
|
63
|
+
Then add phase-specific agents:
|
|
64
|
+
|
|
65
|
+
- `test-writer` before implementation
|
|
66
|
+
- `implementer` for the serial write lane
|
|
67
|
+
- `reviewer` for spec and code-quality gates
|
|
68
|
+
- `debugger` after a reproduced verification failure
|
|
69
|
+
- `verifier` for final command/browser/API evidence
|
|
70
|
+
|
|
71
|
+
The default decision ratio is a 7:3 collaboration bias: choose multi-agent collaboration for substantial or uncertain work about 70% of the time; choose solo mode only for clearly local, low-risk work that is not explicitly in WF/WK mode.
|
|
72
|
+
|
|
37
73
|
## Efficiency Ladder
|
|
38
74
|
|
|
39
75
|
Choose the cheapest coordination level that is safe.
|
|
@@ -46,13 +82,13 @@ Choose the cheapest coordination level that is safe.
|
|
|
46
82
|
| Serial build lane | normal feature or fix | test-writer -> implementer -> reviewers -> verifier |
|
|
47
83
|
| Isolated lanes | disjoint write sets or competing approaches | separate worktrees, then review and merge |
|
|
48
84
|
|
|
49
|
-
Default
|
|
85
|
+
Default for automatic WF triggers: 3-5 active read-only agents before second planning. For explicit WF/WK mode, never use the solo pass unless subagents are unavailable; use bounded role passes as the recorded fallback.
|
|
50
86
|
|
|
51
87
|
## WF Orchestration Shape
|
|
52
88
|
|
|
53
89
|
```text
|
|
54
90
|
controller intake
|
|
55
|
-
-> parallel
|
|
91
|
+
-> parallel planner/researcher/docs-researcher/architect subagents
|
|
56
92
|
-> controller synthesis
|
|
57
93
|
-> second plan with dependencies and write sets
|
|
58
94
|
-> test-writer
|
|
@@ -353,9 +353,20 @@ requireText('Harness/agent-workflow.md', 'Harness/PLAN.md');
|
|
|
353
353
|
requireText('Harness/research/README.md', 'research-results.md');
|
|
354
354
|
requireText('Harness/WF.md', 'Ralph-style harness loop', 'WF loop description');
|
|
355
355
|
requireText('Harness/WF.md', 'Heartbeat Protocol', 'heartbeat protocol');
|
|
356
|
+
requireText('Harness/WF.md', 'WF mode requires multi-subagent orchestration by default', 'WF multi-subagent default');
|
|
357
|
+
requireText('Harness/WF.md', 'Explicit `/wf`, `wf mode`, `workflow mode`, or `wk mode` MUST spawn at least 3 distinct subagents', 'explicit WF/WK subagent minimum');
|
|
358
|
+
requireText('Harness/WF.md', '.claude/agents/', 'WF built-in agent roster path');
|
|
359
|
+
requireText('Harness/WF.md', '7:3 collaboration bias', 'WF collaboration bias');
|
|
360
|
+
requireText('Harness/README.md', '`/wf`, `wf mode`, `workflow mode`, or `wk mode`', 'WF/WK router aliases');
|
|
361
|
+
requireText('Harness/README.md', 'explicit WF/WK loads subagent docs immediately', 'explicit WF/WK router output');
|
|
362
|
+
requireText('.claude/skills/harness-router/SKILL.md', '`/wf`, `wf mode`, `workflow mode`, `wk mode`', 'harness-router WF/WK aliases');
|
|
356
363
|
requireText('.claude/skills/wf-mode/SKILL.md', 'Harness/WF.md', 'wf-mode loads WF document');
|
|
357
364
|
requireText('.claude/skills/wf-mode/SKILL.md', 'Harness/subagents.md', 'wf-mode loads subagent orchestration');
|
|
365
|
+
requireText('.claude/skills/wf-mode/SKILL.md', 'wk mode', 'wf-mode wk alias');
|
|
366
|
+
requireText('.claude/skills/wf-mode/SKILL.md', 'spawn at least 3 distinct subagents from `.claude/agents/`', 'wf-mode subagent minimum');
|
|
358
367
|
requireText('.claude/skills/subagent-orchestrator/SKILL.md', 'Harness/subagents.md', 'subagent-orchestrator loads subagents doc');
|
|
368
|
+
requireText('.claude/skills/subagent-orchestrator/SKILL.md', '.claude/agents/', 'subagent-orchestrator built-in agent roster path');
|
|
369
|
+
requireText('.claude/skills/subagent-orchestrator/SKILL.md', '`workflow mode`, `wk mode`', 'subagent-orchestrator WF/WK aliases');
|
|
359
370
|
requireText('.claude/skills/harness-context/SKILL.md', 'Harness/subagents.md', 'harness-context loads subagents doc');
|
|
360
371
|
requireText('.claude/skills/readme-optimizer/SKILL.md', 'README.md', 'readme-optimizer loads README');
|
|
361
372
|
requireText('.claude/skills/readme-optimizer/SKILL.md', 'Harness/architecture.md', 'readme-optimizer links architecture docs');
|
|
@@ -363,8 +374,16 @@ requireText('Harness/subagents.md', '## Source Attribution', 'subagent source at
|
|
|
363
374
|
requireText('Harness/subagents.md', 'npx skills find', 'find-skills discovery attribution');
|
|
364
375
|
requireText('Harness/subagents.md', 'superpowers:dispatching-parallel-agents', 'parallel-agent source attribution');
|
|
365
376
|
requireText('Harness/subagents.md', 'superpowers:subagent-driven-development', 'subagent-driven source attribution');
|
|
377
|
+
requireText('Harness/subagents.md', '## Built-in Agent Roster', 'built-in agent roster');
|
|
378
|
+
requireText('Harness/subagents.md', '## WF Default Fan-Out', 'WF default fan-out');
|
|
379
|
+
requireText('Harness/subagents.md', '7:3 collaboration bias', 'subagent collaboration bias');
|
|
380
|
+
requireText('Harness/subagents.md', 'parallel planner/researcher/docs-researcher/architect subagents', 'WF roster orchestration shape');
|
|
366
381
|
requireText('Harness/subagents.md', '## Efficiency Ladder', 'subagent efficiency ladder');
|
|
367
382
|
requireText('Harness/subagents.md', '## Review Gates', 'subagent review gates');
|
|
383
|
+
requireText('Harness/architecture.md', '## 2. Interface Decoupling', 'architecture interface decoupling');
|
|
384
|
+
requireText('Harness/architecture.md', '## 3. State Design', 'architecture state design');
|
|
385
|
+
requireText('Harness/architecture.md', 'Avoid speculative abstraction', 'anti-overengineering architecture rule');
|
|
386
|
+
requireText('CLAUDE.md', 'Use explicit interfaces or state models only when they protect a real boundary', 'CLAUDE interface/state simplicity rule');
|
|
368
387
|
|
|
369
388
|
if (errors.length) {
|
|
370
389
|
console.error(`Harness validation failed${strict ? ' (strict)' : ''}:`);
|