@modus-ai/modus 0.1.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.
Files changed (58) hide show
  1. package/README.md +121 -0
  2. package/bin/modus.js +2 -0
  3. package/dist/cli/index.d.ts +2 -0
  4. package/dist/cli/index.d.ts.map +1 -0
  5. package/dist/cli/index.js +39 -0
  6. package/dist/cli/index.js.map +1 -0
  7. package/dist/commands/config.d.ts +2 -0
  8. package/dist/commands/config.d.ts.map +1 -0
  9. package/dist/commands/config.js +66 -0
  10. package/dist/commands/config.js.map +1 -0
  11. package/dist/commands/init.d.ts +2 -0
  12. package/dist/commands/init.d.ts.map +1 -0
  13. package/dist/commands/init.js +89 -0
  14. package/dist/commands/init.js.map +1 -0
  15. package/dist/commands/update.d.ts +2 -0
  16. package/dist/commands/update.d.ts.map +1 -0
  17. package/dist/commands/update.js +19 -0
  18. package/dist/commands/update.js.map +1 -0
  19. package/dist/generators/codebuddy.d.ts +3 -0
  20. package/dist/generators/codebuddy.d.ts.map +1 -0
  21. package/dist/generators/codebuddy.js +77 -0
  22. package/dist/generators/codebuddy.js.map +1 -0
  23. package/dist/index.d.ts +4 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.js +4 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/utils/config.d.ts +13 -0
  28. package/dist/utils/config.d.ts.map +1 -0
  29. package/dist/utils/config.js +25 -0
  30. package/dist/utils/config.js.map +1 -0
  31. package/dist/utils/file-system.d.ts +11 -0
  32. package/dist/utils/file-system.d.ts.map +1 -0
  33. package/dist/utils/file-system.js +41 -0
  34. package/dist/utils/file-system.js.map +1 -0
  35. package/package.json +55 -0
  36. package/schemas/harness-schema.yaml +91 -0
  37. package/schemas/knowledge-schema.yaml +174 -0
  38. package/schemas/plan-schema.yaml +42 -0
  39. package/schemas/spec-schema.yaml +64 -0
  40. package/templates/commands/harness.md +46 -0
  41. package/templates/commands/init.md +16 -0
  42. package/templates/commands/plan.md +28 -0
  43. package/templates/commands/spec.md +37 -0
  44. package/templates/commands/vibe.md +18 -0
  45. package/templates/knowledge-catalog.md +26 -0
  46. package/templates/skills/modus-harness/SKILL.md +247 -0
  47. package/templates/skills/modus-harness-agents/00-skills-builder/SKILL.md +293 -0
  48. package/templates/skills/modus-harness-agents/01-analysis/SKILL.md +135 -0
  49. package/templates/skills/modus-harness-agents/02-dev/SKILL.md +102 -0
  50. package/templates/skills/modus-harness-agents/03-test/SKILL.md +84 -0
  51. package/templates/skills/modus-harness-agents/04-perf/SKILL.md +109 -0
  52. package/templates/skills/modus-harness-agents/05-security/SKILL.md +116 -0
  53. package/templates/skills/modus-harness-agents/06-review/SKILL.md +123 -0
  54. package/templates/skills/modus-harness-agents/07-deploy/SKILL.md +101 -0
  55. package/templates/skills/modus-init/SKILL.md +227 -0
  56. package/templates/skills/modus-plan/SKILL.md +246 -0
  57. package/templates/skills/modus-spec/SKILL.md +255 -0
  58. package/templates/skills/modus-vibe/SKILL.md +150 -0
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@modus-ai/modus",
3
+ "version": "0.1.0",
4
+ "description": "Modus — Business-grounded AI coding accelerator for CodeBuddy IDE",
5
+ "keywords": [
6
+ "ai",
7
+ "coding",
8
+ "codebuddy",
9
+ "agent",
10
+ "skill",
11
+ "harness"
12
+ ],
13
+ "homepage": "https://github.com/modus-ai/modus",
14
+ "license": "MIT",
15
+ "type": "module",
16
+ "main": "dist/index.js",
17
+ "exports": {
18
+ ".": "./dist/index.js"
19
+ },
20
+ "bin": {
21
+ "modus": "bin/modus.js"
22
+ },
23
+ "files": [
24
+ "bin",
25
+ "dist",
26
+ "templates",
27
+ "schemas"
28
+ ],
29
+ "scripts": {
30
+ "build": "tsc",
31
+ "dev": "tsc --watch",
32
+ "dev:cli": "node --loader ts-node/esm src/cli/index.ts",
33
+ "test": "vitest run",
34
+ "lint": "eslint src",
35
+ "prepublishOnly": "npm run build"
36
+ },
37
+ "dependencies": {
38
+ "commander": "^12.1.0",
39
+ "chalk": "^5.3.0",
40
+ "inquirer": "^10.1.8",
41
+ "js-yaml": "^4.1.0",
42
+ "glob": "^11.0.0"
43
+ },
44
+ "devDependencies": {
45
+ "@types/node": "^20.14.0",
46
+ "@types/js-yaml": "^4.0.9",
47
+ "typescript": "^5.5.0",
48
+ "vitest": "^2.0.0",
49
+ "eslint": "^9.0.0",
50
+ "ts-node": "^10.9.2"
51
+ },
52
+ "engines": {
53
+ "node": ">=18.0.0"
54
+ }
55
+ }
@@ -0,0 +1,91 @@
1
+ # Modus Harness Schema
2
+ # 定义 /modus:harness 双 Loop 多智能体流程的产出物及调度规则
3
+ name: harness
4
+ description: 双 Loop 多智能体 Harness — 全自动需求分析、开发、测试、评审、部署流程
5
+
6
+ subAgents:
7
+ - id: "01"
8
+ skill: modus-harness-01-analysis
9
+ name: 需求分析
10
+ generates: 01-analysis.md
11
+ requires: []
12
+ loop: 1
13
+
14
+ - id: "02"
15
+ skill: modus-harness-02-dev
16
+ name: 代码开发
17
+ generates: 02-sprint-contract.md
18
+ requires: ["01"]
19
+ loop: 1
20
+ gateAfter: compile # Gate A: 编译验证
21
+
22
+ - id: "03"
23
+ skill: modus-harness-03-test
24
+ name: 代码测试
25
+ generates: 03-test-report.md
26
+ requires: ["02"]
27
+ loop: 1
28
+ parallel: ["03", "04", "05"] # 与 04/05 并行
29
+
30
+ - id: "04"
31
+ skill: modus-harness-04-perf
32
+ name: 性能审计
33
+ generates: 04-perf-report.md
34
+ requires: ["02"]
35
+ loop: 1
36
+ parallel: ["03", "04", "05"]
37
+
38
+ - id: "05"
39
+ skill: modus-harness-05-security
40
+ name: 安全审计
41
+ generates: 05-security-report.md
42
+ requires: ["02"]
43
+ loop: 1
44
+ parallel: ["03", "04", "05"]
45
+
46
+ - id: "06"
47
+ skill: modus-harness-06-review
48
+ name: 代码评审
49
+ generates: cr-report.md
50
+ requires: ["03", "04", "05"] # Gate B: 等待 03/04/05 全部完成
51
+ loop: 2
52
+
53
+ - id: "07"
54
+ skill: modus-harness-07-deploy
55
+ name: 部署发布
56
+ generates: 07-deploy-status.md
57
+ requires: ["06"]
58
+ loop: 2
59
+ gateAfter: noPnPProblems # Gate C: cr-report.md 无 P1/P2
60
+
61
+ gates:
62
+ compile:
63
+ description: 编译验证
64
+ condition: "项目构建工具编译,exit code = 0"
65
+ onFail: retrySubAgent02
66
+ maxRetry: 3
67
+
68
+ noPnPProblems:
69
+ description: 代码评审质量门
70
+ condition: "cr-report.md 中 P1 和 P2 问题数量为 0"
71
+ onFail: retryFromSubAgent02
72
+ maxRetry: 3
73
+
74
+ loop2:
75
+ trigger: "cr-report.md 中存在 P1 或 P2 问题"
76
+ action: "定位涉及的 Sprint,精准重入 SubAgent 02(非全量重跑)"
77
+ rerunPath: ["02", "Gate A", "03+04+05", "06"]
78
+ maxLoops: 3
79
+ onMaxLoopsReached: "暂停流程,上报用户,请求人工介入"
80
+
81
+ finalReview:
82
+ trigger: "Gate C 通过(cr-report.md 无 P1/P2)"
83
+ action: "等待人工 Final Review,确认后合入主干"
84
+
85
+ timeout:
86
+ perSubAgent: 15m
87
+ action: "汇报卡点,询问用户是否重试"
88
+
89
+ directories:
90
+ active: modus/plans/active
91
+ archive: modus/plans/archive
@@ -0,0 +1,174 @@
1
+ # Modus Knowledge Schema
2
+ # 定义 knowledge-catalog.md 和 Skill frontmatter 的结构规范
3
+
4
+ name: knowledge
5
+ description: 知识体系 schema — 知识目录索引、Skill frontmatter、知识条目类型
6
+
7
+ # ─────────────────────────────────────────
8
+ # knowledge-catalog.md 结构
9
+ # ─────────────────────────────────────────
10
+ catalog:
11
+ location: modus/knowledge-catalog.md
12
+ description: 全景知识目录索引,所有命令启动时 Level 1 加载(~200 tokens)
13
+ fields:
14
+ - name: updated
15
+ type: date
16
+ description: 最后更新日期(YYYY-MM-DD)
17
+ - name: entries
18
+ type: list
19
+ description: 知识条目列表,每条一行摘要
20
+
21
+ entry_format: "- **{skill-name}**: {描述} [maturity: {level}] {time_field}: {date} {optional_warning}"
22
+ example: |
23
+ - **modus-biz-order**: 订单域 — 创建/流转/查询 [maturity: verified] 最近引用: 2026-04-18
24
+ - **modus-tech-wiki**: 跨项目架构决策/反模式库 [maturity: draft] ⚠️ 6个月未引用,可能过时
25
+
26
+ # ─────────────────────────────────────────
27
+ # Skill frontmatter 字段
28
+ # ─────────────────────────────────────────
29
+ skill_frontmatter:
30
+ fields:
31
+ - name: name
32
+ type: string
33
+ required: true
34
+ description: Skill 唯一标识符(目录名)
35
+ example: "modus-biz-order"
36
+
37
+ - name: description
38
+ type: string
39
+ required: true
40
+ description: 一句话描述,必须包含对应标记前缀
41
+ markers:
42
+ biz: "[MODUS:BIZ]"
43
+ tech: "[MODUS:TECH]"
44
+ team: "[MODUS:TEAM]"
45
+ example: "[MODUS:BIZ] 订单业务知识 — 订单创建/状态流转/查询"
46
+
47
+ - name: version
48
+ type: semver
49
+ required: true
50
+ description: Skill 版本,更新时自增 minor(如 1.0.0 → 1.1.0)
51
+
52
+ - name: updated
53
+ type: date
54
+ required: true
55
+ description: 最后更新日期
56
+
57
+ - name: maturity
58
+ type: enum
59
+ required: true
60
+ values: [draft, verified, proven]
61
+ description: |
62
+ 知识成熟度:
63
+ draft — 初始状态,单一来源,未经工作流验证
64
+ verified — 单项目验证,已在 ≥1 个工作流中被引用
65
+ proven — 成熟可信赖,已在 ≥2 个工作流中验证
66
+ default: draft
67
+
68
+ - name: last_referenced
69
+ type: date
70
+ required: true
71
+ description: 最近一次被工作流引用的日期,用于衰减计算
72
+
73
+ - name: usage_count
74
+ type: integer
75
+ required: true
76
+ description: 被工作流引用的累计次数
77
+ default: 0
78
+
79
+ - name: layer
80
+ type: string
81
+ required: false
82
+ description: 知识层级(仅 team-conventions 和 tech-wiki 需要填写)
83
+ values: ["0-T", "1"]
84
+
85
+ # ─────────────────────────────────────────
86
+ # 知识条目类型(五类 MECE)
87
+ # ─────────────────────────────────────────
88
+ knowledge_types:
89
+ - tag: "[model]"
90
+ description: 实体定义、数据结构、关系图、枚举
91
+ examples:
92
+ - "Order 实体的核心字段(id, status, tenantId, amount)"
93
+ - "OrderStatus 枚举:CREATED/PAID/COMPLETED/CANCELLED"
94
+
95
+ - tag: "[decision]"
96
+ description: 技术选型、架构决策及其理由
97
+ examples:
98
+ - "选择事件驱动而非 RPC 同步,原因:解耦、削峰、避免级联失败"
99
+
100
+ - tag: "[guideline]"
101
+ description: 推荐(recommend)或禁止(avoid)的做法
102
+ polarity_values: [recommend, avoid]
103
+ examples:
104
+ - "recommend: AopContext.currentProxy() 解决同类方法事务调用"
105
+ - "avoid: 在 Controller 层写业务逻辑"
106
+
107
+ - tag: "[pitfall]"
108
+ description: 已知风险、故障模式、排查步骤
109
+ examples:
110
+ - "批量操作不加分页保护,数据量大时内存溢出"
111
+ - "多线程下 ThreadLocal 数据未清理导致租户数据串扰"
112
+
113
+ - tag: "[process]"
114
+ description: 业务流程、状态机、操作步骤
115
+ examples:
116
+ - "订单状态流转:CREATED→PAID→COMPLETED(单向,不可逆)"
117
+ - "支付回调:验签→幂等检查→状态更新→MQ 通知"
118
+
119
+ # ─────────────────────────────────────────
120
+ # 成熟度提升与衰减规则
121
+ # ─────────────────────────────────────────
122
+ maturity_lifecycle:
123
+ promotion:
124
+ draft_to_verified:
125
+ condition: "usage_count >= 1(在 1 个工作流中被成功引用)"
126
+ action: "更新 maturity: verified,更新 last_referenced"
127
+ verified_to_proven:
128
+ condition: "usage_count >= 2 且来自不同工作流(跨工作流验证)"
129
+ action: "更新 maturity: proven,更新 last_referenced"
130
+
131
+ decay:
132
+ proven_decay:
133
+ condition: "proven 且距 last_referenced 超过 12 个月"
134
+ action: "降为 verified,追加注释 ⚠️ 12个月未引用,请验证是否仍然适用"
135
+ verified_decay:
136
+ condition: "verified 且距 last_referenced 超过 6 个月"
137
+ action: "降为 draft,追加注释 ⚠️ 6个月未引用,可能已过时"
138
+
139
+ decay_check_trigger:
140
+ - "00-skills-builder 模式 D 执行时"
141
+ - "可手动触发:/modus:init --lint"
142
+
143
+ # ─────────────────────────────────────────
144
+ # HANDOFF 块格式(Harness 产物交接协议)
145
+ # ─────────────────────────────────────────
146
+ handoff_block:
147
+ description: 每个 Harness SubAgent 产出物文件头部的机器可读摘要,Orchestrator 只读此块决策
148
+ format: |
149
+ <!--HANDOFF
150
+ agent: "{agent-id}"
151
+ story_id: "{story-id}"
152
+ domains: ["{domain1}", "{domain2}"]
153
+ sprint_count: {N}
154
+ risk_level: "low|medium|high"
155
+ key_constraints:
156
+ - "{约束1}"
157
+ skill_refs:
158
+ - "{skill-name}@{version}"
159
+ gate_status: "passed|failed|pending"
160
+ issues: []
161
+ -->
162
+ fields:
163
+ - name: agent
164
+ description: 产出此文件的 SubAgent ID
165
+ - name: domains
166
+ description: 本次涉及的业务域列表
167
+ - name: risk_level
168
+ description: 风险等级,影响 SubAgent 06 审查力度
169
+ - name: gate_status
170
+ description: 当前产物的 Gate 状态
171
+ - name: issues
172
+ description: P1/P2 问题列表(cr-report 专用),空则表示通过 Gate C
173
+ - name: skill_refs
174
+ description: 引用的 Skill 版本,用于 ARCHIVE 阶段来源追溯
@@ -0,0 +1,42 @@
1
+ # Modus Plan Schema
2
+ # 定义 /modus:plan 命令的产出物及依赖关系
3
+ name: plan
4
+ description: 功能规划模式 — 生成 proposal、design、tasks 三件套
5
+
6
+ artifacts:
7
+ - id: proposal
8
+ generates: proposal.md
9
+ requires: []
10
+ description: 意图与范围文档,描述为什么做、做什么、不做什么
11
+
12
+ - id: design
13
+ generates: design.md
14
+ requires: [proposal]
15
+ description: 技术方案文档,描述怎么做、架构决策、文件变更清单
16
+
17
+ - id: tasks
18
+ generates: tasks.md
19
+ requires: [proposal, design]
20
+ description: 实现清单,按层次拆分为可执行的 checkbox 任务
21
+
22
+ # 产出物依赖图:
23
+ #
24
+ # proposal
25
+ # │
26
+ # └──► design
27
+ # │
28
+ # └──► tasks
29
+ #
30
+ # 说明:
31
+ # - proposal 是起点,无依赖
32
+ # - design 依赖 proposal(需要理解意图才能设计技术方案)
33
+ # - tasks 依赖 proposal + design(需要完整的 what 和 how 才能拆分任务)
34
+
35
+ archive:
36
+ targetDir: modus/plans/archive
37
+ namePattern: "{YYYY-MM-DD}-{name}"
38
+ preserveAll: true
39
+
40
+ directories:
41
+ active: modus/plans
42
+ archive: modus/plans/archive
@@ -0,0 +1,64 @@
1
+ # Modus Spec Schema
2
+ # 定义 /modus:spec 命令的产出物及依赖关系
3
+ name: spec
4
+ description: OpenSpec 规范驱动开发模式 — 生成 proposal、delta specs、design、tasks 四件套
5
+
6
+ artifacts:
7
+ - id: proposal
8
+ generates: proposal.md
9
+ requires: []
10
+ description: 意图与范围文档,同 plan 模式
11
+
12
+ - id: specs
13
+ generates: "specs/{domain}/spec.md"
14
+ requires: [proposal]
15
+ description: |
16
+ Delta 规格文档,使用 ADDED/MODIFIED/REMOVED 三段式描述行为变更。
17
+ 只描述「系统做什么」(WHAT),不涉及实现细节(HOW)。
18
+ 每个 Requirement 必须有至少一个可测试的 Scenario。
19
+
20
+ - id: design
21
+ generates: design.md
22
+ requires: [proposal]
23
+ description: 技术方案文档,可与 specs 并行生成
24
+
25
+ - id: tasks
26
+ generates: tasks.md
27
+ requires: [specs, design]
28
+ description: 实现清单,末尾额外包含「规格验证」任务
29
+
30
+ # 产出物依赖图:
31
+ #
32
+ # proposal
33
+ # │
34
+ # ┌─────┴─────┐
35
+ # ▼ ▼
36
+ # specs design
37
+ # │ │
38
+ # └─────┬─────┘
39
+ # ▼
40
+ # tasks
41
+ #
42
+ # 说明:
43
+ # - proposal 是起点
44
+ # - specs 和 design 可并行生成(都只依赖 proposal)
45
+ # - tasks 需要 specs + design 都完成后才能生成
46
+
47
+ delta:
48
+ sections:
49
+ - ADDED Requirements # 新增行为 → 归档时追加到主 spec
50
+ - MODIFIED Requirements # 修改行为 → 归档时替换主 spec 中对应条目
51
+ - REMOVED Requirements # 废弃行为 → 归档时从主 spec 中删除
52
+
53
+ mergeTarget: modus/specs # delta 归档后合并到此目录
54
+
55
+ archive:
56
+ targetDir: modus/changes/archive
57
+ namePattern: "{YYYY-MM-DD}-{name}"
58
+ mergeDeltaOnArchive: true # 归档时自动合并 delta specs 到主规格库
59
+ preserveAll: true
60
+
61
+ directories:
62
+ active: modus/changes
63
+ archive: modus/changes/archive
64
+ specs: modus/specs # 主规格库(source of truth)
@@ -0,0 +1,46 @@
1
+ # /modus:harness
2
+
3
+ Full dual-loop multi-agent Harness. Automated end-to-end development flow from requirements analysis to deployment.
4
+
5
+ ## Instructions
6
+
7
+ Read and follow the skill at `.codebuddy/skills/modus-harness/SKILL.md` to execute this command.
8
+
9
+ ## Quick Summary
10
+
11
+ 1. Check for business Skills — if absent, strongly recommend running `/modus:init` first
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:
15
+
16
+ **Loop 1 (sequential):**
17
+ - SubAgent 01: Requirements analysis → `01-analysis.md`
18
+ - SubAgent 02: Code development → `02-sprint-contract.md` + code changes
19
+ - Gate A: Build compilation check
20
+ - SubAgent 03/04/05 (parallel): Tests + Performance audit + Security audit
21
+ - Gate B: Wait for all 3 reports
22
+
23
+ **Loop 2 (quality gate):**
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`
28
+
29
+ 5. Final Review: human confirms before merging
30
+
31
+ ## Working Directory
32
+
33
+ ```
34
+ modus/plans/active/{story-id}/
35
+ ├── 01-analysis.md
36
+ ├── 02-sprint-contract.md
37
+ ├── 03-test-report.md
38
+ ├── 04-perf-report.md
39
+ ├── 05-security-report.md
40
+ ├── cr-report.md
41
+ └── 07-deploy-status.md
42
+ ```
43
+
44
+ ## Resume Support
45
+
46
+ If `modus/plans/active/{story-id}/` already contains partial artifacts, resume from the last completed SubAgent.
@@ -0,0 +1,16 @@
1
+ # /modus:init
2
+
3
+ Analyze the project codebase, classify it by business domains, and generate business Skill files for each domain.
4
+
5
+ ## Instructions
6
+
7
+ Read and follow the skill at `.codebuddy/skills/modus-init/SKILL.md` to execute this command.
8
+
9
+ ## Quick Summary
10
+
11
+ 1. Scan the project structure and identify business domains
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
15
+
16
+ If `.codebuddy/skills/modus-biz-*` directories already exist, offer to update or rebuild them.
@@ -0,0 +1,28 @@
1
+ # /modus:plan
2
+
3
+ Plan mode. Generate structured planning documents (proposal, design, tasks) backed by up-to-date business Skills.
4
+
5
+ ## Instructions
6
+
7
+ Read and follow the skill at `.codebuddy/skills/modus-plan/SKILL.md` to execute this command.
8
+
9
+ ## Quick Summary
10
+
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
20
+
21
+ ## Output Location
22
+
23
+ ```
24
+ modus/plans/{name}/
25
+ ├── proposal.md
26
+ ├── design.md
27
+ └── tasks.md
28
+ ```
@@ -0,0 +1,37 @@
1
+ # /modus:spec
2
+
3
+ OpenSpec-style spec-driven development. Generate behavior specifications (delta specs) + design + tasks, with archive merging specs into the main spec library.
4
+
5
+ ## Instructions
6
+
7
+ Read and follow the skill at `.codebuddy/skills/modus-spec/SKILL.md` to execute this command.
8
+
9
+ ## Quick Summary
10
+
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
23
+
24
+ ## Delta Spec Format
25
+
26
+ Use ADDED/MODIFIED/REMOVED sections with GIVEN/WHEN/THEN scenarios.
27
+ Specs describe WHAT the system does, not HOW.
28
+
29
+ ## Output Location
30
+
31
+ ```
32
+ modus/changes/{name}/
33
+ ├── proposal.md
34
+ ├── specs/{domain}/spec.md ← delta specs
35
+ ├── design.md
36
+ └── tasks.md
37
+ ```
@@ -0,0 +1,18 @@
1
+ # /modus:vibe
2
+
3
+ Context-aware vibe coding. Load relevant business Skills before coding so AI works as a knowledgeable project member.
4
+
5
+ ## Instructions
6
+
7
+ Read and follow the skill at `.codebuddy/skills/modus-vibe/SKILL.md` to execute this command.
8
+
9
+ ## Quick Summary
10
+
11
+ 1. Check if `.codebuddy/skills/modus-biz-*` directories exist
12
+ - If not: offer to run `/modus:init` or continue in degraded mode
13
+ 2. Match user's prompt to relevant business domains
14
+ 3. Confirm domain selection with user
15
+ 4. Load the selected Skill files as context
16
+ 5. Execute the coding task with business context
17
+
18
+ **Degraded mode** (no business Skills): proceed without domain context, but note that code quality may be lower without project-specific knowledge.
@@ -0,0 +1,26 @@
1
+ # Modus 知识全景目录
2
+ # 所有 Modus 命令启动时先读此文件(Level 1 加载,~200 tokens)
3
+ # 按需再读完整 SKILL.md(Level 2),或直接读代码文件(Level 3)
4
+ #
5
+ # maturity: draft → verified → proven
6
+ # 衰减:proven 12个月未引用→verified;verified 6个月未引用→draft
7
+
8
+ updated: {YYYY-MM-DD}
9
+
10
+ ## 团队约定 (Layer 0-T)
11
+ - **modus-team-conventions**: 代码规范/提交规范/硬性约束 [maturity: draft] 更新: {日期}
12
+
13
+ ## 技术知识 (Layer 1)
14
+ - **modus-tech-wiki**: 跨项目架构决策/反模式库/性能优化 [maturity: draft] 更新: {日期}
15
+
16
+ ## 业务知识 (Layer 2)
17
+ <!-- 由 /modus:init 生成,由各模式工作流自动更新 -->
18
+ - **modus-biz-{domain}**: {中文域名} — {核心职责一句话} [maturity: draft] 最近引用: {日期}
19
+
20
+ ## 渐进加载说明
21
+ 启动任意 Modus 命令时的加载顺序:
22
+ Level 1(必须,~200 tokens): 读本文件,了解有哪些知识可用
23
+ Level 2(按需,~3000 tokens/个): 根据任务匹配相关域,读对应 SKILL.md
24
+ Level 3(按需,无上限): 执行任务时读 Skill 引用的实际代码文件
25
+
26
+ 目标:不相关的 Skill 不加载,大幅降低 token 消耗。