@modus-ai/modus 0.2.5 → 0.2.7

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.
Files changed (49) hide show
  1. package/README.md +62 -45
  2. package/dist/commands/init.d.ts.map +1 -1
  3. package/dist/commands/init.js +37 -6
  4. package/dist/commands/init.js.map +1 -1
  5. package/dist/generators/claude.js +1 -1
  6. package/dist/generators/claude.js.map +1 -1
  7. package/dist/generators/codebuddy.d.ts.map +1 -1
  8. package/dist/generators/codebuddy.js +3 -1
  9. package/dist/generators/codebuddy.js.map +1 -1
  10. package/dist/generators/codex.d.ts +10 -0
  11. package/dist/generators/codex.d.ts.map +1 -0
  12. package/dist/generators/codex.js +178 -0
  13. package/dist/generators/codex.js.map +1 -0
  14. package/dist/generators/cursor.d.ts.map +1 -1
  15. package/dist/generators/cursor.js +36 -7
  16. package/dist/generators/cursor.js.map +1 -1
  17. package/dist/generators/custom.d.ts +55 -0
  18. package/dist/generators/custom.d.ts.map +1 -0
  19. package/dist/generators/custom.js +166 -0
  20. package/dist/generators/custom.js.map +1 -0
  21. package/dist/generators/index.d.ts +1 -0
  22. package/dist/generators/index.d.ts.map +1 -1
  23. package/dist/generators/index.js +10 -0
  24. package/dist/generators/index.js.map +1 -1
  25. package/dist/utils/config.d.ts +6 -1
  26. package/dist/utils/config.d.ts.map +1 -1
  27. package/dist/utils/config.js.map +1 -1
  28. package/package.json +1 -1
  29. package/schemas/harness-schema.yaml +178 -53
  30. package/templates/agents/modus-analyst.md +1 -1
  31. package/templates/commands/auto.md +61 -27
  32. package/templates/commands/harness.md +94 -34
  33. package/templates/commands/init.md +43 -10
  34. package/templates/commands/modus.md +55 -28
  35. package/templates/commands/plan.md +60 -18
  36. package/templates/commands/spec.md +69 -25
  37. package/templates/commands/upgrade.md +54 -0
  38. package/templates/commands/vibe.md +55 -5
  39. package/templates/knowledge-catalog.md +23 -10
  40. package/templates/skills/modus-agents/analyst/SKILL.md +11 -12
  41. package/templates/skills/modus-agents/developer/SKILL.md +14 -12
  42. package/templates/skills/modus-agents/reviewer/SKILL.md +50 -23
  43. package/templates/skills/modus-auto/SKILL.md +580 -123
  44. package/templates/skills/modus-design-brief/SKILL.md +17 -9
  45. package/templates/skills/modus-harness/SKILL.md +95 -96
  46. package/templates/skills/modus-init/SKILL.md +403 -188
  47. package/templates/skills/modus-plan/SKILL.md +16 -5
  48. package/templates/skills/modus-platform/SKILL.md +271 -0
  49. package/templates/skills/modus-vibe/SKILL.md +285 -187
@@ -1,37 +1,64 @@
1
- # /modus
1
+ # /modus — Modus AI 编码加速框架
2
2
 
3
- Modus — Business-grounded AI coding accelerator.
3
+ **Modus**知识驱动的 AI 编码框架,核心理念:每次工作流都是一次知识积累,用业务 Skill 消除 AI 的冷启动问题。
4
4
 
5
- ## Available Commands
5
+ ## 可用命令
6
6
 
7
- | Command | Description |
8
- |---|---|
9
- | `/modus:init` | Scan codebase, classify business domains, generate domain Skill files |
10
- | `/modus:vibe` | Context-aware vibe coding with business Skill backing |
11
- | `/modus:plan` | Plan mode with Skill-backed business context |
12
- | `/modus:spec` | OpenSpec-style spec-driven development |
13
- | `/modus:auto` | Smart mode recommendation reads TAPD Story, scores 4 dimensions, recommends vibe/plan/spec/harness |
14
- | `/modus:harness` | Full dual-loop multi-agent Harness (analyze dev → test → review → deploy) |
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
- ## Quick Start
17
+ 所有命令支持 `--help` 参数查看中文完整说明。
17
18
 
