momo-ai 1.0.19 → 1.0.21
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/.claude/skills/algorithmic-art/LICENSE.txt +202 -0
- package/.claude/skills/algorithmic-art/SKILL.md +405 -0
- package/.claude/skills/algorithmic-art/templates/generator_template.js +223 -0
- package/.claude/skills/algorithmic-art/templates/viewer.html +599 -0
- package/.claude/skills/r2mo-rad-lain/PROMPT.md +281 -0
- package/.claude/skills/r2mo-rad-lain/README.md +192 -0
- package/.claude/skills/r2mo-rad-lain/SKILL.md +412 -0
- package/.claude/skills/r2mo-rad-lain/examples/argument-parsing.js +154 -0
- package/.claude/skills/r2mo-rad-lain/examples/file-operations.js +182 -0
- package/.claude/skills/r2mo-rad-lain/file-utils-api.md +281 -0
- package/.claude/skills/r2mo-rad-lain/menu-api.md +187 -0
- package/.claude/skills/r2mo-rad-lain/scripts/file-utils.js +223 -0
- package/.claude/skills/r2mo-rad-lain/scripts/menu.js +289 -0
- package/.claude/skills/r2mo-rad-lain/scripts/yaml-parser.js +209 -0
- package/.claude/skills/r2mo-rad-lain/templates/command.json.template +13 -0
- package/.claude/skills/r2mo-rad-lain/templates/executor.js.template +32 -0
- package/.claude/skills/r2mo-rad-lain/templates/interactive-menu.js.template +221 -0
- package/.cursor/mcp.json +17 -0
- package/.obsidian/app.json +1 -0
- package/.obsidian/appearance.json +4 -0
- package/.obsidian/community-plugins.json +4 -0
- package/.obsidian/core-plugins.json +33 -0
- package/.obsidian/plugins/ai-agent/main.js +98495 -0
- package/.obsidian/plugins/ai-agent/manifest.json +11 -0
- package/.obsidian/plugins/ai-agent/styles.css +806 -0
- package/.obsidian/plugins/dataview/main.js +20876 -0
- package/.obsidian/plugins/dataview/manifest.json +11 -0
- package/.obsidian/plugins/dataview/styles.css +141 -0
- package/.obsidian/plugins/obsidian-excalidraw-plugin/main.js +10 -0
- package/.obsidian/plugins/obsidian-excalidraw-plugin/manifest.json +12 -0
- package/.obsidian/plugins/obsidian-excalidraw-plugin/styles.css +1 -0
- package/.obsidian/plugins/templater-obsidian/main.js +45 -0
- package/.obsidian/plugins/templater-obsidian/manifest.json +11 -0
- package/.obsidian/plugins/templater-obsidian/styles.css +226 -0
- package/.obsidian/plugins/terminal/main.js +200 -0
- package/.obsidian/plugins/terminal/manifest.json +14 -0
- package/.obsidian/plugins/terminal/styles.css +32 -0
- package/.obsidian/themes/AnuPpuccin/manifest.json +7 -0
- package/.obsidian/themes/AnuPpuccin/theme.css +9080 -0
- package/.obsidian/themes/Things/manifest.json +7 -0
- package/.obsidian/themes/Things/theme.css +1628 -0
- package/.obsidian/workspace.json +196 -0
- package/README.md +10 -123
- package/docs/images/logo.jpeg +0 -0
- package/install.sh +1 -0
- package/package.json +6 -2
- package/skills/r2mo-rad-lain/SKILL.md +101 -0
- package/src/_agent/trae/momo-datamodel.json +2 -1
- package/src/_agent/trae/momo-module-req.json +2 -1
- package/src/_agent/trae/momo-system-req.json +2 -1
- package/src/_agent/trae/momo-task.json +2 -1
- package/src/_agent/trae/momo-taskplan.json +2 -1
- package/src/_mcp/skills-server.mjs +70 -0
- package/src/_skill/repositories.json +16 -0
- package/src/_template/LAIN/.momo/advanced/refer.json +0 -4
- package/src/commander/help.json +5 -0
- package/src/commander/mcp.json +13 -0
- package/src/commander/open.json +8 -2
- package/src/commander/skills.json +20 -0
- package/src/executor/executeEnv.js +48 -38
- package/src/executor/executeHelp.js +77 -16
- package/src/executor/executeInit.js +203 -149
- package/src/executor/executeMcp.js +290 -0
- package/src/executor/executeOpen.js +144 -125
- package/src/executor/executeSkills.js +747 -0
- package/src/executor/index.js +5 -39
- package/src/momo.js +2 -1
- package/src/utils/momo-args.js +39 -0
- package/src/utils/momo-file-utils.js +75 -0
- package/src/utils/momo-menu.js +54 -0
- package/src/commander/actor.json +0 -12
- package/src/commander/actors.json +0 -6
- package/src/commander/add.json +0 -12
- package/src/commander/agent.json +0 -12
- package/src/commander/agentcfg.json +0 -5
- package/src/commander/archive.json +0 -12
- package/src/commander/commit.json +0 -12
- package/src/commander/console.json +0 -7
- package/src/commander/lain.json +0 -7
- package/src/commander/list.json +0 -7
- package/src/commander/plan.json +0 -12
- package/src/commander/project.json +0 -12
- package/src/commander/pull.json +0 -6
- package/src/commander/push.json +0 -6
- package/src/commander/repo.json +0 -18
- package/src/commander/run.json +0 -18
- package/src/commander/show.json +0 -12
- package/src/commander/tasks.json +0 -18
- package/src/commander/unlock.json +0 -6
- package/src/commander/validate.json +0 -12
- package/src/executor/executeActor.js +0 -133
- package/src/executor/executeActors.js +0 -58
- package/src/executor/executeAdd.js +0 -307
- package/src/executor/executeAgent.js +0 -224
- package/src/executor/executeAgentCfg.js +0 -195
- package/src/executor/executeArchive.js +0 -124
- package/src/executor/executeCommit.js +0 -202
- package/src/executor/executeConsole.js +0 -142
- package/src/executor/executeList.js +0 -133
- package/src/executor/executePlan.js +0 -164
- package/src/executor/executeProject.js +0 -312
- package/src/executor/executePull.js +0 -127
- package/src/executor/executePush.js +0 -243
- package/src/executor/executeRepo.js +0 -238
- package/src/executor/executeRun.js +0 -644
- package/src/executor/executeShow.js +0 -164
- package/src/executor/executeTasks.js +0 -384
- package/src/executor/executeUnlock.js +0 -110
- package/src/executor/executeValidate.js +0 -210
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
{
|
|
2
|
+
"main": {
|
|
3
|
+
"id": "deac3bae5b8eaf35",
|
|
4
|
+
"type": "split",
|
|
5
|
+
"children": [
|
|
6
|
+
{
|
|
7
|
+
"id": "3c98dd003474dbe3",
|
|
8
|
+
"type": "tabs",
|
|
9
|
+
"children": [
|
|
10
|
+
{
|
|
11
|
+
"id": "fa21b1fcdc6827dc",
|
|
12
|
+
"type": "leaf",
|
|
13
|
+
"state": {
|
|
14
|
+
"type": "empty",
|
|
15
|
+
"state": {},
|
|
16
|
+
"icon": "lucide-file",
|
|
17
|
+
"title": "新标签页"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
"direction": "vertical"
|
|
24
|
+
},
|
|
25
|
+
"left": {
|
|
26
|
+
"id": "feec921b054719db",
|
|
27
|
+
"type": "split",
|
|
28
|
+
"children": [
|
|
29
|
+
{
|
|
30
|
+
"id": "439eeaabbc5578b3",
|
|
31
|
+
"type": "tabs",
|
|
32
|
+
"children": [
|
|
33
|
+
{
|
|
34
|
+
"id": "8c87c9abf3780c7b",
|
|
35
|
+
"type": "leaf",
|
|
36
|
+
"state": {
|
|
37
|
+
"type": "file-explorer",
|
|
38
|
+
"state": {
|
|
39
|
+
"sortOrder": "alphabetical",
|
|
40
|
+
"autoReveal": false
|
|
41
|
+
},
|
|
42
|
+
"icon": "lucide-folder-closed",
|
|
43
|
+
"title": "文件列表"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"id": "f78e0f72132efe31",
|
|
48
|
+
"type": "leaf",
|
|
49
|
+
"state": {
|
|
50
|
+
"type": "search",
|
|
51
|
+
"state": {
|
|
52
|
+
"query": "",
|
|
53
|
+
"matchingCase": false,
|
|
54
|
+
"explainSearch": false,
|
|
55
|
+
"collapseAll": false,
|
|
56
|
+
"extraContext": false,
|
|
57
|
+
"sortOrder": "alphabetical"
|
|
58
|
+
},
|
|
59
|
+
"icon": "lucide-search",
|
|
60
|
+
"title": "搜索"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"id": "88a9bd2a07daaff8",
|
|
65
|
+
"type": "leaf",
|
|
66
|
+
"state": {
|
|
67
|
+
"type": "bookmarks",
|
|
68
|
+
"state": {},
|
|
69
|
+
"icon": "lucide-bookmark",
|
|
70
|
+
"title": "书签"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|
|
75
|
+
],
|
|
76
|
+
"direction": "horizontal",
|
|
77
|
+
"width": 300
|
|
78
|
+
},
|
|
79
|
+
"right": {
|
|
80
|
+
"id": "adfd45868e838464",
|
|
81
|
+
"type": "split",
|
|
82
|
+
"children": [
|
|
83
|
+
{
|
|
84
|
+
"id": "465224b136075e10",
|
|
85
|
+
"type": "tabs",
|
|
86
|
+
"children": [
|
|
87
|
+
{
|
|
88
|
+
"id": "75df603b8eecae7f",
|
|
89
|
+
"type": "leaf",
|
|
90
|
+
"state": {
|
|
91
|
+
"type": "backlink",
|
|
92
|
+
"state": {
|
|
93
|
+
"collapseAll": false,
|
|
94
|
+
"extraContext": false,
|
|
95
|
+
"sortOrder": "alphabetical",
|
|
96
|
+
"showSearch": false,
|
|
97
|
+
"searchQuery": "",
|
|
98
|
+
"backlinkCollapsed": false,
|
|
99
|
+
"unlinkedCollapsed": true
|
|
100
|
+
},
|
|
101
|
+
"icon": "links-coming-in",
|
|
102
|
+
"title": "反向链接"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"id": "0fa5eee885af3640",
|
|
107
|
+
"type": "leaf",
|
|
108
|
+
"state": {
|
|
109
|
+
"type": "outgoing-link",
|
|
110
|
+
"state": {
|
|
111
|
+
"linksCollapsed": false,
|
|
112
|
+
"unlinkedCollapsed": true
|
|
113
|
+
},
|
|
114
|
+
"icon": "links-going-out",
|
|
115
|
+
"title": "出链"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"id": "b5fbfde477b371c5",
|
|
120
|
+
"type": "leaf",
|
|
121
|
+
"state": {
|
|
122
|
+
"type": "tag",
|
|
123
|
+
"state": {
|
|
124
|
+
"sortOrder": "frequency",
|
|
125
|
+
"useHierarchy": true,
|
|
126
|
+
"showSearch": false,
|
|
127
|
+
"searchQuery": ""
|
|
128
|
+
},
|
|
129
|
+
"icon": "lucide-tags",
|
|
130
|
+
"title": "标签"
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"id": "aa8abe9ec34109de",
|
|
135
|
+
"type": "leaf",
|
|
136
|
+
"state": {
|
|
137
|
+
"type": "all-properties",
|
|
138
|
+
"state": {
|
|
139
|
+
"sortOrder": "frequency",
|
|
140
|
+
"showSearch": false,
|
|
141
|
+
"searchQuery": ""
|
|
142
|
+
},
|
|
143
|
+
"icon": "lucide-archive",
|
|
144
|
+
"title": "添加笔记属性"
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"id": "56811194b89ce70c",
|
|
149
|
+
"type": "leaf",
|
|
150
|
+
"state": {
|
|
151
|
+
"type": "outline",
|
|
152
|
+
"state": {
|
|
153
|
+
"followCursor": false,
|
|
154
|
+
"showSearch": false,
|
|
155
|
+
"searchQuery": ""
|
|
156
|
+
},
|
|
157
|
+
"icon": "lucide-list",
|
|
158
|
+
"title": "大纲"
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"id": "4006e4a73182572b",
|
|
163
|
+
"type": "leaf",
|
|
164
|
+
"state": {
|
|
165
|
+
"type": "agent-chat-view",
|
|
166
|
+
"state": {},
|
|
167
|
+
"icon": "brain-cog",
|
|
168
|
+
"title": "Chat with agent"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
]
|
|
172
|
+
}
|
|
173
|
+
],
|
|
174
|
+
"direction": "horizontal",
|
|
175
|
+
"width": 300,
|
|
176
|
+
"collapsed": true
|
|
177
|
+
},
|
|
178
|
+
"left-ribbon": {
|
|
179
|
+
"hiddenItems": {
|
|
180
|
+
"switcher:打开快速切换": false,
|
|
181
|
+
"graph:查看关系图谱": false,
|
|
182
|
+
"canvas:新建白板": false,
|
|
183
|
+
"daily-notes:打开/创建今天的日记": false,
|
|
184
|
+
"templates:插入模板": false,
|
|
185
|
+
"command-palette:打开命令面板": false,
|
|
186
|
+
"bases:新建数据库": false,
|
|
187
|
+
"ai-agent:Chat with Agent": false,
|
|
188
|
+
"templater-obsidian:Templater": false
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"active": "8c87c9abf3780c7b",
|
|
192
|
+
"lastOpenFiles": [
|
|
193
|
+
"Chats/chat-2026-01-21T06-10-48-766Z.md",
|
|
194
|
+
"Chats"
|
|
195
|
+
]
|
|
196
|
+
}
|
package/README.md
CHANGED
|
@@ -3,50 +3,21 @@
|
|
|
3
3
|
 | [](https://www.npmjs.com/package/momo-ai)
|
|
4
4
|
> For [Rachel Momo](https://www.weibo.com/maoxiaotong0216) / Serial Experiments Lain
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
### 1.1. 功能说明
|
|
9
|
-
|
|
10
|
-
当前工具会在操作系统中安装 `momo` 命令,使用它进行 `SDD - Spec Driven Development` 开发:
|
|
11
|
-
|
|
12
|
-
1. 参考:`OpenSpec / Spec-Kit / Kiro`
|
|
13
|
-
2. 工具支持:
|
|
14
|
-
- `Trea`(推荐使用,可支持多Agent模式)
|
|
15
|
-
- `Cursor`(稍贵,可支持多Agent模式)
|
|
16
|
-
- `Lingma`
|
|
17
|
-
- `Kiro`
|
|
18
|
-
3. 中文规范,命令运行之后将 `prompt` 提示词拷贝到剪切板,直接复制到工具中即可使用,提示词生成之后会存储在 `.working` 目录下。
|
|
19
|
-
4. 多个 Agent 协同,实现 Team 团队模式的 AI 开发,无模型限制(推荐使用同一个模型进行任务协同开发)
|
|
6
|
+

|
|
20
7
|
|
|
21
|
-
|
|
22
|
-
完整生命周期的整体开发流程,是 SDD 的一种落地手段——暴力、简单、易懂。由于辅助工具可选择模型,所以本工具不提供模型选择,模型本身取决于你所使用的工具本身,命令行只是一个辅助,核心开发模式为:
|
|
23
|
-
`AI 开发 + 人工审核`,本工具的核心是 `prompt` 的模板化。
|
|
8
|
+
## 引导
|
|
24
9
|
|
|
25
|
-
|
|
10
|
+
- 文档:<https://www.yuque.com/jiezizhu/r2mo>
|
|
11
|
+
- [>> 快速开始](https://www.yuque.com/jiezizhu/r2mo/xw91uhgzl0iztgtm)
|
|
12
|
+
- 示例:<https://gitee.com/zero-ws/zero-rachel-momo>
|
|
26
13
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
1. 使用 `momo init` 初始化协同工程项目(运行之前可使用 `momo env` 检查环境)。
|
|
30
|
-
2. 使用 `momo repo` 添加项目代码库以及工程实例(有多少个 `Agent` 工作就添加多少工程实例),添加完成后可使用 `momo open`
|
|
31
|
-
直接打开工程。
|
|
32
|
-
3. 更新 `project.md / project-model.md / requirement.md` 的细节文档(可用AI帮助拆分和书写)
|
|
33
|
-
4. 使用 `momo add -n 需求名称` 添加细节需求(可用AI帮助拆分和书写:`momo plan -n 需求名称`)
|
|
34
|
-
5. 使用 `momo tasks` 列出所有任务,并且使用 `momo run` 运行任务得到任务提示词
|
|
35
|
-
|
|
36
|
-
> 带 (CV) 📋️ 标记的命令——运行成功后可直接“Ctrl + V”粘贴到 TRAE / Lingma / Cursor / Kiro 中执行。
|
|
14
|
+
## 1. 介绍
|
|
37
15
|
|
|
38
|
-
### 1.
|
|
16
|
+
### 1.1. 功能说明
|
|
39
17
|
|
|
40
|
-
|
|
41
|
-
2. (唯一的人工处理)更新 `project.md` 中的所有信息,核心包括:
|
|
42
|
-
- 功能描述
|
|
43
|
-
- 场景描述等
|
|
44
|
-
- 风格
|
|
45
|
-
- 技术栈
|
|
46
|
-
3. 使用 `momo agentcfg` 给 TRAE 工具配置智能体,主要是导入部分已经定制好的智能体。
|
|
47
|
-
4. 使用 `momo agent -a "智能体名称"` 调用智能体进行开发之前的准备工作,目前支持的智能体可直接使用 `momo agentcfg` 查看。
|
|
18
|
+
当前工具会在操作系统中安装 `momo` 命令,使用它进行 `SDD - Spec Driven Development` 开发。
|
|
48
19
|
|
|
49
|
-
|
|
20
|
+
---
|
|
50
21
|
|
|
51
22
|
## 2. 工具使用
|
|
52
23
|
|
|
@@ -58,98 +29,14 @@ npm install -g momo-ai
|
|
|
58
29
|
momo help
|
|
59
30
|
```
|
|
60
31
|
|
|
61
|
-
### 2.3.
|
|
32
|
+
### 2.3. 命令
|
|
62
33
|
|
|
63
34
|
```bash
|
|
64
|
-
# ------------ 工程初始化 -----------------
|
|
65
|
-
# 🌷 环境检查、工程和代码初始化、工具启动等
|
|
66
35
|
momo env # 环境检查
|
|
67
36
|
|
|
68
37
|
momo init -d app-fly # 初始化 directory = app-fly 的项目
|
|
69
38
|
momo init # 初始化当前项目
|
|
70
|
-
|
|
71
|
-
momo repo -a https://xxx/repo.git # 克隆远程代码库 -> source/repo/develop-01(名称靠解析) -> git submodule
|
|
72
|
-
momo repo -a xxx -i 10 # 克隆远程代码库(10个副本)
|
|
73
|
-
|
|
74
|
-
momo pull # 从远程拉取最新代码 source/develop-xx
|
|
75
|
-
momo commit -m "提交信息" # 提交本地变更形成新的 commits
|
|
76
|
-
momo push # 推送本地 commits 到远程代码库
|
|
77
|
-
|
|
78
|
-
momo open # 交互式使用 TRAE / Lingma / Cursor / Kiro 打开当前项目
|
|
79
|
-
|
|
80
|
-
momo project -s "项目路径" # 将路径中的显示拷贝到当前项目的 reference 目录下,若不提供 -s 则直接列举所有支持的项目类型
|
|
81
|
-
|
|
82
|
-
momo agentcfg # 列出所有智能体,并且打开浏览器配置
|
|
83
|
-
momo agent -a "智能体名称" # 📋️ 调用智能体 -> prompt 得到提示词到剪切板
|
|
84
|
-
|
|
85
|
-
# ------------ 需求相关 -----------------
|
|
86
|
-
# 🌷 需求管理:添加、归档、校验、列出、显示
|
|
87
|
-
momo add -n "需求名称" # 📋️ 添加新需求 -> changes 下追加新内容 -> 包括任务
|
|
88
|
-
momo add -n "需求(MD)文档路径" # 📋️ 添加需求文档 -> changes 下追加新内容 -> 包括任务,如果带后缀直接用文件名做需求名称
|
|
89
|
-
|
|
90
|
-
momo archive -n "需求名称" # 需求归档 -> archive 下追加新内容,删除 changes 下内容
|
|
91
|
-
|
|
92
|
-
momo show -n "需求名称" # 显示需求 -> 显示 changes 下内容
|
|
93
|
-
|
|
94
|
-
momo validate -n "需求名称" # 需求校验 -> 校验 changes 下内容
|
|
95
|
-
|
|
96
|
-
momo list # 列出所有需求 -> changes 下内容
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
# 🌷 需求分析:计划、执行、拆分
|
|
100
|
-
momo plan -n "需求名称" # 📋️ 生成需求的整体开发计划 -> prompt 剪切板
|
|
101
|
-
|
|
102
|
-
# ------------ 任务执行 -----------------
|
|
103
|
-
# 🌷 任务执行:定义角色、执行任务
|
|
104
|
-
momo actors # 列出所有角色
|
|
105
|
-
|
|
106
|
-
momo actor -a "角色名称" # 添加新角色 -> 交互式命令,每个角色可以指定不同的大模型
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
momo tasks # 📋️ 显示任务 -> 需求 / 任务 / 状态 -> 状态 = 待办 / 进行中 / 已完成
|
|
110
|
-
|
|
111
|
-
momo run -a {actor} -t {task} # 📋️ 将任务分配给角色,检查执行目录看哪些任务正在执行
|
|
112
|
-
momo run # 📋️ 从菜单中选择任务
|
|
113
|
-
|
|
114
|
-
momo unlock # 解锁任务 -> 任务状态 = 待办
|
|
115
39
|
```
|
|
116
|
-
|
|
117
|
-
### 2.4. 控制台:定模型
|
|
118
|
-
|
|
119
|
-
> 控制台开发中(Lain 模式)
|
|
120
|
-
|
|
121
|
-
```bash
|
|
122
|
-
# 两个命令都可以启动控制台
|
|
123
|
-
momo console # 启动 Lain 控制台 -> 交互式命令
|
|
124
|
-
lain # 启动 Lain 控制台 -> 交互式命令
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
打开控制台
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
[Momo AI] ----------------- Rachel Momo / AI工具项 ------------------
|
|
131
|
-
[Momo AI] 应用名称: Rachel Momo / SDD
|
|
132
|
-
[Momo AI] 工具主页: https://gitee.com/silentbalanceyh/r2mo-lain
|
|
133
|
-
[Momo AI] 工具版本: 1.0.6 ( Node >= 22.x )
|
|
134
|
-
[Momo AI]
|
|
135
|
-
[Momo AI] ----------------- AI 系统启动…… ----------------------------
|
|
136
|
-
|
|
137
|
-
================================================================================================
|
|
138
|
-
Momo AI / Lain Console
|
|
139
|
-
================================================================================================
|
|
140
|
-
|
|
141
|
-
欢迎使用 Momo AI / Lain 控制台!
|
|
142
|
-
这是一个交互式命令行界面。
|
|
143
|
-
|
|
144
|
-
可用命令:
|
|
145
|
-
help - 显示帮助信息
|
|
146
|
-
llm - 查看大模型配置信息
|
|
147
|
-
quit - 退出控制台
|
|
148
|
-
|
|
149
|
-
请在提示符后输入命令。
|
|
150
|
-
------------------------------------------------------------------------------------------------
|
|
151
|
-
```
|
|
152
|
-
|
|
153
40
|
<hr/>
|
|
154
41
|
|
|
155
42
|
## 3. 参考链接
|
|
Binary file
|
package/install.sh
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
npm install -g .
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "momo-ai",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.21",
|
|
4
4
|
"description": "Rachel Momo ( OpenSpec )",
|
|
5
5
|
"main": "src/momo.js",
|
|
6
6
|
"bin": {
|
|
@@ -27,8 +27,10 @@
|
|
|
27
27
|
"url": "https://github.com/silentbalanceyh/r2mo-lain/issues"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
+
"@modelcontextprotocol/sdk": "^1.25.3",
|
|
30
31
|
"bluebird": "^3.7.2",
|
|
31
32
|
"child_process": "^1.0.2",
|
|
33
|
+
"chokidar": "^5.0.0",
|
|
32
34
|
"clipboard-copy": "^4.0.1",
|
|
33
35
|
"co": "^4.6.0",
|
|
34
36
|
"colors": "^1.4.0",
|
|
@@ -38,6 +40,7 @@
|
|
|
38
40
|
"ejs": "^3.1.10",
|
|
39
41
|
"exceljs": "^4.3.0",
|
|
40
42
|
"extend": "^3.0.2",
|
|
43
|
+
"front-matter": "^4.0.2",
|
|
41
44
|
"handlebars": "^4.7.7",
|
|
42
45
|
"i": "^0.3.7",
|
|
43
46
|
"immutable": "^4.3.0",
|
|
@@ -49,7 +52,8 @@
|
|
|
49
52
|
"superagent": "^8.0.9",
|
|
50
53
|
"taffydb": "^2.7.3",
|
|
51
54
|
"underscore": "^1.13.6",
|
|
52
|
-
"uuid": "^9.0.0"
|
|
55
|
+
"uuid": "^9.0.0",
|
|
56
|
+
"zod": "^4.3.5"
|
|
53
57
|
},
|
|
54
58
|
"homepage": "https://gitee.com/silentbalanceyh/r2mo-lain",
|
|
55
59
|
"github": "https://gitee.com/silentbalanceyh/r2mo-lain.git"
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: r2mo-rad-lain
|
|
3
|
+
description: R2MO RAD CLI Dev Skill (Lain Native)
|
|
4
|
+
version: 3.0.0
|
|
5
|
+
tags: [r2mo, rad, lain, nodejs, cli, momo]
|
|
6
|
+
repository: https://gitee.com/silentbalanceyh/r2mo-lain.git
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Role: R2MO RAD Expert (Lain Project)
|
|
10
|
+
|
|
11
|
+
## 🚨 Critical Rules
|
|
12
|
+
1. **Stack**: CommonJS (`require`). **NO** ESM.
|
|
13
|
+
2. **Core Libs**:
|
|
14
|
+
- Use `const Ec = require('../epic');` for logging/flow.
|
|
15
|
+
- Use `const Utils = require('../utils/momo-*');` for helpers.
|
|
16
|
+
3. **Interactive**: MUST use `require('../utils/momo-menu')`. **NO** raw readline.
|
|
17
|
+
4. **Style**: Use `Ec` for all logging.
|
|
18
|
+
|
|
19
|
+
## 📂 Architecture
|
|
20
|
+
- **Config**: `src/commander/{cmd}.json`
|
|
21
|
+
- **Executor**: `src/executor/execute{Cmd}.js`
|
|
22
|
+
- **Utils**: `src/utils/` (momo-fs, momo-menu, momo-args)
|
|
23
|
+
|
|
24
|
+
## 📝 Config Schema (JSON)
|
|
25
|
+
```json
|
|
26
|
+
{
|
|
27
|
+
"executor": "executeName", "command": "name", "description": "desc",
|
|
28
|
+
"options": [{ "name": "arg", "alias": "a", "type": "string" }]
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 💻 Executor Template(Native)
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
const Ec = require('../epic');
|
|
36
|
+
const Args = require('../utils/momo-args');
|
|
37
|
+
const FS = require('../utils/momo-fs');
|
|
38
|
+
const { selectSingle } = require('../utils/momo-menu');
|
|
39
|
+
|
|
40
|
+
module.exports = async (options) => {
|
|
41
|
+
try {
|
|
42
|
+
// 1. Parsing
|
|
43
|
+
const opts = Args.parseStandard(options);
|
|
44
|
+
const target = Args.parsePositional()[0];
|
|
45
|
+
|
|
46
|
+
// 2. Logic
|
|
47
|
+
Ec.waiting('Working...');
|
|
48
|
+
if (!FS.exists(target)) Ec.error('Path not found');
|
|
49
|
+
|
|
50
|
+
// 3. Menu Example
|
|
51
|
+
const item = await selectSingle([{name: 'Go'}], 'Title');
|
|
52
|
+
if(!item) process.exit(0);
|
|
53
|
+
|
|
54
|
+
// 4. Finish
|
|
55
|
+
Ec.info('✅ Done');
|
|
56
|
+
process.exit(0);
|
|
57
|
+
} catch (e) { Ec.error(e.message); process.exit(1); }
|
|
58
|
+
};
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## 📚 API Reference (Project Context)
|
|
62
|
+
|
|
63
|
+
### 1. File System ( `momo-fs.js` )
|
|
64
|
+
|
|
65
|
+
Combines file-utils and yaml-parser.
|
|
66
|
+
|
|
67
|
+
```js
|
|
68
|
+
const FS = require('../utils/momo-fs');
|
|
69
|
+
// Methods:
|
|
70
|
+
ensureDir(path), exists(path), readJson(path), writeJson(path, data)
|
|
71
|
+
copyDir(src, dest), scanDir(dir, filterFn?), createTempDir(prefix?)
|
|
72
|
+
cleanup(path), gitClone(url, dest)
|
|
73
|
+
parseFile(path) // YAML Frontmatter
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### 2. Interactive Menu ( `momo-menu.js` )
|
|
77
|
+
|
|
78
|
+
```js
|
|
79
|
+
const { selectMultiple, selectSingle, clearScreen } = require('../utils/momo-menu');
|
|
80
|
+
// selectMultiple returns { indices: [], items: [] }
|
|
81
|
+
// selectSingle returns Item | null
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 3. Argument Parser ( `momo-args.js` )
|
|
85
|
+
|
|
86
|
+
```js
|
|
87
|
+
const Args = require('../utils/momo-args');
|
|
88
|
+
// Methods:
|
|
89
|
+
parseStandard(options) // Standard KV
|
|
90
|
+
parseOptional(flag, alias)
|
|
91
|
+
parseBool(flag, alias)
|
|
92
|
+
parsePositional()
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### 4. Core (`../epic`)
|
|
96
|
+
|
|
97
|
+
`Ec.info/warn/error/waiting(msg)`
|
|
98
|
+
|
|
99
|
+
`await Ec.ask(query)` (Use only AFTER menu closes)
|
|
100
|
+
|
|
101
|
+
String colors: `.green, .blue, .bold`, etc.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import fs from "fs/promises";
|
|
6
|
+
import fsSync from "fs";
|
|
7
|
+
import path from "path";
|
|
8
|
+
import fm from "front-matter";
|
|
9
|
+
import os from "os";
|
|
10
|
+
|
|
11
|
+
const GLOBAL_SKILLS_DIR = process.env.MOMO_GLOBAL_SKILLS_DIR || path.join(os.homedir(), '.claude', 'skills');
|
|
12
|
+
const PROJECT_SKILLS_DIR = process.env.MOMO_PROJECT_SKILLS_DIR || path.join(process.cwd(), '.claude', 'skills');
|
|
13
|
+
|
|
14
|
+
const server = new McpServer({ name: "MomoSkills", version: "2.0.0" });
|
|
15
|
+
|
|
16
|
+
async function parseSkillFile(filePath) {
|
|
17
|
+
try {
|
|
18
|
+
const content = await fs.readFile(filePath, "utf8");
|
|
19
|
+
const parsed = fm(content);
|
|
20
|
+
return { attributes: parsed.attributes, body: parsed.body };
|
|
21
|
+
} catch (err) { return null; }
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
async function scanAndRegister(dir, source) {
|
|
25
|
+
if (!fsSync.existsSync(dir)) return;
|
|
26
|
+
try {
|
|
27
|
+
const items = await fs.readdir(dir);
|
|
28
|
+
for (const item of items) {
|
|
29
|
+
const skillDir = path.join(dir, item);
|
|
30
|
+
try {
|
|
31
|
+
if ((await fs.stat(skillDir)).isDirectory()) {
|
|
32
|
+
const skillFile = path.join(skillDir, 'SKILL.md');
|
|
33
|
+
if (fsSync.existsSync(skillFile)) {
|
|
34
|
+
await registerTool(item, skillFile, source);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
} catch(e){}
|
|
38
|
+
}
|
|
39
|
+
} catch(e) {}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async function registerTool(folderName, filePath, source) {
|
|
43
|
+
try {
|
|
44
|
+
const parsed = await parseSkillFile(filePath);
|
|
45
|
+
if(!parsed || !parsed.attributes) return;
|
|
46
|
+
const attr = parsed.attributes;
|
|
47
|
+
const toolName = attr.name || folderName;
|
|
48
|
+
|
|
49
|
+
const argsSchema = {};
|
|
50
|
+
if (Array.isArray(attr.arguments)) {
|
|
51
|
+
attr.arguments.forEach(arg => {
|
|
52
|
+
argsSchema[arg.name] = z.string().describe(arg.description || "");
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
server.tool(toolName, attr.description || "No desc", argsSchema, async (args) => {
|
|
57
|
+
let res = parsed.body;
|
|
58
|
+
for (const [k, v] of Object.entries(args)) res = res.replace(new RegExp(`{{\${k}}}`, 'g'), v);
|
|
59
|
+
return { content: [{ type: "text", text: res }] };
|
|
60
|
+
});
|
|
61
|
+
} catch(e) { console.error(e); }
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async function main() {
|
|
65
|
+
await scanAndRegister(PROJECT_SKILLS_DIR, 'project');
|
|
66
|
+
await scanAndRegister(GLOBAL_SKILLS_DIR, 'global');
|
|
67
|
+
const transport = new StdioServerTransport();
|
|
68
|
+
await server.connect(transport);
|
|
69
|
+
}
|
|
70
|
+
main().catch(err => { console.error(err); process.exit(1); });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"repositories": [
|
|
3
|
+
{
|
|
4
|
+
"name": "anthropics/skills",
|
|
5
|
+
"description": "Anthropic 官方技能仓库",
|
|
6
|
+
"url": "https://github.com/anthropics/skills.git",
|
|
7
|
+
"skillsPath": "skills"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"name": "silentbalanceyh/r2mo-lain",
|
|
11
|
+
"description": "R2MO 项目技能仓库 (Gitee)",
|
|
12
|
+
"url": "https://gitee.com/silentbalanceyh/r2mo-lain.git",
|
|
13
|
+
"skillsPath": "skills"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
|
+
}
|
package/src/commander/help.json
CHANGED