momo-ai 1.0.99 → 1.0.101

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 (64) hide show
  1. package/.r2mo/.obsidian/plugins/obsidian-git/obsidian_askpass.bat +21 -0
  2. package/.r2mo/task/goon-001.md +2 -2
  3. package/.r2mo/task/goon-002.md +4 -2
  4. package/.r2mo/task/goon-003.md +7 -0
  5. package/.r2mo/task/goon-004.md +7 -0
  6. package/.r2mo/task/goon-005.md +7 -0
  7. package/.r2mo/task/goon-006.md +7 -0
  8. package/.r2mo/task/goon-007.md +4 -0
  9. package/.r2mo/task/goon-008.md +7 -0
  10. package/.r2mo/task/goon-009.md +7 -0
  11. package/.r2mo/task/task-001.md +14 -2
  12. package/.r2mo/task/task-002.md +77 -2
  13. package/.r2mo/task/task-003.md +131 -4
  14. package/.r2mo/task/task-004.md +25 -2
  15. package/.r2mo/task/task-005.md +60 -2
  16. package/.r2mo/task/task-006.md +50 -2
  17. package/.r2mo/task/task-007.md +86 -2
  18. package/.r2mo/task/task-008.md +56 -3
  19. package/.r2mo/task/task-009.md +38 -3
  20. package/README.md +176 -73
  21. package/agent/commands/claude/momo/.claude-plugin/plugin.json +1 -1
  22. package/agent/commands/claude/momo/commands/debug.md +47 -0
  23. package/agent/commands/claude/momo/commands/end.md +31 -9
  24. package/agent/commands/claude/momo/commands/goon.md +35 -8
  25. package/agent/commands/claude/momo/commands/plan.md +37 -11
  26. package/agent/commands/claude/momo/commands/run.md +37 -10
  27. package/agent/commands/claude/momo/commands/start.md +37 -0
  28. package/agent/commands/claude/momo/commands/sync.md +37 -0
  29. package/agent/commands/claude/momo/plugin.json +1 -1
  30. package/agent/commands/codex/momo/.codex-plugin/plugin.json +4 -2
  31. package/agent/commands/codex/momo/commands/debug.md +55 -0
  32. package/agent/commands/codex/momo/commands/end.md +31 -18
  33. package/agent/commands/codex/momo/commands/goon.md +28 -15
  34. package/agent/commands/codex/momo/commands/plan.md +32 -13
  35. package/agent/commands/codex/momo/commands/run.md +26 -12
  36. package/agent/commands/codex/momo/commands/start.md +53 -0
  37. package/agent/commands/codex/momo/commands/sync.md +54 -0
  38. package/agent/commands/codex/momo/skills/momo-debug/SKILL.md +31 -0
  39. package/agent/commands/codex/momo/skills/momo-start/SKILL.md +28 -0
  40. package/agent/commands/codex/momo/skills/momo-sync/SKILL.md +28 -0
  41. package/agent/commands/opencode/momo/commands/debug.md +47 -0
  42. package/agent/commands/opencode/momo/commands/end.md +30 -10
  43. package/agent/commands/opencode/momo/commands/goon.md +35 -8
  44. package/agent/commands/opencode/momo/commands/plan.md +37 -11
  45. package/agent/commands/opencode/momo/commands/run.md +37 -10
  46. package/agent/commands/opencode/momo/commands/start.md +37 -0
  47. package/agent/commands/opencode/momo/commands/sync.md +37 -0
  48. package/package.json +1 -1
  49. package/src/executor/executeAiCmd.js +36 -3
  50. package/src/executor/executeApp.js +2 -2
  51. package/src/executor/executeApply.js +4 -2
  52. package/src/executor/executeDict.js +1 -1
  53. package/src/executor/executeDocs.js +1 -1
  54. package/src/executor/executeDomain.js +5 -5
  55. package/src/executor/executeEnv.js +11 -10
  56. package/src/executor/executeMcp.js +2 -1
  57. package/src/executor/executeMmr0.js +5 -5
  58. package/src/executor/executeMmr2.js +5 -5
  59. package/src/executor/executeMod.js +4 -4
  60. package/src/executor/executeOpen.js +3 -2
  61. package/src/utils/momo-ai-cmd.js +45 -11
  62. package/src/utils/momo-audio.js +3 -2
  63. package/src/utils/momo-file-utils.js +10 -2
  64. package/src/utils/momo-menu.js +4 -3
