momo-ai 1.0.100 → 1.0.102

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 (47) hide show
  1. package/.r2mo/task/goon-005.md +7 -0
  2. package/.r2mo/task/goon-006.md +7 -0
  3. package/.r2mo/task/goon-007.md +4 -0
  4. package/.r2mo/task/goon-008.md +7 -0
  5. package/.r2mo/task/goon-009.md +7 -0
  6. package/.r2mo/task/task-005.md +60 -2
  7. package/.r2mo/task/task-006.md +50 -2
  8. package/.r2mo/task/task-007.md +86 -2
  9. package/.r2mo/task/task-008.md +56 -3
  10. package/.r2mo/task/task-009.md +38 -3
  11. package/README.md +20 -6
  12. package/agent/commands/claude/momo/.claude-plugin/plugin.json +1 -1
  13. package/agent/commands/claude/momo/commands/debug.md +28 -7
  14. package/agent/commands/claude/momo/commands/end.md +30 -11
  15. package/agent/commands/claude/momo/commands/goon.md +34 -10
  16. package/agent/commands/claude/momo/commands/plan.md +33 -10
  17. package/agent/commands/claude/momo/commands/run.md +36 -12
  18. package/agent/commands/claude/momo/commands/start.md +37 -0
  19. package/agent/commands/claude/momo/commands/sync.md +37 -0
  20. package/agent/commands/claude/momo/plugin.json +1 -1
  21. package/agent/commands/codex/momo/.codex-plugin/plugin.json +4 -2
  22. package/agent/commands/codex/momo/commands/debug.md +42 -13
  23. package/agent/commands/codex/momo/commands/end.md +31 -18
  24. package/agent/commands/codex/momo/commands/goon.md +28 -15
  25. package/agent/commands/codex/momo/commands/plan.md +32 -13
  26. package/agent/commands/codex/momo/commands/run.md +26 -12
  27. package/agent/commands/codex/momo/commands/start.md +53 -0
  28. package/agent/commands/codex/momo/commands/sync.md +54 -0
  29. package/agent/commands/codex/momo/skills/momo-start/SKILL.md +28 -0
  30. package/agent/commands/codex/momo/skills/momo-sync/SKILL.md +28 -0
  31. package/agent/commands/opencode/momo/commands/debug.md +28 -7
  32. package/agent/commands/opencode/momo/commands/end.md +30 -10
  33. package/agent/commands/opencode/momo/commands/goon.md +35 -8
  34. package/agent/commands/opencode/momo/commands/plan.md +37 -11
  35. package/agent/commands/opencode/momo/commands/run.md +37 -10
  36. package/agent/commands/opencode/momo/commands/start.md +37 -0
  37. package/agent/commands/opencode/momo/commands/sync.md +37 -0
  38. package/package.json +1 -1
  39. package/src/_template/.obsidian/plugins/obsidian-excalidraw-plugin/data.json +1 -1
  40. package/src/_template/.obsidian/plugins/obsidian-excalidraw-plugin/main.js +2 -2
  41. package/src/_template/.obsidian/plugins/obsidian-excalidraw-plugin/manifest.json +1 -1
  42. package/src/_template/.obsidian/plugins/obsidian-meta-bind-plugin/main.js +57 -32
  43. package/src/_template/.obsidian/plugins/obsidian-meta-bind-plugin/manifest.json +1 -1
  44. package/src/_template/.obsidian/plugins/obsidian-meta-bind-plugin/styles.css +2 -2
  45. package/src/executor/executeAiCmd.js +36 -3
  46. package/src/utils/momo-ai-cmd.js +13 -7
  47. package/src/utils/momo-menu.js +4 -3
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: 整改-强化 momo 子命令
3
+ status: Done
4
+ author:
5
+ ---
6
+
7
+ 无待整改项。
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: 整改-强化 momo 子命令 — 规则加载与硬规则
3
+ status: Done
4
+ author:
5
+ ---
6
+
7
+ 无待整改项。
@@ -0,0 +1,4 @@
1
+ ---
2
+ title: 整改-追加新命令momo ai-cmd
3
+ status: Closed
4
+ ---
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: 整改-三平台命令闭环补全 — start/sync 规则扫描与结构对齐
3
+ status: Done
4
+ author:
5
+ ---
6
+
7
+ 无待整改项。
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: 整改-ai-cmd 菜单用法说明增强 + Codex 技能补全
3
+ status: Done
4
+ author:
5
+ ---
6
+
7
+ 无待整改项。
@@ -1,6 +1,64 @@
1
1
  ---
2
2
  runAt: 2026-05-25.11-25-47
3
- title: 任务
4
- status: Pending
3
+ title: 强化 momo 子命令
4
+ status: Done
5
5
  author:
6
6
  ---
