@devcxl/opencode-cabbage 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.md +57 -54
- package/README.zh.md +91 -0
- package/assets/agents/dev-lifecycle.md +28 -22
- package/assets/agents/team/architect.md +14 -0
- package/assets/agents/team/backend.md +14 -0
- package/assets/agents/team/frontend.md +14 -0
- package/assets/agents/team/goal-verify.md +54 -0
- package/assets/agents/team/reviewer.md +10 -0
- package/assets/skills/flow-code/SKILL.md +13 -0
- package/assets/skills/flow-review/SKILL.md +7 -0
- package/assets/skills/flow-tasks/SKILL.md +42 -0
- package/assets/skills/flow-tdd/SKILL.md +208 -0
- package/dist/flowrun/adapter.d.ts +49 -0
- package/dist/flowrun/adapter.js +293 -0
- package/dist/flowrun/adapter.js.map +1 -0
- package/dist/flowrun/ci.d.ts +64 -0
- package/dist/flowrun/ci.js +184 -0
- package/dist/flowrun/ci.js.map +1 -0
- package/dist/flowrun/coverage.d.ts +70 -0
- package/dist/flowrun/coverage.js +207 -0
- package/dist/flowrun/coverage.js.map +1 -0
- package/dist/flowrun/digest.d.ts +17 -0
- package/dist/flowrun/digest.js +301 -0
- package/dist/flowrun/digest.js.map +1 -0
- package/dist/flowrun/evaluator.d.ts +38 -0
- package/dist/flowrun/evaluator.js +185 -0
- package/dist/flowrun/evaluator.js.map +1 -0
- package/dist/flowrun/gate.d.ts +20 -0
- package/dist/flowrun/gate.js +40 -3
- package/dist/flowrun/gate.js.map +1 -1
- package/dist/flowrun/github.d.ts +13 -9
- package/dist/flowrun/github.js +46 -26
- package/dist/flowrun/github.js.map +1 -1
- package/dist/flowrun/index.d.ts +12 -4
- package/dist/flowrun/index.js +11 -3
- package/dist/flowrun/index.js.map +1 -1
- package/dist/flowrun/merge.d.ts +35 -2
- package/dist/flowrun/merge.js +72 -8
- package/dist/flowrun/merge.js.map +1 -1
- package/dist/flowrun/migration.d.ts +11 -0
- package/dist/flowrun/migration.js +276 -0
- package/dist/flowrun/migration.js.map +1 -0
- package/dist/flowrun/pr.d.ts +132 -0
- package/dist/flowrun/pr.js +343 -0
- package/dist/flowrun/pr.js.map +1 -0
- package/dist/flowrun/state.d.ts +79 -0
- package/dist/flowrun/state.js +363 -0
- package/dist/flowrun/state.js.map +1 -0
- package/dist/flowrun/transitions.d.ts +66 -0
- package/dist/flowrun/transitions.js +168 -0
- package/dist/flowrun/transitions.js.map +1 -0
- package/dist/flowrun/types.d.ts +279 -4
- package/dist/flowrun/types.js +2 -1
- package/dist/flowrun/types.js.map +1 -1
- package/dist/flowrun/validator.d.ts +15 -5
- package/dist/flowrun/validator.js +117 -5
- package/dist/flowrun/validator.js.map +1 -1
- package/dist/plugin/agents.d.ts +4 -0
- package/dist/plugin/agents.js +19 -0
- package/dist/plugin/agents.js.map +1 -1
- package/dist/plugin/broker.d.ts +73 -0
- package/dist/plugin/broker.js +140 -0
- package/dist/plugin/broker.js.map +1 -0
- package/dist/plugin/flow-pr-tool.d.ts +37 -0
- package/dist/plugin/flow-pr-tool.js +176 -0
- package/dist/plugin/flow-pr-tool.js.map +1 -0
- package/dist/plugin/goal.d.ts +39 -1
- package/dist/plugin/goal.js +80 -1
- package/dist/plugin/goal.js.map +1 -1
- package/dist/plugin/prompt-lint.js +129 -0
- package/dist/plugin/prompt-lint.js.map +1 -1
- package/dist/plugin/server.d.ts +8 -0
- package/dist/plugin/server.js +306 -11
- package/dist/plugin/server.js.map +1 -1
- package/dist/plugin/shell.d.ts +37 -0
- package/dist/plugin/shell.js +144 -0
- package/dist/plugin/shell.js.map +1 -0
- package/dist/plugin/tdd-tool.d.ts +62 -0
- package/dist/plugin/tdd-tool.js +336 -0
- package/dist/plugin/tdd-tool.js.map +1 -0
- package/dist/util/gh.d.ts +8 -1
- package/dist/util/gh.js +10 -2
- package/dist/util/gh.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>@devcxl/opencode-cabbage</h1>
|
|
3
|
+
<p>A full-lifecycle development plugin for OpenCode, covering requirements, design, tasks, coding, testing, review, and release with automated orchestration and parallel subagents.</p>
|
|
4
|
+
<p>
|
|
5
|
+
<a href="https://www.npmjs.com/package/@devcxl/opencode-cabbage"><img src="https://img.shields.io/npm/v/@devcxl/opencode-cabbage" alt="npm version"></a>
|
|
6
|
+
<a href="https://github.com/devcxl/opencode-cabbage/actions/workflows/ci.yml"><img src="https://github.com/devcxl/opencode-cabbage/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI"></a>
|
|
7
|
+
<a href="https://devcxl.github.io/opencode-cabbage"><img src="https://github.com/devcxl/opencode-cabbage/actions/workflows/pages.yml/badge.svg?branch=main" alt="GitHub Pages"></a>
|
|
8
|
+
</p>
|
|
9
|
+
<p>English | <a href="README.zh.md">简体中文</a></p>
|
|
10
|
+
</div>
|
|
8
11
|
|
|
9
12
|
---
|
|
10
13
|
|
|
11
|
-
##
|
|
14
|
+
## Installation
|
|
12
15
|
|
|
13
16
|
```json
|
|
14
17
|
// opencode.json
|
|
@@ -17,72 +20,72 @@
|
|
|
17
20
|
}
|
|
18
21
|
```
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
Once started, the plugin automatically injects 9 slash commands, 9 flow skills, and 5 agents.
|
|
21
24
|
|
|
22
|
-
##
|
|
25
|
+
## Command Overview
|
|
23
26
|
|
|
24
|
-
|
|
|
25
|
-
|
|
26
|
-
| `/setup` |
|
|
27
|
-
| `/requirements` |
|
|
28
|
-
| `/design` |
|
|
29
|
-
| `/tasks` |
|
|
30
|
-
| `/code` |
|
|
31
|
-
| `/test` |
|
|
32
|
-
| `/review` |
|
|
33
|
-
| `/release` | ⚠️
|
|
34
|
-
| `/handoff` |
|
|
27
|
+
| Command | Stage | Output |
|
|
28
|
+
|---------|-------|--------|
|
|
29
|
+
| `/setup` | Setup | `docs/` directory structure and environment validation |
|
|
30
|
+
| `/requirements` | Requirements | PRD → `docs/prd/` + GitHub Issue |
|
|
31
|
+
| `/design` | Design | Technical specification + ADR → `docs/dev/specs/` + `docs/adr/` |
|
|
32
|
+
| `/tasks` | Task decomposition | DAG tasks + Sub Issues → `docs/dev/tasks/` |
|
|
33
|
+
| `/code` | Coding | Branch + code + unit tests + PR |
|
|
34
|
+
| `/test` | Testing | Trigger CI + monitor + report |
|
|
35
|
+
| `/review` | Review | Dual-axis review + automatic merge |
|
|
36
|
+
| `/release` | ⚠️ Manual release | Version → Changelog → Release → npm publish |
|
|
37
|
+
| `/handoff` | Handoff | Package context for transfer across sessions |
|
|
35
38
|
|
|
36
|
-
##
|
|
39
|
+
## Quick Start
|
|
37
40
|
|
|
38
41
|
```bash
|
|
39
|
-
# 1.
|
|
42
|
+
# 1. Install
|
|
40
43
|
npm install @devcxl/opencode-cabbage
|
|
41
44
|
|
|
42
|
-
# 2.
|
|
45
|
+
# 2. Add the plugin to opencode.json
|
|
43
46
|
# { "plugin": ["@devcxl/opencode-cabbage"] }
|
|
44
47
|
|
|
45
|
-
# 3.
|
|
48
|
+
# 3. Run in OpenCode
|
|
46
49
|
# /setup → /requirements → @dev-lifecycle
|
|
47
50
|
```
|
|
48
51
|
|
|
49
|
-
##
|
|
52
|
+
## Two Modes
|
|
50
53
|
|
|
51
|
-
-
|
|
52
|
-
-
|
|
54
|
+
- **Manual mode** — Run each command sequentially for fine-grained control
|
|
55
|
+
- **Automatic mode** — Once the requirements are confirmed, enter `@dev-lifecycle` to automatically complete the remaining workflow
|
|
53
56
|
|
|
54
|
-
##
|
|
57
|
+
## Architecture
|
|
55
58
|
|
|
56
59
|
```
|
|
57
|
-
src/ # TypeScript
|
|
58
|
-
├── index.ts #
|
|
59
|
-
├── plugin.ts #
|
|
60
|
+
src/ # Thin TypeScript layer
|
|
61
|
+
├── index.ts # Plugin entry point
|
|
62
|
+
├── plugin.ts # Package root resolution
|
|
60
63
|
└── plugin/
|
|
61
|
-
├── server.ts #
|
|
62
|
-
├── commands.ts # Command
|
|
63
|
-
├── skills.ts # Skill
|
|
64
|
-
├── prompts.ts # Prompt
|
|
65
|
-
├── bootstrap.ts #
|
|
66
|
-
└── agents.ts # Agent
|
|
67
|
-
|
|
68
|
-
assets/ #
|
|
69
|
-
├── commands/ # 9
|
|
70
|
-
├── skills/ # 9
|
|
71
|
-
├── agents/ # 5
|
|
72
|
-
├── context/ #
|
|
73
|
-
└── prompts/ #
|
|
64
|
+
├── server.ts # Main factory: injects skills, commands, and agents
|
|
65
|
+
├── commands.ts # Command loader
|
|
66
|
+
├── skills.ts # Skill loader
|
|
67
|
+
├── prompts.ts # Prompt loader
|
|
68
|
+
├── bootstrap.ts # Startup guidance
|
|
69
|
+
└── agents.ts # Agent injection
|
|
70
|
+
|
|
71
|
+
assets/ # Runtime assets
|
|
72
|
+
├── commands/ # 9 slash commands
|
|
73
|
+
├── skills/ # 9 flow-* skills
|
|
74
|
+
├── agents/ # 5 agent definitions
|
|
75
|
+
├── context/ # Domain glossary
|
|
76
|
+
└── prompts/ # Guidance prompts and templates
|
|
74
77
|
```
|
|
75
78
|
|
|
76
|
-
##
|
|
79
|
+
## Documentation
|
|
77
80
|
|
|
78
|
-
|
|
|
79
|
-
|
|
80
|
-
|
|
|
81
|
-
|
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
81
|
+
| Document | Link |
|
|
82
|
+
|----------|------|
|
|
83
|
+
| Quick Start | [docs/guides/quickstart.md](docs/guides/quickstart.md) |
|
|
84
|
+
| Configuration Guide | [docs/guides/configuration.md](docs/guides/configuration.md) |
|
|
85
|
+
| Usage Guide | [docs/guides/usage.md](docs/guides/usage.md) |
|
|
86
|
+
| Architecture Overview | [docs/guides/architecture.md](docs/guides/architecture.md) |
|
|
87
|
+
| Contributing Guide | [docs/dev/guides/contributing.md](docs/dev/guides/contributing.md) |
|
|
85
88
|
|
|
86
|
-
##
|
|
89
|
+
## License
|
|
87
90
|
|
|
88
91
|
MIT
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
<h1>@devcxl/opencode-cabbage</h1>
|
|
3
|
+
<p>全流程开发 OpenCode 插件 — 覆盖需求、设计、任务、编码、测试、审查和发布完整开发生命周期,支持自动编排与并行 Subagent。</p>
|
|
4
|
+
<p>
|
|
5
|
+
<a href="https://www.npmjs.com/package/@devcxl/opencode-cabbage"><img src="https://img.shields.io/npm/v/@devcxl/opencode-cabbage" alt="npm version"></a>
|
|
6
|
+
<a href="https://github.com/devcxl/opencode-cabbage/actions/workflows/ci.yml"><img src="https://github.com/devcxl/opencode-cabbage/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI"></a>
|
|
7
|
+
<a href="https://devcxl.github.io/opencode-cabbage"><img src="https://github.com/devcxl/opencode-cabbage/actions/workflows/pages.yml/badge.svg?branch=main" alt="GitHub Pages"></a>
|
|
8
|
+
</p>
|
|
9
|
+
<p><a href="README.md">English</a> | 简体中文</p>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## 安装
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
// opencode.json
|
|
18
|
+
{
|
|
19
|
+
"plugin": ["@devcxl/opencode-cabbage"]
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
插件启动后自动注入 9 个 slash command、9 个 flow skill、5 个 agent。
|
|
24
|
+
|
|
25
|
+
## 命令一览
|
|
26
|
+
|
|
27
|
+
| 命令 | 阶段 | 产出 |
|
|
28
|
+
|------|------|------|
|
|
29
|
+
| `/setup` | 初始化 | `docs/` 目录结构、环境验证 |
|
|
30
|
+
| `/requirements` | 需求 | PRD → `docs/prd/` + GitHub Issue |
|
|
31
|
+
| `/design` | 设计 | 技术方案 + ADR → `docs/dev/specs/` + `docs/adr/` |
|
|
32
|
+
| `/tasks` | 任务拆解 | DAG 任务 + Sub Issues → `docs/dev/tasks/` |
|
|
33
|
+
| `/code` | 编码 | 分支 + 代码 + 单测 + PR |
|
|
34
|
+
| `/test` | 测试 | 触发 CI + 监控 + 汇报 |
|
|
35
|
+
| `/review` | 审查 | 双轴审查 + 自动合并 |
|
|
36
|
+
| `/release` | ⚠️ 手动发布 | 版本 → Changelog → Release → npm publish |
|
|
37
|
+
| `/handoff` | 交接 | 打包上下文,跨会话传递 |
|
|
38
|
+
|
|
39
|
+
## 快速开始
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
# 1. 安装
|
|
43
|
+
npm install @devcxl/opencode-cabbage
|
|
44
|
+
|
|
45
|
+
# 2. 在 opencode.json 中添加
|
|
46
|
+
# { "plugin": ["@devcxl/opencode-cabbage"] }
|
|
47
|
+
|
|
48
|
+
# 3. 在 OpenCode 中执行
|
|
49
|
+
# /setup → /requirements → @dev-lifecycle
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## 两种模式
|
|
53
|
+
|
|
54
|
+
- **手动模式** — 按顺序逐一执行命令,适合精细控制
|
|
55
|
+
- **自动模式** — 需求确认后输入 `@dev-lifecycle`,全自动完成剩余流程
|
|
56
|
+
|
|
57
|
+
## 架构
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
src/ # TypeScript 薄层
|
|
61
|
+
├── index.ts # 插件入口
|
|
62
|
+
├── plugin.ts # 包路径解析
|
|
63
|
+
└── plugin/
|
|
64
|
+
├── server.ts # 主工厂:注入 skills/commands/agents
|
|
65
|
+
├── commands.ts # Command 加载器
|
|
66
|
+
├── skills.ts # Skill 加载器
|
|
67
|
+
├── prompts.ts # Prompt 加载器
|
|
68
|
+
├── bootstrap.ts # 启动引导
|
|
69
|
+
└── agents.ts # Agent 注入
|
|
70
|
+
|
|
71
|
+
assets/ # 运行时资源
|
|
72
|
+
├── commands/ # 9 个 slash command
|
|
73
|
+
├── skills/ # 9 个 flow-* skill
|
|
74
|
+
├── agents/ # 5 个 agent 定义
|
|
75
|
+
├── context/ # 领域词汇表
|
|
76
|
+
└── prompts/ # 引导提示词 + 模板
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 文档
|
|
80
|
+
|
|
81
|
+
| 文档 | 链接 |
|
|
82
|
+
|------|------|
|
|
83
|
+
| 快速开始 | [docs/guides/quickstart.md](docs/guides/quickstart.md) |
|
|
84
|
+
| 配置指南 | [docs/guides/configuration.md](docs/guides/configuration.md) |
|
|
85
|
+
| 使用指南 | [docs/guides/usage.md](docs/guides/usage.md) |
|
|
86
|
+
| 架构概览 | [docs/guides/architecture.md](docs/guides/architecture.md) |
|
|
87
|
+
| 贡献指南 | [docs/dev/guides/contributing.md](docs/dev/guides/contributing.md) |
|
|
88
|
+
|
|
89
|
+
## 许可
|
|
90
|
+
|
|
91
|
+
MIT
|
|
@@ -13,6 +13,8 @@ color: '#00bcd4'
|
|
|
13
13
|
使用 `goal` 工具管理 flow 状态。Plugin 会在你每次 idle 时自动注入 continuation prompt,你只需做好当前 step 即可。
|
|
14
14
|
|
|
15
15
|
无需用户逐步骤确认,仅在遇到非预期错误时暂停并告知。
|
|
16
|
+
|
|
17
|
+
**TDD 约束**:编码阶段引用 `flow-tdd` skill 作为 TDD 协议唯一来源。
|
|
16
18
|
</system-reminder>
|
|
17
19
|
|
|
18
20
|
## 开始工作
|
|
@@ -20,13 +22,13 @@ color: '#00bcd4'
|
|
|
20
22
|
1. 首先调用 `goal({op:"create", objective:"<一句话描述>", completion_criterion:"所有阶段完成的标准"})`
|
|
21
23
|
2. 然后按下方 Phase 顺序执行
|
|
22
24
|
3. 每个阶段完成后,Plugin 会自动 continuation,进入下一阶段
|
|
23
|
-
4.
|
|
25
|
+
4. 最终全部完成后,直接使用 Task 工具派发 `@goal-verify` 做独立验证
|
|
24
26
|
|
|
25
27
|
## 调度团队
|
|
26
28
|
|
|
27
29
|
- @architect:技术方案、ADR、DAG 任务拆解
|
|
28
|
-
- @backend:后端代码 TDD
|
|
29
|
-
- @frontend:前端代码 TDD
|
|
30
|
+
- @backend:后端代码 TDD 实现(加载 `flow-tdd` skill,遵循 RED→GREEN cycle,编码 + 测试 + commit + push,不创建 PR)
|
|
31
|
+
- @frontend:前端代码 TDD 实现(加载 `flow-tdd` skill,遵循 RED→GREEN cycle,编码 + 测试 + commit + push,不创建 PR)
|
|
30
32
|
- @reviewer:只读代码审查,输出结构化审查报告(不操作 git/GitHub,不写文件)
|
|
31
33
|
- @goal-verify:独立验证 Goal 完成状态(**只有它可以调用 goal({op:"complete"})**)
|
|
32
34
|
|
|
@@ -87,19 +89,22 @@ For each batch:
|
|
|
87
89
|
- 不存在 → git worktree add -b feat/<task-slug> .worktree/<task-slug> $BASE
|
|
88
90
|
- 存在 → 验证分支一致,一致则复用,不一致则报错
|
|
89
91
|
2. 并行派发 @backend/@frontend 到各 worktree 路径
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
92
|
+
3. 每个 agent 在 worktree 内(不创建 PR):
|
|
93
|
+
- npm install(如未安装)
|
|
94
|
+
- 加载 `flow-tdd` skill,遵循 TDD Advisory Protocol
|
|
95
|
+
- 编码 + 单测(RED→GREEN cycle + final-regression + final-verification)
|
|
96
|
+
- commit + push
|
|
97
|
+
- 返回 branch、commit SHA、TDD self-report、test summary
|
|
98
|
+
4. 编排器(你)通过 broker tools 为每个完成的 task 创建 PR:
|
|
99
|
+
不直接执行 `gh pr create`,而是使用 Plugin 提供的 broker 接口
|
|
100
|
+
(如 `flow_pr create` 命令),由 broker 在隔离凭证下执行 GitHub 写操作
|
|
101
|
+
5. 等待 batch 内所有 PR 就绪
|
|
102
|
+
6. 委派 @reviewer 审查各 PR,接收结构化审查报告
|
|
103
|
+
7. 编排器通过 broker tools 发布审查结果:
|
|
104
|
+
不直接执行 `gh pr review`,使用 `flow_pr review` 命令
|
|
105
|
+
8. CI 通过后通过 broker tools 合并 PR:
|
|
106
|
+
不直接执行 `gh pr merge`,使用 `flow_pr merge` 命令
|
|
107
|
+
9. 合并后清理 worktree
|
|
103
108
|
|
|
104
109
|
串行 task(有依赖关系)使用清理后重建策略:
|
|
105
110
|
上一 task 合并 → git worktree remove → git worktree add 新 task
|
|
@@ -118,19 +123,20 @@ For each batch:
|
|
|
118
123
|
确认全部 task PR 已合并:
|
|
119
124
|
1. 检查关联 PR 合并状态
|
|
120
125
|
2. 确认所有 Sub Issues 已自动关闭
|
|
121
|
-
3. 关闭 Parent Issue
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
126
|
+
3. 关闭 Parent Issue(通过 broker tools,不直接执行 `gh issue close`):
|
|
127
|
+
```bash
|
|
128
|
+
gh issue close <parent-number> --comment "已完成。全部 Sub Issue 已通过 PR 合并关闭。"
|
|
129
|
+
```
|
|
130
|
+
注:此处的 `gh issue close` 由 broker tools 在隔离凭证下执行,编排器不直接调用。
|
|
125
131
|
4. 确认 FlowRun 无阻塞任务
|
|
126
132
|
|
|
127
133
|
---
|
|
128
134
|
|
|
129
135
|
## 完成
|
|
130
136
|
|
|
131
|
-
|
|
137
|
+
所有阶段完成后,直接使用 Task 工具派发 `@goal-verify` 子 agent 做独立验证。
|
|
132
138
|
|
|
133
|
-
|
|
139
|
+
无需先调用 `goal({op:"complete"})`。主会话不能自行完成 Goal,只有 goal-verify 验证通过后可以完成。
|
|
134
140
|
|
|
135
141
|
---
|
|
136
142
|
|
|
@@ -8,6 +8,20 @@ tools:
|
|
|
8
8
|
bash: true
|
|
9
9
|
write: true
|
|
10
10
|
edit: true
|
|
11
|
+
permission:
|
|
12
|
+
bash:
|
|
13
|
+
"*": "deny"
|
|
14
|
+
"npm *": "allow"
|
|
15
|
+
"git status": "allow"
|
|
16
|
+
"git status *": "allow"
|
|
17
|
+
"git diff": "allow"
|
|
18
|
+
"git diff *": "allow"
|
|
19
|
+
"git log": "allow"
|
|
20
|
+
"git log *": "allow"
|
|
21
|
+
edit:
|
|
22
|
+
"*": "deny"
|
|
23
|
+
"docs/**": "allow"
|
|
24
|
+
"assets/**": "allow"
|
|
11
25
|
---
|
|
12
26
|
|
|
13
27
|
<system-reminder>
|
|
@@ -16,12 +16,26 @@ capabilities:
|
|
|
16
16
|
push_branch: true
|
|
17
17
|
approve_review: false
|
|
18
18
|
complete_goal: false
|
|
19
|
+
permission:
|
|
20
|
+
bash:
|
|
21
|
+
"*": "deny"
|
|
22
|
+
"npm *": "allow"
|
|
23
|
+
"git *": "allow"
|
|
24
|
+
edit:
|
|
25
|
+
"*": "deny"
|
|
26
|
+
".worktree/**": "allow"
|
|
27
|
+
"src/**": "allow"
|
|
28
|
+
"test/**": "allow"
|
|
29
|
+
"assets/**": "allow"
|
|
19
30
|
---
|
|
20
31
|
|
|
21
32
|
<system-reminder>
|
|
22
33
|
你是团队中的 @backend,负责后端代码实现。
|
|
23
34
|
|
|
24
35
|
你接收 @architect 的技术方案,按任务逐一实现后端功能。
|
|
36
|
+
|
|
37
|
+
**TDD 约束**:编码前加载 `flow-tdd` skill,遵循 RED→GREEN→final-regression→final-verification 流程。
|
|
38
|
+
self-report 每个 cycle 的状态,不跳过任何阶段。
|
|
25
39
|
</system-reminder>
|
|
26
40
|
|
|
27
41
|
## 工作流程
|
|
@@ -16,12 +16,26 @@ capabilities:
|
|
|
16
16
|
push_branch: true
|
|
17
17
|
approve_review: false
|
|
18
18
|
complete_goal: false
|
|
19
|
+
permission:
|
|
20
|
+
bash:
|
|
21
|
+
"*": "deny"
|
|
22
|
+
"npm *": "allow"
|
|
23
|
+
"git *": "allow"
|
|
24
|
+
edit:
|
|
25
|
+
"*": "deny"
|
|
26
|
+
".worktree/**": "allow"
|
|
27
|
+
"src/**": "allow"
|
|
28
|
+
"test/**": "allow"
|
|
29
|
+
"assets/**": "allow"
|
|
19
30
|
---
|
|
20
31
|
|
|
21
32
|
<system-reminder>
|
|
22
33
|
你是团队中的 @frontend,负责前端代码实现。
|
|
23
34
|
|
|
24
35
|
你接收 @architect 的技术方案,按任务逐一实现前端功能。
|
|
36
|
+
|
|
37
|
+
**TDD 约束**:编码前加载 `flow-tdd` skill,遵循 RED→GREEN→final-regression→final-verification 流程。
|
|
38
|
+
self-report 每个 cycle 的状态,不跳过任何阶段。
|
|
25
39
|
</system-reminder>
|
|
26
40
|
|
|
27
41
|
## 工作流程
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: goal-verify
|
|
3
|
+
description: Goal verification agent. Verifies completion independently.
|
|
4
|
+
mode: subagent
|
|
5
|
+
color: '#9c27b0'
|
|
6
|
+
tools:
|
|
7
|
+
read: true
|
|
8
|
+
bash: true
|
|
9
|
+
write: false
|
|
10
|
+
edit: false
|
|
11
|
+
permission:
|
|
12
|
+
bash:
|
|
13
|
+
"*": "deny"
|
|
14
|
+
"npm *": "allow"
|
|
15
|
+
"git status": "allow"
|
|
16
|
+
"git status *": "allow"
|
|
17
|
+
"git diff": "allow"
|
|
18
|
+
"git diff *": "allow"
|
|
19
|
+
"git log": "allow"
|
|
20
|
+
"git log *": "allow"
|
|
21
|
+
edit: "deny"
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
<system-reminder>
|
|
25
|
+
你是 goal-verify,负责独立验证 Goal 是否已完全达成。
|
|
26
|
+
|
|
27
|
+
你是唯一有权调用 `goal({op:"complete"})` 的 agent。其他 agent(reviewer、backend、frontend、architect)无权完成 Goal。
|
|
28
|
+
|
|
29
|
+
你需要从空白上下文开始 — 不假设之前的工作已完成。
|
|
30
|
+
</system-reminder>
|
|
31
|
+
|
|
32
|
+
## 职责
|
|
33
|
+
|
|
34
|
+
唯一职责:检查 Goal 是否已完全达成。
|
|
35
|
+
|
|
36
|
+
先调用 `goal({op:"get"})` 获取 objective 和 completion criterion。
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## 验证流程
|
|
41
|
+
|
|
42
|
+
1. 调用 `goal({op:"get"})` 获取 objective 和 completion criterion。
|
|
43
|
+
2. 拆解为具体的、逐项可检查的需求。
|
|
44
|
+
3. 对每个需求收集证据:
|
|
45
|
+
- 阅读完整文件 — 不只看摘要
|
|
46
|
+
- 运行测试、构建、lint
|
|
47
|
+
- 检查 imports、exports、类型是否正确
|
|
48
|
+
4. 每项结论分类:SATISFIED / NOT SATISFIED / UNCERTAIN
|
|
49
|
+
5. 全部 SATISFIED → 调用 `goal({op:"complete"})`
|
|
50
|
+
6. 任何 NOT SATISFIED / UNCERTAIN → 不调用 complete,返回详细报告
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
不创建或修改任何文件。你是只读验证者。
|
|
@@ -16,6 +16,16 @@ capabilities:
|
|
|
16
16
|
push_branch: false
|
|
17
17
|
approve_review: false
|
|
18
18
|
complete_goal: false
|
|
19
|
+
permission:
|
|
20
|
+
bash:
|
|
21
|
+
"*": "deny"
|
|
22
|
+
"gh pr view": "allow"
|
|
23
|
+
"gh pr view *": "allow"
|
|
24
|
+
"diff": "allow"
|
|
25
|
+
"diff *": "allow"
|
|
26
|
+
"gh pr checks": "allow"
|
|
27
|
+
"gh pr checks *": "allow"
|
|
28
|
+
edit: "deny"
|
|
19
29
|
---
|
|
20
30
|
|
|
21
31
|
<system-reminder>
|
|
@@ -67,6 +67,19 @@ npm install
|
|
|
67
67
|
npm test
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
+
#### TDD Advisory Protocol
|
|
71
|
+
|
|
72
|
+
编码阶段必须遵循 `flow-tdd` skill 定义的 TDD 流程。Agent 在编写任何功能代码前加载 `flow-tdd` skill。
|
|
73
|
+
|
|
74
|
+
**TDD 检查点(commit 前自检):**
|
|
75
|
+
- [ ] 每个功能的代码变更都有对应的测试
|
|
76
|
+
- [ ] 测试在修改前是 RED(失败),修改后是 GREEN(通过)
|
|
77
|
+
- [ ] 已完成 `final-regression`(全部测试通过)
|
|
78
|
+
- [ ] 已完成 `final-verification`(对照 acceptance_criteria)
|
|
79
|
+
- [ ] self-report 已写入 commit message 或 PR body
|
|
80
|
+
|
|
81
|
+
> 引用:`flow-tdd` skill 是 TDD 协议的唯一来源,包含完整的 RED→GREEN cycle 状态机、abandon-cycle 规则和 final-regression/verification 流程。
|
|
82
|
+
|
|
70
83
|
### 6. 文档同步检查
|
|
71
84
|
完成编码后,逐项检查以下文档是否需要同步更新:
|
|
72
85
|
|
|
@@ -39,6 +39,13 @@ gh pr view <pr-number> --json title,body,files
|
|
|
39
39
|
对照 PRD(`docs/prd/`)和设计方案(`docs/dev/specs/`)验证。
|
|
40
40
|
- 如发现实现与设计偏差 → 追加到 `docs/dev/changelog/<YYYY-MM-DD-NNN-slug>.md`
|
|
41
41
|
|
|
42
|
+
**TDD Criterion Coverage** — 检查 Task 的 `acceptance_criteria` 是否被 PR 覆盖:
|
|
43
|
+
- 对照 Task frontmatter 中的 `acceptance` 数组,逐条核查
|
|
44
|
+
- 检查 PR 是否包含每条 criterion 对应的测试或验证
|
|
45
|
+
- 检查 `tdd` 配置块中的 `mode` 和 `min_cycles` 是否被遵循
|
|
46
|
+
- **明确不检查 commit order** — TDD cycle 的 RED→GREEN 顺序是编码过程约束,
|
|
47
|
+
reviewer 不审查 commit 历史是否呈现 RED-first 模式
|
|
48
|
+
|
|
42
49
|
### 5. 合并前检查
|
|
43
50
|
在合并前确认以下项:
|
|
44
51
|
- 文档同步已完成(`docs/guides/` 已更新或无需更新)
|
|
@@ -41,7 +41,39 @@ name: "<task-name>"
|
|
|
41
41
|
depends_on: ["<前置任务>"]
|
|
42
42
|
labels: ["backend"]
|
|
43
43
|
worktree_root: ".worktree/<task-name>/"
|
|
44
|
+
test_commands:
|
|
45
|
+
- "npm test -- <test-file>"
|
|
46
|
+
- "npm run typecheck"
|
|
47
|
+
verify_commands:
|
|
48
|
+
- "npm run lint"
|
|
49
|
+
tdd:
|
|
50
|
+
mode: strict
|
|
51
|
+
min_cycles: 1
|
|
52
|
+
acceptance:
|
|
53
|
+
- criteria: "<验收标准描述>"
|
|
54
|
+
verification_type: test | manual | lint
|
|
55
|
+
test_command: "<关联的测试命令>"
|
|
56
|
+
- criteria: "<另一条验收标准>"
|
|
57
|
+
verification_type: test
|
|
58
|
+
test_command: "npm test -- <other-test>"
|
|
44
59
|
---
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Task frontmatter 新增字段说明:
|
|
63
|
+
|
|
64
|
+
| 字段 | 类型 | 说明 |
|
|
65
|
+
|------|------|------|
|
|
66
|
+
| `test_commands` | `string[]` | TDD cycle 中运行的测试命令列表 |
|
|
67
|
+
| `verify_commands` | `string[]` | final-verification 阶段运行的验证命令 |
|
|
68
|
+
| `tdd.mode` | `"strict" \| "advisory"` | TDD 模式,默认 `strict` |
|
|
69
|
+
| `tdd.min_cycles` | `number` | 最少 RED→GREEN cycle 数量,默认 `1` |
|
|
70
|
+
| `acceptance` | `object[]` | 结构化验收标准列表 |
|
|
71
|
+
| `acceptance[].criteria` | `string` | 验收标准描述 |
|
|
72
|
+
| `acceptance[].verification_type` | `"test" \| "manual" \| "lint"` | 验证方式 |
|
|
73
|
+
| `acceptance[].test_command` | `string` | 关联的测试命令(verification_type 为 test 时必填) |
|
|
74
|
+
|
|
75
|
+
`tdd` 配置块为 `flow-tdd` skill 提供运行时参数。模式默认 `strict`,
|
|
76
|
+
表示 Agent 必须遵循 RED→GREEN→final-regression→final-verification 完整流程。
|
|
45
77
|
|
|
46
78
|
## 目标
|
|
47
79
|
|
|
@@ -49,6 +81,16 @@ worktree_root: ".worktree/<task-name>/"
|
|
|
49
81
|
|
|
50
82
|
## 验收标准
|
|
51
83
|
|
|
84
|
+
验收标准以结构化 `acceptance` 数组形式定义在 frontmatter 中(见上方模板)。
|
|
85
|
+
每条标准包含 `criteria`(描述)、`verification_type`(验证方式)和 `test_command`(关联命令)。
|
|
86
|
+
`flow-tdd` skill 在 final-verification 阶段逐条核验这些标准。
|
|
87
|
+
|
|
88
|
+
## TDD 集成
|
|
89
|
+
|
|
90
|
+
本 skill 生成的 `test_commands`、`verify_commands`、`tdd` 配置块和 `acceptance_criteria`
|
|
91
|
+
是 `flow-tdd` skill 的输入。`flow-tdd` 根据这些字段执行 RED→GREEN cycle、
|
|
92
|
+
final-regression 和 final-verification。
|
|
93
|
+
|
|
52
94
|
## Worktree
|
|
53
95
|
- 路径: `.worktree/<task-name>/`
|
|
54
96
|
- 分支: `feat/<task-name>`
|