@@ -0,0 +1,21 @@
1
+ @echo off
2
+ set "PROMPT=%~1"
3
+ set "TEMP_FILE=%OBSIDIAN_GIT_CREDENTIALS_INPUT%"
4
+
5
+ if not "%PROMPT%"=="" echo %PROMPT%> "%TEMP_FILE%"
6
+
7
+ :wait_response
8
+ if not exist "%TEMP_FILE%" (
9
+ echo Trigger file got removed: Abort 1>&2
10
+ exit /b 1
11
+ )
12
+ if exist "%TEMP_FILE%.response" goto :got_response
13
+ ping -n 1 127.0.0.1 >nul
14
+ goto :wait_response
15
+
16
+ :got_response
17
+ set /p RESPONSE=<"%TEMP_FILE%.response"
18
+ echo %RESPONSE%
19
+
20
+ if exist "%TEMP_FILE%" del "%TEMP_FILE%"
21
+ if exist "%TEMP_FILE%.response" del "%TEMP_FILE%.response"
@@ -1,6 +1,6 @@
1
1
  ---
2
- runAt: 2026-05-25.17-45-00
3
- title: 整改-开发 Claude、Codex、OpenCode 命令
2
+ runAt: 2026-05-25.17-57-24
3
+ title: 整改-BUG-强化隔离区域
4
4
  status: Done
5
5
  author:
6
6
  ---
@@ -1,3 +1,5 @@
1
- # task-002 待整改项
1
+ ---
2
+ title: 整改-追加新的命令
3
+ ---
2
4
 
3
- 当前无待整改项。
5
+ (无待整改项)
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: 整改-强化跨平台兼容性(Windows / Linux / macOS)
3
+ ---
4
+
5
+ ## 待整改项
6
+
7
+ 无待整改项。
@@ -0,0 +1,7 @@
1
+ ---
2
+ title: 整改-更新 README.md
3
+ ---
4
+
5
+ ## 待整改项
6
+
7
+ 无待整改项。
@@ -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,18 @@
1
1
  ---
2
2
  runAt: 2026-05-25.17-57-24
3
- title: 任务
4
- status: Pending
3
+ title: BUG-强化隔离区域
4
+ status: Done
5
5
  author:
6
6
  ---
7
+ 在使用 /momo: 系列命令时出现了 /momo:plan 002 结果最终回写 task-001.md 的场景,对隔离处理进行一轮强化和修正。
8
+
9
+ ## Changes
10
+
11
+ - 2026-05-26 10:30: 强化 /momo:plan、/momo:run、/momo:end、/momo:goon 四个 skill 的任务隔离机制,防止跨任务回写污染。
12
+ - Files changed: `agent/commands/claude/momo/commands/plan.md`, `run.md`, `end.md`, `goon.md` (源文件)
13
+ - Files changed: `~/.claude/plugins/cache/momo-skills/momo/1.0.0/commands/plan.md`, `run.md`, `end.md`, `goon.md` (Claude 插件缓存)
14
+ - Files changed: `~/.codex/plugins/momo/commands/plan.md`, `run.md`, `end.md`, `goon.md` (Codex 命令)
15
+ - Files changed: `~/.codex/plugins/momo/skills/momo-plan/SKILL.md`, `momo-run/SKILL.md`, `momo-end/SKILL.md`, `momo-goon/SKILL.md` (Codex skill)
16
+ - Files changed: `~/.codex/rules/r2mo-task-workflow.md` (共享规则)
17
+ - 新增三层隔离守卫:(1) 隔离锁定声明(📌 任务隔离锁定),(2) 写回前路径校验,(3) 全程隔离约束禁止操作其他 task/goon 文件
18
+ - Verification: grep 确认全部 12 个文件 + 1 个共享规则均包含隔离锁定、写回校验、隔离约束三个关键词
@@ -1,6 +1,81 @@
1
1
  ---
2
2
  runAt: 2026-05-25.17-57-24
3
- title: 任务
4
- status: Pending
3
+ title: 追加新的命令
4
+ status: Done
5
5
  author:
6
6
  ---