18
- 1. Run `/modus:init` once to scan your project and build business Skills
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
- ## Mode Selection Guide
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
- | Situation | Recommended Command |
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
- ## Tips
32
+ ```
33
+ # 1. 首次接入:扫描项目,生成业务知识库
34
+ /modus:init
34
35
 
35
- - Business Skill files live in `.codebuddy/skills/modus-biz-*/SKILL.md`
36
- - Re-run `/modus:init` any time your domain model changes
37
- - All commands fall back gracefully if business Skills are missing
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
- Plan mode. Generate structured planning documents (proposal, design, tasks) backed by up-to-date business Skills.
3
+ **用途:** 针对一个具体需求,基于业务 Skill 上下文进行六维复杂度评估,提出 3 个精准澄清问题后生成结构化 `plan.md`,在用户确认后执行代码生成,最后自动回写新知识到 Skill 库。
4
4
 
5
- ## Instructions
5
+ **借鉴自:** Cursor Plan Mode(只读规划阶段 + 用户确认后执行)
6
6
 
7
- Read and follow the skill at `.codebuddy/skills/modus-plan/SKILL.md` to execute this command.
7
+ ## 参数说明
8
8
 
9
- ## Quick Summary
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
- 1. Check for business Skills (same fallback as `/modus:vibe`)
12
- 2. Identify relevant business domains from the user's request
13
- 3. **Pre-update Skills**: refresh relevant business Skill files based on latest code
14
- 4. Generate planning documents to `modus/plans/{name}/`:
15
- - `proposal.md` intent and scope
16
- - `design.md` — technical approach and decisions
17
- - `tasks.md` implementation checklist
18
- 5. Ask user whether to archive → move to `modus/plans/archive/{YYYY-MM-DD}-{name}/`
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
- ## Output Location
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
- ├── proposal.md
26
- ├── design.md
27
- └── tasks.md
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` 中的完整流程。
@@ -1,37 +1,81 @@
1
- # /modus:spec
1
+ # /modus:spec — 规范驱动开发(OpenSpec 行为规格)
2
2
 
3
- OpenSpec-style spec-driven development. Generate behavior specifications (delta specs) + design + tasks, with archive merging specs into the main spec library.
3
+ **用途:** `/plan` 基础上增加行为规格(delta specs),用 GIVEN/WHEN/THEN 明确系统「WHAT」,规格可测试,归档时自动检测冲突并合并到主规格库(Source of Truth)。适用于有接口契约变更、需要可测试验收标准的场景。
4
4
 
5
- ## Instructions
5
+ **借鉴自:** OpenSpec 规范 + Gherkin BDD(Cucumber)的 Feature/Scenario 格式
6
6
 
7
- Read and follow the skill at `.codebuddy/skills/modus-spec/SKILL.md` to execute this command.
7
+ ## 参数说明
8
8
 
9
- ## Quick Summary
9
+ ```
10
+ /modus:spec [需求描述] [参数]
11
+
12
+ --help 显示完整帮助(中文)
13
+ --story <tapd-url> 关联 TAPD Story(自动填写背景,写入 HANDOFF story_id)
14
+ --project <name> 指定项目(多项目 workspace 使用)
15
+ --lite 轻量模式:跳过 design-brief,仅生成 delta-specs + tasks
16
+ --delta 仅生成 delta-specs.md(不生成 design 和 tasks)
17
+ --testcase 归档前同步生成 QA 测试用例文件(testcases.md,JUnit 5 骨架)
18
+ --verify 归档前执行三维验证(完整性/正确性/一致性)
19
+ --resume <name> 从断点继续(读取 .modus-state.yaml)
20
+ --no-archive 跳过归档到主规格库(适合实验性变更)
21
+ ```
22
+
23
+ ## 使用示例
24
+
25
+ ```
26
+ /modus:spec 新增歌曲批量审批功能
27
+ /modus:spec --story https://tapd.cn/.../stories/view/123 艺人等级评定
28
+ /modus:spec --lite 优化版权查询索引
29
+ /modus:spec --testcase 修改支付超时时间从 30 分钟改为 15 分钟
30
+ /modus:spec --verify --story https://tapd.cn/.../123 电子签约批量重签
31
+ /modus:spec --resume batch-approve 继续上次中断的规格
32
+ ```
33
+
34
+ ## 与 `/modus:plan` 的区别
10
35
 
