@modus-ai/modus 0.2.4 → 0.2.5
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 +45 -4
- package/dist/cli/index.js +2 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +9 -8
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/global.js +1 -1
- package/dist/commands/global.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +0 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/status.js +2 -2
- package/dist/generators/claude.d.ts.map +1 -1
- package/dist/generators/claude.js +0 -36
- package/dist/generators/claude.js.map +1 -1
- package/dist/generators/copilot.d.ts.map +1 -1
- package/dist/generators/copilot.js +0 -1
- package/dist/generators/copilot.js.map +1 -1
- package/dist/utils/config.d.ts +32 -0
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js +10 -2
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/file-system.d.ts.map +1 -1
- package/dist/utils/file-system.js +2 -1
- package/dist/utils/file-system.js.map +1 -1
- package/package.json +1 -1
- package/schemas/knowledge-schema.yaml +111 -1
- package/templates/behavior-guard.md +165 -0
- package/templates/commands/auto.md +3 -1
- package/templates/commands/commit.md +63 -0
- package/templates/commands/harness.md +15 -8
- package/templates/commands/vibe.md +1 -1
- package/templates/knowledge-catalog.md +61 -32
- package/templates/skills/modus-agents/analyst/SKILL.md +16 -0
- package/templates/skills/modus-agents/deployer/SKILL.md +114 -62
- package/templates/skills/modus-agents/designer/SKILL.md +104 -92
- package/templates/skills/modus-agents/developer/SKILL.md +106 -67
- package/templates/skills/modus-agents/perf-auditor/SKILL.md +98 -61
- package/templates/skills/modus-agents/reviewer/SKILL.md +25 -2
- package/templates/skills/modus-agents/security-auditor/SKILL.md +111 -67
- package/templates/skills/modus-agents/skill-creator/SKILL.md +30 -12
- package/templates/skills/modus-agents/tester/SKILL.md +100 -54
- package/templates/skills/modus-auto/SKILL.md +16 -1
- package/templates/skills/modus-design-brief/SKILL.md +31 -13
- package/templates/skills/modus-harness/SKILL.md +78 -12
- package/templates/skills/modus-init/SKILL.md +783 -172
- package/templates/skills/modus-plan/SKILL.md +109 -43
- package/templates/skills/modus-spec/SKILL.md +175 -331
- package/templates/skills/modus-vibe/SKILL.md +147 -44
|
@@ -97,6 +97,19 @@ disable: false
|
|
|
97
97
|
```markdown
|
|
98
98
|
# 需求分析报告
|
|
99
99
|
|
|
100
|
+
<!--HANDOFF
|
|
101
|
+
agent: "01-analysis"
|
|
102
|
+
story_id: "{story-id}"
|
|
103
|
+
domains: ["{domain1}", "{domain2}"]
|
|
104
|
+
sprint_count: {N}
|
|
105
|
+
risk_level: "{low|medium|high}"
|
|
106
|
+
key_constraints:
|
|
107
|
+
- "{约束1,来自 constitution.hard_rules 或需求特殊限制}"
|
|
108
|
+
skill_refs:
|
|
109
|
+
- "modus-biz-{domain}@{version}"
|
|
110
|
+
gate_status: "{passed|failed}"
|
|
111
|
+
-->
|
|
112
|
+
|
|
100
113
|
## 基本信息
|
|
101
114
|
- Story ID: {id}
|
|
102
115
|
- 标题: {标题}
|
|
@@ -140,3 +153,6 @@ disable: false
|
|
|
140
153
|
- 每个风险点必须附带处理建议
|
|
141
154
|
- Sprint 计划必须可直接指导 SubAgent 02 开发,不能含糊
|
|
142
155
|
- 验收标准必须可测试(能直接写成测试用例)
|
|
156
|
+
- **HANDOFF 块必须位于文件最顶部(Markdown 注释形式)**,`gate_status` 字段不可省略
|
|
157
|
+
- `gate_status` 赋值规则:分析完整且无重大歧义 → `passed`;存在无法确认的关键信息 → `failed`(Orchestrator 会重入本 SubAgent)
|
|
158
|
+
- `risk_level` 取值:有事务/并发/数据迁移风险 → `high`;有接口变更但逻辑清晰 → `medium`;纯新增无破坏 → `low`
|
|
@@ -1,108 +1,160 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: modus-deployer
|
|
3
|
-
description: Use this skill when the Harness orchestrator needs to verify deployment after code review passes
|
|
4
|
-
allowed-tools: Read, Write, Glob, Bash
|
|
3
|
+
description: Use this skill when the Harness orchestrator needs to verify deployment after code review passes. Monitors CI/CD pipeline status, validates service health across gray environments (dev→uat→pre→prd), runs P0 smoke tests, monitors error logs for 30 minutes after go-live, pauses for human confirmation before prd. Generates 07-deploy-status.md with HANDOFF block. Triggered by modus-harness after Gate C passes.
|
|
4
|
+
allowed-tools: Read, Write, Glob, Bash
|
|
5
5
|
disable: false
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# modus-deployer(部署发布 SubAgent)
|
|
9
9
|
|
|
10
10
|
**调用方:** Harness Orchestrator(Gate C 通过后触发)
|
|
11
|
-
**输入:** `
|
|
11
|
+
**输入:** `02-sprint-contract.md` + `modus/config.yaml` 的 harness.environments 配置
|
|
12
12
|
**产出物:** `modus/plans/active/{story-id}/07-deploy-status.md`
|
|
13
13
|
|
|
14
14
|
## 职责
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
验证代码从 CI 到逐级灰度环境的部署过程,执行 P0 接口冒烟测试,监控上线后错误日志,prd 环境等待人工确认后才执行。
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
|
20
20
|
## 执行流程
|
|
21
21
|
|
|
22
|
-
### Step 1
|
|
22
|
+
### Step 1:读取部署配置
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
读取 `modus/config.yaml`:
|
|
25
|
+
```yaml
|
|
26
|
+
harness:
|
|
27
|
+
buildCommand: "mvn clean compile -q"
|
|
28
|
+
environments: [dev, uat, pre] # prd 单独人工确认
|
|
29
|
+
tapdProjectId: "{TAPD项目ID}"
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
读取 `02-sprint-contract.md` 的 `changed_files`,确认本次变更的模块范围。
|
|
33
|
+
|
|
34
|
+
### Step 2:CI 状态轮询
|
|
35
|
+
|
|
36
|
+
检查 CI/CD 流水线(如有 API/CLI 访问权限):
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# 轮询 CI 状态(每 30 秒检查一次,超时 10 分钟)
|
|
40
|
+
# 根据项目 CI 工具配置具体命令
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**若 CI 失败:**
|
|
44
|
+
```
|
|
45
|
+
❌ CI 失败,Harness 无法继续部署验证。
|
|
46
|
+
请检查:{CI 失败的 job 和错误摘要}
|
|
47
|
+
修复后重新运行 /modus:harness(断点续跑)。
|
|
48
|
+
⏸️ 等待用户处理。
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Step 3:逐环境灰度验证
|
|
52
|
+
|
|
53
|
+
按 `harness.environments` 顺序逐级验证(dev → uat → pre):
|
|
54
|
+
|
|
55
|
+
**每个环境的验证步骤:**
|
|
56
|
+
|
|
57
|
+
1. **服务健康检查:** 确认服务实例正常启动(健康检查接口返回 200)
|
|
58
|
+
2. **P0 冒烟测试:** 执行核心接口的基本功能验证(从 01-analysis.md 验收标准选取最关键的 1-3 个场景)
|
|
59
|
+
3. **错误日志监控:** 检查部署后 5 分钟内是否有新增 ERROR 日志(基线对比)
|
|
27
60
|
|
|
28
|
-
|
|
61
|
+
**冒烟测试规范:**
|
|
62
|
+
```bash
|
|
63
|
+
# 从 01-analysis.md 的验收标准提取 P0 场景
|
|
64
|
+
# 使用 curl / HTTP 客户端执行请求
|
|
65
|
+
# 验证响应码和关键字段
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**环境验证通过条件:**
|
|
69
|
+
- 健康检查接口返回 200
|
|
70
|
+
- P0 冒烟测试全部通过
|
|
71
|
+
- 5 分钟内新增 ERROR 日志数 ≤ 基线的 110%(允许少量噪音)
|
|
29
72
|
|
|
30
|
-
|
|
31
|
-
- 构建是否通过
|
|
32
|
-
- 单元测试是否通过
|
|
33
|
-
- 代码扫描是否通过
|
|
73
|
+
**环境验证失败 → 立即停止,上报 Orchestrator 等待人工介入。**
|
|
34
74
|
|
|
35
|
-
|
|
75
|
+
### Step 4:⏸️ prd 人工确认
|
|
36
76
|
|
|
37
|
-
|
|
77
|
+
pre 环境验证通过后,暂停等待人工确认:
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
✅ pre 环境验证通过
|
|
81
|
+
冒烟测试: {N}/{N} 通过
|
|
82
|
+
错误日志: 无新增 ERROR
|
|
38
83
|
|
|
39
|
-
|
|
84
|
+
⏸️ prd 部署等待人工确认:
|
|
85
|
+
|
|
86
|
+
变更摘要:
|
|
87
|
+
- 涉及模块: {模块列表}
|
|
88
|
+
- 变更文件: {N} 个
|
|
89
|
+
- 已验证环境: dev ✅ | uat ✅ | pre ✅
|
|
90
|
+
|
|
91
|
+
是否继续部署到 prd?[Y/n]
|
|
92
|
+
```
|
|
40
93
|
|
|
41
|
-
|
|
42
|
-
1. 检查服务健康状态(health check 接口)
|
|
43
|
-
2. 执行 P0 冒烟测试(来自 `01-analysis.md` 的验收 Scenario)
|
|
44
|
-
3. 查询近 15 分钟 ERROR 日志数量,与上线前基线对比
|
|
94
|
+
等待用户确认后继续。
|
|
45
95
|
|
|
46
|
-
### Step
|
|
96
|
+
### Step 5:prd 上线监控(仅在用户确认后执行)
|
|
97
|
+
|
|
98
|
+
prd 部署后监控 30 分钟:
|
|
99
|
+
- 每 5 分钟检查一次 ERROR 日志数量
|
|
100
|
+
- 若 ERROR 数量显著增加(> 基线 150%),立即告警并暂停
|
|
101
|
+
|
|
102
|
+
### Step 6:写入部署状态报告
|
|
47
103
|
|
|
48
104
|
---
|
|
49
105
|
|
|
50
106
|
## 产出物格式(07-deploy-status.md)
|
|
51
107
|
|
|
52
108
|
```markdown
|
|
53
|
-
|
|
109
|
+
<!--HANDOFF
|
|
110
|
+
agent: "07-deployer"
|
|
111
|
+
story_id: "{story-id}"
|
|
112
|
+
gate_status: "{passed|failed|pending_prd}"
|
|
113
|
+
environments_passed: ["{dev}", "{uat}", "{pre}"]
|
|
114
|
+
prd_status: "{deployed|pending|skipped}"
|
|
115
|
+
-->
|
|
116
|
+
|
|
117
|
+
# 部署状态报告 — {Story 标题}
|
|
54
118
|
|
|
55
|
-
##
|
|
56
|
-
- Story ID: {id}
|
|
119
|
+
## 部署摘要
|
|
57
120
|
- 部署时间: {YYYY-MM-DD HH:mm}
|
|
58
|
-
-
|
|
121
|
+
- 触发版本: {commit hash 或构建号}
|
|
122
|
+
- 最终状态: {✅ 全部通过 / ❌ 失败 / ⏸️ 等待 prd}
|
|
59
123
|
|
|
60
|
-
##
|
|
61
|
-
| 阶段 | 状态 | 耗时 |
|
|
62
|
-
|------|------|------|
|
|
63
|
-
| 构建 | ✅ | {N}s |
|
|
64
|
-
| 单元测试 | ✅ | {N}s |
|
|
65
|
-
| 代码扫描 | ✅ | {N}s |
|
|
124
|
+
## 环境验证结果
|
|
66
125
|
|
|
67
|
-
|
|
126
|
+
| 环境 | 健康检查 | 冒烟测试 | ERROR日志 | 结论 |
|
|
127
|
+
|-----|---------|---------|---------|-----|
|
|
128
|
+
| dev | ✅ | ✅ N/N | 无新增 | ✅ 通过 |
|
|
129
|
+
| uat | ✅ | ✅ N/N | 无新增 | ✅ 通过 |
|
|
130
|
+
| pre | ✅ | ✅ N/N | 无新增 | ✅ 通过 |
|
|
131
|
+
| prd | ⏸️ 待确认 | — | — | ⏸️ 等待人工 |
|
|
68
132
|
|
|
69
|
-
|
|
70
|
-
- 服务状态: ✅ 健康
|
|
71
|
-
- 冒烟测试: {N}/{N} 通过
|
|
72
|
-
- ERROR 日志: 上线前 {N}/h → 上线后 {N}/h({变化})
|
|
133
|
+
## 冒烟测试详情
|
|
73
134
|
|
|
74
|
-
###
|
|
75
|
-
-
|
|
76
|
-
-
|
|
135
|
+
### P0 场景:{场景名}
|
|
136
|
+
- 请求: `{HTTP Method} {path}`
|
|
137
|
+
- 响应: HTTP 200,{关键字段验证}
|
|
138
|
+
- 结果: ✅ 通过
|
|
77
139
|
|
|
78
|
-
|
|
79
|
-
- 服务状态: ✅ 健康
|
|
80
|
-
- 冒烟测试: {N}/{N} 通过
|
|
81
|
-
- ERROR 日志: 上线前 {N}/h → 上线后 {N}/h
|
|
140
|
+
## prd 监控日志(上线后 30 分钟)
|
|
82
141
|
|
|
83
|
-
|
|
84
|
-
⏸️ 等待人工确认部署
|
|
142
|
+
{prd 部署后补充}
|
|
85
143
|
|
|
86
|
-
|
|
87
|
-
- [ ] pre 环境验证通过
|
|
88
|
-
- [ ] 业务方确认冒烟通过
|
|
89
|
-
- [ ] 运维确认资源充足
|
|
144
|
+
## 部署注意事项
|
|
90
145
|
|
|
91
|
-
|
|
92
|
-
| 场景 | 接口 | 状态 |
|
|
93
|
-
|------|------|------|
|
|
94
|
-
| {验收场景1} | POST /api/v1/{path} | ✅ |
|
|
95
|
-
| {验收场景2} | GET /api/v1/{path} | ✅ |
|
|
96
|
-
|
|
97
|
-
## 结论
|
|
98
|
-
{✅ 灰度验证通过,可推进 prd 部署}
|
|
99
|
-
{❌ 灰度验证失败: {失败原因}}
|
|
146
|
+
{记录部署过程中发现的特殊情况,供知识沉淀使用}
|
|
100
147
|
```
|
|
101
148
|
|
|
149
|
+
**`gate_status` 赋值规则:**
|
|
150
|
+
- `passed`:所有非 prd 环境通过,prd 也已完成且监控正常
|
|
151
|
+
- `pending_prd`:non-prd 通过,prd 等待人工确认(正常状态)
|
|
152
|
+
- `failed`:任一环境验证失败或 prd 上线后出现 ERROR 激增
|
|
153
|
+
|
|
102
154
|
---
|
|
103
155
|
|
|
104
|
-
##
|
|
156
|
+
## 质量标准
|
|
105
157
|
|
|
106
|
-
-
|
|
107
|
-
-
|
|
108
|
-
-
|
|
158
|
+
- 冒烟测试场景必须来自 01-analysis.md 的验收标准,不得自行编造
|
|
159
|
+
- prd 环境**必须等待人工确认**,不得自动部署
|
|
160
|
+
- **HANDOFF 块必须位于文件最顶部**,Orchestrator 读取 `prd_status` 决定是否进入 ARCHIVE 阶段
|
|
@@ -1,140 +1,152 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: modus-designer
|
|
3
|
-
description: Use this skill when the Harness orchestrator needs to generate a design
|
|
3
|
+
description: Use this skill when the Harness orchestrator needs to generate a technical design brief after requirements analysis. Takes 01-analysis.md as input, prompts human for architecture decisions, and produces 01.5-design-brief.md with HANDOFF block. Contains a mandatory human confirmation pause (⏸️) for architecture choices. Triggered by modus-harness after Gate A0 passes.
|
|
4
4
|
allowed-tools: Read, Write, Glob
|
|
5
5
|
disable: false
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# modus-designer(技术方案设计 SubAgent)
|
|
9
9
|
|
|
10
|
-
**调用方:** Harness Orchestrator
|
|
11
|
-
**输入:** `
|
|
10
|
+
**调用方:** Harness Orchestrator(Gate A0 通过后触发)
|
|
11
|
+
**输入:** `01-analysis.md` + 相关业务 Skill 内容 + constitution.hard_rules
|
|
12
12
|
**产出物:** `modus/plans/active/{story-id}/01.5-design-brief.md`
|
|
13
13
|
|
|
14
14
|
## 职责
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
在需求分析(01-analysis.md)与代码开发(SubAgent 02)之间插入设计推导层,生成结构化技术方案(design-brief),消除实现时的架构歧义。包含一个**人工架构决策确认节点**(⏸️),确保关键选型由人决定,而非由 AI 自行猜测。
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
|
|
20
20
|
## 执行流程
|
|
21
21
|
|
|
22
|
-
### Step 1
|
|
22
|
+
### Step 1:读取输入
|
|
23
23
|
|
|
24
|
-
1. 读取 `
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
- 读取验收标准(Scenario 列表)
|
|
28
|
-
- 读取风险点(事务、并发、性能、安全)
|
|
24
|
+
1. 读取 `01-analysis.md`(需求分析报告)
|
|
25
|
+
2. 读取 Orchestrator 传入的业务 Skill 内容(已由 INIT 阶段加载)
|
|
26
|
+
3. 读取 `modus/config.yaml` 的 `constitution.hard_rules` 和 `tech_stack`
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
3. 读取 `modus/config.yaml` 的 `constitution` 字段
|
|
28
|
+
### Step 2:识别架构歧义点
|
|
32
29
|
|
|
33
|
-
|
|
30
|
+
基于 01-analysis.md 的影响范围和风险点,识别**需要人工确认的架构决策**:
|
|
34
31
|
|
|
35
|
-
|
|
32
|
+
**必须确认的决策类型:**
|
|
33
|
+
- 存在 2 种以上可行的技术选型(如同步 RPC vs 异步 MQ)
|
|
34
|
+
- 接口设计有破坏性变更(需确认兼容性策略)
|
|
35
|
+
- 业务 Skill 中有冲突的 `[decision]` 记录
|
|
36
|
+
- 01-analysis.md 标注 `risk_level: high` 时,并发/事务策略需确认
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
|
|
38
|
+
**不需要确认的情况(直接使用 constitution + Skill 的约束):**
|
|
39
|
+
- 技术栈已在 constitution 中明确规定
|
|
40
|
+
- 业务 Skill 中有对应场景的唯一 `[guideline]`
|
|
41
|
+
- 变更范围为纯新增、不影响现有接口/数据
|
|
42
|
+
|
|
43
|
+
### Step 3:⏸️ 人工架构决策确认
|
|
44
|
+
|
|
45
|
+
**若发现需要确认的决策点,必须暂停等待用户输入:**
|
|
42
46
|
|
|
43
|
-
**示例问题格式:**
|
|
44
47
|
```
|
|
45
|
-
|
|
48
|
+
⏸️ 设计方案需要确认以下架构决策:
|
|
46
49
|
|
|
47
|
-
1. [
|
|
48
|
-
|
|
50
|
+
1. [技术选型] {决策问题,如「批量操作是同步处理还是 MQ 异步?」}
|
|
51
|
+
- 方案 A: {技术方案 + 优劣}
|
|
52
|
+
- 方案 B: {技术方案 + 优劣}
|
|
53
|
+
- 推荐: {基于已有 Skill 知识的建议}
|
|
49
54
|
|
|
50
|
-
2. [
|
|
51
|
-
|
|
55
|
+
2. [接口兼容性] {如「旧的 createOrder v1 是否需要兼容?」}
|
|
56
|
+
- 方案 A: 保留 v1,新增 v2 → 维护两套代码
|
|
57
|
+
- 方案 B: 直接替换 v1 → 需协调调用方升级
|
|
58
|
+
- 推荐: {建议}
|
|
52
59
|
|
|
53
|
-
|
|
54
|
-
确认处理策略:{选项A} 还是 {选项B}?
|
|
60
|
+
请回答上述问题(直接告知选择 A/B 或给出具体方案),我将据此生成完整设计方案。
|
|
55
61
|
```
|
|
56
62
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
- {决策1}: {结果}
|
|
61
|
-
- {决策2}: {结果}
|
|
62
|
-
```
|
|
63
|
+
等待用户回答后继续。
|
|
64
|
+
|
|
65
|
+
**若无需确认的决策点,直接进入 Step 4(输出标注"架构决策无歧义,直接生成")。**
|
|
63
66
|
|
|
64
|
-
### Step
|
|
67
|
+
### Step 4:生成技术方案(design-brief)
|
|
65
68
|
|
|
66
|
-
|
|
67
|
-
- `mode: harness`
|
|
68
|
-
- `output_path: modus/plans/active/{story-id}/01.5-design-brief.md`
|
|
69
|
-
- `analysis_doc: 01-analysis.md 内容`
|
|
70
|
-
- `business_skills: 已加载的 Skill 内容`
|
|
71
|
-
- `constitution: constitution 字段`
|
|
72
|
-
- `arch_decisions: Step 2 确认的决策`
|
|
69
|
+
基于确认的架构决策,生成结构化技术方案文档:
|
|
73
70
|
|
|
74
|
-
|
|
71
|
+
```markdown
|
|
72
|
+
## 1. 基本信息
|
|
73
|
+
- Story ID / 需求摘要
|
|
74
|
+
- 设计时间
|
|
75
|
+
- 依赖的业务域及 Skill 版本
|
|
76
|
+
|
|
77
|
+
## 2. 业务意图摘要
|
|
78
|
+
{1-2 句话,从 01-analysis.md 提炼}
|
|
79
|
+
|
|
80
|
+
## 3. 实体与数据模型
|
|
81
|
+
- 新增/修改的 Entity 字段(含类型、约束)
|
|
82
|
+
- DB 变更(DDL 摘要)
|
|
83
|
+
- 关键枚举新增值
|
|
84
|
+
|
|
85
|
+
## 4. API / 接口合同
|
|
86
|
+
- 新增接口(路径、方法、入参、出参)
|
|
87
|
+
- 修改接口(变更前后对比)
|
|
88
|
+
- 接口兼容性策略(v1/v2 并存 or 直接替换)
|
|
89
|
+
|
|
90
|
+
## 5. 实现蓝图(分层调用链)
|
|
91
|
+
Data: {Mapper 类/方法}
|
|
92
|
+
Service: {Manager/Service 类/方法}
|
|
93
|
+
API: {Facade/Controller 类/方法}
|
|
94
|
+
MQ: {Producer/Consumer(如有)}
|
|
95
|
+
|
|
96
|
+
## 6. 边界条件与异常处理
|
|
97
|
+
- 前置校验(哪些参数必须校验,校验规则)
|
|
98
|
+
- 异常场景(并发、超时、下游失败)的处理策略
|
|
99
|
+
- 幂等策略(如有)
|
|
100
|
+
|
|
101
|
+
## 7. 代码生成提示(供 SubAgent 02 使用)
|
|
102
|
+
- 已有的关键类路径(避免重复创建)
|
|
103
|
+
- 必须使用的注解/工具类(来自 Skill guideline)
|
|
104
|
+
- 禁止的做法(来自 Skill pitfall + constitution)
|
|
105
|
+
|
|
106
|
+
## 8. 禁止事项(汇总自 constitution + Skill)
|
|
107
|
+
{逐条列出 constitution.hard_rules + 业务 Skill [pitfall] 中与本次相关的约束}
|
|
108
|
+
|
|
109
|
+
## 9. 需求-任务追踪矩阵
|
|
110
|
+
| 需求点 | 对应实现(类/方法) | Sprint | 校验方式 |
|
|
111
|
+
|--------|-----------------|--------|---------|
|
|
112
|
+
| {需求} | {类.方法()} | Sprint N | {测试/联调} |
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Step 5:写入产出物
|
|
75
116
|
|
|
76
|
-
|
|
117
|
+
将 design-brief 写入 `modus/plans/active/{story-id}/01.5-design-brief.md`,文件头部附加 HANDOFF 块。
|
|
118
|
+
|
|
119
|
+
---
|
|
77
120
|
|
|
78
|
-
|
|
121
|
+
## 产出物格式(01.5-design-brief.md)
|
|
79
122
|
|
|
80
123
|
```markdown
|
|
81
124
|
<!--HANDOFF
|
|
82
125
|
agent: "01.5-design"
|
|
83
126
|
story_id: "{story-id}"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
- "{com.company.XxxService#methodName}"
|
|
91
|
-
sprint_mapping:
|
|
92
|
-
Sprint1: "{Data层实现描述}"
|
|
93
|
-
Sprint2: "{Service层实现描述}"
|
|
94
|
-
Sprint3: "{API层实现描述}"
|
|
95
|
-
quality_check:
|
|
96
|
-
passed: {N}
|
|
97
|
-
total: 6
|
|
98
|
-
issues: ["{若有未通过项}"]
|
|
99
|
-
gate_status: "passed"
|
|
127
|
+
decisions_confirmed: {N}
|
|
128
|
+
design_sections: 9
|
|
129
|
+
gate_status: "{passed|warning|failed}"
|
|
130
|
+
key_decisions:
|
|
131
|
+
- "{已确认的架构决策摘要1}"
|
|
132
|
+
- "{已确认的架构决策摘要2}"
|
|
100
133
|
-->
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
**gate_status 判定:**
|
|
104
|
-
- `passed`:质量自检 6/6 通过
|
|
105
|
-
- `warning`:有 `⚠️ 待补充` 标注,但不阻断流程(SubAgent 02 需关注)
|
|
106
|
-
- `failed`:关键节(节 4 / 节 5)有严重缺失,需重新生成(上报 Orchestrator)
|
|
107
134
|
|
|
108
|
-
|
|
135
|
+
# 技术方案 — {Story 标题}
|
|
109
136
|
|
|
137
|
+
{design-brief 完整内容,见 Step 4}
|
|
110
138
|
```
|
|
111
|
-
✅ SubAgent 01.5 完成 → 01.5-design-brief.md
|
|
112
|
-
设计决策: {N}个 | 追踪矩阵: {N}行 | 质量自检: {N}/6
|
|
113
|
-
关键实体: {Entity1}, {Entity2}
|
|
114
|
-
接口合同: {方法签名列表(最多3个)}
|
|
115
|
-
→ Gate A0: passed,SubAgent 02 可以启动
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
---
|
|
119
139
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
├── 01-analysis.md ← SubAgent 01 产出(输入)
|
|
125
|
-
├── 01.5-design-brief.md ← 本 SubAgent 产出(含 HANDOFF)
|
|
126
|
-
└── 02-sprint-contract.md ← SubAgent 02 产出(下一步)
|
|
127
|
-
```
|
|
140
|
+
**`gate_status` 赋值规则:**
|
|
141
|
+
- `passed`:所有架构决策已确认,设计方案完整无歧义
|
|
142
|
+
- `warning`:存在低风险的未确认点,但不阻塞开发(如纯优化类决策)
|
|
143
|
+
- `failed`:存在高风险的未确认点,或用户答复后仍有歧义 → Orchestrator 重入本 SubAgent(最多 2 次)
|
|
128
144
|
|
|
129
145
|
---
|
|
130
146
|
|
|
131
|
-
##
|
|
132
|
-
|
|
133
|
-
SubAgent 02 在 Step 1 读取上下文时,**必须读取** `01.5-design-brief.md`:
|
|
134
|
-
|
|
135
|
-
1. 先读 HANDOFF 块,获取 `key_entities`、`api_contracts`、`sprint_mapping`
|
|
136
|
-
2. 再读完整内容,以节 5(实现蓝图)和节 7(代码生成提示)作为主要编码指南
|
|
137
|
-
3. 以节 8(禁止事项)作为代码审查自检列表
|
|
138
|
-
4. 以节 9(追踪矩阵)作为 Sprint 完成的验收依据
|
|
147
|
+
## 质量标准
|
|
139
148
|
|
|
140
|
-
|
|
149
|
+
- 追踪矩阵的每行须能追溯到 01-analysis.md 中的具体需求点
|
|
150
|
+
- 「禁止事项」必须包含所有与本次变更相关的 constitution.hard_rules
|
|
151
|
+
- 「实现蓝图」中的类路径必须来自 Skill 的关键文件索引或已有代码,不得凭空创造
|
|
152
|
+
- **HANDOFF 块必须位于文件最顶部**,Orchestrator 仅读此块(≤ 20 行)决策是否继续
|