7
+ 基于当前 /momo 系列命令,追加新的 /momo:debug 专用命令,这种任务应该是直接处理成 BUG 排查,检查当前环境中是否存在 superpowers,如果有,调用系统排查的命令进行BUG诊断。
8
+
9
+ ## Plan
10
+
11
+ ### 目标拆解
12
+
13
+ 1. **新增 `/momo:debug` AI 命令**:作为 `/momo:plan|run|end|goon` 之外的第五个专用命令,面向 BUG 排查场景
14
+ 2. **Superpowers 检测与调度**:命令执行时先检测当前环境是否安装了 superpowers 插件;有则调用 `superpowers:systematic-debugging` 进行系统化 BUG 诊断;无则降级为手动排查工作流
15
+ 3. **全平台覆盖**:Claude Code / Codex / OpenCode 三平台均需安装该命令
16
+ 4. **安装/卸载闭环**:`momo ai-cmd` 安装和卸载时正确处理 `debug` 命令
17
+
18
+ ### 涉及文件/模块
19
+
20
+ | 文件 | 变更类型 | 说明 |
21
+ |------|----------|------|
22
+ | `agent/commands/claude/momo/commands/debug.md` | 新增 | Claude Code slash command 定义 |
23
+ | `agent/commands/codex/momo/commands/debug.md` | 新增 | Codex prompt command 定义 |
24
+ | `agent/commands/opencode/momo/commands/debug.md` | 新增 | OpenCode command 定义 |
25
+ | `src/utils/momo-ai-cmd.js` | 修改 | `MOMO_COMMANDS` 数组追加 `'momo:debug'`,卸载清理逻辑自动生效 |
26
+ | `agent/commands/claude/momo/plugin.json` | 修改 | `description` 字段追加 `/momo:debug` |
27
+
28
+ ### 执行步骤
29
+
30
+ **Step 1 — 创建 `agent/commands/claude/momo/commands/debug.md`**
31
+
32
+ - YAML frontmatter:`description: "BUG 排查:检测 superpowers 并调用系统化诊断命令"`,`argument-hint: "[bug-description]"`
33
+ - 正文 Workflow:
34
+ 1. 声明本次执行目标(BUG 排查)
35
+ 2. 检测 superpowers 是否可用(检查 skill 列表中是否存在 `superpowers:systematic-debugging`)
36
+ 3. **有 superpowers**:调用 `superpowers:systematic-debugging` skill,传入 `$ARGUMENTS` 作为 BUG 描述,按其工作流执行
37
+ 4. **无 superpowers**:降级为手动排查流程——收集错误信息、定位相关文件、分析根因、给出修复建议
38
+ 5. 排查完成后输出诊断结论和修复方向
39
+ - 风格与 plan.md / run.md 保持一致(Workflow 编号、Verification 段落)
40
+
41
+ **Step 2 — 创建 `agent/commands/codex/momo/commands/debug.md`**
42
+
43
+ - 与 Step 1 内容一致,Codex 平台无需额外适配
44
+
45
+ **Step 3 — 创建 `agent/commands/opencode/momo/commands/debug.md`**
46
+
47
+ - 与 Step 1 内容一致,OpenCode 平台无需额外适配
48
+
49
+ **Step 4 — 修改 `src/utils/momo-ai-cmd.js`**
50
+
51
+ - 将 `MOMO_COMMANDS` 数组从 `['momo:plan', 'momo:run', 'momo:end', 'momo:goon']` 更新为 `['momo:plan', 'momo:run', 'momo:end', 'momo:goon', 'momo:debug']`
52
+ - `removeOpenCodeCommandEntries` 函数依赖此数组进行卸载清理,追加后自动生效,无需额外修改
53
+
54
+ **Step 5 — 修改 `agent/commands/claude/momo/plugin.json`**
55
+
56
+ - 更新 `description` 字段为 `"R2MO task workflow slash commands: /momo:plan, /momo:run, /momo:end, /momo:goon, /momo:debug."`
57
+
58
+ ### 验证方式
59
+
60
+ 1. **语法检查**:`node --check src/utils/momo-ai-cmd.js` 确认无语法错误
61
+ 2. **安装测试**:`node src/momo.js ai-cmd` 选择 Claude 平台安装,确认 `debug.md` 被复制到目标目录
62
+ 3. **命令发现**:在 Claude Code 中输入 `/momo:debug` 确认命令可被发现
63
+ 4. **卸载测试**:`node src/momo.js ai-cmd -u` 确认 `momo:debug` 条目被正确清理
64
+ 5. **功能验证**:在 Claude Code 中执行 `/momo:debug 问题描述` 确认 superpowers 检测逻辑和降级路径均正常工作
65
+
66
+ ### 风险与交接说明
67
+
68
+ - **风险**:superpowers 检测依赖于 skill 列表在运行时可见,若 Claude Code 版本差异导致 skill 发现机制不同,降级路径需作为兜底保障
69
+ - **边界**:本 Plan 仅覆盖 `/momo:debug` 命令的创建与安装,不涉及 superpowers 插件本身的修改
70
+ - **交接**:实施者需确认三平台 debug.md 内容一致;安装后需在真实环境执行一次端到端验证
71
+
72
+ ## Changes
73
+
74
+ - 2026-05-26 11:00: 新增 `/momo:debug` AI 命令,覆盖 Claude Code / Codex / OpenCode 三平台
75
+ - Files changed: `agent/commands/claude/momo/commands/debug.md` (新增), `agent/commands/codex/momo/commands/debug.md` (新增), `agent/commands/opencode/momo/commands/debug.md` (新增), `src/utils/momo-ai-cmd.js` (MOMO_COMMANDS 追加 `momo:debug`), `agent/commands/claude/momo/plugin.json` (description 追加 `/momo:debug`)
76
+ - Verification: `node --check src/utils/momo-ai-cmd.js` 通过;三平台 debug.md 文件存在且 frontmatter 正确;`require('./src/utils/momo-ai-cmd')` 加载正常
77
+
78
+ - 2026-05-26 11:15: 整改闭环 — 修复两处遗漏
79
+ - 整改项 1:`src/utils/momo-ai-cmd.js` marketplace JSON description 追加 `/momo:debug`(L307)
80
+ - 整改项 2:`src/utils/momo-ai-cmd.js` `uninstallCodexPlugin` 追加 `momo-debug.md` 卸载清理(L510)
81
+ - Verification: `node --check src/utils/momo-ai-cmd.js` 通过;`require('./src/utils/momo-ai-cmd')` 加载正常
@@ -1,6 +1,133 @@
1
1
  ---