11
- 1. Check for business Skills (same fallback as `/modus:vibe`)
12
- 2. Identify relevant business domains
13
- 3. **Pre-update Skills**: refresh relevant business Skill files
14
- 4. Generate specification documents to `modus/changes/{name}/`:
15
- - `proposal.md` intent and scope
16
- - `specs/{domain}/spec.md` delta specs (ADDED/MODIFIED/REMOVED requirements with Scenarios)
17
- - `design.md` technical approach
18
- - `tasks.md` implementation checklist (includes spec verification tasks)
19
- 5. Ask user whether to archive:
20
- - Delta specs merged into `modus/specs/` (source of truth)
21
- - Change folder moved to `modus/changes/archive/{YYYY-MM-DD}-{name}/`
22
- 6. **Post-update Skills**: write back new business rules and contracts
36
+ | 维度 | `/modus:plan` | `/modus:spec` |
37
+ |------|--------------|----------------|
38
+ | 产出物 | 单一 `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` |
23
44
 
24
- ## Delta Spec Format
45
+ ## Delta Specs 格式(Gherkin 风格)
25
46
 
26
- Use ADDED/MODIFIED/REMOVED sections with GIVEN/WHEN/THEN scenarios.
27
- Specs describe WHAT the system does, not HOW.
47
+ ```markdown
48
+ Feature: 批量审批订单
28
49
 
29
- ## Output Location
50
+ ## ADDED Requirements
51
+
52
+ ### Scenario: Happy Path
53
+ Given 用户已登录且拥有审批权限
54
+ When 提交包含 ≥1 条订单 ID 的批量审批请求
55
+ Then 所有订单状态变更为 APPROVED,返回成功数量
56
+
57
+ ### Scenario: 超出上限
58
+ Given 请求包含 > 50 条订单 ID
59
+ When 提交批量审批请求
60
+ Then 系统返回 400 错误:"批量操作上限 50 条"
61
+ ```
62
+
63
+ ## 产出物
30
64
 
31
65
  ```
32
66
  modus/changes/{name}/
33
- ├── proposal.md
34
- ├── specs/{domain}/spec.md delta specs
35
- ├── design.md
36
- └── tasks.md
67
+ ├── .modus-state.yaml — 状态文件(支持断点续跑)
68
+ ├── proposal.md 意图与范围
69
+ ├── specs/{domain}/spec.md — delta specs(ADDED/MODIFIED/REMOVED)
70
+ ├── design.md — 技术方案
71
+ ├── design-brief.md — 精确实现指南(Full 模式)
72
+ ├── tasks.md — 实现清单(追踪到 Scenario)
73
+ └── testcases.md — QA 用例(--testcase 时生成)
74
+
75
+ 归档后:modus/changes/archive/{date}-{name}/
76
+ 主规格库:modus/specs/{domain}/spec.md(历次归档合并)
37
77
  ```