7
+ - /momo:plan 中应该优先调用 superpower 里的 brainstomring 功能和书写计划的功能,如果没有安装则走原来路径
8
+ - /momo 命令可以支持格式如:/momo:run 004 在 Worktree 中执行,简单说就是此处后续有内容也要解析到环境中去处理
9
+ - 强化 /momo 的命令,打造完美闭环(让 AI 可以定向作用)
10
+ - run + goon:持续执行
11
+ - end:验证
12
+ - debug:诊断BUG
13
+ - plan:处理计划
14
+
15
+ 记住同时处理三大工具和三大平台
16
+
17
+ ## Changes
18
+
19
+ ### 变更摘要
20
+
21
+ 强化 momo 子命令系统,为 5 个命令(plan/run/end/goon/debug)× 3 个平台(Claude/Codex/OpenCode)= 15 个文件统一增加:
22
+
23
+ 1. **参数指令解析**:编号后可附加指令(如 `005 Team模式 Worktree`),支持的指令:
24
+ - `Team`/`Team模式` → 强制启用 Team 模式
25
+ - `Worktree`/`WT` → 强制使用 Worktree 隔离
26
+ - `深度`/`Deep` → 深度分析/验收/诊断模式
27
+ - `严格`/`Strict` → 严格验收模式(end 专用)
28
+ 2. **Superpowers 集成**(plan):优先调用 `superpowers:brainstorming` + `superpowers:writing-plans`,不可用时降级为标准流程
29
+ 3. **闭环指引**:每个命令末尾增加 `闭环指引`/`Next Steps` 章节,明确 plan→run→end→goon 的流转路径
30
+ 4. **debug 增强**:支持 `深度` 和 `Worktree` 指令,声明 Superpowers 诊断路径
31
+
32
+ ### 涉及文件
33
+
34
+ - `agent/commands/claude/momo/commands/plan.md` — 参数解析 + Superpowers 集成 + 闭环指引
35
+ - `agent/commands/claude/momo/commands/run.md` — 参数解析 + 执行指令覆盖 + 闭环指引
36
+ - `agent/commands/claude/momo/commands/end.md` — 参数解析 + 深度/严格验收 + 闭环指引
37
+ - `agent/commands/claude/momo/commands/goon.md` — 参数解析 + 执行指令覆盖 + 闭环指引
38
+ - `agent/commands/claude/momo/commands/debug.md` — 参数解析 + 深度/Worktree 指令 + 闭环指引
39
+ - `agent/commands/codex/momo/commands/plan.md` — 同上(Codex 格式)
40
+ - `agent/commands/codex/momo/commands/run.md` — 同上(Codex 格式)
41
+ - `agent/commands/codex/momo/commands/end.md` — 同上(Codex 格式)
42
+ - `agent/commands/codex/momo/commands/goon.md` — 同上(Codex 格式)
43
+ - `agent/commands/codex/momo/commands/debug.md` — 同上(Codex 格式)
44
+ - `agent/commands/opencode/momo/commands/plan.md` — 同上(OpenCode 格式)
45
+ - `agent/commands/opencode/momo/commands/run.md` — 同上(OpenCode 格式)
46
+ - `agent/commands/opencode/momo/commands/end.md` — 同上(OpenCode 格式)
47
+ - `agent/commands/opencode/momo/commands/goon.md` — 同上(OpenCode 格式)
48
+ - `agent/commands/opencode/momo/commands/debug.md` — 同上(OpenCode 格式)
49
+
50
+ ### 验证
51
+
52
+ - 15 个文件全部存在,文件大小合理(2-5KB)
53
+ - 14/15 文件包含 `参数解析` 章节(debug 使用末尾提取规则,格式不同)
54
+ - 10/15 文件包含 `闭环指引` 章节(plan/debug 使用不同的指引格式)
55
+ - 3 个 plan 文件均包含 `Superpowers` 集成逻辑
56
+
57
+ ### 整改闭环(goon-005)
58
+
59
+ 4 项整改全部修复,涉及 Codex 平台 4 个命令文件:
60
+
61
+ 1. **隔离锁定声明**:plan/run/end/goon 的 Preflight 中增加 `📌 任务隔离锁定` 显式声明步骤
62
+ 2. **写回校验+隔离约束**:plan/run/end/goon 的 Commands 提示词中增加 `写回校验` 和 `隔离约束` 规则
63
+ 3. **执行指令覆盖**:run/goon 的 Commands 提示词中增加 `执行指令覆盖` 规则;end 的 Commands 中增加 `深度验收` 和 `严格模式` 规则
64
+ 4. **闭环指引补全**:run 增加"整改后再验收"循环说明;goon 增加"如遇 BUG → /momo-debug"分支
@@ -1,6 +1,54 @@
1
1
  ---
2
2
  runAt: 2026-05-25.11-26-41
3
- title: 任务
4
- status: Pending
3
+ title: 强化 momo 子命令 — 规则加载与硬规则
4
+ status: Done
5
5
  author:
6
6
  ---
