@modus-ai/modus 0.2.11 → 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/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +8 -3
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.d.ts +37 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +215 -0
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +9 -3
- package/dist/commands/status.js.map +1 -1
- package/dist/generators/claude.d.ts +4 -2
- package/dist/generators/claude.d.ts.map +1 -1
- package/dist/generators/claude.js +17 -8
- package/dist/generators/claude.js.map +1 -1
- package/dist/generators/codebuddy.d.ts.map +1 -1
- package/dist/generators/codebuddy.js +5 -1
- package/dist/generators/codebuddy.js.map +1 -1
- package/dist/generators/codex.d.ts.map +1 -1
- package/dist/generators/codex.js +4 -4
- package/dist/generators/codex.js.map +1 -1
- package/dist/generators/continue.d.ts +3 -2
- package/dist/generators/continue.d.ts.map +1 -1
- package/dist/generators/continue.js +11 -5
- package/dist/generators/continue.js.map +1 -1
- package/dist/generators/copilot.d.ts.map +1 -1
- package/dist/generators/copilot.js +3 -2
- package/dist/generators/copilot.js.map +1 -1
- package/dist/generators/cursor.d.ts +4 -3
- package/dist/generators/cursor.d.ts.map +1 -1
- package/dist/generators/cursor.js +15 -10
- package/dist/generators/cursor.js.map +1 -1
- package/dist/generators/custom.d.ts +2 -2
- package/dist/generators/custom.js +1 -1
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +7 -0
- package/dist/generators/index.js.map +1 -1
- package/dist/generators/modus.d.ts +12 -0
- package/dist/generators/modus.d.ts.map +1 -0
- package/dist/generators/modus.js +225 -0
- package/dist/generators/modus.js.map +1 -0
- package/package.json +1 -1
- package/schemas/harness-schema.yaml +13 -13
- package/templates/agents/modus-analyst.md +2 -2
- package/templates/agents/modus-deployer.md +1 -1
- package/templates/agents/modus-designer.md +1 -1
- package/templates/agents/modus-developer.md +1 -1
- package/templates/agents/modus-perf-auditor.md +1 -1
- package/templates/agents/modus-reviewer.md +1 -1
- package/templates/agents/modus-security-auditor.md +1 -1
- package/templates/agents/modus-skill-creator.md +1 -1
- package/templates/agents/modus-tester.md +1 -1
- package/templates/commands/auto.md +3 -1
- package/templates/commands/commit.md +11 -5
- package/templates/commands/cr.md +14 -10
- package/templates/commands/harness.md +27 -18
- package/templates/commands/init.md +56 -23
- package/templates/commands/modus.md +33 -11
- package/templates/commands/plan.md +23 -19
- package/templates/commands/spec.md +30 -17
- package/templates/commands/upgrade.md +50 -38
- package/templates/commands/vibe.md +30 -20
- package/templates/domain-business-readme.md +69 -0
- package/templates/domain-code/SKILL.md +94 -0
- package/templates/domain-code/apis.md +48 -0
- package/templates/domain-code/data-models.md +57 -0
- package/templates/domain-code/entities.md +45 -0
- package/templates/domain-code/services.md +51 -0
- package/templates/domain-history-readme.md +60 -0
- package/templates/domain-scenarios-readme.md +58 -0
- package/templates/knowledge-base-map.md +78 -0
- package/templates/knowledge-base-service-graph.md +100 -0
- package/templates/knowledge-catalog.md +38 -43
- package/templates/paths-v4.md +156 -0
- package/templates/rules/modus-workflow/RULE.mdc +45 -38
- package/templates/skills/modus-agents/analyst/SKILL.md +1 -1
- package/templates/skills/modus-agents/developer/SKILL.md +1 -1
- package/templates/skills/modus-agents/reviewer/SKILL.md +1 -1
- package/templates/skills/modus-agents/skill-creator/SKILL.md +3 -3
- package/templates/skills/modus-auto/SKILL.md +19 -19
- package/templates/skills/modus-cr/SKILL.md +1 -1
- package/templates/skills/modus-design-brief/SKILL.md +3 -3
- package/templates/skills/modus-harness/SKILL.md +5 -5
- package/templates/skills/modus-init/SKILL.md +64 -64
- package/templates/skills/modus-init/shared/frontmatter-spec.md +2 -2
- package/templates/skills/modus-init/shared/stack-detection.md +1 -1
- package/templates/skills/modus-init/strategies/fallback-init.md +1 -1
- package/templates/skills/modus-plan/SKILL.md +6 -6
- package/templates/skills/modus-platform/SKILL.md +1 -1
- package/templates/skills/modus-spec/SKILL.md +1 -1
- package/templates/skills/modus-vibe/SKILL.md +10 -10
- package/templates/template/analysis.md +83 -0
- package/templates/template/design.md +160 -0
- package/templates/template/pid.md +97 -0
- package/templates/template/plan.md +91 -0
- package/templates/template/spec.md +78 -0
- package/templates/template/sprint-contract.md +101 -0
package/templates/commands/cr.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# /modus:cr — 代码评审(含文档一致性检查)
|
|
2
2
|
|
|
3
|
-
**用途:**
|
|
3
|
+
**用途:** 基于技术方案文档(`design.md` / `plan.md`)和可选的 PRD,对代码变更进行「文档-代码一致性检查」与「代码质量 CR」,输出分级问题报告,可选自动创建 TAPD Bug 单。
|
|
4
|
+
|
|
5
|
+
> **路径范式版本:v4.0**(详见 `templates/paths-v4.md`)
|
|
4
6
|
|
|
5
7
|
**借鉴自:** speckit.analyze(文档一致性自检)+ modus-reviewer(代码质量 CR 框架)+ opsx:apply(contextFiles 上下文加载)
|
|
6
8
|
|
|
@@ -20,9 +22,10 @@
|
|
|
20
22
|
## 使用示例
|
|
21
23
|
|
|
22
24
|
```
|
|
23
|
-
/modus:cr --doc modus/
|
|
24
|
-
/modus:cr --doc modus/
|
|
25
|
-
/modus:cr --doc "modus/
|
|
25
|
+
/modus:cr --doc modus/artifacts/{story_id}/design/design.md
|
|
26
|
+
/modus:cr --doc modus/artifacts/{story_id}/design/design.md --story https://tapd.cn/.../123
|
|
27
|
+
/modus:cr --doc "modus/artifacts/{story_id}/design/design.md modus/artifacts/{story_id}/code/plan.md"
|
|
28
|
+
/modus:cr --doc modus/plans/batch-export/design.md # 独立模式(不关联 Story)
|
|
26
29
|
/modus:cr --quick --diff src/order/
|
|
27
30
|
/modus:cr --doc modus/plans/refactor/design.md --diff src/payment/
|
|
28
31
|
```
|
|
@@ -39,12 +42,13 @@
|
|
|
39
42
|
⑥ 可选:自动创建 TAPD Bug 单(需配置 tapdProjectId)
|
|
40
43
|
```
|
|
41
44
|
|
|
42
|
-
##
|
|
45
|
+
## 产出物(v4.0)
|
|
43
46
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
**关联 Story时**:写入 `modus/artifacts/{story_id}/code/cr-report.md`
|
|
48
|
+
|
|
49
|
+
**独立模式**:写入 `modus/cr/{YYYYMMDD}-{feature-name}/cr-report.md`
|
|
50
|
+
|
|
51
|
+
报告格式与HANDOFF 一致,含一致性摘要 + P1/P2/P3 分级问题列表。
|
|
48
52
|
|
|
49
53
|
## 与 harness 内置 CR 的对比
|
|
50
54
|
|
|
@@ -71,4 +75,4 @@ modus/cr/{YYYYMMDD}-{feature-name}/
|
|
|
71
75
|
|
|
72
76
|
## 执行此命令
|
|
73
77
|
|
|
74
|
-
读取并执行 `.
|
|
78
|
+
读取并执行 `.modus/skills/modus-cr/SKILL.md` 中的完整流程(中性源;各平台目录为引用桩)。
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# /modus:harness — 双 Loop 全自动开发流程
|
|
2
2
|
|
|
3
|
-
**用途:** 输入 TAPD Story URL
|
|
3
|
+
**用途:** 输入 TAPD Story URL,自动执行从需求澄清、设计、开发到部署验证的完整开发流程。8 个专业 SubAgent 分工协作,双 Loop 质量闭环,最终将开发经验自动沉淀到知识库。
|
|
4
|
+
|
|
5
|
+
> **路径范式版本:v4.0**(产出物废 `modus/plans/active/`,统一使用 `modus/artifacts/{story_id}/` 按 pid/design/code/archive 划分子目录;详见 `templates/paths-v4.md`)
|
|
4
6
|
|
|
5
7
|
**借鉴自:** GitHub Actions Job/Step/Gate 模型 + Devin 多步骤 Agent 架构
|
|
6
8
|
|
|
@@ -50,13 +52,14 @@
|
|
|
50
52
|
|
|
51
53
|
```
|
|
52
54
|
Loop 1(生产层)
|
|
53
|
-
INIT: SubAgent 00 知识注入(更新相关
|
|
54
|
-
SA 01:
|
|
55
|
-
SA
|
|
55
|
+
INIT: SubAgent 00 知识注入(更新相关 domain 知识至最新)
|
|
56
|
+
SA 01: 需求澄清 → modus/artifacts/{story_id}/pid/prd.md + dialog/
|
|
57
|
+
SA 01.5: 设计评审 → modus/artifacts/{story_id}/design/design.md
|
|
58
|
+
SA 02: 代码开发 → modus/artifacts/{story_id}/code/sprint-contract.md + 代码变更
|
|
56
59
|
Gate A: 编译验证(mvn clean compile)→ 失败重入 SA 02,最多 3 次
|
|
57
60
|
SA 03+04+05: 并行(测试/性能/安全)
|
|
58
61
|
Gate B: 三份报告全部 complete
|
|
59
|
-
SA 06: 代码评审 → cr-report.md
|
|
62
|
+
SA 06: 代码评审 → modus/artifacts/{story_id}/code/cr-report.md
|
|
60
63
|
|
|
61
64
|
Loop 2(修复层)
|
|
62
65
|
Gate C: 读 cr-report.md 的 issues 列表
|
|
@@ -64,8 +67,8 @@ Loop 2(修复层)
|
|
|
64
67
|
→ 通过:进入收尾
|
|
65
68
|
|
|
66
69
|
收尾
|
|
67
|
-
SA 07: 部署验证 →
|
|
68
|
-
ARCHIVE: 知识提取回写
|
|
70
|
+
SA 07: 部署验证 → modus/artifacts/{story_id}/code/deploy-status.md(prd 等待人工确认)
|
|
71
|
+
ARCHIVE: 知识提取回写 modus/knowledge_base/domain/{d}/history/ + 更新 map.md
|
|
69
72
|
Human Final Review: 人工确认后合入主干
|
|
70
73
|
```
|
|
71
74
|
|
|
@@ -85,18 +88,24 @@ Loop 2(修复层)
|
|
|
85
88
|
[ARCH] ✓ 知识沉淀 (2 [pitfall], 1 [decision] 回写)
|
|
86
89
|
```
|
|
87
90
|
|
|
88
|
-
##
|
|
91
|
+
## 产出物(v4.0)
|
|
89
92
|
|
|
90
93
|
```
|
|
91
|
-
modus/
|
|
92
|
-
├──
|
|
93
|
-
├──
|
|
94
|
-
|
|
95
|
-
├──
|
|
96
|
-
|
|
97
|
-
├──
|
|
98
|
-
├──
|
|
99
|
-
|
|
94
|
+
modus/artifacts/{story_id}/
|
|
95
|
+
├── pid/
|
|
96
|
+
│ ├── prd.md ← SubAgent 01 (modus-analyst)产出
|
|
97
|
+
│ └── dialog/ ← 多轮澄清对话历史
|
|
98
|
+
├── design/
|
|
99
|
+
│ └── design.md ← SubAgent 01.5 (modus-designer)产出
|
|
100
|
+
├── code/
|
|
101
|
+
│ ├── sprint-contract.md ← SubAgent 02 (modus-developer)产出,含 HANDOFF
|
|
102
|
+
│ ├── test-report.md ← SubAgent 03 (modus-tester)
|
|
103
|
+
│ ├── perf-report.md ← SubAgent 04 (modus-perf-auditor)
|
|
104
|
+
│ ├── security-report.md ← SubAgent 05 (modus-security-auditor)
|
|
105
|
+
│ ├── cr-report.md ← SubAgent 06 (modus-reviewer),含 HANDOFF.issues
|
|
106
|
+
│ ├── deploy-status.md ← SubAgent 07 (modus-deployer)
|
|
107
|
+
│ └── .harness-state.yaml ← 状态机
|
|
108
|
+
└── archive/ ← 上线后人工触发,输出 summary.md 与 key-scenarios/
|
|
100
109
|
```
|
|
101
110
|
|
|
102
111
|
所有产出物头部包含 HANDOFF 块(schema v1.1,见 `modus/docs/protocol.md`)。
|
|
@@ -119,4 +128,4 @@ skill_refs: ["biz-track@v2.1"]
|
|
|
119
128
|
|
|
120
129
|
## 执行此命令
|
|
121
130
|
|
|
122
|
-
读取并执行 `.
|
|
131
|
+
读取并执行 `.modus/skills/modus-harness/SKILL.md` 中的完整流程(中性源;各平台目录为引用桩)。
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
# /modus:init —
|
|
1
|
+
# /modus:init — 业务知识库初始化(v4.0)
|
|
2
2
|
|
|
3
|
-
**用途:** 扫描项目代码,按业务域分类,在 `modus/
|
|
3
|
+
**用途:** 扫描项目代码,按业务域分类,在 `modus/knowledge_base/domain/` 下生成结构化知识,作为后续所有 Modus 命令的知识底座。支持多项目工作区路由、多平台引用式适配,以及 v3.2 → v4.0 路径迁移。
|
|
4
|
+
|
|
5
|
+
> **路径范式版本:v4.0**(详见 `templates/paths-v4.md`)
|
|
4
6
|
|
|
5
7
|
## 参数说明
|
|
6
8
|
|
|
@@ -9,41 +11,72 @@
|
|
|
9
11
|
|
|
10
12
|
--help 显示完整帮助(中文)
|
|
11
13
|
--project <name> 指定项目(多项目 workspace 使用)
|
|
12
|
-
--enhance <domain> 仅增量更新指定业务域(如 --enhance
|
|
13
|
-
--enhance-all
|
|
14
|
-
--platform <p1,p2> 仅同步指定平台(claude,cursor,codex,copilot)
|
|
14
|
+
--enhance <domain> 仅增量更新指定业务域(如 --enhance contract)
|
|
15
|
+
--enhance-all 重建所有业务域知识(保留 _conventions / _tech-wiki)
|
|
16
|
+
--platform <p1,p2> 仅同步指定平台(claude,cursor,codex,copilot,codebuddy,continue)
|
|
15
17
|
--dry-run 预览将生成/修改的文件,不写入磁盘
|
|
16
18
|
--force 跳过所有确认提示,直接执行
|
|
17
|
-
--no-sync 跳过多平台同步,仅生成 modus/
|
|
18
|
-
--migrate
|
|
19
|
+
--no-sync 跳过多平台同步,仅生成 modus/knowledge_base/
|
|
20
|
+
--migrate-v4 迁移 v3.2 路径 → v4.0(modus/knowledge/ → modus/knowledge_base/domain/<d>/code/,
|
|
21
|
+
modus/stories/ → modus/artifacts/)
|
|
22
|
+
--migrate 兼容旧版别名,等同 --migrate-v4
|
|
19
23
|
--verbose 输出详细扫描过程
|
|
20
|
-
--reset-maturity
|
|
24
|
+
--reset-maturity 重置所有业务域知识的 maturity 为 draft
|
|
21
25
|
```
|
|
22
26
|
|
|
23
27
|
## 使用示例
|
|
24
28
|
|
|
25
29
|
```
|
|
26
|
-
/modus:init
|
|
27
|
-
/modus:init --help
|
|
28
|
-
/modus:init --enhance biz-
|
|
29
|
-
/modus:init --migrate --dry-run
|
|
30
|
-
/modus:init --migrate
|
|
31
|
-
/modus:init --enhance-all --no-sync
|
|
32
|
-
/modus:init --project operations-job
|
|
30
|
+
/modus:init # 全量初始化(首次使用或大重构后)
|
|
31
|
+
/modus:init --help # 查看帮助
|
|
32
|
+
/modus:init --enhance contract # 仅更新合同域知识(v4 域名不再带 biz- 前缀)
|
|
33
|
+
/modus:init --migrate-v4 --dry-run # 预览 v3.2 → v4.0 迁移
|
|
34
|
+
/modus:init --migrate-v4 # 执行迁移
|
|
35
|
+
/modus:init --enhance-all --no-sync # 重建所有域,不同步平台
|
|
36
|
+
/modus:init --project operations-job # 多项目时指定项目
|
|
33
37
|
```
|
|
34
38
|
|
|
35
|
-
##
|
|
39
|
+
## 产出物(v4.0)
|
|
36
40
|
|
|
37
41
|
```
|
|
38
|
-
modus/
|
|
39
|
-
├──
|
|
40
|
-
├──
|
|
41
|
-
└──
|
|
42
|
+
modus/knowledge_base/
|
|
43
|
+
├── map.md # L0 全景索引(替代旧 knowledge-catalog.md)
|
|
44
|
+
├── service-graph.md # L0 全局服务调用图
|
|
45
|
+
└── domain/
|
|
46
|
+
├── _conventions/code/SKILL.md # 团队约定(横切)
|
|
47
|
+
├── _tech-wiki/code/SKILL.md # 技术 Wiki(横切)
|
|
48
|
+
└── <domain>/ # 普通业务域
|
|
49
|
+
├── README.md # 域描述
|
|
50
|
+
├── code/ # 代码翻译层(强刷生成)
|
|
51
|
+
│ ├── SKILL.md # 入口(含 frontmatter)
|
|
52
|
+
│ ├── entities.md
|
|
53
|
+
│ ├── apis.md
|
|
54
|
+
│ ├── services.md
|
|
55
|
+
│ └── data-models.md
|
|
56
|
+
├── business/ # 业务规则(人工维护,不被覆盖)
|
|
57
|
+
├── scenarios/ # 测试场景(人工/spec 命令维护)
|
|
58
|
+
└── history/ # 变更历史(追加)
|
|
59
|
+
|
|
60
|
+
modus/workspace-catalog.md # 工作区顶层路由(多项目)
|
|
61
|
+
|
|
62
|
+
# 命令源(中性层,所有平台共用)
|
|
63
|
+
.modus/commands/*.md
|
|
64
|
+
.modus/skills/*/ # 团队自定义技能包
|
|
42
65
|
|
|
43
|
-
|
|
44
|
-
|
|
66
|
+
# 平台引用桩(仅 1 行 @import 指向中性源)
|
|
67
|
+
.codebuddy/ | .claude/ | .cursor/ | .continue/ ...
|
|
45
68
|
```
|
|
46
69
|
|
|
70
|
+
## v3.2 → v4.0 迁移要点
|
|
71
|
+
|
|
72
|
+
| v3.2 旧 | v4.0 新 |
|
|
73
|
+
|---------|---------|
|
|
74
|
+
| `modus/knowledge/biz-{d}/SKILL.md` | `modus/knowledge_base/domain/{d}/code/SKILL.md`(拆为 5 文件) |
|
|
75
|
+
| `modus/knowledge-catalog.md` | `modus/knowledge_base/map.md` |
|
|
76
|
+
| `modus/stories/{id}/...` | `modus/artifacts/{id}/...`(按 pid/design/code/archive 分目录) |
|
|
77
|
+
|
|
78
|
+
详见 `templates/paths-v4.md`。
|
|
79
|
+
|
|
47
80
|
## 执行此命令
|
|
48
81
|
|
|
49
|
-
读取并执行 `.codebuddy/skills/modus-init/SKILL.md`
|
|
82
|
+
读取并执行 `.modus/skills/modus-init/SKILL.md` 中的完整流程(中性源;平台目录如 `.codebuddy/skills/modus-init/SKILL.md` 为引用桩)。
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
| 命令 | 用途 | 常用参数 |
|
|
8
8
|
|------|------|---------|
|
|
9
|
-
| `/modus:init` | 扫描代码库,初始化/更新业务知识库 | `--enhance <domain>`, `--migrate`, `--dry-run` |
|
|
9
|
+
| `/modus:init` | 扫描代码库,初始化/更新业务知识库 | `--enhance <domain>`, `--migrate-v4`, `--dry-run` |
|
|
10
10
|
| `/modus:vibe` | 上下文感知日常编码(氛围编程) | `--domain <name>`, `--verbose` |
|
|
11
11
|
| `/modus:plan` | 功能规划(设计文档 + Build 循环) | `--story <url>`, `--design`, `--quick` |
|
|
12
12
|
| `/modus:spec` | 规范驱动开发(行为规格 + 验收标准) | `--story <url>`, `--lite`, `--testcase` |
|
|
@@ -43,22 +43,44 @@
|
|
|
43
43
|
/modus:harness https://tapd.cn/.../stories/view/1234567890
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
## 知识库路径(
|
|
46
|
+
## 知识库路径(v4.0)
|
|
47
47
|
|
|
48
48
|
```
|
|
49
|
-
modus/
|
|
50
|
-
├──
|
|
51
|
-
├──
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
modus/ # 顶层 Models 层
|
|
50
|
+
├── template/ # 产出模板(pid/design/spec/plan/...)
|
|
51
|
+
├── knowledge_base/ # Single Source of Truth
|
|
52
|
+
│ ├── map.md # 全景索引(~200 tokens)
|
|
53
|
+
│ ├── service-graph.md # L0 全局调用图
|
|
54
|
+
│ └── domain/
|
|
55
|
+
│ ├── _conventions/code/SKILL.md # 团队约定
|
|
56
|
+
│ ├── _tech-wiki/code/SKILL.md # 技术知识
|
|
57
|
+
│ └── <domain>/ # 业务域
|
|
58
|
+
│ ├── code/ # 代码翻译层(自动生成)
|
|
59
|
+
│ │ ├── SKILL.md
|
|
60
|
+
│ │ ├── entities.md
|
|
61
|
+
│ │ ├── apis.md
|
|
62
|
+
│ │ ├── services.md
|
|
63
|
+
│ │ └── data-models.md
|
|
64
|
+
│ ├── business/ # 业务规则(人工维护)
|
|
65
|
+
│ ├── scenarios/ # 测试场景
|
|
66
|
+
│ └── history/ # 变更历史
|
|
67
|
+
└── artifacts/<STORY_ID>/ # 产出区(按 Story 隔离)
|
|
68
|
+
├── pid/ # 需求澄清
|
|
69
|
+
├── design/ # 评估设计
|
|
70
|
+
├── code/ # 编码实施(plan/spec/harness)
|
|
71
|
+
└── archive/ # 上线后人工归档
|
|
72
|
+
|
|
73
|
+
.modus/ # CLI 中性层
|
|
74
|
+
├── commands/ # 命令全集源头
|
|
75
|
+
└── skills/ # 团队自定义技能包
|
|
76
|
+
|
|
77
|
+
.codebuddy/ | .claude/ | .cursor/ | .continue/ # 平台引用桩(仅 1 行 @import)
|
|
56
78
|
```
|
|
57
79
|
|
|
58
80
|
重新初始化或更新知识库:
|
|
59
81
|
|
|
60
82
|
```
|
|
61
|
-
/modus:init --enhance biz-
|
|
83
|
+
/modus:init --enhance <domain> # 仅更新某个域(v4 名不带 biz- 前缀)
|
|
62
84
|
/modus:init --enhance-all # 重建所有业务域
|
|
63
|
-
/modus:init --migrate
|
|
85
|
+
/modus:init --migrate-v4 # 从 v3.2 路径迁移
|
|
64
86
|
```
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# /modus:plan — 功能规划(含 Build 执行与知识归档)
|
|
2
2
|
|
|
3
|
-
**用途:**
|
|
3
|
+
**用途:** 针对一个具体需求,基于业务知识库(`modus/knowledge_base/`)上下文进行六维复杂度评估,提出 3 个精准澄清问题后生成结构化 `plan.md`,在用户确认后执行代码生成,最后自动回写新知识到知识库。
|
|
4
|
+
|
|
5
|
+
> **路径范式版本:v4.0**(详见 `templates/paths-v4.md`)
|
|
4
6
|
|
|
5
7
|
**借鉴自:** Cursor Plan Mode(只读规划阶段 + 用户确认后执行)
|
|
6
8
|
|
|
@@ -36,8 +38,8 @@
|
|
|
36
38
|
/modus:plan --design 评估版权对账系统的重构方案
|
|
37
39
|
/modus:plan --design --story https://tapd.cn/.../123456 # 设计评审模式,关联 TAPD
|
|
38
40
|
/modus:plan --continue my-feature # 评审通过,接力 harness 开发
|
|
39
|
-
/modus:plan --code modus/
|
|
40
|
-
/modus:plan --code modus/
|
|
41
|
+
/modus:plan --code modus/artifacts/{story_id}/code/design.md # 按 design.md 任务清单编码(v4 路径)
|
|
42
|
+
/modus:plan --code modus/artifacts/{story_id}/code/ # 自动定位目录下的设计文档
|
|
41
43
|
/modus:plan --quick 修复版权审核列表分页 bug
|
|
42
44
|
/modus:plan --read-only 分析中央曲库同步的架构方案
|
|
43
45
|
/modus:plan --resume batch-export 继续上次中断的规划
|
|
@@ -53,7 +55,7 @@
|
|
|
53
55
|
↓ 人工评审通过后(两种路径可选)
|
|
54
56
|
|
|
55
57
|
路径 A:任务驱动编码(轻量,无 harness)
|
|
56
|
-
/modus:plan --code modus/
|
|
58
|
+
/modus:plan --code modus/artifacts/{story_id}/code/design.md
|
|
57
59
|
↓ 按 tasks.md 中的 T-ID 逐任务执行,`- [ ]` → `- [x]`
|
|
58
60
|
↓ 完成后建议 /modus:cr --doc
|
|
59
61
|
|
|
@@ -67,10 +69,10 @@
|
|
|
67
69
|
## 执行流程概览
|
|
68
70
|
|
|
69
71
|
```
|
|
70
|
-
① 域匹配:基于
|
|
72
|
+
① 域匹配:基于 modus/knowledge_base/map.md 判断涉及的业务域
|
|
71
73
|
② 复杂度评估:六维评分 → simple / medium / complex 分级
|
|
72
74
|
complex → 提示考虑升级为 /modus:spec 或 /modus:harness
|
|
73
|
-
③
|
|
75
|
+
③ 两层知识检索:域入口 SKILL.md 前置更新(hash 检查)→ entities/apis/services/data-models 按需加载 → 源码按需加载
|
|
74
76
|
④ 精准 3 问:pitfall 关联问题 + 范围边界 + 优先级约束
|
|
75
77
|
⑤ 生成 plan.md:概述 / 关键约束 / 已知风险 / 方案对比 / Todos / 影响文件
|
|
76
78
|
⚠️ 规划阶段 — 此时尚未修改任何代码
|
|
@@ -78,25 +80,27 @@
|
|
|
78
80
|
⑦ 后置知识回写:技术决策 → [decision],新风险 → [pitfall]
|
|
79
81
|
```
|
|
80
82
|
|
|
81
|
-
##
|
|
83
|
+
## 产出物(v4.0)
|
|
82
84
|
|
|
83
|
-
|
|
85
|
+
**Story 模式(含 --story):**
|
|
84
86
|
```
|
|
85
|
-
modus/
|
|
86
|
-
├── .
|
|
87
|
-
└──
|
|
87
|
+
modus/artifacts/{story_id}/
|
|
88
|
+
├── design/design.md — --design 模式产出
|
|
89
|
+
└── code/
|
|
90
|
+
├── plan.md — 标准模式产出
|
|
91
|
+
├── .modus-state.yaml — 状态机,支持断点续跑
|
|
92
|
+
└── spec/ — (如后续接 /modus:spec)
|
|
88
93
|
```
|
|
89
94
|
|
|
90
|
-
|
|
95
|
+
**独立模式(不含 --story):**
|
|
91
96
|
```
|
|
92
|
-
modus/plans/{name}/
|
|
93
|
-
├── .modus-state.yaml
|
|
94
|
-
├──
|
|
95
|
-
|
|
96
|
-
└── tasks.md — 任务清单(spec-kit T-ID 格式,供 --code 模式消费)
|
|
97
|
+
modus/plans/{name}/ — 临时规划区(未关联 Story)
|
|
98
|
+
├── .modus-state.yaml
|
|
99
|
+
├── plan.md
|
|
100
|
+
└── design.md / research.md / tasks.md (仅 --design 模式)
|
|
97
101
|
```
|
|
98
102
|
|
|
99
|
-
归档后移动到:`modus/plans/archive/{date}-{name}
|
|
103
|
+
归档后移动到:`modus/artifacts/{story_id}/archive/`(Story 模式)或 `modus/plans/archive/{date}-{name}/`(独立模式)
|
|
100
104
|
|
|
101
105
|
## 与其他命令的对比
|
|
102
106
|
|
|
@@ -109,4 +113,4 @@ modus/plans/{name}/
|
|
|
109
113
|
|
|
110
114
|
## 执行此命令
|
|
111
115
|
|
|
112
|
-
读取并执行 `.
|
|
116
|
+
读取并执行 `.modus/skills/modus-plan/SKILL.md` 中的完整流程(中性源;各平台目录下同名文件为引用桩)。
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
**用途:** 在 `/plan` 基础上增加行为规格(delta specs),用 GIVEN/WHEN/THEN 明确系统「WHAT」,规格可测试,归档时自动检测冲突并合并到主规格库(Source of Truth)。适用于有接口契约变更、需要可测试验收标准的场景。
|
|
4
4
|
|
|
5
|
+
> **路径范式版本:v4.0**(详见 `templates/paths-v4.md`)
|
|
6
|
+
|
|
5
7
|
**借鉴自:** OpenSpec 规范 + Gherkin BDD(Cucumber)的 Feature/Scenario 格式
|
|
6
8
|
|
|
7
9
|
## 参数说明
|
|
@@ -36,11 +38,11 @@
|
|
|
36
38
|
| 维度 | `/modus:plan` | `/modus:spec` |
|
|
37
39
|
|------|--------------|----------------|
|
|
38
40
|
| 产出物 | 单一 `plan.md` | `delta-specs.md` + `design.md` + `tasks.md` |
|
|
39
|
-
| 目录 | `modus/plans/{name}/` | `modus/changes/{name}/` |
|
|
40
|
-
| 行为规格 | 无 | 有(ADDED/MODIFIED/REMOVED + GIVEN/WHEN/THEN
|
|
41
|
-
| 验收标准 | 无 | 有(可测试 Scenario
|
|
42
|
-
| 冲突检测 | 无 | 有(MODIFIED/REMOVED
|
|
43
|
-
| 归档目标 | `modus/plans/archive/` | 合并到 `modus/specs/{domain}/spec.md` |
|
|
41
|
+
| 目录 | `modus/artifacts/{story_id}/code/` 或 `modus/plans/{name}/` | `modus/artifacts/{story_id}/code/spec/` 或 `modus/changes/{name}/` |
|
|
42
|
+
| 行为规格 | 无 | 有(ADDED/MODIFIED/REMOVED + GIVEN/WHEN/THEN)|
|
|
43
|
+
| 验收标准 | 无 | 有(可测试 Scenario)|
|
|
44
|
+
| 冲突检测 | 无 | 有(MODIFIED/REMOVED 目标必须存在于主库)|
|
|
45
|
+
| 归档目标 | `modus/artifacts/{id}/archive/` 或 `modus/plans/archive/` | 合并到 `modus/knowledge_base/domain/{d}/scenarios/` 或 `modus/specs/{domain}/spec.md` |
|
|
44
46
|
|
|
45
47
|
## Delta Specs 格式(Gherkin 风格)
|
|
46
48
|
|
|
@@ -60,22 +62,33 @@ Feature: 批量审批订单
|
|
|
60
62
|
Then 系统返回 400 错误:"批量操作上限 50 条"
|
|
61
63
|
```
|
|
62
64
|
|
|
63
|
-
##
|
|
65
|
+
## 产出物(v4.0)
|
|
64
66
|
|
|
67
|
+
**Story 模式(含 --story):**
|
|
68
|
+
```
|
|
69
|
+
modus/artifacts/{story_id}/
|
|
70
|
+
├── design/design.md
|
|
71
|
+
└── code/
|
|
72
|
+
├── spec/ — delta specs(ADDED/MODIFIED/REMOVED)
|
|
73
|
+
├── spec-proposal.md — 意图与范围
|
|
74
|
+
├── tasks.md — 实现清单(追踪到 Scenario)
|
|
75
|
+
└── testcases.md — QA 用例(--testcase 时生成)
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
**独立模式(不含 --story):**
|
|
65
79
|
```
|
|
66
80
|
modus/changes/{name}/
|
|
67
|
-
├── .modus-state.yaml
|
|
68
|
-
├── proposal.md
|
|
69
|
-
├── specs/{domain}/spec.md
|
|
70
|
-
├── design.md
|
|
71
|
-
├── design-brief.md
|
|
72
|
-
├── tasks.md
|
|
73
|
-
└── testcases.md
|
|
74
|
-
|
|
75
|
-
归档后:modus/changes/archive/{date}-{name}/
|
|
76
|
-
主规格库:modus/specs/{domain}/spec.md(历次归档合并)
|
|
81
|
+
├── .modus-state.yaml
|
|
82
|
+
├── proposal.md
|
|
83
|
+
├── specs/{domain}/spec.md
|
|
84
|
+
├── design.md
|
|
85
|
+
├── design-brief.md
|
|
86
|
+
├── tasks.md
|
|
87
|
+
└── testcases.md
|
|
77
88
|
```
|
|
78
89
|
|
|
90
|
+
归档后:Story 模式合并到 `modus/knowledge_base/domain/{domain}/scenarios/`;独立模式合并到 `modus/specs/{domain}/spec.md`。
|
|
91
|
+
|
|
79
92
|
## 执行此命令
|
|
80
93
|
|
|
81
|
-
读取并执行 `.
|
|
94
|
+
读取并执行 `.modus/skills/modus-spec/SKILL.md` 中的完整流程(中性源;各平台目录为引用桩)。
|
|
@@ -33,8 +33,9 @@
|
|
|
33
33
|
|
|
34
34
|
| 版本 | 主要变更 |
|
|
35
35
|
|------|---------|
|
|
36
|
-
| v4.0.0 |
|
|
37
|
-
| v3.
|
|
36
|
+
| **v4.0.0** | 目录范式重构:`modus/knowledge/` → `modus/knowledge_base/domain/<d>/code/` (拆分 5 文件) + `business/` + `scenarios/` + `history/`;`modus/stories/` → `modus/artifacts/<id>/` (pid/design/code/archive);`modus/knowledge-catalog.md` → `modus/knowledge_base/map.md`;新增 `modus/template/` 产出模板;新增 `.modus/commands/` + `.modus/skills/` 中立命令与团队技能包;平台目录全部降为引用桩 |
|
|
37
|
+
| v3.3.0 | plan --design 设计评审节点;plan --continue + harness --from-plan 接力机制;HANDOFF protocol schema v1.3 (plan 专用字段);Progress Event Protocol (events.jsonl);AGENTS.md 自动生成 |
|
|
38
|
+
| v3.2.0 | 跨 Skill 路径全面统一到 `modus/knowledge/biz-*/`;步骤编号规范化(禁止小数步骤);modus-analyst 产出路径更正到 `modus/stories/{id}/harness/`;modus-plan 双路径产出规则 |
|
|
38
39
|
| v3.1.0 | 知识库路径迁移:`.codebuddy/skills/modus-biz-*` → `modus/knowledge/biz-*`;新增工作区顶层路由 `modus/workspace-catalog.md`;HANDOFF 协议升级到 schema v1.1 |
|
|
39
40
|
| v3.0.0 | 多项目工作区支持(modus-workspace.yaml);引用式适配(不复制知识) |
|
|
40
41
|
| v2.x | 初始版本 |
|
|
@@ -57,32 +58,43 @@
|
|
|
57
58
|
```
|
|
58
59
|
Step 1: 备份
|
|
59
60
|
创建 modus/backup/{YYYYMMDD}-v3.x/ 目录
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
Step 2:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
61
|
+
复制所有现有知识与产物文件到备份目录
|
|
62
|
+
|
|
63
|
+
Step 2: 知识库重构
|
|
64
|
+
modus/knowledge/biz-{d}/SKILL.md
|
|
65
|
+
→ modus/knowledge_base/domain/{d}/code/SKILL.md (仅保留 frontmatter 与摘要)
|
|
66
|
+
→ 拆分原内容到 entities.md / apis.md / services.md / data-models.md
|
|
67
|
+
→ 创建空的 business/ + scenarios/ + history/子目录
|
|
68
|
+
modus/knowledge/_conventions/SKILL.md
|
|
69
|
+
→ modus/knowledge_base/domain/_conventions/code/SKILL.md
|
|
70
|
+
modus/knowledge/_tech-wiki/SKILL.md
|
|
71
|
+
→ modus/knowledge_base/domain/_tech-wiki/code/SKILL.md
|
|
72
|
+
modus/knowledge-catalog.md
|
|
73
|
+
→ modus/knowledge_base/map.md (结构重生成)
|
|
74
|
+
生成 modus/knowledge_base/service-graph.md (基于代码扫描)
|
|
75
|
+
|
|
76
|
+
Step 3: 产出区重构
|
|
77
|
+
modus/stories/{id}/
|
|
78
|
+
├─ harness/01-analysis.md → modus/artifacts/{id}/pid/prd.md
|
|
79
|
+
├─ harness/02-design-brief.md → modus/artifacts/{id}/design/design.md
|
|
80
|
+
├─ plan.md → modus/artifacts/{id}/code/plan.md
|
|
81
|
+
├─ spec/ → modus/artifacts/{id}/code/spec/
|
|
82
|
+
├─ harness/03-sprint-contract → modus/artifacts/{id}/code/sprint-contract.md
|
|
83
|
+
├─ harness/cr-report.md → modus/artifacts/{id}/code/cr-report.md
|
|
84
|
+
└─ harness/.harness-state.yaml → modus/artifacts/{id}/code/.harness-state.yaml
|
|
85
|
+
创建空的 archive/ 子目录
|
|
86
|
+
|
|
87
|
+
Step 4: 产出模板与中性命令源
|
|
88
|
+
将 templates/template/ 复制到项目下 modus/template/
|
|
89
|
+
将现有命令同步到 .modus/commands/ (中性源)
|
|
90
|
+
将团队资源迁移到 .modus/skills/ (如某些所谓的「查日志」Skill)
|
|
91
|
+
|
|
92
|
+
Step 5: 平台目录降为引用桩
|
|
93
|
+
重写 .codebuddy/skills/modus-*/SKILL.md 为仅 1 行 @import,指向 .modus/skills/
|
|
94
|
+
.claude/, .cursor/, .continue/ 同理
|
|
95
|
+
|
|
96
|
+
Step 6: HANDOFF schema 升级与路径调整
|
|
97
|
+
扫描 modus/artifacts/*/code/*.md 中的旧 HANDOFF 块,路径字段调整为 v4 路径
|
|
86
98
|
|
|
87
99
|
Step 7: 更新 modus/config.yaml
|
|
88
100
|
将 modus_version 更新为 "4.0.0"
|
|
@@ -95,20 +107,20 @@ Step 7: 更新 modus/config.yaml
|
|
|
95
107
|
✅ Modus v4.0.0 升级完成
|
|
96
108
|
|
|
97
109
|
迁移内容:
|
|
98
|
-
✓
|
|
99
|
-
✓
|
|
100
|
-
✓
|
|
101
|
-
✓
|
|
102
|
-
✓
|
|
110
|
+
✓ 知识库:N 个业务域拆分为 code/{entities|apis|services|data-models}.md
|
|
111
|
+
✓ 产出区:M 个 Story 从 stories/ 迁移到 artifacts/<id>/{pid|design|code|archive}/
|
|
112
|
+
✓ 中性命令源:.modus/commands/ + .modus/skills/ 已生成
|
|
113
|
+
✓ 平台目录:.codebuddy / .claude / .cursor / .continue 已重写为引用桩
|
|
114
|
+
✓ 模板:modus/template/ 生成(6 个产出模板)
|
|
103
115
|
|
|
104
116
|
备份位置:modus/backup/{YYYYMMDD}-v3.x/
|
|
105
117
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
118
|
+
后续手动步骤:
|
|
119
|
+
1. 人工检查 modus/knowledge_base/domain/<d>/business/ 并补充业务规则
|
|
120
|
+
2. 人工检查 modus/knowledge_base/service-graph.md 并修正调用关系
|
|
121
|
+
3. 运行 /modus:init --enhance-all 验证迁移后知识是否可重生成
|
|
110
122
|
```
|
|
111
123
|
|
|
112
124
|
## 执行此命令
|
|
113
125
|
|
|
114
|
-
读取并执行 `.
|
|
126
|
+
读取并执行 `.modus/skills/modus-upgrade/SKILL.md` 中的完整流程(中性源;各平台目录为引用桩)。
|