78
+
79
+ ## 执行此命令
80
+
81
+ 读取并执行 `.codebuddy/skills/modus-spec/SKILL.md` 中的完整流程。
@@ -0,0 +1,54 @@
1
+ # /modus:upgrade — 框架版本升级
2
+
3
+ **用途:** 检测 Modus 框架新版本,自动执行目录结构迁移和 Skill 格式升级,保持项目与最新规范一致。
4
+
5
+ ## 参数说明
6
+
7
+ ```
8
+ /modus:upgrade [参数]
9
+
10
+ --help 显示完整帮助(中文)
11
+ --check 仅检查当前版本和最新版本,不执行升级
12
+ --dry-run 预览将修改哪些文件,不实际写入
13
+ --changelog 显示从当前版本到最新版的变更日志
14
+ --target <version> 升级到指定版本(默认最新稳定版)
15
+ --project <name> 仅升级指定项目的 Skill 文件(多项目时)
16
+ --migrate-only 仅执行文件结构迁移,不更新框架 Skill 模板
17
+ --backup-dir <path> 指定备份目录(默认 modus/backup/{date}/)
18
+ --force 强制升级(即使版本一致,用于修复损坏的文件)
19
+ ```
20
+
21
+ ## 使用示例
22
+
23
+ ```
24
+ /modus:upgrade # 检查并执行升级到最新版
25
+ /modus:upgrade --check # 仅检查当前和最新版本
26
+ /modus:upgrade --dry-run # 预览升级变更,不实际修改
27
+ /modus:upgrade --changelog # 查看版本变更说明
28
+ /modus:upgrade --target 3.2.0 # 升级到指定版本
29
+ /modus:upgrade --migrate-only # 仅迁移目录结构,不更新模板
30
+ ```
31
+
32
+ ## 版本迁移说明
33
+
34
+ | 版本 | 主要变更 |
35
+ |------|---------|
36
+ | v3.2.0 | 跨 Skill 路径全面统一到 `modus/knowledge/biz-*/`;步骤编号规范化(禁止小数步骤);modus-analyst 产出路径更正到 `modus/stories/{id}/harness/`;modus-plan 双路径产出规则(Story 模式 vs 独立模式) |
37
+ | v3.1.0 | 知识库路径迁移:`.codebuddy/skills/modus-biz-*` → `modus/knowledge/biz-*`;新增工作区顶层路由 `modus/workspace-catalog.md`;HANDOFF 协议升级到 schema v1.1 |
38
+ | v3.0.0 | 多项目工作区支持(modus-workspace.yaml);引用式适配(不复制知识) |
39
+ | v2.x | 初始版本 |
40
+
41
+ ## 升级流程
42
+
43
+ ```
44
+ ① 读取本地 modus/config.yaml 的 modus_version 字段
45
+ ② 对比目标版本,展示差异摘要
46
+ ③ 询问确认(--force 时跳过)
47
+ ④ 备份现有文件到 modus/backup/{date}/
48
+ ⑤ 执行迁移:文件结构调整 + Skill 格式更新
49
+ ⑥ 输出迁移完成报告
50
+ ```
51
+
52
+ ## 执行此命令
53
+
54
+ 读取并执行 `.codebuddy/skills/modus-upgrade/SKILL.md` 中的完整流程。
@@ -1,12 +1,24 @@
1
- # /modus:vibe
1
+ # /modus:vibe — 上下文感知编码(氛围编程)
2
2
 
3
- Context-aware vibe coding. Intelligently loads relevant business Skills, auto-syncs stale knowledge, and applies rule-driven clarification before coding so AI works as a knowledgeable project member.
3
+ **用途:** 执行日常编码任务前,自动加载相关业务 Skill,让 AI 以「懂项目的开发者」身份工作,而非冷启动。适合 Bug 修复、小功能迭代、代码重构等日常任务。
4
4
 
5
- ## Instructions
5
+ > Context-aware vibe coding. Intelligently loads relevant business Skills, auto-syncs stale knowledge, and applies rule-driven clarification before coding so AI works as a knowledgeable project member.
6
6
 
7
- Read and follow the skill at `.codebuddy/skills/modus-vibe/SKILL.md` to execute this command.
7
+ ## 参数说明
8
8
 
9
- ## Quick Summary
9
+ ```
10
+ /modus:vibe [需求描述] [参数]
11
+
12
+ --help 显示完整帮助(中文)
13
+ --domain <name> 强制加载指定业务域(跳过自动匹配,如 --domain biz-track)
14
+ --project <name> 指定项目(多项目 workspace 使用)
15
+ --context <file> 额外加载指定文件作为上下文(相对路径)
16
+ --no-skill 跳过 Skill 加载,直接用原始代码上下文(不推荐)
17
+ --verbose 显示 Skill 加载过程和 token 预估
18
+ --dry-run 仅展示将加载的 Skill 和文件,不执行编码
19
+ ```
20
+
21
+ ## 执行流程(概览)
10
22
 
