moluoxixi-ai-rules 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/LICENSE +21 -0
  2. package/README-zh.md +246 -0
  3. package/README.md +246 -0
  4. package/dist/constants/hosts.d.ts +34 -0
  5. package/dist/constants/hosts.js +71 -0
  6. package/dist/constants/skills.d.ts +91 -0
  7. package/dist/constants/skills.js +156 -0
  8. package/dist/scripts/cli.d.ts +2 -0
  9. package/dist/scripts/cli.js +145 -0
  10. package/dist/scripts/host-setup.d.ts +2 -0
  11. package/dist/scripts/host-setup.js +147 -0
  12. package/dist/scripts/lib/install.d.ts +78 -0
  13. package/dist/scripts/lib/install.js +367 -0
  14. package/dist/scripts/lib/links.d.ts +8 -0
  15. package/dist/scripts/lib/links.js +18 -0
  16. package/dist/scripts/lib/skill-projection.d.ts +14 -0
  17. package/dist/scripts/lib/skill-projection.js +54 -0
  18. package/dist/scripts/lib/tool.d.ts +40 -0
  19. package/dist/scripts/lib/tool.js +125 -0
  20. package/dist/scripts/lib/vendor-sync.d.ts +3 -0
  21. package/dist/scripts/lib/vendor-sync.js +129 -0
  22. package/dist/scripts/lib/vendors.d.ts +29 -0
  23. package/dist/scripts/lib/vendors.js +155 -0
  24. package/dist/scripts/lib/verify.d.ts +7 -0
  25. package/dist/scripts/lib/verify.js +84 -0
  26. package/dist/scripts/sync-vendors.d.ts +1 -0
  27. package/dist/scripts/sync-vendors.js +173 -0
  28. package/dist/scripts/verify-host.d.ts +2 -0
  29. package/dist/scripts/verify-host.js +42 -0
  30. package/package.json +60 -0
  31. package/rules/AGENTS.md +30 -0
  32. package/skills/skill-validation-standard/SKILL.md +45 -0
  33. package/skills/skill-validation-standard/__test__/verify-rules.test.ts +108 -0
  34. package/skills/skill-validation-standard/scripts/verify-rules.mjs +186 -0
  35. package/skills/workflow/frontend-code-standard/SKILL.md +58 -0
  36. package/skills/workflow/frontend-code-standard/__test__/verify-rules.test.ts +227 -0
  37. package/skills/workflow/frontend-code-standard/scripts/verify-rules.mjs +537 -0
  38. package/skills/workflow/java-code-standard/SKILL.md +58 -0
  39. package/skills/workflow/java-code-standard/__test__/verify-rules.test.ts +48 -0
  40. package/skills/workflow/java-code-standard/scripts/verify-rules.mjs +215 -0
  41. package/skills/workflow/nestjs-code-standard/SKILL.md +61 -0
  42. package/skills/workflow/nestjs-code-standard/__test__/verify-rules.test.ts +48 -0
  43. package/skills/workflow/nestjs-code-standard/scripts/verify-rules.mjs +219 -0
  44. package/skills/workflow/node-code-standard/SKILL.md +62 -0
  45. package/skills/workflow/node-code-standard/__test__/verify-rules.test.ts +48 -0
  46. package/skills/workflow/node-code-standard/scripts/verify-rules.mjs +213 -0
  47. package/skills/workflow/project-knowledge-read-workflow/SKILL.md +102 -0
  48. package/skills/workflow/project-knowledge-refresh-workflow/SKILL.md +149 -0
  49. package/skills/workflow/software-development-workflow/SKILL.md +85 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Moluoxixi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README-zh.md ADDED