7
+ - 所有命令执行前必须加载完整规则:AGENTS.md/CLAUDE.md/CODEX.md 及其引用的所有规则文件,扫描项目中所有可检索的 .mdc 规则文件
8
+ - 追加硬规则:一行摘要式,禁止性语言约束关键执行路径
9
+ - end 验收仅核验 Changes 声明范围,不触碰非本次变更的脏文件
10
+ - Worktree 规范:必须存储在项目内 .r2mo/worktrees/task-<编号>,三平台共享
11
+ - Superpowers 检测必执行(无则降级),不可跳过也不因缺失而失败
12
+ - 规则持久化到项目记忆 momo-hard-rules.md 和 Priority Context
13
+
14
+ ## Changes
15
+
16
+ ### 变更摘要
17
+
18
+ 1. **规则加载补全**:15 个文件扩展规则加载步骤为读取引用规则文件 + 扫描项目中所有可检索的 `.mdc` 规则文件
19
+ 2. **硬规则**:15 个文件统一追加一行硬规则摘要
20
+ 3. **end 验收边界**:3 个 end.md 追加"验收仅核验Changes声明范围,不触碰非本次变更的脏文件"
21
+ 4. **Worktree 规范**:6 个 run/goon 文件追加项目内 `.r2mo/worktrees/task-<编号>` 规则
22
+ 5. **规则持久化**:写入项目记忆 `momo-hard-rules.md` 和 Priority Context
23
+
24
+ ### 涉及文件
25
+
26
+ - 15 个命令文件(3 平台 × 5 命令)
27
+ - `.claude/projects/.../memory/momo-hard-rules.md` — 规则持久化
28
+
29
+ ### 验证
30
+
31
+ - 15/15 文件包含 `扫描项目中所有可检索的 .mdc`
32
+ - 15/15 文件包含 `硬规则` 一行摘要
33
+ - 6/6 run/goon 包含 Worktree 规范
34
+ - 3/3 end 包含验收边界约束
35
+
36
+ ### 整改闭环(goon-006)
37
+
38
+ 4 项整改全部修复:
39
+
40
+ 1. **三文件统一加载**:15 个文件统一为 `AGENTS.md` + `CLAUDE.md` + `CODEX.md`(若存在)
41
+ 2. **Superpowers 硬规则全覆盖**:9 个 run/end/goon 文件硬规则追加 `Superpowers检测必执行(无则降级)`,15/15 全覆盖
42
+ 3. **momo-hard-rules.md 持久化**:文件存在于 `.claude/projects/.../memory/momo-hard-rules.md`,MEMORY.md 索引已补充
43
+ 4. **Priority Context 持久化**:通过 OMC notepad API 写入,运行时可自动加载
44
+
45
+ ### goon-006 二次整改闭环(2026-05-27)
46
+
47
+ 1. **momo-hard-rules.md 内容修正**:将"plan/debug 必须检测 superpowers 技能"更新为"所有命令执行前必检测 superpowers 技能,无则降级走标准流程",与 15/15 命令文件实现一致
48
+ 2. **Priority Context 落盘证据**:确认 `.omc/notepad.md` Priority Context 区域已持久化硬规则摘要,后续 Agent 可通过读取该文件直接发现和核验
49
+
50
+ ### 验证(goon-006 二次)
51
+
52
+ - momo-hard-rules.md Superpowers 规则描述已与 15/15 命令文件一致
53
+ - `.omc/notepad.md` Priority Context 可被后续 Agent 直接读取核验
54
+ - goon-006.md 已清空,无待整改项
@@ -1,6 +1,90 @@
1
1
  ---
2
2
  runAt: 2026-05-25.11-26-41
3
- title: 任务
4
- status: Pending
3
+ title: 追加新命令momo ai-cmd
4
+ status: Done
5
5
  author:
6
6
  ---
7
+ 运行 momo ai-cmd 的时候将 Claude , OpenCode 以及 Codex 中的用法打印到多选菜单上边进行说明
8
+
9
+ /momo:sync 新命令,一旦执行,直接同步 git
10
+ - 将当前系统中所有改动(全量提交)
11
+ - 从远程拉取最新版和当前所有改动进行合并
12
+ - 确认环境中没有多余 stash
13
+ - 确认环境中没有多余 worktree
14
+ - 合并最新版到 develop(第一优先级),如果没有 develop 则 master
15
+ - 合并完成后 push 一份到远程对应分支中
16
+
17
+ /momo:start 新命令,一旦执行,直接拉起当前环境
18
+ - 必须参考 mdc 进行环境拉起
19
+ - 如果环境已经启动,则停止之后编译最新版然后再拉起
20
+ - 确保拉起环境的整体稳定性,不要出现其他额外流程
21
+
22
+ ## Changes
23
+
24
+ ### 变更摘要
25
+
26
+ 1. **ai-cmd 菜单增强**:安装时多选菜单中展示各平台命令用法说明(Claude/OpenCode 用 `/momo:plan` 格式,Codex 用 `$momo-plan` 格式)
27
+ 2. **新增 momo sync 命令**:全量提交 → fetch/pull → 检查 stash/worktree → 合并到 develop(优先)/master → push
28
+ 3. **新增 momo start 命令**:扫描 mdc 规则检测启动命令 → 检测运行状态 → 停止(若已启动) → 编译 → 拉起环境
29
+ 4. **README.md 更新**:新增 sync/start 命令文档,命令按字典序排列,AI 平台命令表补充 debug/sync/start
30
+
31
+ ### 涉及文件
32
+
33
+ | 文件 | 操作 |
34
+ |:---|:---|
35
+ | `src/executor/executeAiCmd.js` | 修改 — 添加平台用法说明常量,菜单 description 展示用法 |
36
+ | `src/executor/executeSync.js` | 新增 — sync 命令执行器 |
37
+ | `src/executor/executeStart.js` | 新增 — start 命令执行器 |
38
+ | `src/executor/index.js` | 修改 — 注册 executeSync、executeStart |
39
+ | `src/commander/sync.json` | 新增 — sync 命令配置 |
40
+ | `src/commander/start.json` | 新增 — start 命令配置 |
41
+ | `src/utils/momo-ai-cmd.js` | 修改 — MOMO_COMMANDS 添加 sync/start,卸载清理 sync/start prompts,plugin description 更新 |
42
+ | `agent/commands/claude/momo/commands/sync.md` | 新增 — Claude Code sync 命令 |
43
+ | `agent/commands/claude/momo/commands/start.md` | 新增 — Claude Code start 命令 |
44
+ | `agent/commands/codex/momo/commands/sync.md` | 新增 — Codex sync 命令 |
45
+ | `agent/commands/codex/momo/commands/start.md` | 新增 — Codex start 命令 |
46
+ | `agent/commands/opencode/momo/commands/sync.md` | 新增 — OpenCode sync 命令 |
47
+ | `agent/commands/opencode/momo/commands/start.md` | 新增 — OpenCode start 命令 |
48
+ | `agent/commands/claude/momo/plugin.json` | 修改 — description 添加 sync/start |
49
+ | `README.md` | 修改 — 新增命令文档、字典序重排、闭环流程补充 |
50
+
51
+ ### 验证命令与结果
52
+
53
+ ```bash
54
+ node --check src/executor/executeSync.js # OK
55
+ node --check src/executor/executeStart.js # OK
56
+ node --check src/executor/executeAiCmd.js # OK
57
+ node --check src/executor/index.js # OK
58
+ node --check src/utils/momo-ai-cmd.js # OK
59
+ # 全部通过,7 个 agent command 文件(3 平台 × sync+start)均已创建
60
+ ```
61
+
62
+ ### 整改闭环(goon-007)
63
+
64
+ #### 整改项 1:sync 失败路径未中断
65
+
66
+ - 修复:新增 `_must()` 函数,关键 git 操作失败立即 `process.exit(1)`
67
+ - 涉及 9 处 `_run()` → `_must()` 替换:add、commit、fetch、pull、checkout、merge、push
68
+ - 验证:`grep -c '_must(' src/executor/executeSync.js` → 9 处
69
+
70
+ #### 整改项 2:OpenCode 安装路径未尊重 homeDir
71
+
72
+ - 修复:`openCodeConfigDir(homeDir)` 接受 homeDir 参数,Windows 下仅真实 home 使用 `%APPDATA%`
73
+ - `PLATFORMS.opencode.targetDir` 改为 `(homeDir) => path.join(openCodeConfigDir(homeDir), 'opencode.json')`
74
+ - `openCodeConfigFiles` 内部调用传入 `homeDir`
75
+ - 验证:`grep -n 'openCodeConfigDir' src/utils/momo-ai-cmd.js` → 三处均传入 homeDir
76
+
77
+ #### 整改项 3:start 进程检测过于宽泛
78
+
79
+ - 修复:移除全局 `pgrep -f "node"` / `pgrep -f "java"` 检测
80
+ - 新增 `_isProjectRunning(startCmd, cwd)`:从 mdc 提取的启动命令中反推进程特征(脚本名/路径)
81
+ - 启动/构建/停止命令统一由 mdc 优先提供,磁盘脚本作为 fallback
82
+ - 验证:`grep -c 'pgrep.*node\|pgrep.*java' src/executor/executeStart.js` → 0
83
+
84
+ #### 整改项 4(第二轮):三平台 start.md 进程检测说明未对齐
85
+
86
+ - 修复:Codex `start.md` 去掉 `pgrep -f "node|java"`,改为基于启动命令特征(脚本名/路径)检测
87
+ - Claude/OpenCode `start.md` Workflow 步骤 3 补充"基于启动命令特征检测"和"不使用全局 node/java 进程检测"说明
88
+ - 三平台行为说明现已与 `executeStart.js` 的 `_isProjectRunning()` 逻辑一致
89
+ - 涉及文件:`agent/commands/codex/momo/commands/start.md`、`agent/commands/claude/momo/commands/start.md`、`agent/commands/opencode/momo/commands/start.md`
90
+ - 验证:三平台 start.md 中无全局 `pgrep -f "node|java"`,均为"基于启动命令特征"检测
@@ -1,6 +1,59 @@
1
1
  ---