11
23
  1. Read `modus/config.yaml` for hard constraints (constitution)
12
24
  2. Load `modus/knowledge-catalog.md` (Level 1, ~200 tokens)
@@ -20,3 +32,41 @@ Read and follow the skill at `.codebuddy/skills/modus-vibe/SKILL.md` to execute
20
32
  10. Append session log to `modus/sessions/vibe-log.md`
21
33
 
22
34
  **Degraded mode** (no business Skills): proceed without domain context, note quality may be lower, show `[降级模式:无业务上下文,建议先运行 /modus:init]`.
35
+
36
+ ## 使用示例
37
+
38
+ ```
39
+ /modus:vibe 给歌曲列表接口加一个按状态筛选的功能
40
+ /modus:vibe 订单支付回调逻辑有个 NPE,帮我排查
41
+ /modus:vibe --domain biz-track 重构歌曲同步的重试机制
42
+ /modus:vibe --verbose 分析专辑发行流程的性能瓶颈
43
+ /modus:vibe --dry-run 优化版权审核的并发处理
44
+ ```
45
+
46
+ ## 知识加载策略(渐进三级)
47
+
48
+ ```
49
+ Level 1(必须,~200 tokens)
50
+ 读 modus/knowledge-catalog.md
51
+ → 了解可用知识域,匹配当前任务相关域
52
+
53
+ Level 2(按需,~3000 tokens/个)
54
+ 仅读与任务语义匹配的 modus/knowledge/biz-*/SKILL.md
55
+ → 不相关的域不加载,节省 ~59% token
56
+
57
+ Level 3(执行时,无上限)
58
+ 从 Skill 的 key_files 索引按需读取实际代码文件
59
+ → 绝不预先全量读取
60
+ ```
61
+
62
+ ## 无业务 Skill 时的兜底
63
+
64
+ ```
65
+ ⚠️ 未找到业务知识库!建议先运行:/modus:init
66
+ A. 现在运行快速初始化
67
+ B. 继续(无业务上下文,结果质量可能降低)
68
+ ```
69
+
70
+ ## 执行此命令
71
+
72
+ 读取并执行 `.codebuddy/skills/modus-vibe/SKILL.md` 中的完整流程。
@@ -1,5 +1,12 @@
1
- # Modus 知识全景目录
1
+ # Modus 知识全景目录 — {project-name}
2
2
  # 所有 Modus 命令启动时先读此文件(Level 1 加载,~200 tokens)
3
+ # 框架版本:3.1.0 | 知识库路径:{project}/modus/knowledge/**(Single Source of Truth)
4
+ # 多平台适配:CLAUDE.md / AGENTS.md / .cursor/rules/ 均为引用式,修改请直接编辑 modus/knowledge/ 下的文件
5
+ #
6
+ # 路由层级:
7
+ # workspace → modus/workspace-catalog.md(顶层,~100 tokens)
8
+ # project → 本文件(~200 tokens)
9
+ # domain → modus/knowledge/biz-*/SKILL.md(~3000 tokens/个,按需加载)
3
10
  # 按需再读完整 SKILL.md(Level 2,~3000 tokens/个)
4
11
  # 或直接读 Skill 引用的实际代码文件(Level 3,按需)
5
12
 
@@ -12,20 +19,17 @@ updated: {YYYY-MM-DD}
12
19
  [由 /modus:init 生成,不随项目代码变化,手动维护]
13
20
 
14
21
  ## 团队约定 (Layer 0-T)
15
- - **modus-team-conventions**: 代码规范/提交规范/最佳实践
16
- [status: draft] [format: v2/14节] [upstream: -]
17
- 更新: {日期}
22
+ - **_conventions**: {规范描述} [maturity: draft] 更新: {日期}
23
+ - 路径:`{project}/modus/knowledge/_conventions/SKILL.md`
18
24
 
19
25
  ## 技术知识 (Layer 1)
