@modus-ai/modus 0.2.4 → 0.2.6
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 +100 -42
- 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 +37 -7
- 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 +1 -37
- package/dist/generators/claude.js.map +1 -1
- package/dist/generators/codebuddy.d.ts.map +1 -1
- package/dist/generators/codebuddy.js +3 -1
- package/dist/generators/codebuddy.js.map +1 -1
- package/dist/generators/codex.d.ts +10 -0
- package/dist/generators/codex.d.ts.map +1 -0
- package/dist/generators/codex.js +178 -0
- package/dist/generators/codex.js.map +1 -0
- 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/generators/cursor.d.ts.map +1 -1
- package/dist/generators/cursor.js +36 -7
- package/dist/generators/cursor.js.map +1 -1
- package/dist/generators/custom.d.ts +55 -0
- package/dist/generators/custom.d.ts.map +1 -0
- package/dist/generators/custom.js +166 -0
- package/dist/generators/custom.js.map +1 -0
- package/dist/generators/index.d.ts +1 -0
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +10 -0
- package/dist/generators/index.js.map +1 -1
- package/dist/utils/config.d.ts +38 -1
- 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/harness-schema.yaml +178 -53
- package/schemas/knowledge-schema.yaml +111 -1
- package/templates/agents/modus-analyst.md +1 -1
- package/templates/behavior-guard.md +165 -0
- package/templates/commands/auto.md +61 -25
- package/templates/commands/commit.md +63 -0
- package/templates/commands/harness.md +97 -30
- package/templates/commands/init.md +43 -10
- package/templates/commands/modus.md +55 -28
- package/templates/commands/plan.md +60 -18
- package/templates/commands/spec.md +69 -25
- package/templates/commands/upgrade.md +54 -0
- package/templates/commands/vibe.md +56 -6
- package/templates/knowledge-catalog.md +74 -32
- package/templates/skills/modus-agents/analyst/SKILL.md +18 -3
- 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 +107 -66
- package/templates/skills/modus-agents/perf-auditor/SKILL.md +98 -61
- package/templates/skills/modus-agents/reviewer/SKILL.md +61 -11
- 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 +581 -109
- package/templates/skills/modus-design-brief/SKILL.md +45 -19
- package/templates/skills/modus-harness/SKILL.md +150 -85
- package/templates/skills/modus-init/SKILL.md +1145 -319
- package/templates/skills/modus-plan/SKILL.md +125 -48
- package/templates/skills/modus-platform/SKILL.md +271 -0
- package/templates/skills/modus-spec/SKILL.md +175 -331
- package/templates/skills/modus-vibe/SKILL.md +256 -55
|
@@ -1,38 +1,74 @@
|
|
|
1
|
-
# /modus:auto
|
|
1
|
+
# /modus:auto — 智能模式推荐
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**用途:** 读取 TAPD Story,从四个维度(复杂度/风险/需求明确度/接口契约)进行评分,自动推荐最适合的 Modus 命令(vibe/plan/spec/harness),确认后自动启动。**不确定用哪个命令时,首选此命令。**
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 执行流程
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
1. 接受 TAPD Story URL(或提示手动粘贴内容)
|
|
8
|
+
2. 通过 TAPD MCP 读取 Story
|
|
9
|
+
3. 四维评分:复杂度 / 风险 / 需求明确度 / 接口契约影响
|
|
10
|
+
4. 应用决策树 → 推荐:vibe / plan / spec / harness
|
|
11
|
+
5. 展示推荐结果 + 其他选项对比
|
|
12
|
+
6. 等待人工选择确认
|
|
13
|
+
7. 展示参数确认窗口(二次确认)
|
|
14
|
+
8. 以 TAPD 上下文自动启动所选模式:
|
|
15
|
+
- **plan** 模式:附加 `[AUTO_MODE: questions_confirmed]` 标记,modus-plan Step 3 检测到后跳过交互式澄清
|
|
16
|
+
- **vibe** / **spec** / **harness** 模式:直接传入 TAPD 上下文
|
|
8
17
|
|
|
9
|
-
##
|
|
18
|
+
## 参数说明
|
|
10
19
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
```
|
|
21
|
+
/modus:auto [tapd-url] [参数]
|
|
22
|
+
|
|
23
|
+
--help 显示完整帮助(中文)
|
|
24
|
+
--project <name> 指定项目(多项目 workspace 使用)
|
|
25
|
+
--force <mode> 强制指定模式(vibe|plan|spec|harness),跳过推荐评分
|
|
26
|
+
--no-confirm 二次确认直接启动(CI/自动化场景使用)
|
|
27
|
+
--show-scores 展示四维评分详情(复杂度/风险/明确度/契约)
|
|
28
|
+
--dry-run 仅展示推荐结果,不启动任何命令
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 使用示例
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
/modus:auto https://tapd.cn/.../stories/view/1234567890
|
|
35
|
+
/modus:auto # 不带 URL,手动粘贴 Story 内容
|
|
36
|
+
/modus:auto https://tapd.cn/.../1234 --show-scores
|
|
37
|
+
/modus:auto https://tapd.cn/.../1234 --force harness
|
|
38
|
+
/modus:auto https://tapd.cn/.../1234 --dry-run
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## 推荐逻辑(四维评分)
|
|
19
42
|
|
|
20
|
-
|
|
43
|
+
```
|
|
44
|
+
维度 1 - 复杂度:预估文件变更数、跨域数量
|
|
45
|
+
维度 2 - 风险:支付/权限/多租户/金额是否涉及
|
|
46
|
+
维度 3 - 需求明确度:验收标准是否完整
|
|
47
|
+
维度 4 - 接口契约影响:是否新增/修改/废弃接口
|
|
21
48
|
|
|
49
|
+
推荐规则:
|
|
50
|
+
低复杂+低风险+无契约 → vibe
|
|
51
|
+
明确+中等+无契约 → plan
|
|
52
|
+
有接口契约/高风险 → spec
|
|
53
|
+
不明确/高复杂+高风险 → harness
|
|
22
54
|
```
|
|
23
|
-
|
|
24
|
-
|
|
55
|
+
|
|
56
|
+
## 推荐输出示例
|
|
57
|
+
|
|
25
58
|
```
|
|
59
|
+
需求分析结果 — 新增歌曲批量导出功能
|
|
60
|
+
──────────────────────────────────────
|
|
61
|
+
复杂度: 中等 — 预估 4 个文件变更
|
|
62
|
+
风险: 低 — 纯新增,不修改现有逻辑
|
|
63
|
+
需求明确度: 高 — 验收标准完整
|
|
64
|
+
接口契约: 有 — 新增 POST /api/v1/track/batch-export
|
|
26
65
|
|
|
27
|
-
|
|
66
|
+
推荐模式:/modus:spec
|
|
67
|
+
理由:有新接口契约,建议用 spec 生成可测试验收规格。
|
|
28
68
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
| Low complexity + Low risk + No contract change | vibe |
|
|
32
|
-
| Medium complexity + High clarity + No contract change | plan |
|
|
33
|
-
| Any contract change OR High risk OR needs testable acceptance criteria | spec |
|
|
34
|
-
| Low clarity OR High complexity + High risk OR full automation needed | harness |
|
|
69
|
+
请选择:A. vibe B. plan C. spec(推荐) D. harness
|
|
70
|
+
```
|
|
35
71
|
|
|
36
|
-
##
|
|
72
|
+
## 执行此命令
|
|
37
73
|
|
|
38
|
-
|
|
74
|
+
读取并执行 `.codebuddy/skills/modus-auto/SKILL.md` 中的完整流程。
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# /modus:commit
|
|
2
|
+
|
|
3
|
+
Knowledge-aware git commit. Drains pending knowledge from `modus/sessions/pending-knowledge.yaml` into the corresponding business Skill files, then executes the actual git commit.
|
|
4
|
+
|
|
5
|
+
## Instructions
|
|
6
|
+
|
|
7
|
+
Read and follow the steps below to execute this command.
|
|
8
|
+
|
|
9
|
+
## What It Does
|
|
10
|
+
|
|
11
|
+
During `/modus:vibe` sessions, newly discovered knowledge (new enum values, business rules, pitfalls) is buffered to `modus/sessions/pending-knowledge.yaml` rather than written directly to Skill files. This prevents exploratory or incomplete sessions from polluting the knowledge base.
|
|
12
|
+
|
|
13
|
+
`/modus:commit` is the trigger that drains this buffer at the right moment — when code is confirmed ready to commit.
|
|
14
|
+
|
|
15
|
+
## Execution Steps
|
|
16
|
+
|
|
17
|
+
1. **Check pending knowledge buffer:**
|
|
18
|
+
Read `modus/sessions/pending-knowledge.yaml` (if it exists).
|
|
19
|
+
If empty or absent → skip to Step 4 and execute a normal git commit.
|
|
20
|
+
|
|
21
|
+
2. **Show pending entries for confirmation:**
|
|
22
|
+
```
|
|
23
|
+
📚 发现 {N} 条待沉淀知识(来自最近 {K} 次 vibe 会话):
|
|
24
|
+
|
|
25
|
+
· [pitfall] order 域:批量操作超 50 条需分批处理
|
|
26
|
+
证据: OrderService.java:142
|
|
27
|
+
· [guideline] order 域:新增审批流必须记录审批人 ID 到日志
|
|
28
|
+
证据: OrderManager.java:89
|
|
29
|
+
· [model] payment 域:PayStatus 新增 REFUNDING 枚举值
|
|
30
|
+
证据: PayStatus.java:15
|
|
31
|
+
|
|
32
|
+
是否将以上知识写入对应 Skill 文件?[Y/n]
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
3. **Write back to Skills (if confirmed):**
|
|
36
|
+
For each entry in `pending-knowledge.yaml`:
|
|
37
|
+
- Call `modus-skill-creator` Mode C to append the entry to the corresponding `modus-biz-{domain}/SKILL.md`
|
|
38
|
+
- Mark the entry as `settled: true` in `pending-knowledge.yaml`
|
|
39
|
+
- Output per-entry status: `✓ [pitfall] → modus-biz-order 已写入`
|
|
40
|
+
|
|
41
|
+
After all entries processed:
|
|
42
|
+
- Remove settled entries from `pending-knowledge.yaml` (keep only `settled: false` entries)
|
|
43
|
+
- Update `modus/knowledge-catalog.md` if any Skill version changed
|
|
44
|
+
|
|
45
|
+
4. **Execute git commit:**
|
|
46
|
+
Run the standard git commit flow:
|
|
47
|
+
```bash
|
|
48
|
+
git add .
|
|
49
|
+
git commit
|
|
50
|
+
```
|
|
51
|
+
(Opens editor for commit message or accepts message from user input)
|
|
52
|
+
|
|
53
|
+
5. **Output summary:**
|
|
54
|
+
```
|
|
55
|
+
✅ 知识沉淀完成({N} 条已写入 Skill)
|
|
56
|
+
✅ Git commit 执行完成
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Notes
|
|
60
|
+
|
|
61
|
+
- If the user skips knowledge write-back (answer `n`), the entries remain in `pending-knowledge.yaml` for the next `/modus:commit` call.
|
|
62
|
+
- Entries with `settled: false` that are older than 30 days will be highlighted with `⚠️ 较旧` to prompt cleanup.
|
|
63
|
+
- This command only handles knowledge write-back for `/modus:vibe` sessions. Knowledge from `/modus:plan`, `/modus:spec`, and `/modus:harness` is written back immediately (not buffered).
|
|
@@ -1,46 +1,113 @@
|
|
|
1
|
-
# /modus:harness
|
|
1
|
+
# /modus:harness — 双 Loop 全自动开发流程
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**用途:** 输入 TAPD Story URL,自动执行从需求分析到部署验证的完整开发流程。8 个专业 SubAgent 分工协作,双 Loop 质量闭环,最终将开发经验自动沉淀到知识库。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**借鉴自:** GitHub Actions Job/Step/Gate 模型 + Devin 多步骤 Agent 架构
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## 参数说明
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
```
|
|
10
|
+
/modus:harness <tapd-url> [参数]
|
|
11
|
+
|
|
12
|
+
--help 显示完整帮助(中文)
|
|
13
|
+
--project <name> 指定项目(多项目 workspace 使用)
|
|
14
|
+
--story <tapd-url> 与直接传 URL 等价(alias)
|
|
15
|
+
--skip <agents> 跳过指定 SubAgent(逗号分隔,如 "04-perf,05-security")
|
|
16
|
+
--loop1-only 仅执行 Loop 1,不触发 Loop 2 自动修复
|
|
17
|
+
--resume 从最后完成的 SubAgent 断点继续
|
|
18
|
+
--dry-run 展示将执行的 SubAgent 列表和配置,不实际执行
|
|
19
|
+
--force-rebuild-skill 强制重建 Skill(忽略 hash 检查)
|
|
20
|
+
--no-deploy 跳过 07-deploy SubAgent(仅交付到 pre 环境)
|
|
21
|
+
--max-loop2 <n> Loop 2 最大重入次数(默认 3,填 0 禁用 Loop 2)
|
|
22
|
+
--notify <channel> 完成后通知渠道(wework|dingtalk|slack)
|
|
23
|
+
```
|
|
10
24
|
|
|
11
|
-
|
|
12
|
-
2. Accept TAPD Story URL as input
|
|
13
|
-
3. Create working directory: `modus/plans/active/{story-id}/`
|
|
14
|
-
4. Run the Harness Orchestrator which coordinates 7 SubAgents:
|
|
25
|
+
## 使用示例
|
|
15
26
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
```
|
|
28
|
+
/modus:harness https://tapd.cn/.../stories/view/1234567890
|
|
29
|
+
/modus:harness https://tapd.cn/.../1234 --dry-run
|
|
30
|
+
/modus:harness https://tapd.cn/.../1234 --skip 04-perf,05-security
|
|
31
|
+
/modus:harness https://tapd.cn/.../1234 --loop1-only
|
|
32
|
+
/modus:harness https://tapd.cn/.../1234 --resume
|
|
33
|
+
/modus:harness https://tapd.cn/.../1234 --max-loop2 0 --no-deploy
|
|
34
|
+
```
|
|
22
35
|
|
|
23
|
-
**
|
|
24
|
-
- SubAgent 06: Code review → `cr-report.md`
|
|
25
|
-
- If P1/P2 found → precise re-entry to SubAgent 02 → repeat
|
|
26
|
-
- Gate C: No P1/P2 → proceed
|
|
27
|
-
- SubAgent 07: Deployment verification → `07-deploy-status.md`
|
|
36
|
+
**Step Final:** SubAgent 00 (Mode D) — ARCHIVE knowledge extraction
|
|
28
37
|
|
|
29
38
|
5. Final Review: human confirms before merging
|
|
30
39
|
|
|
31
|
-
##
|
|
40
|
+
## 双 Loop 流程总览
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
Loop 1(生产层)
|
|
44
|
+
INIT: SubAgent 00 知识注入(更新相关 Skill 至最新)
|
|
45
|
+
SA 01: 需求分析 → 01-analysis.md
|
|
46
|
+
SA 02: 代码开发 → 02-sprint-contract.md + 代码变更
|
|
47
|
+
Gate A: 编译验证(mvn clean compile)→ 失败重入 SA 02,最多 3 次
|
|
48
|
+
SA 03+04+05: 并行(测试/性能/安全)
|
|
49
|
+
Gate B: 三份报告全部 complete
|
|
50
|
+
SA 06: 代码评审 → cr-report.md
|
|
51
|
+
|
|
52
|
+
Loop 2(修复层)
|
|
53
|
+
Gate C: 读 cr-report.md 的 issues 列表
|
|
54
|
+
→ 有 P1/P2:精准重入受影响 Sprint(非全量重跑),最多 3 次
|
|
55
|
+
→ 通过:进入收尾
|
|
56
|
+
|
|
57
|
+
收尾
|
|
58
|
+
SA 07: 部署验证 → 07-deploy-status.md(prd 等待人工确认)
|
|
59
|
+
ARCHIVE: 知识提取回写 Skill + 更新 catalog
|
|
60
|
+
Human Final Review: 人工确认后合入主干
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Pipeline 状态输出(GitHub Actions 风格)
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
[SA-00] ✓ 知识注入 (3 Skill 更新, 0s)
|
|
67
|
+
[SA-01] ✓ 需求分析 (2 Sprint, Gate: N/A, 45s)
|
|
68
|
+
[SA-02] ✓ 代码开发 (4 files, Gate A: passed, 2m30s)
|
|
69
|
+
[SA-03] ✓ 单元测试 (coverage: 82%, Gate B: -, 1m15s)
|
|
70
|
+
[SA-04] ✓ 性能审计 (0 high, 1 medium, Gate B: -, 45s)
|
|
71
|
+
[SA-05] ✓ 安全审计 (0 critical, Gate B: passed, 50s)
|
|
72
|
+
[SA-06] ✓ 代码评审 (P1:0 P2:1 P3:2, Gate C: failed → Loop2)
|
|
73
|
+
[Loop2] ✓ 精准修复 Sprint-2 (1 P2 已修复, 1m20s)
|
|
74
|
+
[SA-06] ✓ 代码评审 Re-run (P1:0 P2:0 P3:2, Gate C: passed)
|
|
75
|
+
[SA-07] ✓ 部署验证 dev→uat→pre (3/3 通过, prd 等待人工)
|
|
76
|
+
[ARCH] ✓ 知识沉淀 (2 [pitfall], 1 [decision] 回写)
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## 产出物
|
|
32
80
|
|
|
33
81
|
```
|
|
34
82
|
modus/plans/active/{story-id}/
|
|
35
|
-
├── 01-analysis.md
|
|
36
|
-
├──
|
|
37
|
-
├──
|
|
38
|
-
├──
|
|
39
|
-
├──
|
|
40
|
-
├──
|
|
41
|
-
|
|
83
|
+
├── 01-analysis.md ← SubAgent 01 产出,含 HANDOFF 块(影响范围、Sprint 拆分)
|
|
84
|
+
├── 01.5-design-brief.md ← SubAgent 01.5 产出,含架构决策
|
|
85
|
+
├── 02-sprint-contract.md ← SubAgent 02 产出,含代码变更清单(接口契约)
|
|
86
|
+
├── 03-test-report.md ← SubAgent 03 产出(单元测试报告)
|
|
87
|
+
├── 04-perf-report.md ← SubAgent 04 产出(性能审计 N+1/分页风险)
|
|
88
|
+
├── 05-security-report.md ← SubAgent 05 产出(安全审计 多租户/权限)
|
|
89
|
+
├── cr-report.md ← SubAgent 06 产出,含 HANDOFF.issues(P1/P2/P3)
|
|
90
|
+
└── 07-deploy-status.md ← SubAgent 07 产出(部署状态 各环境结果)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
所有产出物头部包含 HANDOFF 块(schema v1.1,见 `modus/docs/protocol.md`)。
|
|
94
|
+
|
|
95
|
+
## HANDOFF 协议(SubAgent 间传递信息)
|
|
96
|
+
|
|
97
|
+
```markdown
|
|
98
|
+
<!--HANDOFF
|
|
99
|
+
schema_version: "1.1"
|
|
100
|
+
agent: "01-analysis"
|
|
101
|
+
run_id: "{YYYYMMDD}-{story_id}"
|
|
102
|
+
story_id: "{tapd-story-id}"
|
|
103
|
+
domains: ["biz-track", "biz-album"]
|
|
104
|
+
gate_status: "passed"
|
|
105
|
+
artifact_status: "complete"
|
|
106
|
+
issues: []
|
|
107
|
+
skill_refs: ["biz-track@v2.1"]
|
|
108
|
+
-->
|
|
42
109
|
```
|
|
43
110
|
|
|
44
|
-
##
|
|
111
|
+
## 执行此命令
|
|
45
112
|
|
|
46
|
-
|
|
113
|
+
读取并执行 `.codebuddy/skills/modus-harness/SKILL.md` 中的完整流程。
|
|
@@ -1,16 +1,49 @@
|
|
|
1
|
-
# /modus:init
|
|
1
|
+
# /modus:init — 业务知识库初始化
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**用途:** 扫描项目代码,按业务域分类,在 `modus/knowledge/` 下生成结构化 Skill 文件,作为后续所有 Modus 命令的知识底座。支持多项目工作区路由和多平台引用式适配。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 参数说明
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
```
|
|
8
|
+
/modus:init [参数]
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
--help 显示完整帮助(中文)
|
|
11
|
+
--project <name> 指定项目(多项目 workspace 使用)
|
|
12
|
+
--enhance <domain> 仅增量更新指定业务域(如 --enhance biz-track)
|
|
13
|
+
--enhance-all 重建所有业务域 Skill(保留框架 Skill)
|
|
14
|
+
--platform <p1,p2> 仅同步指定平台(claude,cursor,codex,copilot)
|
|
15
|
+
--dry-run 预览将生成/修改的文件,不写入磁盘
|
|
16
|
+
--force 跳过所有确认提示,直接执行
|
|
17
|
+
--no-sync 跳过多平台同步,仅生成 modus/knowledge/
|
|
18
|
+
--migrate 迁移旧路径 .codebuddy/skills/modus-biz-* → modus/knowledge/
|
|
19
|
+
--verbose 输出详细扫描过程
|
|
20
|
+
--reset-maturity 重置所有 Skill 的 maturity 为 draft
|
|
21
|
+
```
|
|
10
22
|
|
|
11
|
-
|
|
12
|
-
2. Present the domain classification to the user for confirmation
|
|
13
|
-
3. For each confirmed domain, generate `.codebuddy/skills/modus-biz-{domain}/SKILL.md`
|
|
14
|
-
4. Report completion
|
|
23
|
+
## 使用示例
|
|
15
24
|
|
|
16
|
-
|
|
25
|
+
```
|
|
26
|
+
/modus:init # 全量初始化(首次使用或大重构后)
|
|
27
|
+
/modus:init --help # 查看帮助
|
|
28
|
+
/modus:init --enhance biz-track # 仅更新歌曲域知识
|
|
29
|
+
/modus:init --migrate --dry-run # 预览知识库路径迁移
|
|
30
|
+
/modus:init --migrate # 执行迁移(旧路径 → modus/knowledge/)
|
|
31
|
+
/modus:init --enhance-all --no-sync # 重建所有域,不同步平台
|
|
32
|
+
/modus:init --project operations-job # 多项目时指定项目
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## 产出物
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
modus/knowledge/
|
|
39
|
+
├── _conventions/SKILL.md — Layer 0-T 团队约定(融合各平台规则)
|
|
40
|
+
├── _tech-wiki/SKILL.md — Layer 1 技术知识骨架
|
|
41
|
+
└── biz-{domain}/SKILL.md — Layer 2 业务域知识(每个域一个)
|
|
42
|
+
|
|
43
|
+
modus/knowledge-catalog.md — 全景索引(所有命令的快速入口)
|
|
44
|
+
modus/workspace-catalog.md — 工作区顶层路由(多项目)
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## 执行此命令
|
|
48
|
+
|
|
49
|
+
读取并执行 `.codebuddy/skills/modus-init/SKILL.md` 中的完整流程。
|
|
@@ -1,37 +1,64 @@
|
|
|
1
|
-
# /modus
|
|
1
|
+
# /modus — Modus AI 编码加速框架
|
|
2
2
|
|
|
3
|
-
Modus —
|
|
3
|
+
**Modus** — 知识驱动的 AI 编码框架,核心理念:每次工作流都是一次知识积累,用业务 Skill 消除 AI 的冷启动问题。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 可用命令
|
|
6
6
|
|
|
7
|
-
|
|
|
8
|
-
|
|
9
|
-
| `/modus:init` |
|
|
10
|
-
| `/modus:vibe` |
|
|
11
|
-
| `/modus:plan` |
|
|
12
|
-
| `/modus:spec` |
|
|
13
|
-
| `/modus:auto` |
|
|
14
|
-
| `/modus:harness` |
|
|
7
|
+
| 命令 | 用途 | 常用参数 |
|
|
8
|
+
|------|------|---------|
|
|
9
|
+
| `/modus:init` | 扫描代码库,初始化/更新业务知识库 | `--enhance <domain>`, `--migrate`, `--dry-run` |
|
|
10
|
+
| `/modus:vibe` | 上下文感知日常编码(氛围编程) | `--domain <name>`, `--verbose` |
|
|
11
|
+
| `/modus:plan` | 功能规划(设计文档 + Build 循环) | `--story <url>`, `--design`, `--quick` |
|
|
12
|
+
| `/modus:spec` | 规范驱动开发(行为规格 + 验收标准) | `--story <url>`, `--lite`, `--testcase` |
|
|
13
|
+
| `/modus:auto` | 智能模式推荐(读 TAPD 自动决策) | `--show-scores`, `--force <mode>` |
|
|
14
|
+
| `/modus:harness` | 全自动交付流水线(需求→部署) | `--story <url>`, `--skip`, `--loop1-only` |
|
|
15
|
+
| `/modus:upgrade` | 框架版本升级 | `--check`, `--dry-run`, `--changelog` |
|
|
15
16
|
|
|
16
|
-
|
|
17
|
+
所有命令支持 `--help` 参数查看中文完整说明。
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
2. Use `/modus:auto [tapd-url]` when unsure which mode fits — AI recommends based on story analysis
|
|
20
|
-
3. Use `/modus:vibe` for day-to-day coding with project context
|
|
21
|
-
4. Use `/modus:harness` for full-cycle feature delivery from a TAPD Story URL
|
|
19
|
+
## 命令选择指南
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
| 场景 | 推荐命令 |
|
|
22
|
+
|------|---------|
|
|
23
|
+
| 不确定用哪个命令 | `/modus:auto [tapd-url]` |
|
|
24
|
+
| 日常 Bug 修复、小改动 | `/modus:vibe` |
|
|
25
|
+
| 需要设计文档,无需规格 | `/modus:plan` |
|
|
26
|
+
| 有接口契约变更/可测试验收标准 | `/modus:spec` |
|
|
27
|
+
| 有 TAPD Story,全自动到部署 | `/modus:harness` |
|
|
28
|
+
| 项目新接手或代码大重构后 | `/modus:init` |
|
|
24
29
|
|
|
25
|
-
|
|
26
|
-
|-----------|-------------------|
|
|
27
|
-
| Not sure which mode to use | `/modus:auto [tapd-url]` |
|
|
28
|
-
| Quick bug fix / small change | `/modus:vibe` |
|
|
29
|
-
| Feature with design docs, no spec needed | `/modus:plan` |
|
|
30
|
-
| Interface contract changes / testable acceptance criteria | `/modus:spec` |
|
|
31
|
-
| Full automation from TAPD story to deployment | `/modus:harness` |
|
|
30
|
+
## 快速开始
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
```
|
|
33
|
+
# 1. 首次接入:扫描项目,生成业务知识库
|
|
34
|
+
/modus:init
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
# 2. 不确定用哪个命令时:输入 TAPD Story URL 让 AI 推荐
|
|
37
|
+
/modus:auto https://tapd.cn/.../stories/view/1234567890
|
|
38
|
+
|
|
39
|
+
# 3. 日常编码:描述需求,AI 自动加载业务上下文
|
|
40
|
+
/modus:vibe 给歌曲列表接口加按状态筛选功能
|
|
41
|
+
|
|
42
|
+
# 4. 全自动交付:输入 Story URL,从需求到部署
|
|
43
|
+
/modus:harness https://tapd.cn/.../stories/view/1234567890
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## 知识库路径(v3.2)
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
modus/knowledge/ # Single Source of Truth(平台无关)
|
|
50
|
+
├── _conventions/SKILL.md # 团队约定(Layer 0-T)
|
|
51
|
+
├── _tech-wiki/SKILL.md # 技术知识(Layer 1)
|
|
52
|
+
└── biz-{domain}/SKILL.md # 业务域知识(Layer 2)
|
|
53
|
+
|
|
54
|
+
modus/knowledge-catalog.md # 项目知识目录(~200 tokens)
|
|
55
|
+
modus/workspace-catalog.md # 工作区顶层路由(多项目)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
重新初始化或更新知识库:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
/modus:init --enhance biz-track # 仅更新某个域
|
|
62
|
+
/modus:init --enhance-all # 重建所有业务域
|
|
63
|
+
/modus:init --migrate # 从旧路径迁移到 modus/knowledge/
|
|
64
|
+
```
|
|
@@ -1,28 +1,70 @@
|
|
|
1
|
-
# /modus:plan
|
|
1
|
+
# /modus:plan — 功能规划(含 Build 执行与知识归档)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**用途:** 针对一个具体需求,基于业务 Skill 上下文进行六维复杂度评估,提出 3 个精准澄清问题后生成结构化 `plan.md`,在用户确认后执行代码生成,最后自动回写新知识到 Skill 库。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**借鉴自:** Cursor Plan Mode(只读规划阶段 + 用户确认后执行)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## 参数说明
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
```
|
|
10
|
+
/modus:plan [需求描述] [参数]
|
|
11
|
+
|
|
12
|
+
--help 显示完整帮助(中文)
|
|
13
|
+
--story <tapd-url> 关联 TAPD Story(自动填写背景,写入 HANDOFF story_id)
|
|
14
|
+
--project <name> 指定项目(多项目 workspace 使用)
|
|
15
|
+
--design 仅生成技术评估文档(design.md),不生成 tasks(技术方案评审场景)
|
|
16
|
+
--quick 跳过澄清 3 问,直接生成 plan(适合简单任务)
|
|
17
|
+
--enhance 生成 plan 前强制刷新相关 Skill(hash 检查)
|
|
18
|
+
--no-build 归档模式:生成 plan.md 但不触发 Build 确认循环
|
|
19
|
+
--read-only 规划模式:仅输出 plan.md,永远不触发代码生成(Cursor Plan Mode 风格)
|
|
20
|
+
--resume <name> 从已有 plan 的断点继续(读取 .modus-state.yaml)
|
|
21
|
+
--complexity <level> 手动指定复杂度(simple|medium|complex),跳过自动评分
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 使用示例
|
|
10
25
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
6. **Post-update Skills**: write back new knowledge discovered during planning
|
|
26
|
+
```
|
|
27
|
+
/modus:plan 需要支持歌曲批量导出为 Excel
|
|
28
|
+
/modus:plan --story https://tapd.cn/.../stories/view/123 新增艺人等级评定功能
|
|
29
|
+
/modus:plan --design 评估版权对账系统的重构方案
|
|
30
|
+
/modus:plan --quick 修复版权审核列表分页 bug
|
|
31
|
+
/modus:plan --read-only 分析中央曲库同步的架构方案
|
|
32
|
+
/modus:plan --resume batch-export 继续上次中断的规划
|
|
33
|
+
```
|
|
20
34
|
|
|
21
|
-
##
|
|
35
|
+
## 执行流程概览
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
① 域匹配:基于 knowledge-catalog.md 判断涉及的业务域
|
|
39
|
+
② 复杂度评估:六维评分 → simple / medium / complex 分级
|
|
40
|
+
complex → 提示考虑升级为 /modus:spec 或 /modus:harness
|
|
41
|
+
③ 两层知识检索:Skill 前置更新(hash 检查)→ 源码按需加载
|
|
42
|
+
④ 精准 3 问:pitfall 关联问题 + 范围边界 + 优先级约束
|
|
43
|
+
⑤ 生成 plan.md:概述 / 关键约束 / 已知风险 / 方案对比 / Todos / 影响文件
|
|
44
|
+
⚠️ 规划阶段 — 此时尚未修改任何代码
|
|
45
|
+
⑥ Build 确认循环(人工审批节点):用户确认后启动代码生成
|
|
46
|
+
⑦ 后置知识回写:技术决策 → [decision],新风险 → [pitfall]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## 产出物
|
|
22
50
|
|
|
23
51
|
```
|
|
24
52
|
modus/plans/{name}/
|
|
25
|
-
├──
|
|
26
|
-
|
|
27
|
-
|
|
53
|
+
├── .modus-state.yaml — 状态文件(含 complexity,支持断点续跑)
|
|
54
|
+
└── plan.md — 规划文档(概述/风险/方案对比/Todos/影响文件)
|
|
55
|
+
|
|
56
|
+
归档后移动到:modus/plans/archive/{date}-{name}/
|
|
28
57
|
```
|
|
58
|
+
|
|
59
|
+
## 与其他命令的对比
|
|
60
|
+
|
|
61
|
+
| 场景 | 推荐命令 |
|
|
62
|
+
|------|---------|
|
|
63
|
+
| 日常 Bug 修复、小改动 | `/modus:vibe` |
|
|
64
|
+
| 需要设计文档,无需规格 | `/modus:plan`(本命令) |
|
|
65
|
+
| 需要可测试验收标准、接口契约 | `/modus:spec` |
|
|
66
|
+
| 有 TAPD Story,全自动到部署 | `/modus:harness` |
|
|
67
|
+
|
|
68
|
+
## 执行此命令
|
|
69
|
+
|
|
70
|
+
读取并执行 `.codebuddy/skills/modus-plan/SKILL.md` 中的完整流程。
|