2
- runAt: 2026-05-25.11-25-47
3
- title: 任务
4
- status: Pending
5
- author:
2
+ runAt: 2026-05-26.14-41-00
3
+ title: 强化跨平台兼容性(Windows / Linux / macOS)
4
+ status: Done
5
+ author: Claude
6
6
  ---
7
+
8
+ ## 目标
9
+
10
+ 全量扫描 r2mo-lain 所有命令源码,修复 Windows / Linux / macOS 三平台兼容性问题,确保安装、卸载、命令执行在三个平台上行为一致。
11
+
12
+ ## 扫描结果
13
+
14
+ ### 高严重度:Windows `spawn`/`execSync` 缺少 `shell: true`
15
+
16
+ Windows 上 npm 全局安装的 CLI 是 `.cmd` 文件,`spawn`/`execSync` 不加 `shell: true` 会抛 `ENOENT`。
17
+
18
+ | 文件 | 调用 |
19
+ |------|------|
20
+ | `src/utils/momo-audio.js` | `spawnSync(checker)`, `spawn(player.command)` |
21
+ | `src/utils/momo-ai-cmd.js` | `spawnSync(lookup)`, `spawnSync(command)` |
22
+ | `src/executor/executeOpen.js` | `spawn(whereCmd)`, `spawn(command)` |
23
+ | `src/executor/executeApp.js` | `spawn(whereCmd)`, `spawn('ai')` |
24
+ | `src/executor/executeMmr0.js` | `execSync(whereCmd)`, `execSync(git fetch/rev-parse/pull)` |
25
+ | `src/executor/executeMmr2.js` | `execSync(whereCmd)`, `execSync(git fetch/rev-parse/pull)` |
26
+ | `src/executor/executeDomain.js` | `spawn(whereCmd)`, `execSync(git fetch/rev-parse/pull)` |
27
+ | `src/executor/executeDocs.js` | `execSync(whereCmd obsidian)` |
28
+ | `src/executor/executeMod.js` | `execSync(git fetch/rev-parse/pull)` |
29
+ | `src/executor/executeMcp.js` | `execSync(npm install)` |
30
+ | `src/executor/executeApply.js` | `execSync(git pull/clone)` |
31
+ | `src/executor/executeDict.js` | `execSync(npm install -g)` |
32
+ | `src/executor/executeEnv.js` | `execAsync(whereCmd/java/node/npm/git/codex)` 共 8 处 |
33
+ | `src/utils/momo-file-utils.js` | `execSync(git clone)` |
34
+
35
+ ### 高严重度:OpenCode 配置路径
36
+
37
+ - `momo-ai-cmd.js` OpenCode 平台 `targetDir` 硬编码 `~/.config/opencode/`,Windows 不使用此路径,应使用 `%APPDATA%\opencode\`
38
+
39
+ ### 中严重度:Windows 文件锁定
40
+
41
+ - `momo-ai-cmd.js` 中 `fs.rm`/`fs.copyFile` 在文件被占用时抛 `EPERM`/`EBUSY`,无重试机制
42
+
43
+ ### 中严重度:符号链接
44
+
45
+ - `momo-ai-cmd.js` 和 `momo-file-utils.js` 中 `copyDir` 只处理 `isFile()`,跳过 `isSymbolicLink()`
46
+
47
+ ### 低严重度:README 缺少跨平台安装说明
48
+
49
+ - 2.1 安装章节只有一行 `npm install -g momo-ai`,无平台差异说明
50
+ - 缺 Windows 排错提示(PowerShell 执行策略、文件锁定)
51
+
52
+ ## Changes
53
+
54
+ ### 代码修复
55
+
56
+ 1. **`src/utils/momo-ai-cmd.js`**
57
+ - `commandExists` / `runOptionalCommand`:加 `shell: process.platform === 'win32'`
58
+ - 新增 `openCodeConfigDir()`:Windows 使用 `%APPDATA%\opencode\`,其他平台使用 `~/.config/opencode/`
59
+ - `PLATFORMS[2].targetDir` 改为调用 `openCodeConfigDir()`
60
+ - `openCodeConfigFiles` 使用 `openCodeConfigDir()` 查找 legacy jsonc
61
+ - 新增 `retryOnWindows()`:对 `removeIfExists`、`removeExistingPath`、`copyFile` 自动重试 `EPERM`/`EBUSY`
62
+ - `copyDir` 增加 `entry.isSymbolicLink()` 分支
63
+
64
+ 2. **`src/utils/momo-audio.js`**
65
+ - `_isCommandAvailable`:`spawnSync` 加 `shell: process.platform === 'win32'`
66
+ - `_playWith`:`spawn` 加 `shell: process.platform === 'win32'`
67
+
68
+ 3. **`src/utils/momo-file-utils.js`**
69
+ - `gitClone`:`execSync` 加 `shell: process.platform === 'win32'`
70
+
71
+ 4. **`src/executor/executeOpen.js`**
72
+ - `_isCommandAvailable`:`spawn` 加 `shell`
73
+ - `_openWithSpawn`:`spawn` 加 `shell`
74
+
75
+ 5. **`src/executor/executeApp.js`**
76
+ - `_isCommandAvailable`:`spawn` 加 `shell`
77
+ - `_executeAiCommand`:`spawn('ai')` 改 `shell: false` 为 `shell: process.platform === 'win32'`
78
+
79
+ 6. **`src/executor/executeMmr0.js`**
80
+ - `_isCommandAvailable`、`_isRepositoryUpToDate`、`_cloneOrUpdateRepository` 中所有 `execSync` 加 `shell`
81
+
82
+ 7. **`src/executor/executeMmr2.js`**
83
+ - 同上,4 处 `execSync` 加 `shell`
84
+
85
+ 8. **`src/executor/executeDomain.js`**
86
+ - `_isCommandAvailable`:`spawn` 加 `shell`
87
+ - git 操作 3 处 `execSync` 加 `shell`
88
+
89
+ 9. **`src/executor/executeDocs.js`**
90
+ - `execSync(whereCmd obsidian)` 加 `shell`
91
+
92
+ 10. **`src/executor/executeMod.js`**
93
+ - git 操作 3 处 `execSync` 加 `shell`
94
+
95
+ 11. **`src/executor/executeMcp.js`**
96
+ - `execSync('npm install')` 加 `shell`
97
+
98
+ 12. **`src/executor/executeApply.js`**
99
+ - `execSync(git pull/clone)` 2 处加 `shell`
100
+
101
+ 13. **`src/executor/executeDict.js`**
102
+ - `execSync(npm install -g)` 加 `shell`
103
+
104
+ 14. **`src/executor/executeEnv.js`**
105
+ - 新增 `_shellOpt()` 辅助函数
106
+ - 8 处 `execAsync` 调用全部加 `_shellOpt()`
107
+
108
+ ### README.md 修复
109
+
110
+ - 2.1 安装章节:补充 macOS / Linux / Windows 三平台安装命令、权限处理、卸载命令
111
+ - 添加 Windows 文件锁定排错提示
112
+ - 2.3 AI 平台命令安装:闭环流程 Mermaid 图改纵向(`flowchart TD`)
113
+ - 文字按子章节拆分(闭环流程、前置校验、各平台调用方式、卸载、平台安装细节)
114
+ - SDD 表格按平台拆分为两个独立表格
115
+ - 平台安装细节表格改为 bullet list
116
+ - 各列表行加 `<br/>` 换行避免拥挤
117
+
118
+ ### 验证
119
+
120
+ - 14 个修改文件全部通过 `node --check` 语法检查
121
+
122
+ ### Goon 整改闭环(goon-003)
123
+
124
+ 整改项:`momo-file-utils.js` 的 `copyDir` 使用 `fsAsync.stat()`(跟随符号链接),需改为 `fsAsync.lstat()`(不跟随),并补齐 `isSymbolicLink()` 分支。
125
+
126
+ 修复内容:
127
+ - `fsAsync.stat(sPath)` → `fsAsync.lstat(sPath)`
128
+ - 新增 `stat.isSymbolicLink()` 分支:使用 `fsAsync.readlink()` 读取链接目标,再用 `fsAsync.symlink()` 重建链接
129
+ - 目录和普通文件分支保持不变
130
+
131
+ 涉及文件:`src/utils/momo-file-utils.js:20-33`
132
+
133
+ 验证:`node --check src/utils/momo-file-utils.js` 通过,goon-003.md 整改项已清空。
@@ -1,6 +1,29 @@
1
1
  ---
2
2
  runAt: 2026-05-25.11-25-47
3
- title: 任务
4
- status: Pending
3
+ title: 更新 README.md
4
+ status: Done
5
5
  author:
6
6
  ---
7
+ - 扫描 README.md 中看是否有遗漏的命令
8
+ - 强化 Mermaid 图(要瘦长从上往下,方便主页查看)
9
+ - 所有表格不要出现换行,有文字的尽量多列显示
10
+
11
+ ## Changes
12
+
13
+ - **变更摘要**: 更新 README.md,补充遗漏命令、Mermaid 图瘦长化、表格多列无换行
14
+ - **涉及文件**: `README.md`
15
+ - **具体变更**:
16
+ 1. 环境初始化表格补充 `momo focus` 命令(commander 有 focus.json 但 README 遗漏)
17
+ 2. 环境初始化表和开发实施表增加「选项」列,说明列缩短避免换行
18
+ 3. 需求分析表和 SDD 开发表说明列精简,去除跨行描述
19
+ 4. Mermaid 图节点文本精简,移除粗体标记和冗长描述,保持瘦长纵向布局
20
+ - **验证命令**: `grep -c 'momo focus' README.md` → 1
21
+ - **验证结果**: `momo focus` 已出现在环境初始化表格中,所有表格无换行文本,Mermaid 图纵向精简
22
+
23
+ ### 整改闭环(goon-004)
24
+
25
+ - **整改项**: 各平台调用方式表格说明列过长,未完全对齐"多列显示"要求
26
+ - **整改执行**: Claude/OpenCode 表扩展为「命令」「前置」「写回」「说明」4列;Codex 表扩展为「命令」「等价」「说明」3列
27
+ - **涉及文件**: `README.md`
28
+ - **验证命令**: `grep -c '前置' README.md` → 1
29
+ - **验证结果**: 两个平台表均已多列化,无长句挤单单元格,goon-004.md 已清空
@@ -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: 闭环指引),结构完整对齐