20
- - **modus-tech-wiki**: 跨项目技术经验(反模式、架构决策、性能优化)
21
- [status: draft] [format: v2/14节] [upstream: -]
22
- 更新: {日期}
26
+ - **_tech-wiki**: {技术栈描述} [maturity: draft] 更新: {日期}
27
+ - 路径:`{project}/modus/knowledge/_tech-wiki/SKILL.md`
23
28
 
24
29
  ## 业务知识 (Layer 2)
25
30
  <!-- 由 /modus:init 生成,由各模式工作流自动更新 -->
26
- - **modus-biz-{domain}**: {中文域名} — {核心职责一句话}
27
- [status: draft] [format: v3/17节] [upstream: {依赖域列表,无则写-}]
28
- 更新: {日期} hash: {last_hash 前8位}
31
+ - **biz-{domain}**: {中文域名} — {核心职责一句话} [maturity: draft] 最近引用: {日期}
32
+ - 路径:`{project}/modus/knowledge/biz-{domain}/SKILL.md`
29
33
 
30
34
  ## 域依赖图 (Dependency Graph)
31
35
  <!--
@@ -52,6 +56,15 @@ updated: {YYYY-MM-DD}
52
56
 
53
57
  目标:不相关的 Skill 不加载,大幅降低 token 消耗。
54
58
 
59
+ ## 框架命令(快速参考)
60
+ - **modus:init** `--help` `--enhance [domain]` `--enhance-all` `--migrate` `--dry-run` `--force` `--platform [list]` `--no-sync` `--verbose` `--reset-maturity` `--project [name]`
61
+ - **modus:vibe** `--help` `--domain [name]` `--project [name]` `--context [file]` `--no-skill` `--verbose` `--dry-run`
62
+ - **modus:plan** `--help` `--story [url]` `--design` `--quick` `--enhance` `--no-build` `--resume [name]` `--complexity [level]` `--project [name]`
63
+ - **modus:spec** `--help` `--story [url]` `--lite` `--delta` `--testcase` `--verify` `--resume [name]` `--no-archive` `--project [name]`
64
+ - **modus:auto** `--help` `--force [mode]` `--no-confirm` `--show-scores` `--project [name]`
65
+ - **modus:harness** `--help` `--story [url]` `--skip [agents]` `--loop1-only` `--resume` `--dry-run` `--force-rebuild-skill` `--no-deploy` `--max-loop2 [n]` `--notify [channel]` `--project [name]`
66
+ - **modus:upgrade** `--help` `--check` `--dry-run` `--changelog` `--target [version]` `--project [name]`
67
+
55
68
  ## Skill status 生命周期
56
69
 
57
70
  | status | 含义 | 升级方式 |
@@ -9,7 +9,7 @@ disable: false
9
9
 
10
10
  **调用方:** Harness Orchestrator(`modus-harness`)
11
11
  **输入:** TAPD Story URL + 相关业务 Skill 内容
12
- **产出物:** `modus/plans/active/{story-id}/01-analysis.md`
12
+ **产出物:** `modus/stories/{story-id}/harness/01-analysis.md`
13
13
 
14
14
  ## 职责
15
15
 
@@ -23,7 +23,7 @@ disable: false
23
23
 
24
24
  1. 从 TAPD Story URL 获取需求内容(标题、描述、验收标准)
25
25
  2. 读取 Orchestrator 传入的相关业务 Skill 文件
26
- 3. 读取 `modus/config.yaml` 中的项目背景信息
26
+ 3. 使用 Orchestrator 传入的 constitution 内容(来自 `{project}/modus/config.yaml`,无需独立读取)
27
27
 
28
28
  ### Step 2:业务分析
29
29
 
@@ -95,20 +95,19 @@ disable: false
95
95
  ## 产出物格式(01-analysis.md)
96
96
 
