momo-ai 1.0.20 → 1.0.22
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/SKILL.md +101 -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/.trae/skills/algorithmic-art/LICENSE.txt +202 -0
- package/.trae/skills/algorithmic-art/SKILL.md +405 -0
- package/.trae/skills/algorithmic-art/templates/generator_template.js +223 -0
- package/.trae/skills/algorithmic-art/templates/viewer.html +599 -0
- package/.trae/skills/doc-coauthoring/SKILL.md +375 -0
- package/.trae/skills/frontend-design/LICENSE.txt +177 -0
- package/.trae/skills/frontend-design/SKILL.md +42 -0
- package/.trae/skills/r2mo-rad-lain/SKILL.md +101 -0
- package/README.md +12 -148
- package/docs/images/logo.jpeg +0 -0
- package/docs/images/r2mo-lain.png +0 -0
- package/install.sh +1 -0
- package/package.json +15 -11
- package/skills/r2mo-rad-domain/SKILL.md +70 -0
- package/skills/r2mo-rad-lain/SKILL.md +101 -0
- package/src/_mcp/skills-server.mjs +70 -0
- package/src/_skill/repositories.json +22 -0
- package/src/_template/LAIN/.obsidian/app.json +1 -0
- package/src/_template/LAIN/.obsidian/appearance.json +10 -0
- package/src/_template/LAIN/.obsidian/community-plugins.json +7 -0
- package/src/_template/LAIN/.obsidian/core-plugins.json +33 -0
- package/src/_template/LAIN/.obsidian/plugins/dataview/main.js +20876 -0
- package/src/_template/LAIN/.obsidian/plugins/dataview/manifest.json +11 -0
- package/src/_template/LAIN/.obsidian/plugins/dataview/styles.css +141 -0
- package/src/_template/LAIN/.obsidian/plugins/obsidian-excalidraw-plugin/data.json +815 -0
- package/src/_template/LAIN/.obsidian/plugins/obsidian-excalidraw-plugin/main.js +10 -0
- package/src/_template/LAIN/.obsidian/plugins/obsidian-excalidraw-plugin/manifest.json +12 -0
- package/src/_template/LAIN/.obsidian/plugins/obsidian-excalidraw-plugin/styles.css +1 -0
- package/src/_template/LAIN/.obsidian/plugins/obsidian-kanban/main.js +153 -0
- package/src/_template/LAIN/.obsidian/plugins/obsidian-kanban/manifest.json +11 -0
- package/src/_template/LAIN/.obsidian/plugins/obsidian-kanban/styles.css +1 -0
- package/src/_template/LAIN/.obsidian/plugins/obsidian-plantuml/main.js +7732 -0
- package/src/_template/LAIN/.obsidian/plugins/obsidian-plantuml/manifest.json +10 -0
- package/src/_template/LAIN/.obsidian/plugins/obsidian-plantuml/styles.css +38 -0
- package/src/_template/LAIN/.obsidian/plugins/obsidian-tasks-plugin/main.js +504 -0
- package/src/_template/LAIN/.obsidian/plugins/obsidian-tasks-plugin/manifest.json +12 -0
- package/src/_template/LAIN/.obsidian/plugins/obsidian-tasks-plugin/styles.css +1 -0
- package/src/_template/LAIN/.obsidian/snippets/body-font.css +27 -0
- package/src/_template/LAIN/.obsidian/themes/Primary/manifest.json +9 -0
- package/src/_template/LAIN/.obsidian/themes/Primary/theme.css +3878 -0
- package/src/_template/LAIN/.obsidian/themes/Retro Windows/manifest.json +7 -0
- package/src/_template/LAIN/.obsidian/themes/Retro Windows/theme.css +582 -0
- package/src/_template/LAIN/.obsidian/themes/RetroOS 98/manifest.json +9 -0
- package/src/_template/LAIN/.obsidian/themes/RetroOS 98/theme.css +2566 -0
- package/src/_template/LAIN/.obsidian/types.json +28 -0
- package/src/_template/LAIN/.obsidian/workspace.json +184 -0
- package/src/_template/LAIN/AGENTS.md +170 -16
- package/src/_template/R2MO/domain-enhance.md +10 -0
- package/src/commander/app.json +13 -0
- package/src/commander/apply.json +13 -0
- package/src/commander/ask.json +6 -0
- package/src/commander/docs.json +13 -0
- package/src/commander/domain.json +19 -0
- package/src/commander/help.json +5 -0
- package/src/commander/init.json +1 -1
- package/src/commander/mcp.json +13 -0
- package/src/commander/mmr0.json +6 -0
- package/src/commander/mmr2.json +6 -0
- package/src/commander/open.json +8 -2
- package/src/executor/executeApp.js +133 -0
- package/src/executor/executeApply.js +611 -0
- package/src/executor/executeAsk.js +274 -0
- package/src/executor/executeDocs.js +498 -0
- package/src/executor/executeDomain.js +293 -0
- package/src/executor/executeEnv.js +48 -38
- package/src/executor/executeHelp.js +77 -16
- package/src/executor/executeInit.js +176 -346
- package/src/executor/executeMcp.js +363 -0
- package/src/executor/executeMmr0.js +488 -0
- package/src/executor/executeMmr2.js +880 -0
- package/src/executor/executeOpen.js +144 -125
- package/src/executor/index.js +17 -39
- package/src/momo.js +2 -1
- package/src/python/r2mo_proto.py +418 -0
- package/src/python/r2mo_proto_database.py +369 -0
- package/src/python/r2mo_proto_domain.py +458 -0
- package/src/utils/momo-args.js +39 -0
- package/src/utils/momo-file-utils.js +75 -0
- package/src/utils/momo-menu.js +84 -0
- package/src/_template/LAIN/.momo/advanced/actor.md +0 -42
- package/src/_template/LAIN/.momo/advanced/refer.json +0 -46
- package/src/_template/LAIN/.momo/scripts/submodule-clean.sh +0 -56
- package/src/_template/LAIN/changes/proposal.md +0 -39
- package/src/_template/LAIN/changes/tasks/task-detail.md +0 -45
- package/src/_template/LAIN/changes/tasks.md +0 -49
- package/src/_template/LAIN/execute/admin-n-f-dashboard.md +0 -53
- package/src/_template/LAIN/execute/admin-n-f-form.md +0 -51
- package/src/_template/LAIN/execute/admin-n-f-home.md +0 -49
- package/src/_template/LAIN/execute/admin-n-f-list.md +0 -52
- package/src/_template/LAIN/execute/admin-n-f-login.md +0 -56
- package/src/_template/LAIN/specification/project-model.md +0 -13
- package/src/_template/LAIN/specification/project.md +0 -73
- package/src/_template/LAIN/specification/requirement.md +0 -25
- 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 -299
- package/src/executor/executeAgentCfg.js +0 -210
- 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 -313
- 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,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.
|
package/README.md
CHANGED
|
@@ -3,167 +3,31 @@
|
|
|
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` 开发:
|
|
6
|
+

|
|
11
7
|
|
|
12
|
-
|
|
13
|
-
2. 工具支持:
|
|
14
|
-
- `Trea`(推荐使用,可支持多Agent模式)
|
|
15
|
-
- `Cursor`(稍贵,可支持多Agent模式)
|
|
16
|
-
- `Lingma`
|
|
17
|
-
- `Kiro`
|
|
18
|
-
3. 中文规范,命令运行之后将 `prompt` 提示词拷贝到剪切板,直接复制到工具中即可使用,提示词生成之后会存储在 `.working` 目录下。
|
|
19
|
-
4. 多个 Agent 协同,实现 Team 团队模式的 AI 开发,无模型限制(推荐使用同一个模型进行任务协同开发)
|
|
8
|
+
## 0. 引导
|
|
20
9
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
- 教程:<https://www.yuque.com/jiezizhu/r2mo>
|
|
11
|
+
- [>> 快速开始](https://www.yuque.com/jiezizhu/r2mo/ssl9rl5klogu7cp0)
|
|
12
|
+
- 教程地图:<https://kumu.io/LangYu1017/zero>
|
|
13
|
+
- 示例:<https://gitee.com/zero-ws/zero-rachel-momo>
|
|
24
14
|
|
|
25
|
-
|
|
15
|
+

|
|
26
16
|
|
|
27
|
-
|
|
17
|
+
---
|
|
28
18
|
|
|
29
|
-
1.
|
|
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 中执行。
|
|
37
|
-
|
|
38
|
-
### 1.3. 项目计划
|
|
19
|
+
## 1. 介绍
|
|
39
20
|
|
|
40
|
-
|
|
41
|
-
2. (唯一的人工处理)更新 `project.md` 中的所有信息,核心包括:
|
|
42
|
-
- 功能描述
|
|
43
|
-
- 场景描述等
|
|
44
|
-
- 风格
|
|
45
|
-
- 技术栈
|
|
46
|
-
3. 使用 `momo agentcfg` 给 TRAE 工具配置智能体,主要是导入部分已经定制好的智能体。
|
|
47
|
-
4. 使用 `momo agent -a "智能体名称"` 调用智能体进行开发之前的准备工作,目前支持的智能体可直接使用 `momo agentcfg` 查看。
|
|
21
|
+
当前工具会在操作系统中安装 `momo` 命令,使用它进行 `SDD - Spec Driven Development` 开发。
|
|
48
22
|
|
|
49
|
-
|
|
23
|
+
---
|
|
50
24
|
|
|
51
25
|
## 2. 工具使用
|
|
52
26
|
|
|
53
|
-
### 2.1. 安装
|
|
54
|
-
|
|
55
27
|
```bash
|
|
56
28
|
npm install -g momo-ai
|
|
57
29
|
# 查看帮助
|
|
58
30
|
momo help
|
|
59
31
|
```
|
|
60
32
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
# ------------ 工程初始化 -----------------
|
|
65
|
-
# 🌷 环境检查、工程和代码初始化、工具启动等
|
|
66
|
-
momo env # 环境检查
|
|
67
|
-
|
|
68
|
-
momo init -d app-fly # 初始化 directory = app-fly 的项目
|
|
69
|
-
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
|
-
```
|
|
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
|
-
<hr/>
|
|
154
|
-
|
|
155
|
-
## 3. 参考链接
|
|
156
|
-
|
|
157
|
-
### 3.1. 旧版
|
|
158
|
-
|
|
159
|
-
- (后端)Zero Ecotope:<https://www.zerows.io>
|
|
160
|
-
- (前端)Zero UI:<https://www.vertxui.cn>
|
|
161
|
-
- (工具)Zero AI:<https://www.vertxai.cn>
|
|
162
|
-
- (标准)Zero Schema:<https://www.vertx-cloud.cn>
|
|
163
|
-
|
|
164
|
-
### 3.2. 新增
|
|
165
|
-
|
|
166
|
-
- Maven 统一版本管理:<https://gitee.com/silentbalanceyh/rachel-momo>
|
|
167
|
-
- Rapid快速开发框架:<https://gitee.com/silentbalanceyh/r2mo-rapid>
|
|
168
|
-
- Zero Epoch:<https://www.zerows.io>
|
|
169
|
-
- Zero Demo:<https://gitee.com/zero-ws/zero-rachel-momo>
|
|
33
|
+
<hr/>
|
|
Binary file
|
|
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.22",
|
|
4
4
|
"description": "Rachel Momo ( OpenSpec )",
|
|
5
5
|
"main": "src/momo.js",
|
|
6
6
|
"bin": {
|
|
@@ -27,29 +27,33 @@
|
|
|
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",
|
|
35
|
-
"commander": "^
|
|
36
|
-
"crypto-js": "^4.
|
|
37
|
+
"commander": "^14.0.2",
|
|
38
|
+
"crypto-js": "^4.2.0",
|
|
37
39
|
"dox": "^1.0.0",
|
|
38
|
-
"ejs": "^
|
|
39
|
-
"exceljs": "^4.
|
|
40
|
+
"ejs": "^4.0.1",
|
|
41
|
+
"exceljs": "^4.4.0",
|
|
40
42
|
"extend": "^3.0.2",
|
|
41
|
-
"
|
|
43
|
+
"front-matter": "^4.0.2",
|
|
44
|
+
"handlebars": "^4.7.8",
|
|
42
45
|
"i": "^0.3.7",
|
|
43
|
-
"immutable": "^
|
|
46
|
+
"immutable": "^5.1.4",
|
|
44
47
|
"linebyline": "^1.3.0",
|
|
45
|
-
"lodash": "^4.17.
|
|
48
|
+
"lodash": "^4.17.23",
|
|
46
49
|
"mkdirp": "^3.0.1",
|
|
47
50
|
"mockjs": "^1.1.0",
|
|
48
51
|
"random-js": "^2.1.0",
|
|
49
|
-
"superagent": "^
|
|
52
|
+
"superagent": "^10.3.0",
|
|
50
53
|
"taffydb": "^2.7.3",
|
|
51
|
-
"underscore": "^1.13.
|
|
52
|
-
"uuid": "^
|
|
54
|
+
"underscore": "^1.13.7",
|
|
55
|
+
"uuid": "^13.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,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: r2mo-rad-domain
|
|
3
|
+
description: R2MO Domain Intelligence Enhancer (AI Protocol)
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
tags: [r2mo, rad, lain, protocol, natural-language]
|
|
6
|
+
repository: https://gitee.com/silentbalanceyh/r2mo-lain.git
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Role: R2MO Domain Expert
|
|
10
|
+
|
|
11
|
+
## 🚨 Critical Rules
|
|
12
|
+
1. **Execution Mode**: You act as a direct processor. Do not generate script code. **Perform the analysis and file modifications directly.**
|
|
13
|
+
2. **Path Resolution Logic**:
|
|
14
|
+
- **Identify**: Read `pom.xml` in the current root -> Extract `<artifactId>` -> Set as **{PROJECT_ID}**.
|
|
15
|
+
- **Locate**: Enter directory `./{PROJECT_ID}-ui/.r2mo/domain/`.
|
|
16
|
+
3. **Enhancement Logic**:
|
|
17
|
+
- **Read**: Scan all `.proto` files in the target directory.
|
|
18
|
+
- **Translate**: Identify the main model name, translate its business meaning into Chinese, and append it as a comment.
|
|
19
|
+
- **Infer**: Apply "Expert Experience" rules to field names.
|
|
20
|
+
- **Rewrite**: Append semantic constraints as comments to the file content in-place.
|
|
21
|
+
4. **Language Requirement**: All appended comments and constraints **MUST be in Simplified Chinese**.
|
|
22
|
+
|
|
23
|
+
## 📂 Architecture
|
|
24
|
+
- **Input**: Project `pom.xml` and Protobuf definitions.
|
|
25
|
+
- **Logic**: Semantic Inference Engine (Expert Knowledge Base).
|
|
26
|
+
- **Output**: Enhanced `.proto` files with Chinese business constraints.
|
|
27
|
+
|
|
28
|
+
## 💻 Executor Template(Native)
|
|
29
|
+
|
|
30
|
+
**[INSTRUCTION SET FOR AI AGENT]**
|
|
31
|
+
|
|
32
|
+
### STEP 1: CONTEXTUALIZATION
|
|
33
|
+
1. **Find Project ID**:
|
|
34
|
+
- Scan the current directory for `pom.xml`.
|
|
35
|
+
- Extract the text content of the `<artifactId>` tag.
|
|
36
|
+
- *Example*: If `<artifactId>shop</artifactId>`, then ID is `shop`.
|
|
37
|
+
2. **Target Directory**:
|
|
38
|
+
- Construct path: `{ID}-ui/.r2mo/domain/`.
|
|
39
|
+
- If directory exists, proceed. If not, stop and report error.
|
|
40
|
+
|
|
41
|
+
### STEP 2: SEMANTIC ANALYSIS (The Expert Rules)
|
|
42
|
+
|
|
43
|
+
**Part A: Model Name Translation**
|
|
44
|
+
Identify the main `message` name in each file. Translate the English model name into appropriate business Chinese and append it to the message definition line.
|
|
45
|
+
* *Example*: `message MerchantAccount {` -> `message MerchantAccount { // [模型: 商户账户]`
|
|
46
|
+
* *Example*: `message OrderItem {` -> `message OrderItem { // [模型: 订单明细]`
|
|
47
|
+
|
|
48
|
+
**Part B: Field Constraint Inference**
|
|
49
|
+
Read every field definition. Analyze the **Field Name**. If it matches a pattern below, append the specific **Chinese Comment**:
|
|
50
|
+
|
|
51
|
+
| Field Name Pattern | Constraint Comment to Append (Chinese) |
|
|
52
|
+
| :--- | :--- |
|
|
53
|
+
| `email` | `// [格式: 邮箱]` |
|
|
54
|
+
| `phone`, `mobile` | `// [格式: 手机号]` |
|
|
55
|
+
| `password`, `secret` | `// [安全: 加密存储]` |
|
|
56
|
+
| `price`, `amount`, `cost` | `// [精度: 2位小数]` |
|
|
57
|
+
| `rate`, `ratio` | `// [精度: 4位小数]` |
|
|
58
|
+
| `status`, `type`, `state` | `// [枚举/常量]` (Check for Enum definitions) |
|
|
59
|
+
| `created_at`, `_time` | `// [格式: ISO8601]` |
|
|
60
|
+
| `is_...`, `active`, `enable` | `// [布尔: 0/1]` |
|
|
61
|
+
| `_id`, `_key` | `// [必填, 雪花/UUID]` |
|
|
62
|
+
| `name`, `title` | `// [长度: 64]` |
|
|
63
|
+
| `desc`, `content`, `remark` | `// [长度: 500/大字段]` |
|
|
64
|
+
| *(Repeated Field)* | `// [关系: 0..n]` |
|
|
65
|
+
|
|
66
|
+
### STEP 3: EXECUTION (Rewrite)
|
|
67
|
+
1. **Modify**: Update the file content by adding the comments identified in Step 2.
|
|
68
|
+
- *Constraint*: Do **NOT** change the `syntax`, `package`, `option`, field types, or field names. Only add comments at the end of lines.
|
|
69
|
+
2. **Save**: Overwrite the files with the enhanced content.
|
|
70
|
+
3. **Report**: List the files that were successfully enhanced.
|
|
@@ -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,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"repositories": [
|
|
3
|
+
{
|
|
4
|
+
"name": "anthropics",
|
|
5
|
+
"description": "Anthropic 官方技能仓库",
|
|
6
|
+
"url": "https://github.com/anthropics/skills.git",
|
|
7
|
+
"skillsPath": "skills"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"name": "r2mo",
|
|
11
|
+
"description": "R2MO 项目技能仓库",
|
|
12
|
+
"url": "https://gitee.com/silentbalanceyh/r2mo-lain.git",
|
|
13
|
+
"skillsPath": "skills"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name":"superpowers",
|
|
17
|
+
"description": "Superpowers AI 官方技能仓库",
|
|
18
|
+
"url": "https://github.com/obra/superpowers.git",
|
|
19
|
+
"skillsPath": "skills"
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"file-explorer": true,
|
|
3
|
+
"global-search": true,
|
|
4
|
+
"switcher": true,
|
|
5
|
+
"graph": true,
|
|
6
|
+
"backlink": true,
|
|
7
|
+
"canvas": true,
|
|
8
|
+
"outgoing-link": true,
|
|
9
|
+
"tag-pane": true,
|
|
10
|
+
"footnotes": false,
|
|
11
|
+
"properties": true,
|
|
12
|
+
"page-preview": true,
|
|
13
|
+
"daily-notes": true,
|
|
14
|
+
"templates": true,
|
|
15
|
+
"note-composer": true,
|
|
16
|
+
"command-palette": true,
|
|
17
|
+
"slash-command": false,
|
|
18
|
+
"editor-status": true,
|
|
19
|
+
"bookmarks": true,
|
|
20
|
+
"markdown-importer": true,
|
|
21
|
+
"zk-prefixer": false,
|
|
22
|
+
"random-note": false,
|
|
23
|
+
"outline": true,
|
|
24
|
+
"word-count": true,
|
|
25
|
+
"slides": true,
|
|
26
|
+
"audio-recorder": false,
|
|
27
|
+
"workspaces": true,
|
|
28
|
+
"file-recovery": true,
|
|
29
|
+
"publish": true,
|
|
30
|
+
"sync": true,
|
|
31
|
+
"bases": true,
|
|
32
|
+
"webviewer": true
|
|
33
|
+
}
|