2
- runAt: 2026-05-25.11-26-41
3
- title: 任务
4
- status: Pending
2
+ runAt: 2026-05-27
3
+ title: 三平台命令闭环补全 — start/sync 规则扫描与结构对齐
4
+ status: Done
5
5
  author:
6
6
  ---
7
+
8
+ ## 背景
9
+
10
+ task-005/006 对 plan/run/end/goon/debug 五个命令做了三平台统一强化,但 start 和 sync 两个命令存在以下闭环缺失:
11
+
12
+ ## 待执行项
13
+
14
+ 1. **Codex start/sync Preflight 规则扫描不完整**
15
+ - 当前:仅扫描 `.codex/rules/`、`.cursor/rules/` 及其他路径
16
+ - 缺失:`.claude/rules/`、`.opencode/` 目录,以及 `~/.codex/rules/r2mo-task-workflow.md`(若存在)
17
+ - 涉及文件:
18
+ - `agent/commands/codex/momo/commands/start.md`
19
+ - `agent/commands/codex/momo/commands/sync.md`
20
+ - 对齐目标:与 Claude/OpenCode 版本一致,扫描 `.claude/rules/`、`.codex/rules/`、`.cursor/rules/`、`.opencode/` 及其他任意路径下的 `.mdc`,加上 `~/.codex/rules/r2mo-task-workflow.md`(若存在)
21
+
22
+ 2. **Codex start/sync 缺少 Summary + Next Steps section**
23
+ - 当前:Codex start/sync 结构到 `## Verification` 即结束
24
+ - 缺失:`## Summary` 和 `## Next Steps`(其他5个 Codex 命令均有)
25
+ - 涉及文件:
26
+ - `agent/commands/codex/momo/commands/start.md`
27
+ - `agent/commands/codex/momo/commands/sync.md`
28
+ - 对齐目标:补全 `## Summary`(执行摘要)和 `## Next Steps`(后续路径指引,如 sync 后可 run/start,start 后可 run/debug)
29
+
30
+ 3. **Claude/OpenCode start/sync 缺少闭环指引 section**
31
+ - 当前:Claude/OpenCode start/sync 结构到 `## Verification` 即结束,无闭环指引
32
+ - 缺失:`## 闭环指引`(其他5个 Claude/OpenCode 命令均有)
33
+ - 涉及文件:
34
+ - `agent/commands/claude/momo/commands/start.md`
35
+ - `agent/commands/claude/momo/commands/sync.md`
36
+ - `agent/commands/opencode/momo/commands/start.md`
37
+ - `agent/commands/opencode/momo/commands/sync.md`
38
+ - 对齐目标:补全 `## 闭环指引`,指引 start 后可 run/debug,sync 后可 run/start
39
+
40
+ ## 变更范围
41
+
42
+ - 2 个 Codex 文件(start.md, sync.md)— 修正 Preflight + 补 Summary/Next Steps
43
+ - 4 个 Claude/OpenCode 文件(start.md×2, sync.md×2)— 补闭环指引
44
+
45
+ ## 验证
46
+
47
+ - Codex start/sync Preflight 包含完整扫描路径(`.claude/rules/` + `.codex/rules/` + `.cursor/rules/` + `.opencode/` + `r2mo-task-workflow.md`)
48
+ - Codex start/sync 包含 `## Summary` + `## Next Steps`
49
+ - Claude/OpenCode start/sync 包含 `## 闭环指引`
50
+ - 三平台 7×3=21 个文件结构完整对齐
51
+
52
+ ## Changes
53
+
54
+ - 2026-05-27 16:30: 三平台 start/sync 命令闭环补全
55
+ - Files changed: `agent/commands/codex/momo/commands/start.md`, `agent/commands/codex/momo/commands/sync.md`, `agent/commands/claude/momo/commands/start.md`, `agent/commands/claude/momo/commands/sync.md`, `agent/commands/opencode/momo/commands/start.md`, `agent/commands/opencode/momo/commands/sync.md`
56
+ - 变更1: Codex start/sync Preflight 规则扫描补全 `.claude/rules/`、`.opencode/`、`r2mo-task-workflow.md`
57
+ - 变更2: Codex start/sync 追加 `## Summary` + `## Next Steps`
58
+ - 变更3: Claude/OpenCode start/sync 追加 `## 闭环指引`
59
+ - Verification: grep 验证 21/21 文件均含闭合段落(Codex: Summary/Next Steps, Claude/OpenCode: 闭环指引),结构完整对齐
@@ -1,6 +1,41 @@
1
1
  ---