97
97
  ```markdown
98
- # 需求分析报告
99
-
100
- <!--HANDOFF
98
+ ---
99
+ schema_version: "1.1"
101
100
  agent: "01-analysis"
101
+ run_id: "{YYYYMMDD}-{story_id_prefix}"
102
102
  story_id: "{story-id}"
103
+ task_id: ""
103
104
  domains: ["{domain1}", "{domain2}"]
104
- sprint_count: {N}
105
- risk_level: "{low|medium|high}"
106
- key_constraints:
107
- - "{约束1,来自 constitution.hard_rules 或需求特殊限制}"
105
+ gate_status: "{passed|failed}"
106
+ artifact_status: "complete"
107
+ issues: []
108
108
  skill_refs:
109
109
  - "modus-biz-{domain}@{version}"
110
- gate_status: "{passed|failed}"
111
- -->
110
+ ---
112
111
 
113
112
  ## 基本信息
114
113
  - Story ID: {id}
@@ -153,6 +152,6 @@ gate_status: "{passed|failed}"
153
152
  - 每个风险点必须附带处理建议
154
153
  - Sprint 计划必须可直接指导 SubAgent 02 开发,不能含糊
155
154
  - 验收标准必须可测试(能直接写成测试用例)
156
- - **HANDOFF 块必须位于文件最顶部(Markdown 注释形式)**,`gate_status` 字段不可省略
155
+ - **HANDOFF 块必须位于文件最顶部(YAML frontmatter 形式,`---...---`)**,`gate_status` 字段不可省略
157
156
  - `gate_status` 赋值规则:分析完整且无重大歧义 → `passed`;存在无法确认的关键信息 → `failed`(Orchestrator 会重入本 SubAgent)
158
157
  - `risk_level` 取值:有事务/并发/数据迁移风险 → `high`;有接口变更但逻辑清晰 → `medium`;纯新增无破坏 → `low`
@@ -8,8 +8,8 @@ disable: false
8
8
  # modus-developer(代码开发 SubAgent)
9
9
 
10
10
  **调用方:** Harness Orchestrator(Gate A0.5 通过后触发)
11
- **输入:** `01-analysis.md` + `01.5-design-brief.md` + 业务 Skill 内容 + constitution
12
- **产出物:** `modus/plans/active/{story-id}/02-sprint-contract.md` + 代码变更
11
+ **输入:** `01-analysis.md` + `02-design-brief.md` + 业务 Skill 内容 + constitution
12
+ **产出物:** `modus/stories/{story-id}/harness/03-sprint-contract.md` + 代码变更
13
13
 
14
14
  ## 职责
15
15
 
@@ -21,7 +21,7 @@ disable: false
21
21
 
22
22
  ### Step 1:读取输入
23
23
 
24
- 1. 读取 `01.5-design-brief.md`(技术方案,重点关注节 5-8)
24
+ 1. 读取 `02-design-brief.md`(技术方案,重点关注节 5-8)
25
25
  2. 读取 `01-analysis.md`(Sprint 执行计划、验收标准)
26
26
  3. 确认 `constitution.hard_rules` 和 `key_patterns`(最高优先级约束)
27
27
  4. 按需读取 Skill 关键文件索引中的实际代码文件(Level 3 加载,≤ 10 个文件)
@@ -105,17 +105,19 @@ Sprint 4:集成层(如有)
105
105
  ## 产出物格式(02-sprint-contract.md)
106
106
 
107
107
  ```markdown
108
- <!--HANDOFF
109
- agent: "02-developer"
108
+ ---
109
+ schema_version: "1.1"
110
+ agent: "03-dev"
111
+ run_id: "{YYYYMMDD}-{story_id_prefix}"
110
112
  story_id: "{story-id}"
111
- sprint_count: {N}
112
- sprints_completed: {N}
113
+ task_id: ""
114
+ domains: ["{domain1}", "{domain2}"]
113
115
  gate_status: "{passed|failed}"
114
- changed_files:
115
- - "{文件路径}"
116
- key_decisions:
117
- - "{实现中做出的关键决策}"
118
- -->
116
+ artifact_status: "complete"
117
+ issues: []
118
+ skill_refs:
119
+ - "modus-biz-{domain}@{version}"
120
+ ---
119
121
 
120
122
  # 代码开发执行合同 — {Story 标题}
121
123