@@ -0,0 +1,246 @@
1
+ # Moluoxixi AIRules
2
+
3
+ > 🧩 用"乐高积木"的方式,拼装你自己的 AI 编程最佳实践。
4
+
5
+ **[English](README.md)** | **中文**
6
+
7
+ ## 这是什么?
8
+
9
+ AIRules 是一个**可组合的 AI 技能分发系统**。它的核心思想很简单:
10
+
11
+ - **克隆**业界成熟的 AI Skills(来自 antfu、Anthropic、Google Gemini、Vercel 等)
12
+ - **编写**你自己的领域专属 Skills
13
+ - **组合**这些小单元模块,形成你个人的开发生态最佳实践
14
+ - **一键分发**到所有 AI 代理(Claude、Cursor、Codex、Gemini 等)
15
+
16
+ ## 核心理念
17
+
18
+ ### 🏗️ 三层架构
19
+
20
+ ```
21
+ ┌─────────────────────────────────────────────┐
22
+ │ 🔧 第一方 Skills(你自己写的) │ ← 你的核心竞争力
23
+ │ software-development-workflow / 标准集合 │
24
+ ├─────────────────────────────────────────────┤
25
+ │ 📦 第三方 Skills(克隆成熟仓库) │ ← 站在巨人肩膀上
26
+ │ antfu/vue · anthropic/design · gemini/... │
27
+ ├─────────────────────────────────────────────┤
28
+ │ 🚀 分发引擎(一键安装到所有 AI 代理) │ ← 自动化基础设施
29
+ │ Claude · Cursor · Codex · Gemini · ... │
30
+ └─────────────────────────────────────────────┘
31
+ ```
32
+
33
+ ### 📐 设计原则
34
+
35
+ | 原则 | 说明 |
36
+ |------|------|
37
+ | **小单元模块化** | 每个 skill 只做一件事,独立、可测试、可替换 |
38
+ | **组合 > 大而全** | 像 Unix 管道一样,通过组合小工具解决大问题 |
39
+ | **第三方优先** | 能用成熟的就不自己写,自己只写真正有独特价值的部分 |
40
+ | **自愈式分发** | 一条命令同步到所有 AI 代理,自动处理软链接、依赖、验证 |
41
+
42
+ ## 你能得到什么?
43
+
44
+ - 🔥 **开箱即得** 25+ 精选前端/后端/通用 AI Skills
45
+ - 🧱 **预留第一方扩展位**:保留顶层自定义 skills 投影入口,后续补充时无需调整整体分发模型
46
+ - 🌐 **多代理同步**:一次配置,Claude / Cursor / Codex / Qoder / Tare / OpenCode / CC-Switch 全部生效
47
+ - 🔄 **持续更新**:上游 skills 更新后,一条命令同步最新版本
48
+
49
+ ## 安装
50
+
51
+ **作为 Node CLI 使用(本地开发 / npm link):**
52
+
53
+ ```bash
54
+ npm install
55
+ npm run build
56
+ npm link
57
+ airules sync --host all
58
+ ```
59
+
60
+ 添加本地 skill 并同步到所有宿主:
61
+
62
+ ```bash
63
+ airules add ./my-skill --host all
64
+ ```
65
+
66
+ `add` 命令要求源目录包含 `SKILL.md`,并会复制到 `~/.moluoxixi/skills/<skill-name>`,再通过同一套 vendor/host 投影链路同步。
67
+
68
+ **macOS / Linux / Git Bash:**
69
+
70
+ ```bash
71
+ git clone https://github.com/moluoxixi/AIRules.git "$HOME/.moluoxixi"
72
+ cd "$HOME/.moluoxixi"
73
+ npm run sync
74
+ ```
75
+
76
+ **Windows CMD:**
77
+
78
+ ```cmd
79
+ git clone https://github.com/moluoxixi/AIRules.git "%USERPROFILE%\.moluoxixi"
80
+ cd "%USERPROFILE%\.moluoxixi"
81
+ npm run sync
82
+ ```
83
+
84
+ **Windows PowerShell:**
85
+
86
+ ```powershell
87
+ git clone https://github.com/moluoxixi/AIRules.git "$env:USERPROFILE\.moluoxixi"
88
+ cd "$env:USERPROFILE\.moluoxixi"
89
+ npm run sync
90
+ ```
91
+
92
+ > [!TIP]
93
+ > **同步流程**:该命令会重建 vendor skills、清理死链接,并在完成后自动运行宿主验证。需要避免拉取第三方供应商时,可使用 `airules sync --skip-vendors`。
94
+
95
+ ---
96
+
97
+ ## 发布
98
+
99
+ 发布由 `.github/workflows/publish.yml` 负责。
100
+
101
+ 1. 创建具备发布权限的 npm automation token,并保存为 GitHub Actions 仓库 secret:`NPM_TOKEN`。
102
+ 2. 将 `package.json` 升到准备发布的版本,然后推送匹配的 Git tag,例如 `v0.1.0`。
103
+ 3. 推送 tag 会自动发布;也可以在 Actions 页面手动运行 `Publish package` workflow 并填写已有 tag。
104
+ 4. workflow 会安装依赖、校验 tag 与 `package.json` 版本一致、执行 lint/typecheck/tests,然后通过 `npm publish --provenance --access public` 发布到 npm。
105
+
106
+ 当前 workflow 使用 `npm install`,因为本仓库有意不跟踪 lockfile。
107
+
108
+ ---
109
+
110
+ ## 特定宿主安装
111
+
112
+ **macOS / Linux / Git Bash:**
113
+
114
+ ```bash
115
+ git clone https://github.com/moluoxixi/AIRules.git "$HOME/.moluoxixi"
116
+ cd "$HOME/.moluoxixi"
117
+ npm run rules:install -- --host 宿主名(例如 claude)
118
+ ```
119
+
120
+ **Windows CMD:**
121
+
122
+ ```cmd
123
+ git clone https://github.com/moluoxixi/AIRules.git "%USERPROFILE%\.moluoxixi"
124
+ cd "%USERPROFILE%\.moluoxixi"
125
+ npm run rules:install -- --host 宿主名(例如 claude)
126
+ ```
127
+
128
+ **Windows PowerShell:**
129
+
130
+ ```powershell
131
+ git clone https://github.com/moluoxixi/AIRules.git "$env:USERPROFILE\.moluoxixi"
132
+ cd "$env:USERPROFILE\.moluoxixi"
133
+ npm run rules:install -- --host 宿主名(例如 claude)
134
+ ```
135
+
136
+ > [!TIP]
137
+ > 仓库内也可以继续使用 `npm run rules:install -- --host claude`,该脚本现在等价转发到 `airules sync`。
138
+
139
+ ---
140
+
141
+ ## CLI 命令
142
+
143
+ | 命令 | 作用 |
144
+ |------|------|
145
+ | `airules sync --host all` | 同步内置、用户自定义和第三方 skills 到所有已存在宿主 |
146
+ | `airules add ./my-skill --host all` | 添加本地 skill,并同步到所有宿主 |
147
+ | `airules add ./my-skill --name review-plus --overwrite` | 指定安装名并覆盖已有用户 skill |
148
+ | `airules verify --host codex` | 校验指定宿主的 skills 链接完整性 |
149
+
150
+ 常用选项:
151
+
152
+ | 选项 | 说明 |
153
+ |------|------|
154
+ | `--home <dir>` | 指定 AIRules 安装目录,默认 `~/.moluoxixi` |
155
+ | `--user-home <dir>` | 指定宿主配置所在的用户目录,默认当前系统用户目录 |
156
+ | `--host <name\|all>` | 指定宿主,默认 `all` |
157
+ | `--skip-vendors` | `sync` 时不刷新第三方 vendor 仓库 |
158
+ | `--skip-sync` | `add` 后只写入用户 skill,不立即同步宿主 |
159
+ | `--no-verify` | 跳过宿主验证 |
160
+
161
+ ---
162
+
163
+ ### 宿主支持矩阵
164
+
165
+ Moluoxixi AIRules 通过自动化投影,支持不断增长的 AI 代理生态系统:
166
+
167
+ | 代理 | `--host` 参数 | 宿主路径 | 投影方式 | 引导文件 |
168
+ |-------|---------------|----------|----------|----------|
169
+ | **Claude Code** | `claude` | `~/.claude/` | 软链接 | `CLAUDE.md` |
170
+ | **Codex** | `codex` | `~/.codex/` | 软链接 | `AGENTS.md` |
171
+ | **Cursor** | `cursor` | `~/.cursor/` | 软链接 | `AGENTS.md` |
172
+ | **Tare** | `tare` | `~/.tare/` | 软链接 | `AGENTS.md` |
173
+ | **OpenCode** | `opencode` | `~/.config/opencode/` | 软链接 | `AGENTS.md` |
174
+ | **CC-Switch** | `cc-switch` | `~/.cc-switch/` | 软链接 | `AGENTS.md` |
175
+
176
+ > [!NOTE]
177
+ > 所有技能在安装过程中都会自动投影到代理专属的 skills 目录中。
178
+
179
+ ---
180
+
181
+ ## Skills 全景图
182
+
183
+ ### 第一方 Skills(自写)
184
+
185
+ | 名称 | 描述 |
186
+ |------|------|
187
+ | **software-development-workflow** | 通用软件开发标准流程:需求、拆分、设计、实现、验证、复核与交付报告 |
188
+ | **frontend-code-standard** | Vue 3 与 React TypeScript/JavaScript 前端编码标准:统一组件、模块、工具库和 UI 组件库规则,覆盖评审输出、边界、导出、import 路径、类型契约与交付检查 |
189
+ | **node-code-standard** | Node.js 后端实现标准:适用于 TypeScript/JavaScript 服务,覆盖显式契约、运行时校验、依赖注入、事务边界、持久化封装与交付检查 |
190
+ | **nestjs-code-standard** | NestJS 后端实现与评审标准:面向新写、重构和代码评审,覆盖 DTO 契约、ValidationPipe、构造函数注入、事务边界、持久化封装和基于证据的评审输出 |
191
+ | **java-code-standard** | Java 与 Spring Boot 后端编码标准:适用于 Java 17+ 基线、Java 21/25 LTS、Maven 和 Gradle,覆盖领域包、构造函数注入、Bean Validation、事务边界、迁移与错误映射 |
192
+ | **skill-validation-standard** | 最小 Skill 产物校验标准:校验生成或修改后的 Claude/Codex skill 的 SKILL.md YAML frontmatter、文件夹命名一致性和行数限制 |
193
+
194
+ > workflow 标准可以继续放在 `skills/workflow` 等嵌套源目录下,但安装时会展平为 `vendor/skills/<skill-name>`;仓库级规则位于 `rules/AGENTS.md`。
195
+
196
+ ### 第三方 Skills(精选)
197
+
198
+ | 来源 | Skills | 说明 |
199
+ |------|--------|------|
200
+ | **antfu** | vue, nuxt, pinia, vite, vitest, unocss, pnpm, vitepress, slidev, tsdown, turborepo 等 15 个 | Vue 全家桶 + 前端工具链最佳实践 |
201
+ | **Google Gemini** | code-reviewer, pr-creator | 代码审查与 PR 自动创建 |
202
+ | **Vercel Labs** | find-skills | 开源生态 Skill 发现与安装 |
203
+ | **Vercel Agent Skills** | react-best-practices, react-native-skills, web-design-guidelines | React/React Native 实现指导与 Web UI 审查 |
204
+ | **Anthropic** | frontend-design | 生产级前端视觉设计指导 |
205
+ | **OpenAI** | playwright | 浏览器自动化与 UI 流程调试 |
206
+ | **Superpowers** | systematic-debugging, verification-before-completion, receiving-code-review, writing-skills, using-git-worktrees, writing-plans | 精选代码库工作流技能,不默认启用 TDD 或子代理执行重流程 |
207
+
208
+ ## 项目结构
209
+
210
+ ```
211
+ ~/.moluoxixi/
212
+ ├── rules/
213
+ │ └── AGENTS.md # 仓库级运行规则
214
+ ├── skills/ # 第一方 skills(你的核心资产)
215
+ │ ├── skill-validation-standard/
216
+ │ └── workflow/
217
+ │ ├── software-development-workflow/
218
+ │ ├── frontend-code-standard/
219
+ │ ├── node-code-standard/
220
+ │ ├── nestjs-code-standard/
221
+ │ └── java-code-standard/
222
+ ├── vendor/
223
+ │ ├── repos/ # 克隆的第三方源仓库
224
+ │ └── skills/ # 展平后的提取 skills
225
+ ├── constants/skills.ts # 唯一的第三方技能配置清单
226
+ ├── scripts/ # 安装/同步/校验脚本
227
+ └── tests/ # 自动化验证测试
228
+ ```
229
+
230
+ > 源 `skills/` 目录允许递归分组;安装后的 vendor 与宿主 skills 目录统一按叶子 skill 名称展平。
231
+
232
+ ## 为什么不是另一个 AI Rules 集合?
233
+
234
+ 市面上已经有很多 AI rules 仓库。AIRules 不同的地方在于:
235
+
236
+ | 其他方案 | AIRules |
237
+ |---------|---------|
238
+ | 一个大的 rules 文件 | 模块化的小 skill 单元 |
239
+ | 手动复制粘贴 | 脚本驱动的自动分发 |
240
+ | 只支持一种代理 | 同时支持 7 种 AI 代理 |
241
+ | 全部自己写 | 克隆成熟的 + 自己写独特的 |
242
+ | 一次性配置 | 持续同步 + 自愈修复 |
243
+
244
+ ## 许可证
245
+
246
+ MIT
package/README.md ADDED
@@ -0,0 +1,246 @@
1
+ # Moluoxixi AIRules
2
+
3
+ > 🧩 Build your own AI coding best practices by composing modular skills — like LEGO bricks.
4
+
5
+ **English** | **[中文](README-zh.md)**
6
+
7
+ ## What is this?
8
+
9
+ AIRules is a **composable AI skill distribution system**. The core idea is simple:
10
+
11
+ - **Clone** mature AI Skills from the community (antfu, Anthropic, Google Gemini, Vercel, etc.)
12
+ - **Write** your own domain-specific Skills
13
+ - **Compose** these small, modular units into your personalized development best practices
14
+ - **Distribute** them to all your AI agents (Claude, Cursor, Codex, Gemini, etc.) with one command
15
+
16
+ ## Core Philosophy
17
+
18
+ ### 🏗️ Three-Layer Architecture
19
+
20
+ ```
21
+ ┌─────────────────────────────────────────────┐
22
+ │ 🔧 First-Party Skills (your own) │ ← Your competitive edge
23
+ │ software-development-workflow / standards │
24
+ ├─────────────────────────────────────────────┤
25
+ │ 📦 Third-Party Skills (cloned from mature │ ← Stand on the shoulders
26
+ │ repos) antfu/vue · anthropic/design · ... │ of giants
27
+ ├─────────────────────────────────────────────┤
28
+ │ 🚀 Distribution Engine (one-command deploy │ ← Automated infrastructure
29
+ │ to all AI agents) │
30
+ └─────────────────────────────────────────────┘
31
+ ```
32
+
33
+ ### 📐 Design Principles
34
+
35
+ | Principle | Description |
36
+ |-----------|-------------|
37
+ | **Small, Modular Units** | Each skill does one thing — independent, testable, replaceable |
38
+ | **Composition > Monolith** | Like Unix pipes — combine small tools to solve big problems |
39
+ | **Third-Party First** | Use mature community skills; only write what's uniquely yours |
40
+ | **Self-Healing Distribution** | One command syncs to all agents with auto link repair and verification |
41
+
42
+ ## What You Get
43
+
44
+ - 🔥 **25+ curated** frontend/backend/general AI Skills out of the box
45
+ - 🧱 **Reserved first-party expansion slots** so you can add your own top-level skills later without changing the distribution model
46
+ - 🌐 **Multi-agent sync**: configure once, works across Claude / Cursor / Codex / Qoder / Tare / OpenCode / CC-Switch
47
+ - 🔄 **Continuous updates**: one command pulls latest upstream skills
48
+
49
+ ## Installation
50
+
51
+ **Use as a Node CLI (local development / npm link):**
52
+
53
+ ```bash
54
+ npm install
55
+ npm run build
56
+ npm link
57
+ airules sync --host all
58
+ ```
59
+
60
+ Add a local skill and sync it to every host:
61
+
62
+ ```bash
63
+ airules add ./my-skill --host all
64
+ ```
65
+
66
+ The `add` command requires the source directory to contain `SKILL.md`. It copies the skill to `~/.moluoxixi/skills/<skill-name>` and then uses the same vendor/host projection pipeline.
67
+
68
+ **macOS / Linux / Git Bash:**
69
+
70
+ ```bash
71
+ git clone https://github.com/moluoxixi/AIRules.git "$HOME/.moluoxixi"
72
+ cd "$HOME/.moluoxixi"
73
+ npm run sync
74
+ ```
75
+
76
+ **Windows CMD:**
77
+
78
+ ```cmd
79
+ git clone https://github.com/moluoxixi/AIRules.git "%USERPROFILE%\.moluoxixi"
80
+ cd "%USERPROFILE%\.moluoxixi"
81
+ npm run sync
82
+ ```
83
+
84
+ **Windows PowerShell:**
85
+
86
+ ```powershell
87
+ git clone https://github.com/moluoxixi/AIRules.git "$env:USERPROFILE\.moluoxixi"
88
+ cd "$env:USERPROFILE\.moluoxixi"
89
+ npm run sync
90
+ ```
91
+
92
+ > [!TIP]
93
+ > **Sync Process**: This command rebuilds vendor skills, cleans dead links, and runs host verification after projection. Use `airules sync --skip-vendors` when you do not want to refresh third-party vendor repositories.
94
+
95
+ ---
96
+
97
+ ## Publishing
98
+
99
+ Publishing is handled by `.github/workflows/publish.yml`.
100
+
101
+ 1. Create an npm automation token with publish permission and save it as the GitHub Actions repository secret `NPM_TOKEN`.
102
+ 2. Bump `package.json` to the version you want to publish, then push a matching Git tag such as `v0.1.0`.
103
+ 3. The pushed tag publishes automatically; you can also manually run the `Publish package` workflow with an existing tag name.
104
+ 4. The workflow installs dependencies, verifies the tag matches `package.json`, runs lint/typecheck/tests, and publishes with `npm publish --provenance --access public`.
105
+
106
+ The workflow uses `npm install` because this repository intentionally does not track lockfiles.
107
+
108
+ ---
109
+
110
+ ## Specific Host Installation
111
+
112
+ **macOS / Linux / Git Bash:**
113
+
114
+ ```bash
115
+ git clone https://github.com/moluoxixi/AIRules.git "$HOME/.moluoxixi"
116
+ cd "$HOME/.moluoxixi"
117
+ npm run rules:install -- --host <host-name> (e.g., claude)
118
+ ```
119
+
120
+ **Windows CMD:**
121
+
122
+ ```cmd
123
+ git clone https://github.com/moluoxixi/AIRules.git "%USERPROFILE%\.moluoxixi"
124
+ cd "%USERPROFILE%\.moluoxixi"
125
+ npm run rules:install -- --host <host-name> (e.g., claude)
126
+ ```
127
+
128
+ **Windows PowerShell:**
129
+
130
+ ```powershell
131
+ git clone https://github.com/moluoxixi/AIRules.git "$env:USERPROFILE\.moluoxixi"
132
+ cd "$env:USERPROFILE\.moluoxixi"
133
+ npm run rules:install -- --host <host-name> (e.g., claude)
134
+ ```
135
+
136
+ > [!TIP]
137
+ > Inside the cloned repository, `npm run rules:install -- --host claude` still works and now forwards to `airules sync`.
138
+
139
+ ---
140
+
141
+ ## CLI Commands
142
+
143
+ | Command | Purpose |
144
+ |---------|---------|
145
+ | `airules sync --host all` | Sync built-in, user-defined, and third-party skills to every existing host |
146
+ | `airules add ./my-skill --host all` | Add a local skill and sync it to every host |
147
+ | `airules add ./my-skill --name review-plus --overwrite` | Set the installed skill name and replace an existing user skill |
148
+ | `airules verify --host codex` | Verify skill links for one host |
149
+
150
+ Common options:
151
+
152
+ | Option | Description |
153
+ |--------|-------------|
154
+ | `--home <dir>` | AIRules install directory, defaults to `~/.moluoxixi` |
155
+ | `--user-home <dir>` | User home used for host directories, defaults to the current OS home |
156
+ | `--host <name\|all>` | Target host, defaults to `all` |
157
+ | `--skip-vendors` | Do not refresh third-party vendor repos during `sync` |
158
+ | `--skip-sync` | Add the user skill without projecting it immediately |
159
+ | `--no-verify` | Skip host verification |
160
+
161
+ ---
162
+
163
+ ### Agent Support Matrix
164
+
165
+ Moluoxixi AIRules supports a growing ecosystem of AI agents through automated projection:
166
+
167
+ | Agent | `--host` Value | Host Path | Projection Method | Baseline File |
168
+ |-------|----------------|-----------|-------------------|---------------|
169
+ | **Claude Code** | `claude` | `~/.claude/` | Symlink | `CLAUDE.md` |
170
+ | **Codex** | `codex` | `~/.codex/` | Symlink | `AGENTS.md` |
171
+ | **Cursor** | `cursor` | `~/.cursor/` | Symlink | `AGENTS.md` |
172
+ | **Tare** | `tare` | `~/.tare/` | Symlink | `AGENTS.md` |
173
+ | **OpenCode** | `opencode` | `~/.config/opencode/` | Symlink | `AGENTS.md` |
174
+ | **CC-Switch** | `cc-switch` | `~/.cc-switch/` | Symlink | `AGENTS.md` |
175
+
176
+ > [!NOTE]
177
+ > All skills are automatically projected into the agent's dedicated skills directory during installation.
178
+
179
+ ---
180
+
181
+ ## Skills Overview
182
+
183
+ ### First-Party Skills (Custom)
184
+
185
+ | Name | Description |
186
+ |------|-------------|
187
+ | **software-development-workflow** | Standard software development workflow for requirements, splitting, design, implementation, verification, review, and delivery reports |
188
+ | **frontend-code-standard** | Vue 3 and React TypeScript/JavaScript frontend code standards for components, modules, utility libraries, UI component libraries, review output, and delivery checks |
189
+ | **node-code-standard** | Node.js backend implementation standards for TypeScript/JavaScript services with explicit contracts, runtime validation, dependency injection, transaction boundaries, persistence encapsulation, and delivery checks |
190
+ | **nestjs-code-standard** | NestJS backend implementation and review standards for new code, rewrites, and code reviews with DTO contracts, ValidationPipe, constructor injection, transaction boundaries, persistence encapsulation, and evidence-based review output |
191
+ | **java-code-standard** | Java and Spring Boot backend code standards for Java 17+ baseline, Java 21/25 LTS, Maven, and Gradle with domain packages, constructor injection, Bean Validation, transaction boundaries, migrations, and error mapping |
192
+ | **skill-validation-standard** | Minimal skill validation standard for generated or modified Claude/Codex skills, covering SKILL.md YAML frontmatter, folder-name matching, and line-count limits |
193
+
194
+ > Workflow standards may live under nested source folders such as `skills/workflow`, but installation flattens them into `vendor/skills/<skill-name>`. First-party rules live in `rules/AGENTS.md`.
195
+
196
+ ### Third-Party Skills (Curated)
197
+
198
+ | Source | Skills | Description |
199
+ |--------|--------|-------------|
200
+ | **antfu** | vue, nuxt, pinia, vite, vitest, unocss, pnpm, vitepress, slidev, tsdown, turborepo + 4 more | Vue ecosystem + frontend toolchain best practices |
201
+ | **Google Gemini** | code-reviewer, pr-creator | Automated code review and PR creation |
202
+ | **Vercel Labs** | find-skills | Open ecosystem skill discovery and installation |
203
+ | **Vercel Agent Skills** | react-best-practices, react-native-skills, web-design-guidelines | React/React Native implementation guidance and Web UI review |
204
+ | **Anthropic** | frontend-design | Production-grade frontend visual design guidance |
205
+ | **OpenAI** | playwright | Browser automation and UI-flow debugging |
206
+ | **Superpowers** | systematic-debugging, verification-before-completion, receiving-code-review, writing-skills, using-git-worktrees, writing-plans | Selected codebase workflow skills without default TDD or subagent execution |
207
+
208
+ ## Project Structure
209
+
210
+ ```
211
+ ~/.moluoxixi/
212
+ ├── rules/
213
+ │ └── AGENTS.md # Repository-level operating rules
214
+ ├── skills/ # First-party skills (your core assets)
215
+ │ ├── skill-validation-standard/
216
+ │ └── workflow/
217
+ │ ├── software-development-workflow/
218
+ │ ├── frontend-code-standard/
219
+ │ ├── node-code-standard/
220
+ │ ├── nestjs-code-standard/
221
+ │ └── java-code-standard/
222
+ ├── vendor/
223
+ │ ├── repos/ # Cloned third-party source repos
224
+ │ └── skills/ # Flattened extracted skills
225
+ ├── constants/skills.ts # Single source of truth for vendor config
226
+ ├── scripts/ # Install / sync / verify scripts
227
+ └── tests/ # Automated verification tests
228
+ ```
229
+
230
+ > Source `skills/` folders may be grouped recursively; installed vendor and host skill directories are flattened by leaf skill name.
231
+
232
+ ## Why Not Just Another AI Rules Repo?
233
+
234
+ There are many AI rules repositories out there. Here's what makes AIRules different:
235
+
236
+ | Other Approaches | AIRules |
237
+ |-----------------|---------|
238
+ | One large rules file | Modular, composable skill units |
239
+ | Manual copy-paste | Script-driven automated distribution |
240
+ | Single agent support | 7 AI agents supported simultaneously |
241
+ | Everything custom-written | Clone mature skills + write only what's unique |
242
+ | One-time setup | Continuous sync + self-healing repair |
243
+
244
+ ## License
245
+
246
+ MIT
@@ -0,0 +1,34 @@
1
+ /**
2
+ * 单个宿主(AI 代理)的配置定义
3
+ */
4
+ export interface HostConfig {
5
+ /** 宿主标识符,也是 --host 参数的值 */
6
+ id: string;
7
+ /** 宿主的主目录(相对于 userHome 的路径片段) */
8
+ homeRelPath: string;
9
+ /** 宿主基线文件的文件名(如 CLAUDE.md / AGENTS.md) */
10
+ baselineFileName: string;
11
+ /** 宿主内 skills 目录的名字(默认 'skills') */
12
+ skillsDirName?: string;
13
+ }
14
+ /**
15
+ * 所有支持的宿主(AI 代理)配置表
16
+ *
17
+ * 新增宿主时只需在此添加一条记录,脚本会自动感知。
18
+ */
19
+ export declare const HOST_CONFIGS: HostConfig[];
20
+ /** 所有支持的宿主 ID 列表,供 --host all 使用 */
21
+ export declare const ALL_HOST_IDS: string[];
22
+ /**
23
+ * 根据宿主 ID 获取配置,找不到时返回 undefined
24
+ */
25
+ export declare function findHostConfig(id: string): HostConfig | undefined;
26
+ /**
27
+ * 根据宿主配置和用户 home 目录,解析出完整的绝对路径集合
28
+ */
29
+ export interface ResolvedHostPaths {
30
+ hostHome: string;
31
+ hostBaselineFile: string;
32
+ skillsDirName: string;
33
+ }
34
+ export declare function resolveHostPaths(config: HostConfig, userHome: string): ResolvedHostPaths;
@@ -0,0 +1,71 @@
1
+ import path from 'node:path';
2
+ /**
3
+ * 所有支持的宿主(AI 代理)配置表
4
+ *
5
+ * 新增宿主时只需在此添加一条记录,脚本会自动感知。
6
+ */
7
+ export const HOST_CONFIGS = [
8
+ {
9
+ id: 'claude',
10
+ homeRelPath: '.claude',
11
+ baselineFileName: 'CLAUDE.md',
12
+ },
13
+ {
14
+ id: 'codex',
15
+ homeRelPath: '.codex',
16
+ baselineFileName: 'AGENTS.md',
17
+ },
18
+ {
19
+ id: 'cursor',
20
+ homeRelPath: '.cursor',
21
+ baselineFileName: 'AGENTS.md',
22
+ skillsDirName: 'skills-cursor',
23
+ },
24
+ // 不需要,会自己复用.agents
25
+ // {
26
+ // id: 'qoder',
27
+ // homeRelPath: '.qoder',
28
+ // baselineFileName: 'AGENTS.md',
29
+ // },
30
+ {
31
+ id: 'qoderwork',
32
+ homeRelPath: '.qoderwork',
33
+ baselineFileName: 'AGENTS.md',
34
+ },
35
+ {
36
+ id: 'trae',
37
+ homeRelPath: '.trae',
38
+ baselineFileName: 'AGENTS.md',
39
+ },
40
+ {
41
+ id: 'trae-cn',
42
+ homeRelPath: '.trae-cn',
43
+ baselineFileName: 'AGENTS.md',
44
+ },
45
+ {
46
+ id: 'opencode',
47
+ homeRelPath: path.join('.config', 'opencode'),
48
+ baselineFileName: 'AGENTS.md',
49
+ },
50
+ {
51
+ id: 'cc-switch',
52
+ homeRelPath: '.cc-switch',
53
+ baselineFileName: 'AGENTS.md',
54
+ },
55
+ ];
56
+ /** 所有支持的宿主 ID 列表,供 --host all 使用 */
57
+ export const ALL_HOST_IDS = HOST_CONFIGS.map(h => h.id);
58
+ /**
59
+ * 根据宿主 ID 获取配置,找不到时返回 undefined
60
+ */
61
+ export function findHostConfig(id) {
62
+ return HOST_CONFIGS.find(h => h.id === id);
63
+ }
64
+ export function resolveHostPaths(config, userHome) {
65
+ const hostHome = path.join(userHome, ...config.homeRelPath.split(path.sep));
66
+ return {
67
+ hostHome,
68
+ hostBaselineFile: path.join(hostHome, config.baselineFileName),
69
+ skillsDirName: config.skillsDirName ?? 'skills',
70
+ };
71
+ }