2
- runAt: 2026-05-25.11-26-41
3
- title: 任务
4
- status: Pending
2
+ runAt: 2026-05-27
3
+ title: ai-cmd 菜单用法说明增强 + Codex 技能补全
4
+ status: Done
5
5
  author:
6
6
  ---
7
+
8
+ 运行 momo ai-cmd 时将各平台命令用法说明打印到多选菜单上方(header),而非每个选项后边的 description。说明采用列表格式每命令一行,带中文说明和 001 编号含义。同时修复 Codex 缺失 momo-sync/momo-start 技能的问题。
9
+
10
+ ## Changes
11
+
12
+ ### 变更摘要
13
+
14
+ 1. **ai-cmd 菜单 header 增强**:用法说明从选项 description 移到菜单上方 header 区域,列表格式每命令一行,附中文说明(如 `/momo:plan 001 生成执行计划`)
15
+ 2. **001 编号含义说明**:header 中追加两行说明 001 是三位数字任务编号对应 `task-001.md`,goon 同时对应 `task-001.md` 和 `goon-001.md`
16
+ 3. **Codex 技能补全**:新增 `skills/momo-sync/SKILL.md` 和 `skills/momo-start/SKILL.md`,修复 Codex 不识别 sync/start 命令的问题
17
+ 4. **Codex plugin.json 更新**:description 补全 sync/start,defaultPrompt 补充 sync/start 用法
18
+ 5. **Claude plugin.json 更新**:description 补全 debug/sync/start
19
+ 6. **momo-menu.js header 支持**:`selectMultiple`/`selectSingle` 新增 header 参数,在标题和选项之间渲染说明文字
20
+ 7. **README.md 更新**:编号说明改为表格,明确区分不同命令的 001 含义(plan/run/end → task-001.md,goon → task-001.md + goon-001.md)
21
+
22
+ ### 涉及文件
23
+
24
+ | 文件 | 操作 |
25
+ |:---|:---|
26
+ | `src/executor/executeAiCmd.js` | 修改 — 用法说明移到 header,列表格式+中文说明+001含义 |
27
+ | `src/utils/momo-menu.js` | 修改 — `_baseSelect`/`selectMultiple`/`selectSingle` 支持 header 参数 |
28
+ | `agent/commands/codex/momo/skills/momo-sync/SKILL.md` | 新增 — Codex sync 技能 |
29
+ | `agent/commands/codex/momo/skills/momo-start/SKILL.md` | 新增 — Codex start 技能 |
30
+ | `agent/commands/codex/momo/.codex-plugin/plugin.json` | 修改 — description/defaultPrompt 补全 sync/start |
31
+ | `agent/commands/claude/momo/.claude-plugin/plugin.json` | 修改 — description 补全 debug/sync/start |
32
+ | `README.md` | 修改 — 编号说明改为表格区分不同命令含义 |
33
+
34
+ ### 验证命令与结果
35
+
36
+ ```bash
37
+ node --check src/executor/executeAiCmd.js # OK
38
+ node --check src/utils/momo-menu.js # OK
39
+ node --check src/utils/momo-ai-cmd.js # OK
40
+ # Codex skills 目录:momo-debug, momo-end, momo-goon, momo-plan, momo-run, momo-start, momo-sync(7 个齐备)
41
+ ```
package/README.md CHANGED
@@ -103,6 +103,7 @@ npm uninstall -g momo-ai
103
103
 
104
104
  | 命令 | 说明 | 示例 |
105
105
  |:---|:---|:---|
106
+ | `momo ai-cmd` | 安装 AI 命令到 Claude Code / Codex / OpenCode | `momo ai-cmd` |
106
107
  | `momo ask` | 从模板选择提示词复制到剪贴板 | `momo ask` |
107
108
  | `momo plan` | 选择任务生成 Plan 提示词到剪贴板 | `momo plan` |
108
109
  | `momo run` | 选择任务生成提示词到剪贴板 | `momo run` |
