@modus-ai/modus 0.2.10 → 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 +39 -2
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +234 -3
- 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 +15 -3
- 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 +17 -0
- package/dist/generators/continue.d.ts.map +1 -0
- package/dist/generators/continue.js +441 -0
- package/dist/generators/continue.js.map +1 -0
- 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 +22 -11
- package/dist/generators/cursor.js.map +1 -1
- package/dist/generators/custom.d.ts +2 -2
- package/dist/generators/custom.d.ts.map +1 -1
- package/dist/generators/custom.js +9 -2
- package/dist/generators/custom.js.map +1 -1
- package/dist/generators/index.d.ts.map +1 -1
- package/dist/generators/index.js +11 -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/dist/utils/config.d.ts +20 -1
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/config.js.map +1 -1
- package/dist/utils/file-system.d.ts +16 -0
- package/dist/utils/file-system.d.ts.map +1 -1
- package/dist/utils/file-system.js +40 -0
- package/dist/utils/file-system.js.map +1 -1
- 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 +330 -824
- package/templates/skills/modus-init/shared/frontmatter-spec.md +255 -0
- package/templates/skills/modus-init/shared/stack-detection.md +144 -0
- package/templates/skills/modus-init/shared/universal-skill-format.md +362 -0
- package/templates/skills/modus-init/strategies/fallback-init.md +150 -0
- package/templates/skills/modus-init/strategies/frontend-init.md +298 -0
- package/templates/skills/modus-init/strategies/java-init.md +278 -0
- 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
|
@@ -1,59 +1,66 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Modus workflow conventions. Load this rule when the user runs any /modus:* command or asks about Modus commands, Skills, Harness, plan/spec/vibe workflow,
|
|
2
|
+
description: Modus workflow conventions (v4.0). Load this rule when the user runs any /modus:* command or asks about Modus commands, Skills, Harness, plan/spec/vibe workflow, knowledge_base, artifacts, or business Skills.
|
|
3
3
|
alwaysApply: false
|
|
4
4
|
enabled: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Modus
|
|
7
|
+
# Modus 工作流规范(v4.0)
|
|
8
|
+
|
|
9
|
+
> 完整路径范式见 `templates/paths-v4.md`。
|
|
8
10
|
|
|
9
11
|
## 核心目录结构
|
|
10
12
|
|
|
11
13
|
```
|
|
12
|
-
|
|
13
|
-
├──
|
|
14
|
-
│ ├──
|
|
15
|
-
│
|
|
16
|
-
│
|
|
17
|
-
|
|
18
|
-
│
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
├──
|
|
28
|
-
|
|
29
|
-
├──
|
|
30
|
-
├──
|
|
31
|
-
│
|
|
32
|
-
│
|
|
33
|
-
|
|
34
|
-
|
|
14
|
+
<项目根>/
|
|
15
|
+
├── .modus/ # CLI 中性层
|
|
16
|
+
│ ├── commands/ # 命令源(所有平台共用)
|
|
17
|
+
│ └── skills/ # 团队自定义技能包(如查日志、查监控)
|
|
18
|
+
│
|
|
19
|
+
├── .codebuddy/ | .claude/ | .cursor/ | .continue/ # 平台引用桩(仅 1 行 @import)
|
|
20
|
+
│
|
|
21
|
+
└── modus/ # 顶层 Models 层
|
|
22
|
+
├── config.yaml # 项目配置 + constitution
|
|
23
|
+
├── template/ # 产物模板(pid/design/spec/plan/...)
|
|
24
|
+
├── knowledge_base/ # 知识库(Single Source of Truth)
|
|
25
|
+
│ ├── map.md # L0 全景索引(替代旧 knowledge-catalog.md)
|
|
26
|
+
│ ├── service-graph.md # L0 服务调用图
|
|
27
|
+
│ └── domain/
|
|
28
|
+
│ ├── _conventions/code/SKILL.md # 团队约定
|
|
29
|
+
│ ├── _tech-wiki/code/SKILL.md # 技术 Wiki
|
|
30
|
+
│ └── <domain>/ # 业务域
|
|
31
|
+
│ ├── code/ # 自动生成层(SKILL.md + 4 子文件)
|
|
32
|
+
│ ├── business/ # 业务规则(人工维护)
|
|
33
|
+
│ ├── scenarios/ # 测试场景
|
|
34
|
+
│ └── history/ # 变更历史
|
|
35
|
+
└── artifacts/<STORY_ID>/ # 产物(按 Story 隔离)
|
|
36
|
+
├── pid/ # 需求澄清
|
|
37
|
+
├── design/ # 评估设计
|
|
38
|
+
├── code/ # 编码实施(plan/spec/harness)
|
|
39
|
+
└── archive/ # 上线归档
|
|
35
40
|
```
|
|
36
41
|
|
|
37
|
-
##
|
|
42
|
+
## 渐进加载原则(v4.0 四级)
|
|
38
43
|
|
|
39
44
|
每次 Modus 命令启动时:
|
|
40
|
-
1. **Level 1(必须,~200 tokens)**:读 `modus/
|
|
41
|
-
2. **Level 2(按需,~
|
|
42
|
-
3. **Level 3
|
|
45
|
+
1. **Level 1(必须,~200 tokens)**:读 `modus/knowledge_base/map.md`
|
|
46
|
+
2. **Level 2(按需,~500 tokens/域)**:基于任务匹配,读对应 `domain/<d>/code/SKILL.md`(入口含子文件索引)
|
|
47
|
+
3. **Level 3(按需,~800 tokens/文件)**:按需读 `entities.md` / `apis.md` / `services.md` / `data-models.md`
|
|
48
|
+
4. **Level 4(执行时,无上限)**:从知识中的 `key_files` 索引按需读取实际代码文件
|
|
43
49
|
|
|
44
|
-
|
|
50
|
+
不相关的域、子文件不加载,大幅降低 token 消耗。
|
|
45
51
|
|
|
46
|
-
##
|
|
52
|
+
## 命令速查(v4.0 产物路径)
|
|
47
53
|
|
|
48
|
-
| 命令 | 场景 |
|
|
54
|
+
| 命令 | 场景 | 产出物(v4.0) |
|
|
49
55
|
|------|------|--------|
|
|
50
|
-
| `/modus:init` | 首次初始化或重建知识库 |
|
|
51
|
-
| `/modus:vibe` | 日常编码(含业务上下文) | 代码 + `modus/sessions/vibe-log.md` |
|
|
52
|
-
| `/modus:plan` | 功能规划 | `modus/plans/{name}
|
|
53
|
-
| `/modus:spec` | 规范驱动开发 | `modus/changes/{name}
|
|
54
|
-
| `/modus:harness` | 全自动 Harness 流程 | `
|
|
56
|
+
| `/modus:init` | 首次初始化或重建知识库 | `modus/knowledge_base/domain/<d>/code/*` |
|
|
57
|
+
| `/modus:vibe` | 日常编码(含业务上下文) | 代码 + `modus/sessions/vibe-log.md`(或 `artifacts/<id>/code/vibe-log.md`) |
|
|
58
|
+
| `/modus:plan` | 功能规划 | `artifacts/<id>/code/plan.md`(Story 模式)/ `modus/plans/{name}/`(独立模式) |
|
|
59
|
+
| `/modus:spec` | 规范驱动开发 | `artifacts/<id>/code/spec/`(Story 模式)/ `modus/changes/{name}/`(独立模式) |
|
|
60
|
+
| `/modus:harness` | 全自动 Harness 流程 | `artifacts/<id>/{pid|design|code}/*` |
|
|
61
|
+
| `/modus:cr` | 代码评审 | `artifacts/<id>/code/cr-report.md` 或 `modus/cr/{date}-{name}/` |
|
|
55
62
|
|
|
56
|
-
##
|
|
63
|
+
## 知识状态
|
|
57
64
|
|
|
58
65
|
| maturity | 含义 | 衰减规则 |
|
|
59
66
|
|----------|------|---------|
|
|
@@ -9,7 +9,7 @@ disable: false
|
|
|
9
9
|
|
|
10
10
|
**调用方:** Harness Orchestrator(Gate A0.5 通过后触发)
|
|
11
11
|
**输入:** `01-analysis.md` + `02-design-brief.md` + 业务 Skill 内容 + constitution
|
|
12
|
-
**产出物:** `modus/
|
|
12
|
+
**产出物:** `modus/artifacts/{story_id}/code/sprint-contract.md` + 代码变更(v4.0 路径)
|
|
13
13
|
|
|
14
14
|
## 职责
|
|
15
15
|
|
|
@@ -9,7 +9,7 @@ disable: false
|
|
|
9
9
|
|
|
10
10
|
**调用方:** Harness Orchestrator(Gate B 通过后触发)
|
|
11
11
|
**输入:** 全部产出物(01-analysis.md 至 06-security-report.md)+ 代码变更
|
|
12
|
-
**产出物:** `modus/
|
|
12
|
+
**产出物:** `modus/artifacts/{story_id}/code/cr-report.md`(v4.0 路径)
|
|
13
13
|
|
|
14
14
|
## 职责
|
|
15
15
|
|
|
@@ -9,7 +9,7 @@ disable: false
|
|
|
9
9
|
|
|
10
10
|
**调用方:** `/modus:init` / `/modus:plan` 前置更新 / `/modus:spec` 前置更新 / Harness 后置更新 / Harness ARCHIVE 阶段
|
|
11
11
|
**输入:** 业务域信息 + 项目代码
|
|
12
|
-
**产出物:**
|
|
12
|
+
**产出物:** `modus/knowledge_base/domain/{domain}/code/SKILL.md` (业务域入口) / `modus/knowledge_base/domain/_conventions/code/SKILL.md` / `modus/knowledge_base/domain/_tech-wiki/code/SKILL.md` + `modus/knowledge_base/map.md` 更新
|
|
13
13
|
|
|
14
14
|
## 职责
|
|
15
15
|
|
|
@@ -677,7 +677,7 @@ Step 4 扩展:upstream/downstream 双向同步(append-only,Git 无冲突
|
|
|
677
677
|
|
|
678
678
|
### Step 5:更新 knowledge-catalog.md
|
|
679
679
|
|
|
680
|
-
|
|
680
|
+
每次写入知识后,同步更新 `modus/knowledge_base/map.md`(使用升级后的条目格式):
|
|
681
681
|
|
|
682
682
|
```markdown
|
|
683
683
|
- **modus-biz-order**: 订单域 — 创建/状态流转/查询
|
|
@@ -1055,7 +1055,7 @@ layer: "1"
|
|
|
1055
1055
|
- 关键文件索引路径必须真实存在
|
|
1056
1056
|
- 每条知识条目必须打上五类型标签之一:`[model]` `[decision]` `[guideline]` `[pitfall]` `[process]`
|
|
1057
1057
|
- 更新时必须更新 `updated` 日期和 `last_referenced`
|
|
1058
|
-
- 模式 D 每次执行后必须同步更新 `modus/
|
|
1058
|
+
- 模式 D 每次执行后必须同步更新 `modus/knowledge_base/map.md`
|
|
1059
1059
|
- 统一使用 `status` 字段(不使用 `maturity`),枚举值:`draft | verified | proven | stale | archived`
|
|
1060
1060
|
- 新生成的 Skill 默认写入 `format_version: v3`(17节标准格式);存量 14 节 Skill 保留 `format_version: v2`;存量 7 节 Skill 迁移前标记 `format_version: v1`
|
|
1061
1061
|
|
|
@@ -220,7 +220,7 @@ Modus Auto — 智能模式路由工具
|
|
|
220
220
|
/modus:auto https://tapd.cn/.../1234 --scores-only --output json
|
|
221
221
|
/modus:auto --resume
|
|
222
222
|
|
|
223
|
-
更多文档:modus/
|
|
223
|
+
更多文档:modus/knowledge_base/map.md
|
|
224
224
|
```
|
|
225
225
|
|
|
226
226
|
---
|
|
@@ -264,8 +264,8 @@ except MCP_UNAVAILABLE:
|
|
|
264
264
|
|
|
265
265
|
# 2. 尝试读取知识目录(文件系统不可用时跳过)
|
|
266
266
|
try:
|
|
267
|
-
catalog = read("modus/
|
|
268
|
-
# v3.2 路径:modus/
|
|
267
|
+
catalog = read("modus/knowledge_base/map.md")
|
|
268
|
+
# v3.2 路径:modus/knowledge_base/domain/*/code/SKILL.md(唯一权威)
|
|
269
269
|
except FILESYSTEM_UNAVAILABLE:
|
|
270
270
|
catalog = None
|
|
271
271
|
note += " | 文件系统不可用,跳过 Skill 加载,基于 Story 文本评分"
|
|
@@ -297,7 +297,7 @@ context_bundle:
|
|
|
297
297
|
story_id: "1234567890"
|
|
298
298
|
story_title: "{Story 标题}"
|
|
299
299
|
domains: ["{domain}"]
|
|
300
|
-
domain_skill_path: "modus/
|
|
300
|
+
domain_skill_path: "modus/knowledge_base/domain/{domain}/code/SKILL.md" # v3.2 路径
|
|
301
301
|
scores: {complexity: 2, risk: 1, clarity: 3, contract: 1}
|
|
302
302
|
recommended_mode: "spec"
|
|
303
303
|
skip_clarify: true
|
|
@@ -359,15 +359,15 @@ if cache.valid:
|
|
|
359
359
|
|
|
360
360
|
#### Step 2:读取知识目录
|
|
361
361
|
|
|
362
|
-
读取 `modus/
|
|
362
|
+
读取 `modus/knowledge_base/map.md`:
|
|
363
363
|
|
|
364
364
|
```
|
|
365
365
|
知识库路径(v3.2 Single Source of Truth):
|
|
366
|
-
modus/
|
|
367
|
-
modus/
|
|
368
|
-
modus/
|
|
366
|
+
modus/knowledge_base/domain/*/code/SKILL.md ← Layer 2 业务域(唯一权威,v3.1+ 迁移后)
|
|
367
|
+
modus/knowledge_base/domain/_tech-wiki/code/SKILL.md
|
|
368
|
+
modus/knowledge_base/domain/_conventions/code/SKILL.md
|
|
369
369
|
|
|
370
|
-
⚠️ 注意(v3.1+ 变更):业务域 Skill 已迁移至 modus/
|
|
370
|
+
⚠️ 注意(v3.1+ 变更):业务域 Skill 已迁移至 modus/knowledge_base/domain/*/code/SKILL.md,
|
|
371
371
|
.codebuddy/skills/modus-biz-* 为引用桩,不含实际内容,请勿从旧路径读取。
|
|
372
372
|
```
|
|
373
373
|
|
|
@@ -454,7 +454,7 @@ if cache.valid:
|
|
|
454
454
|
若用户带 `--preview`,路由完成后输出产物目录预览,然后停止:
|
|
455
455
|
```
|
|
456
456
|
预览:/modus:spec 将在以下路径生成产物
|
|
457
|
-
modus/
|
|
457
|
+
modus/artifacts/{id}/code/spec/
|
|
458
458
|
├── .modus-state.yaml
|
|
459
459
|
├── delta/{domain}.md
|
|
460
460
|
├── design.md
|
|
@@ -521,7 +521,7 @@ if cache.valid:
|
|
|
521
521
|
确认启动 /modus:plan
|
|
522
522
|
Story 摘要: {标题 + 核心需求}
|
|
523
523
|
业务域: {domain} [draft]
|
|
524
|
-
产物路径: modus/
|
|
524
|
+
产物路径: modus/artifacts/{id}/code/plan.md ← v3.2 统一路由
|
|
525
525
|
快速模式(--quick,跳过设计文档): [y/N]
|
|
526
526
|
|
|
527
527
|
确认?[Y/n]
|
|
@@ -533,7 +533,7 @@ if cache.valid:
|
|
|
533
533
|
Story URL: {原始 URL}
|
|
534
534
|
业务域: {domain} [draft]
|
|
535
535
|
规格级别: Full(因有接口契约变更)/ 可加 --lite 降级
|
|
536
|
-
产物路径: modus/
|
|
536
|
+
产物路径: modus/artifacts/{id}/code/spec/ ← v3.2 统一路由
|
|
537
537
|
验收标准: 已提取 {n} 条,将作为 Scenario 输入
|
|
538
538
|
|
|
539
539
|
确认?[Y/n]
|
|
@@ -543,7 +543,7 @@ if cache.valid:
|
|
|
543
543
|
```
|
|
544
544
|
确认启动 /modus:harness
|
|
545
545
|
Story URL: {原始 URL}
|
|
546
|
-
产物路径: modus/
|
|
546
|
+
产物路径: modus/artifacts/{id}/code/ ← v3.2 统一路由
|
|
547
547
|
跳过阶段: 无(如需跳过:--skip [agents])
|
|
548
548
|
|
|
549
549
|
⚠️ Harness 将全自动执行多个 SubAgent,预计耗时较长。
|
|
@@ -562,7 +562,7 @@ context_bundle:
|
|
|
562
562
|
acceptance_criteria: ["{ac1}", "{ac2}"]
|
|
563
563
|
domains: ["{domain}"]
|
|
564
564
|
domain_skill_paths: # v3.2 路径(唯一权威)
|
|
565
|
-
- "modus/
|
|
565
|
+
- "modus/knowledge_base/domain/{domain}/code/SKILL.md"
|
|
566
566
|
domain_skills_loaded: true
|
|
567
567
|
scores:
|
|
568
568
|
complexity: 2
|
|
@@ -588,16 +588,16 @@ context_bundle:
|
|
|
588
588
|
|
|
589
589
|
```
|
|
590
590
|
有 --story [id]:
|
|
591
|
-
modus/
|
|
592
|
-
modus/
|
|
593
|
-
modus/
|
|
591
|
+
modus/artifacts/{id}/code/plan.md # plan 产物
|
|
592
|
+
modus/artifacts/{id}/code/spec/ # spec 产物目录
|
|
593
|
+
modus/artifacts/{id}/code/ # harness 产物目录
|
|
594
594
|
|
|
595
595
|
无 --story(自动推断 feature 名):
|
|
596
596
|
modus/local/{feature-name}/plan.md
|
|
597
597
|
modus/local/{feature-name}/spec/
|
|
598
598
|
```
|
|
599
599
|
|
|
600
|
-
> **v3.2 变更说明**:废弃 `modus/plans/active/{id}/`,统一使用 `modus/
|
|
600
|
+
> **v3.2 变更说明**:废弃 `modus/plans/active/{id}/`,统一使用 `modus/artifacts/{id}/`。
|
|
601
601
|
|
|
602
602
|
---
|
|
603
603
|
|
|
@@ -653,7 +653,7 @@ Modus Auto — 请提供需求来源:
|
|
|
653
653
|
- **--no-confirm 默认生效**:Codex 环境视同携带此参数
|
|
654
654
|
- **文件系统降级**:文件系统不可用时跳过 Skill 加载,仅基于 Story 文本评分,Context Bundle 不写文件
|
|
655
655
|
- **结构化日志**:`--output json` 时输出完整 JSON,便于在 Codex 日志中机器解析
|
|
656
|
-
- **Context Bundle 路径**:使用 `modus/
|
|
656
|
+
- **Context Bundle 路径**:使用 `modus/knowledge_base/domain/*/code/SKILL.md`(v3.2 唯一权威路径),不读旧路径
|
|
657
657
|
|
|
658
658
|
---
|
|
659
659
|
|
|
@@ -51,7 +51,7 @@ disable: false
|
|
|
51
51
|
- 若路径是目录,自动在目录内查找:`design.md` > `plan.md`,以及同级 `tasks.md`
|
|
52
52
|
2. 若有 `--story`,调用 TAPD MCP(`tapd_mcp_http`)读取 Story 描述作为 PRD 补充
|
|
53
53
|
3. `modus/config.yaml`:读取 `constitution`(`hard_rules`、`tech_stack`、`key_patterns`)
|
|
54
|
-
4. `modus/
|
|
54
|
+
4. `modus/knowledge_base/map.md`:识别相关业务域,加载对应 `modus/knowledge_base/domain/{domain}/code/SKILL.md`(仅 hash 检查,不更新)
|
|
55
55
|
|
|
56
56
|
**输出上下文加载摘要:**
|
|
57
57
|
|
|
@@ -27,7 +27,7 @@ disable: false
|
|
|
27
27
|
|
|
28
28
|
| `mode` 值 | 来源类型 | 处理方式 |
|
|
29
29
|
|----------|---------|---------|
|
|
30
|
-
| `harness` | 文件路径 | 读取 `modus/
|
|
30
|
+
| `harness` | 文件路径 | 读取 `modus/artifacts/{story_id}/pid/prd.md`(v3.2 路径)|
|
|
31
31
|
| `spec` | 文件路径 | 读取调用方目录下的 `proposal.md`;若存在同级 `specs/*/spec.md` 也一并读取 |
|
|
32
32
|
| `vibe` | 运行时字符串 | `analysis_doc` 参数是调用方直接传入的「用户意图摘要」字符串,**不读取任何文件**;直接将此字符串作为需求描述,与 Step 5 加载的 Skill 内容结合生成设计方案 |
|
|
33
33
|
|
|
@@ -108,7 +108,7 @@ disable: false
|
|
|
108
108
|
将生成内容写入调用方指定路径:
|
|
109
109
|
- plan 模式:`modus/plans/{name}/design-brief.md`
|
|
110
110
|
- spec 模式:`modus/changes/{name}/design-brief.md`(gate_status 写 `passed`,此模式无 Gate 检查)
|
|
111
|
-
- harness 模式:`modus/
|
|
111
|
+
- harness 模式:`modus/artifacts/{story_id}/design/design.md`
|
|
112
112
|
- **gate_status 必须由 `modus-designer` SubAgent 在 Step 4 后动态评估并填写**(见 `modus-harness-agents/01-5-design/SKILL.md` 的 gate_status 赋值规则)
|
|
113
113
|
- 固定写 `passed` 将使 Gate A0.5 失效,严禁在 harness 模式下硬编码该字段
|
|
114
114
|
|
|
@@ -347,4 +347,4 @@ constitution: {constitution 字段内容}
|
|
|
347
347
|
|
|
348
348
|
### harness 模式调用方式
|
|
349
349
|
|
|
350
|
-
由 SubAgent 02(设计阶段,原 01.5)独立执行(见 `modus-harness-agents/01-5-design/SKILL.md`),输入为 `modus/
|
|
350
|
+
由 SubAgent 02(设计阶段,原 01.5)独立执行(见 `modus-harness-agents/01-5-design/SKILL.md`),输入为 `modus/artifacts/{story_id}/pid/prd.md`,输出为 `modus/artifacts/{story_id}/design/design.md` 含 HANDOFF 块(`agent: "02-design"`)。
|
|
@@ -101,7 +101,7 @@ Step P1:读取 plan.md
|
|
|
101
101
|
→ continue_token:记录到工作目录 .harness-state.yaml
|
|
102
102
|
|
|
103
103
|
Step P2:初始化工作目录
|
|
104
|
-
若 plan.md 含 story_id:工作目录 = modus/
|
|
104
|
+
若 plan.md 含 story_id:工作目录 = modus/artifacts/{story_id}/code/
|
|
105
105
|
若无 story_id:工作目录 = modus/plans/{PLAN_NAME}/harness/
|
|
106
106
|
|
|
107
107
|
Step P3:输出接力摘要
|
|
@@ -130,10 +130,10 @@ Step P4:设置 SKIP_AGENTS = ["01", "02"](强制跳过 SA01 + SA02)
|
|
|
130
130
|
读取 `{project}/modus/config.yaml`(即当前项目根目录下的 `modus/config.yaml`,多项目 workspace 需先通过 `workspace-catalog.md` 确认项目路径,如 `operations-job/modus/config.yaml`)的 `constitution` 字段,将 `hard_rules` 传递给所有 SubAgent 作为硬性约束。SubAgent 直接使用 Orchestrator 传入的 constitution 内容,无需独立解析路径。
|
|
131
131
|
|
|
132
132
|
**检查业务 Skill:**
|
|
133
|
-
读取 `modus/
|
|
133
|
+
读取 `modus/knowledge_base/map.md`(Level 1 加载):
|
|
134
134
|
- 若不存在,强烈建议先运行 `/modus:init`:
|
|
135
135
|
```
|
|
136
|
-
⚠️ 未找到知识目录(modus/
|
|
136
|
+
⚠️ 未找到知识目录(modus/knowledge_base/map.md)!
|
|
137
137
|
|
|
138
138
|
/modus:harness 依赖业务 Skill 为 SubAgent 提供项目背景知识。
|
|
139
139
|
建议:
|
|
@@ -143,14 +143,14 @@ B. 强制继续(无业务上下文,风险较高)
|
|
|
143
143
|
|
|
144
144
|
**解析 Story ID + 初始化状态追踪:**
|
|
145
145
|
- 从 TAPD URL 提取 Story ID(格式:`tapd.cn/{project}/stories/view/{id}`)
|
|
146
|
-
- 创建工作目录:`modus/
|
|
146
|
+
- 创建工作目录:`modus/artifacts/{story_id}/code/`
|
|
147
147
|
|
|
148
148
|
**`.harness-state.yaml` 断点续跑机制(优先级高于 HANDOFF 块探测):**
|
|
149
149
|
|
|
150
150
|
检查工作目录下是否存在 `.harness-state.yaml`;若存在部分产出物(含 HANDOFF frontmatter),也可从断点处继续。
|
|
151
151
|
|
|
152
152
|
```yaml
|
|
153
|
-
# 示例:modus/
|
|
153
|
+
# 示例:modus/artifacts/{story_id}/code/.harness-state.yaml
|
|
154
154
|
story_id: "{story-id}"
|
|
155
155
|
loop: 1 # 当前 Loop 轮次(1 或 2)
|
|
156
156
|
# SubAgent ID 约定:00=INIT 阶段、01/02/03/04/05/06/07/08 为主流程;00-ARCHIVE=ARCHIVE 阶段
|