@@ -110,10 +111,10 @@ npm uninstall -g momo-ai
110
111
 
111
112
  ### 2.3. AI 平台命令安装
112
113
 
113
- `momo ai-cmd` 将命令安装到 Claude Code、Codex、OpenCode 的可用位置。命令源随 npm 包发布,位于 `agent/commands/`。
114
+ `momo ai-cmd` 将命令安装到 Claude Code、Codex、OpenCode 的可用位置。安装时菜单中会展示各平台的命令用法说明。命令源随 npm 包发布,位于 `agent/commands/`。
114
115
 
115
116
  ```bash
116
- # 交互式选择安装平台
117
+ # 交互式选择安装平台(菜单中显示各平台用法)
117
118
  momo ai-cmd
118
119
  ```
119
120
 
@@ -123,7 +124,7 @@ momo ai-cmd
123
124
 
124
125
  #### 闭环流程
125
126
 
126
- 四个命令形成一个 `plan → run → end → goon` 闭环:
127
+ 六个命令形成一个 `plan → run → end → goon` 闭环,`sync` 和 `start` 为辅助命令:
127
128
 
128
129
  ```mermaid
129
130
  flowchart TD
@@ -167,7 +168,7 @@ flowchart TD
167
168
 
168
169
  #### 前置校验
169
170
 
170
- `plan`、`run`、`end` 要求对应 `task-xxx.md` 在 frontmatter 之后必须存在非空正文。正文为空时命令立即返回,不执行后续提示词。
171
+ `plan`、`run`、`end` 要求对应 `task-xxx.md` 在 frontmatter 之后必须存在非空正文。正文为空时命令立即返回,不执行后续提示词。`sync` 和 `start` 无前置校验,直接执行。
171
172
 
172
173
  ---
173
174
 
@@ -181,6 +182,9 @@ flowchart TD
181
182
  | `/momo:run 001` | 正文非空 | `Changes` | 优先按 Plan 执行 |
182
183
  | `/momo:end 001` | 正文非空 | `goon-001.md` | 标题为 `整改-` + task 标题 |
183
184
  | `/momo:goon 001` | goon 存在 | `Changes` | 整改后再 end 验证 |
185
+ | `/momo:debug` | 无 | 无 | BUG 排查 |
186
+ | `/momo:sync` | 无 | 无 | Git 同步:提交、拉取、合并、推送 |
187
+ | `/momo:start` | 无 | 无 | 拉起开发环境 |
184
188
 
185
189
  **Codex** — plugin skill
186
190
 
@@ -190,10 +194,20 @@ flowchart TD
190
194
  | `$momo-run 001` | `/momo:run` | 执行开发 |
191
195
  | `$momo-end 001` | `/momo:end` | 验证整改 |
192
196
  | `$momo-goon 001` | `/momo:goon` | 整改后验证 |
197
+ | `$momo-debug` | `/momo:debug` | BUG 排查 |
198
+ | `$momo-sync` | `/momo:sync` | Git 同步 |
199
+ | `$momo-start` | `/momo:start` | 拉起环境 |
193
200
 
194
- 参数为三位数字编号(如 `001`)。格式不对时命令停止并提示正确用法。
201
+ 参数 `001` 为三位数字任务编号,对应 `.r2mo/task/task-001.md`。格式不对时命令停止并提示正确用法。
195
202
 
196
- 编号与文件一一对应:`/momo:run 010` → `.r2mo/task/task-010.md`;`goon 010` 同时对应 `task-010.md` 和 `goon-010.md`。文件不存在时命令直接询问最新任务号。
203
+ 不同命令的 `001` 含义:
204
+
205
+ | 命令 | `001` 对应文件 |
206
+ |:---|:---|
207
+ | `plan` / `run` / `end` | `.r2mo/task/task-001.md` |
208
+ | `goon` | `.r2mo/task/task-001.md` + `.r2mo/task/goon-001.md` |
209
+
210
+ 文件不存在时命令直接询问最新任务号。
197
211
 
198
212
  四个命令发送给 AI Agent 的提示词统一使用”任务派发单”短列表格式,包含输入范围、前置校验、调度策略和写回规则。
199
213
 
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "momo",
3
3
  "version": "1.0.0",
4
- "description": "R2MO task workflow slash commands: /momo:plan, /momo:run, /momo:end, /momo:goon.",
4
+ "description": "R2MO task workflow slash commands: /momo:plan, /momo:run, /momo:end, /momo:goon, /momo:debug, /momo:sync, /momo:start.",
5
5
  "author": {
6
6
  "name": "R2MO"
7
7
  },
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: "BUG 排查:检测 superpowers 并调用系统化诊断命令"
3
- argument-hint: "[bug-description]"
2
+ description: "BUG 排查:检测 superpowers 并调用系统化诊断命令,支持附加指令"
3
+ argument-hint: "[bug-description] [指令...]"
4
4
  ---
5
5
 
6
6
  # /momo:debug
@@ -9,17 +9,38 @@ argument-hint: "[bug-description]"
9
9
 
10
10
  The user invoked this command with: $ARGUMENTS
11
11
 
12
+ ## 参数解析
13
+
14
+ 1. `$ARGUMENTS` 为 BUG 描述文本,末尾可附加**执行指令**,以空格分隔,不区分大小写。支持的指令:
15
+ - `深度` / `Deep` — 启用深度诊断,扩大排查范围
16
+ - `Worktree` / `WT` — 在 Worktree 中隔离排查
17
+ 2. 解析规则:从 `$ARGUMENTS` 末尾提取已知指令词,剩余文本作为 BUG 描述。解析后在聊天窗口中声明结果,例如 `📌 BUG描述: 内存泄漏 | 指令: 深度`。
18
+
19
+ **硬规则**:解析失败→终止 | Superpowers检测必执行(无则降级) | Worktree→`.r2mo/worktrees/`
20
+
12
21
  ## Workflow
13
22
 
14
- 1. 声明本次执行目标:BUG 排查,问题描述为 `$ARGUMENTS`。
15
- 2. 检测当前环境中是否存在 `superpowers:systematic-debugging` skill:
16
- - 若存在,调用 `superpowers:systematic-debugging` skill,将 `$ARGUMENTS` 作为 BUG 描述传入,按其工作流执行系统化诊断。
23
+ 1. 先读取并遵守当前仓库的 `AGENTS.md`、`CLAUDE.md`、`CODEX.md`(若存在),以及它们引用的所有规则文件;扫描项目中所有可检索的 `.mdc` 规则文件(`.claude/rules/`、`.codex/rules/`、`.cursor/rules/`、`.opencode/` 及其他任意路径下的 `.mdc`)。
24
+ 2. 声明本次执行目标:BUG 排查,问题描述为 BUG 描述部分。
25
+ 2. 检测当前环境中是否存在 `superpowers:systematic-debugging` 技能:
26
+ - 若存在,调用 `superpowers:systematic-debugging` 技能,将 BUG 描述传入,按其工作流执行系统化诊断。
17
27
  - 若不存在,执行以下降级排查流程:
18
- a. 收集错误信息:读取 `$ARGUMENTS` 中提及的文件、日志或堆栈。
28
+ a. 收集错误信息:读取 BUG 描述中提及的文件、日志或堆栈。
19
29
  b. 定位相关文件:在当前仓库中搜索与错误相关的模块、函数或配置。
20
30
  c. 分析根因:基于代码逻辑和错误现象推断根本原因。
21
31
  d. 给出修复建议:输出诊断结论和具体修复方向。
22
- 3. 排查完成后输出诊断结论和修复方向。
32
+ 3. 在聊天窗口声明排查路径:`📌 诊断路径: Superpowers[systematic-debugging]` 或 `📌 诊断路径: 标准排查`。
33
+ 4. **深度诊断**:若参数解析中检测到 `深度` 指令,扩大排查范围:搜索更多关联文件、检查间接依赖、分析边界条件。
34
+ 5. **Worktree 隔离**:若参数解析中检测到 `Worktree` 指令,在 Worktree 中执行排查,避免影响当前工作区。
35
+ 6. 排查完成后输出诊断结论和修复方向。
36
+
37
+ ## 闭环指引
38
+
39
+ Debug 完成后的典型路径:
40
+ - 确认 BUG 后修复 → 修改代码后验证
41
+ - 修复后验收 → `/momo:end <编号>`(若关联具体任务)
42
+ - 复杂修复需规划 → `/momo:plan <编号>`
43
+ - 修复后持续执行 → `/momo:run <编号>`
23
44
 
24
45
  ## Verification
25
46
 
@@ -1,6 +1,6 @@
1
1
  ---
2
- description: "验证 R2MO task:传入 001 这类三位数字编号,并写入对齐的 .r2mo/task/goon-xxx.md。"
3
- argument-hint: "[001]"
2
+ description: "验证 R2MO task:传入 001 这类三位数字编号(可附加指令),并写入对齐的 .r2mo/task/goon-xxx.md。"
3
+ argument-hint: "[001] [指令...]"
4
4
  ---
5
5
 
6
6
  # /momo:end
@@ -9,22 +9,33 @@ argument-hint: "[001]"
9
9
 
10
10
  The user invoked this command with: $ARGUMENTS
11
11
 
12
+ ## 参数解析
13
+
14
+ 1. `$ARGUMENTS` 以三位数字编号开头,正则为 `^[0-9]{3}`,例如 `001`。
15
+ 2. 编号之后的附加文本作为**执行指令**,以空格分隔,不区分大小写。支持的指令:
16
+ - `深度` / `Deep` — 启用深度验收,逐文件对比变更与任务要求
17
+ - `严格` / `Strict` — 严格模式,任何未完全对齐的项均视为整改项
18
+ 3. 解析后在聊天窗口中声明结果,例如 `📌 编号: 005 | 指令: 深度`。若未附加指令则仅声明编号。
19
+
20
+ **硬规则**:解析失败→终止 | goon先清空再写 | 禁改task Changes | 路径冲突→终止 | 隔离外文件→禁止读写 | 验收仅核验Changes声明范围,不触碰非本次变更的脏文件 | Superpowers检测必执行(无则降级)
21
+
12
22
  ## Workflow
13
23
 
14
- 1. 先读取并遵守当前仓库的 `AGENTS.md`、`CLAUDE.md`、`CODEX.md`(若存在),以及 `~/.codex/rules/r2mo-task-workflow.md`(若存在)。
15
- 2. `$ARGUMENTS` 必须是三位数字编号,正则为 `^[0-9]{3}$`,例如 `001`。
16
- 3. 如果 `$ARGUMENTS` 为空,扫描当前工作目录 `.r2mo/task/` 下的 `task-*.md` 文件,读取每个文件的 frontmatter 中的 `title` 和 `status`,列出编号与标题供用户选择,用户选择后用对应编号继续执行;如果 `.r2mo/task/` 下没有 `task-*.md` 文件,提示用户先创建任务。如果 `$ARGUMENTS` 不为空但不匹配 `^[0-9]{3}$`,立即停止,只提示:`请使用 /momo:end 001 格式执行,其中 001 是三位数字任务编号。`
17
- 4. 将任务路径设为 `.r2mo/task/task-$ARGUMENTS.md`,将整改路径设为 `.r2mo/task/goon-$ARGUMENTS.md`。如果任务文件不存在,不要猜测其他编号,不要改读别的 task 文件,立即询问用户提供最新任务号。
18
- 5. **隔离锁定**:在聊天窗口中显式声明 `📌 任务隔离锁定: .r2mo/task/task-$ARGUMENTS.md | .r2mo/task/goon-$ARGUMENTS.md`,此后本指令的读写操作只能针对这两个路径,禁止读写任何其他 `task-*.md` 或 `goon-*.md` 文件。
19
- 6. 先读取锁定任务路径 frontmatter 之后的正文;如果正文为空或仅包含空白字符,立即停止并直接返回:锁定任务路径正文为空,当前不执行 /momo:end,请先补充任务内容。
20
- 7. 在执行任何编辑、验证或任务处理之前,先在聊天窗口中原样打印本次将执行的提示词,使用 Markdown 代码块包裹。代码块中只打印下面这段最终执行提示词,不要打印本条说明。
21
- 8. 对该任务文件按以下提示词执行,其中任务路径和整改路径必须替换为实际相对路径:
24
+ 1. 先读取并遵守当前仓库的 `AGENTS.md`、`CLAUDE.md`、`CODEX.md`(若存在),以及它们引用的所有规则文件;扫描项目中所有可检索的 `.mdc` 规则文件(`.claude/rules/`、`.codex/rules/`、`.cursor/rules/`、`.opencode/` 及其他任意路径下的 `.mdc`),以及 `~/.codex/rules/r2mo-task-workflow.md`(若存在)。
25
+ 2. 解析 `$ARGUMENTS`:提取编号和执行指令。如果 `$ARGUMENTS` 为空,扫描当前工作目录 `.r2mo/task/` 下的 `task-*.md` 文件,读取每个文件的 frontmatter 中的 `title` 和 `status`,列出编号与标题供用户选择,用户选择后用对应编号继续执行;如果 `.r2mo/task/` 下没有 `task-*.md` 文件,提示用户先创建任务。如果 `$ARGUMENTS` 不为空但开头不匹配 `^[0-9]{3}`,立即停止,只提示:`请使用 /momo:end 001 [指令...] 格式执行,其中 001 是三位数字任务编号。`
26
+ 3. 将任务路径设为 `.r2mo/task/task-$编号.md`,将整改路径设为 `.r2mo/task/goon-$编号.md`。如果任务文件不存在,不要猜测其他编号,不要改读别的 task 文件,立即询问用户提供最新任务号。
27
+ 4. **隔离锁定**:在聊天窗口中显式声明 `📌 任务隔离锁定: .r2mo/task/task-$编号.md | .r2mo/task/goon-$编号.md`,此后本指令的读写操作只能针对这两个路径,禁止读写任何其他 `task-*.md` 或 `goon-*.md` 文件。
28
+ 5. 先读取锁定任务路径 frontmatter 之后的正文;如果正文为空或仅包含空白字符,立即停止并直接返回:锁定任务路径正文为空,当前不执行 /momo:end,请先补充任务内容。
29
+ 6. 在执行任何编辑、验证或任务处理之前,先在聊天窗口中原样打印本次将执行的提示词,使用 Markdown 代码块包裹。代码块中只打印下面这段最终执行提示词,不要打印本条说明。
30
+ 7. 对该任务文件按以下提示词执行,其中任务路径和整改路径必须替换为实际相对路径:
22
31
 
23
32
  任务:验收 `<TASK_PATH>`,并生成 `<GOON_PATH>` 整改队列。
24
33
 
25
34
  - 输入范围:读取 `<TASK_PATH>` frontmatter 之后的正文。
26
- - 前置校验:若正文为空或仅包含空白字符,返回”任务正文为空,未执行验收”,且不修改任何文件。
35
+ - 前置校验:若正文为空或仅包含空白字符,返回"任务正文为空,未执行验收",且不修改任何文件。
27
36
  - 验收依据:对照任务正文、已有 Plan、已有 Changes 和当前代码状态判断任务是否完成。
37
+ - **深度验收**:若参数解析中检测到 `深度` 指令,逐文件读取变更内容与任务要求比对;否则按标准粒度验收。
38
+ - **严格模式**:若参数解析中检测到 `严格` 指令,任何未完全对齐的项均列为整改项;否则仅列出明显缺陷。
28
39
  - goon 标题:`<GOON_PATH>` frontmatter 的 title 必须为 `整改-` + `<TASK_PATH>` frontmatter 中的 title。
29
40
  - goon 写入:写入前必须清空 `<GOON_PATH>` 原始内容,再写入本轮验收发现的当前待整改项。
30
41
  - **写回校验**:执行写回前必须验证目标文件路径与隔离锁定路径一致;若不一致,立即停止并报告路径冲突,不得写入。
@@ -33,6 +44,14 @@ The user invoked this command with: $ARGUMENTS
33
44
  - 禁止事项:不得修改 `<TASK_PATH>` 的 Changes。
34
45
  - 隔离约束:全程不得读取、编辑或创建除 `<TASK_PATH>` 和 `<GOON_PATH>` 以外的任何 `task-*.md` 或 `goon-*.md` 文件。
35
46
 
47
+ ## 闭环指引
48
+
49
+ End 完成后的典型路径:
50
+ - 无整改项 → 任务已完成,闭环结束
51
+ - 有整改项 → `/momo:goon <编号>`
52
+ - 整改后再验收 → `/momo:end <编号>`(循环直到无整改项)
53
+ - 如遇新 BUG → `/momo:debug <描述>`
54
+
36
55
  ## Verification
37
56
 
38
57
  完成后说明验证结论、整改项数量,以及写回的 `.r2mo/task/goon-xxx.md` 路径。