@mison/ling 1.1.0 → 1.2.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.
- package/.agents/rules/GEMINI.md +17 -0
- package/.agents/skills/clean-code/SKILL.md +24 -14
- package/.agents/skills/doc.md +9 -5
- package/CHANGELOG.md +34 -1
- package/README.md +138 -195
- package/bin/adapters/gemini.js +6 -2
- package/bin/core/generator.js +1 -0
- package/bin/interactive.js +6 -4
- package/bin/ling-cli.js +893 -170
- package/bin/utils.js +52 -9
- package/docs/PLAN.md +21 -17
- package/docs/TECH.md +40 -13
- package/package.json +1 -1
- package/scripts/ci-verify.js +4 -1
- package/scripts/health-check.js +4 -13
- package/tests/cli-smoke.test.js +115 -0
- package/tests/global-sync.test.js +15 -2
- package/tests/spec-init-doctor.test.js +233 -0
- package/tests/spec-profile.test.js +84 -0
- package/tests/standards-compliance.test.js +31 -0
- package/.agents/skills/vulnerability-scanner/scripts/__pycache__/security_scan.cpython-310.pyc +0 -0
package/.agents/rules/GEMINI.md
CHANGED
|
@@ -27,6 +27,23 @@ trigger: always_on
|
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
|
+
## Spec 协议(任务跟踪 CSV 驱动)
|
|
31
|
+
|
|
32
|
+
当工作区存在 `issues.csv` 时,视其为任务跟踪文件(单一事实源),并遵循:
|
|
33
|
+
|
|
34
|
+
1. 读取 `issues.csv` 并只锁定一个原子任务。
|
|
35
|
+
2. 将任务状态从“未开始”改为“进行中”,再开始开发。
|
|
36
|
+
3. 修改完成后运行最小充分验证,并记录证据。
|
|
37
|
+
4. 自审通过后将状态改为“已完成”。
|
|
38
|
+
5. 若验证失败,先修复或回退,不得静默降级。
|
|
39
|
+
|
|
40
|
+
模板参考:
|
|
41
|
+
|
|
42
|
+
- 优先:`.ling/spec/templates/driver-prompt.md`
|
|
43
|
+
- 其次:`~/.ling/spec/templates/driver-prompt.md`(若已启用全局 Spec Profile)
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
30
47
|
## 请求分类器(第 1 步)
|
|
31
48
|
|
|
32
49
|
**在执行任何动作前,先对请求分类:**
|
|
@@ -143,24 +143,34 @@ File to edit: UserService.ts
|
|
|
143
143
|
|
|
144
144
|
> [CRITICAL] **核心要求:** 每个代理完成后仅运行所属技能脚本。
|
|
145
145
|
|
|
146
|
+
### 脚本路径约定
|
|
147
|
+
|
|
148
|
+
下表中的 `<skills_root>` 代表 Skills 根目录,常见取值:
|
|
149
|
+
|
|
150
|
+
- Ling 仓库源码:`.agents/skills`
|
|
151
|
+
- Gemini 工作区:`.agent/skills`
|
|
152
|
+
- Codex 全局:`~/.codex/skills`
|
|
153
|
+
- Gemini CLI 全局:`~/.gemini/skills`
|
|
154
|
+
- Antigravity 全局:`~/.gemini/antigravity/skills`
|
|
155
|
+
|
|
146
156
|
### 代理 -> 脚本映射
|
|
147
157
|
|
|
148
158
|
| 代理 | 脚本 | 命令 |
|
|
149
159
|
|-------|--------|---------|
|
|
150
|
-
| **frontend-specialist** | UX Audit | `python
|
|
151
|
-
| **frontend-specialist** | A11y Check | `python
|
|
152
|
-
| **backend-specialist** | API Validator | `python
|
|
153
|
-
| **mobile-developer** | Mobile Audit | `python
|
|
154
|
-
| **database-architect** | Schema Validate | `python
|
|
155
|
-
| **security-auditor** | Security Scan | `python
|
|
156
|
-
| **seo-specialist** | SEO Check | `python
|
|
157
|
-
| **seo-specialist** | GEO Check | `python
|
|
158
|
-
| **performance-optimizer** | Lighthouse | `python
|
|
159
|
-
| **test-engineer** | Test Runner | `python
|
|
160
|
-
| **test-engineer** | Playwright | `python
|
|
161
|
-
| **Any agent** | Lint Check | `python
|
|
162
|
-
| **Any agent** | Type Coverage | `python
|
|
163
|
-
| **Any agent** | i18n Check | `python
|
|
160
|
+
| **frontend-specialist** | UX Audit | `python <skills_root>/frontend-design/scripts/ux_audit.py .` |
|
|
161
|
+
| **frontend-specialist** | A11y Check | `python <skills_root>/frontend-design/scripts/accessibility_checker.py .` |
|
|
162
|
+
| **backend-specialist** | API Validator | `python <skills_root>/api-patterns/scripts/api_validator.py .` |
|
|
163
|
+
| **mobile-developer** | Mobile Audit | `python <skills_root>/mobile-design/scripts/mobile_audit.py .` |
|
|
164
|
+
| **database-architect** | Schema Validate | `python <skills_root>/database-design/scripts/schema_validator.py .` |
|
|
165
|
+
| **security-auditor** | Security Scan | `python <skills_root>/vulnerability-scanner/scripts/security_scan.py .` |
|
|
166
|
+
| **seo-specialist** | SEO Check | `python <skills_root>/seo-fundamentals/scripts/seo_checker.py .` |
|
|
167
|
+
| **seo-specialist** | GEO Check | `python <skills_root>/geo-fundamentals/scripts/geo_checker.py .` |
|
|
168
|
+
| **performance-optimizer** | Lighthouse | `python <skills_root>/performance-profiling/scripts/lighthouse_audit.py <url>` |
|
|
169
|
+
| **test-engineer** | Test Runner | `python <skills_root>/testing-patterns/scripts/test_runner.py .` |
|
|
170
|
+
| **test-engineer** | Playwright | `python <skills_root>/webapp-testing/scripts/playwright_runner.py <url>` |
|
|
171
|
+
| **Any agent** | Lint Check | `python <skills_root>/lint-and-validate/scripts/lint_runner.py .` |
|
|
172
|
+
| **Any agent** | Type Coverage | `python <skills_root>/lint-and-validate/scripts/type_coverage.py .` |
|
|
173
|
+
| **Any agent** | i18n Check | `python <skills_root>/i18n-localization/scripts/i18n_checker.py .` |
|
|
164
174
|
|
|
165
175
|
> [FAIL] **错误做法:** `test-engineer` 运行 `ux_audit.py`
|
|
166
176
|
> [OK] **正确做法:** `frontend-specialist` 运行 `ux_audit.py`
|
package/.agents/skills/doc.md
CHANGED
|
@@ -18,7 +18,11 @@
|
|
|
18
18
|
|
|
19
19
|
| 范围 | 路径 | 说明 |
|
|
20
20
|
|---------|-----------|-------|
|
|
21
|
-
| **
|
|
21
|
+
| **Ling 仓库源码(Canonical)** | `<ling-repo>/.agents/skills/` | 模板源,用于构建与分发 |
|
|
22
|
+
| **Workspace(工作区)** | `<workspace-root>/.agent/skills/` | 仅作用于当前项目(Gemini/Antigravity) |
|
|
23
|
+
| **Global(全局)** | `~/.codex/skills/`、`~/.gemini/skills/`、`~/.gemini/antigravity/skills/` | 跨项目复用(按目标工具读取) |
|
|
24
|
+
|
|
25
|
+
> 约定:下文示例使用 `<skills_root>` 表示 Skills 根目录;请按你的安装方式替换为上表路径。
|
|
22
26
|
|
|
23
27
|
### 技能目录结构
|
|
24
28
|
|
|
@@ -39,7 +43,7 @@ my-skill/
|
|
|
39
43
|
### 步骤 1:创建目录
|
|
40
44
|
|
|
41
45
|
```bash
|
|
42
|
-
mkdir -p
|
|
46
|
+
mkdir -p <skills_root>/code-review
|
|
43
47
|
```
|
|
44
48
|
|
|
45
49
|
### 步骤 2:创建 SKILL.md
|
|
@@ -119,12 +123,12 @@ Agent(智能体)会自动识别 `code-review` 技能,加载信息并按指
|
|
|
119
123
|
### 步骤 1:创建目录
|
|
120
124
|
|
|
121
125
|
```bash
|
|
122
|
-
mkdir -p
|
|
126
|
+
mkdir -p <skills_root>/license-header-adder/resources
|
|
123
127
|
```
|
|
124
128
|
|
|
125
129
|
### 步骤 2:创建模板文件
|
|
126
130
|
|
|
127
|
-
|
|
131
|
+
**`<skills_root>/license-header-adder/resources/HEADER.txt`**:
|
|
128
132
|
|
|
129
133
|
```
|
|
130
134
|
/*
|
|
@@ -136,7 +140,7 @@ mkdir -p .agent/skills/license-header-adder/resources
|
|
|
136
140
|
|
|
137
141
|
### 步骤 3:创建 SKILL.md
|
|
138
142
|
|
|
139
|
-
|
|
143
|
+
**`<skills_root>/license-header-adder/SKILL.md`**:
|
|
140
144
|
|
|
141
145
|
```markdown
|
|
142
146
|
---
|
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,37 @@
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [ling-1.2.0] - 2026-03-14
|
|
11
|
+
|
|
12
|
+
### 新增
|
|
13
|
+
|
|
14
|
+
- `antigravity` 作为独立目标进入 CLI 主链路:`init/update/update-all/status/doctor/global sync/spec enable|disable` 均可直接指定,不再由 `gemini` 隐式代管。
|
|
15
|
+
- 共享 `.agent/` 工作区新增本地安装状态文件 `.ling/install-state.json`,用于准确记录 `gemini` / `antigravity` 的逻辑注册身份,即使工作区未写入全局索引也能正确识别。
|
|
16
|
+
|
|
17
|
+
### 变更
|
|
18
|
+
|
|
19
|
+
- 全局同步默认目标调整为 `codex + gemini + antigravity`;`--target gemini` 仅写入 `~/.gemini/skills/`,`--target antigravity` 仅写入 `~/.gemini/antigravity/skills/`。
|
|
20
|
+
- README、TECH、PLAN 与测试基线同步对齐新的三目标语义,并补充共享 `.agent/` 的状态识别说明。
|
|
21
|
+
- 健康检查与维护链路统一收口到 `npm`,Web 子项目不再保留 `bun.lock`。
|
|
22
|
+
|
|
23
|
+
### 维护
|
|
24
|
+
|
|
25
|
+
- `reference/` 清理重复官方资料:删除 `reference/official-docs/` 镜像,仅保留 `reference/official/` 单份受管参考。
|
|
26
|
+
- 根目录与 `reference/.gitignore` 调整为白名单模式,仅跟踪 `reference/official/`、`reference/docs-archive/` 等保留资料。
|
|
27
|
+
|
|
28
|
+
## [ling-1.1.1] - 2026-03-14
|
|
29
|
+
|
|
30
|
+
### 新增
|
|
31
|
+
|
|
32
|
+
- Spec 项目级工作区初始化与诊断:新增 `ling spec init` / `ling spec doctor`,在工作区落盘 `.ling/spec` 资产与 `issues.csv` 校验。
|
|
33
|
+
- Spec Profiles 资产:全局与项目级均包含 `profiles/`,并纳入完整性校验与回退语义。
|
|
34
|
+
- Spec 资产分支拉取:`ling spec init --branch <name>` 支持从指定分支的 `.spec/` 拉取 templates/references/profiles。
|
|
35
|
+
|
|
36
|
+
### 变更
|
|
37
|
+
|
|
38
|
+
- Spec 状态判定强化:`ling spec status` 增加文件级完整性校验,且在 `state.json` 缺失但检测到残留 artifacts 时返回 `broken` 并给出修复提示。
|
|
39
|
+
- CI 改为 npm:CI 矩阵不再依赖 bun,统一使用 `npm ci/test/run` 执行验证。
|
|
40
|
+
|
|
10
41
|
## [ling-1.1.0] - 2026-03-13
|
|
11
42
|
|
|
12
43
|
### 新增
|
|
@@ -67,7 +98,9 @@
|
|
|
67
98
|
|
|
68
99
|
本项目在 Ling 重启前的 2.x/3.x 版本记录已冻结,不再维护。
|
|
69
100
|
|
|
70
|
-
[Unreleased]: https://github.com/MisonL/Ling/compare/ling-1.
|
|
101
|
+
[Unreleased]: https://github.com/MisonL/Ling/compare/ling-1.2.0...HEAD
|
|
102
|
+
[ling-1.2.0]: https://github.com/MisonL/Ling/releases/tag/ling-1.2.0
|
|
103
|
+
[ling-1.1.1]: https://github.com/MisonL/Ling/releases/tag/ling-1.1.1
|
|
71
104
|
[ling-1.1.0]: https://github.com/MisonL/Ling/releases/tag/ling-1.1.0
|
|
72
105
|
[ling-1.0.2]: https://github.com/MisonL/Ling/releases/tag/ling-1.0.2
|
|
73
106
|
[ling-1.0.1]: https://github.com/MisonL/Ling/releases/tag/ling-1.0.1
|
package/README.md
CHANGED
|
@@ -12,178 +12,196 @@
|
|
|
12
12
|
npm install -g @mison/ling
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
`ling` 解决三件事:
|
|
16
|
+
|
|
17
|
+
- 项目内安装 Gemini / Antigravity / Codex 资产
|
|
18
|
+
- 全局同步可复用 Skills
|
|
19
|
+
- 为项目启用 Spec 工作流
|
|
20
|
+
|
|
21
|
+
最常见的项目初始化:
|
|
16
22
|
|
|
17
23
|
```bash
|
|
18
24
|
cd /path/to/your-project
|
|
19
|
-
ling init --target gemini
|
|
20
|
-
ling init --target
|
|
21
|
-
|
|
25
|
+
ling init --target gemini
|
|
26
|
+
ling init --target antigravity
|
|
27
|
+
ling init --target codex
|
|
22
28
|
```
|
|
23
29
|
|
|
24
|
-
|
|
25
|
-
- npm 安装的主命令入口为 `ling`。
|
|
26
|
-
|
|
27
|
-
可选:不做全局安装,直接在仓库目录执行:
|
|
30
|
+
如果要同时安装多个目标:
|
|
28
31
|
|
|
29
32
|
```bash
|
|
30
|
-
|
|
31
|
-
node bin/ling.js init --target codex --path /path/to/your-project
|
|
33
|
+
ling init --targets gemini,antigravity,codex
|
|
32
34
|
```
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
如果你要先做全局 Skills 安装:
|
|
35
37
|
|
|
36
38
|
```bash
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
ling global sync
|
|
40
|
+
ling global sync --target codex
|
|
41
|
+
ling global sync --target gemini
|
|
42
|
+
ling global sync --target antigravity
|
|
40
43
|
```
|
|
41
44
|
|
|
42
|
-
|
|
45
|
+
## 先选模式
|
|
43
46
|
|
|
44
|
-
|
|
47
|
+
| 你要做什么 | 命令 | 结果 |
|
|
48
|
+
| --- | --- | --- |
|
|
49
|
+
| 给当前项目安装完整资产 | `ling init` | 项目内生成 `.agent/` / `.agents/`;共享 `.agent/` 时会维护 `.ling/install-state.json` |
|
|
50
|
+
| 给电脑全局同步可复用 Skills | `ling global sync` | 写入 `~/.codex/skills/`、`~/.gemini/skills/` 等 |
|
|
51
|
+
| 给项目启用 Spec 工作流 | `ling spec init` | 项目内生成 `issues.csv` 等 Spec 资产 |
|
|
45
52
|
|
|
46
|
-
|
|
53
|
+
一句话区分:
|
|
47
54
|
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
51
|
-
- 真实落盘:
|
|
52
|
-
- `codex` -> `~/.codex/skills/`
|
|
53
|
-
- `gemini` -> 同时写入 `~/.gemini/skills/` 与 `~/.gemini/antigravity/skills/`
|
|
55
|
+
- `init` 面向项目
|
|
56
|
+
- `global sync` 面向整台电脑
|
|
57
|
+
- `spec init` 面向项目里的任务驱动流程
|
|
54
58
|
|
|
55
|
-
|
|
59
|
+
## 项目安装
|
|
60
|
+
|
|
61
|
+
项目安装是默认用法,也是能力最完整的模式。
|
|
62
|
+
|
|
63
|
+
- `gemini` 写入项目内 `.agent/`
|
|
64
|
+
- `antigravity` 写入项目内 `.agent/`(与 Gemini 复用目录,命令与状态独立)
|
|
65
|
+
- `codex` 写入项目内 `.agents/`
|
|
66
|
+
- Ling 会在项目内写入 `.ling/install-state.json`,用于记录共享 `.agent/` 上到底注册了 `gemini`、`antigravity` 还是两者
|
|
67
|
+
- Codex 额外注入工作区 `AGENTS.md` 和 `ling.rules`
|
|
56
68
|
|
|
57
69
|
```bash
|
|
58
|
-
|
|
59
|
-
ling
|
|
60
|
-
ling
|
|
61
|
-
ling
|
|
70
|
+
cd /path/to/your-project
|
|
71
|
+
ling init --target gemini
|
|
72
|
+
ling init --target antigravity
|
|
73
|
+
ling init --target codex
|
|
74
|
+
ling update
|
|
75
|
+
ling doctor
|
|
62
76
|
```
|
|
63
77
|
|
|
64
|
-
|
|
65
|
-
覆盖同名 Skill 前会自动备份;手动回滚方式见 `docs/TECH.md`。
|
|
78
|
+
非交互环境下,`init` 必须显式传 `--target` 或 `--targets`。
|
|
66
79
|
|
|
67
|
-
|
|
80
|
+
## 全局 Skills
|
|
68
81
|
|
|
69
|
-
|
|
70
|
-
- npm 包版本遵循 SemVer(`package.json`)
|
|
71
|
-
- git tag 与 CLI `--version` 显示使用 `ling-<SemVer>`(例如 `ling-1.0.0`)
|
|
82
|
+
全局模式只做一件事:把 Skills 同步到真实消费端目录,方便跨项目复用。
|
|
72
83
|
|
|
73
|
-
|
|
84
|
+
```bash
|
|
85
|
+
ling global sync
|
|
86
|
+
ling global sync --target codex
|
|
87
|
+
ling global sync --target gemini
|
|
88
|
+
ling global sync --target antigravity
|
|
89
|
+
ling global status
|
|
90
|
+
```
|
|
74
91
|
|
|
75
|
-
|
|
92
|
+
- `codex` -> `~/.codex/skills/`
|
|
93
|
+
- `gemini` -> `~/.gemini/skills/`
|
|
94
|
+
- `antigravity` -> `~/.gemini/antigravity/skills/`
|
|
76
95
|
|
|
77
|
-
|
|
78
|
-
- `b` 备份后移除(推荐)
|
|
79
|
-
- `r` 直接移除(不备份)
|
|
96
|
+
全局模式不会写入项目 Rules、Agents、Workflows,也不会改你的全局 `~/.codex/rules`。
|
|
80
97
|
|
|
81
|
-
|
|
98
|
+
## Spec
|
|
82
99
|
|
|
83
|
-
|
|
84
|
-
- 项目级预备份:
|
|
85
|
-
- Gemini:`<project>/.agent-backup/<timestamp>/preflight/.agent/`
|
|
86
|
-
- Codex:`<project>/.agents-backup/<timestamp>/preflight/.agents/` 或 `<project>/.agents-backup/<timestamp>/preflight/.codex/`
|
|
87
|
-
- 全局 Skills:`$HOME/.ling/backups/global/<timestamp>/...`
|
|
88
|
-
- Spec Profile:`$HOME/.ling/backups/spec/<timestamp>/before/...`
|
|
100
|
+
Spec 是核心进阶功能,但理解它只需要记住两句:
|
|
89
101
|
|
|
90
|
-
|
|
91
|
-
- `
|
|
92
|
-
- `init` 在检测到已有资产且未指定 `--force` 时会报错提示改用交互终端或显式 `--force`
|
|
102
|
+
- `ling spec enable` 给这台电脑安装全局 Spec 工具箱
|
|
103
|
+
- `ling spec init` 给当前项目创建真正要用的 `issues.csv`
|
|
93
104
|
|
|
94
|
-
|
|
105
|
+
也就是说:
|
|
95
106
|
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
- `ling spec status`
|
|
99
|
-
- `ling spec enable`
|
|
100
|
-
- `ling spec disable`
|
|
101
|
-
- 默认目标:`ling spec enable` 未指定目标时,会启用 `codex + gemini`
|
|
102
|
-
- 当前全局层会安装:
|
|
103
|
-
- Skills:`harness-engineering`、`cybernetic-systems-engineering`
|
|
104
|
-
- Spec 运行模板:写入 `~/.ling/spec/templates/`
|
|
105
|
-
- Spec 参考资料:写入 `~/.ling/spec/references/`
|
|
106
|
-
- 目标平台落盘:
|
|
107
|
-
- `codex` -> `~/.codex/skills/`
|
|
108
|
-
- `gemini` -> 同时写入 `~/.gemini/skills/` 与 `~/.gemini/antigravity/skills/`
|
|
107
|
+
- 全局 Spec 负责模板、参考资料、约束
|
|
108
|
+
- 项目里的 `issues.csv` 永远放在项目根目录
|
|
109
109
|
|
|
110
|
-
|
|
110
|
+
最常用的两种方式:
|
|
111
111
|
|
|
112
112
|
```bash
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
ling spec
|
|
113
|
+
# 完整模式:项目自带 Spec 资产
|
|
114
|
+
cd /path/to/your-project
|
|
115
|
+
ling spec init
|
|
116
|
+
|
|
117
|
+
# 轻量模式:只在项目里放 issues.csv,其他能力走全局后备
|
|
118
|
+
cd /path/to/your-project
|
|
119
|
+
ling spec enable
|
|
120
|
+
ling spec init --csv-only
|
|
116
121
|
```
|
|
117
122
|
|
|
118
|
-
|
|
123
|
+
你会得到:
|
|
119
124
|
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
125
|
+
- 完整模式:`<project>/.ling/spec/`、`<project>/issues.csv`、`<project>/docs/reviews/`、`<project>/docs/handoff/`
|
|
126
|
+
- `--csv-only`:`<project>/issues.csv`、`<project>/docs/reviews/`、`<project>/docs/handoff/`
|
|
127
|
+
- 全局 Spec 资源:`~/.ling/spec/templates/`、`~/.ling/spec/references/`、`~/.ling/spec/profiles/`
|
|
123
128
|
|
|
124
|
-
|
|
129
|
+
如果你只想要一个本机演练空间,而不是某个真实项目:
|
|
125
130
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
- 如需启用官方 `.rules` 审批策略,请参考 `docs/TECH.md` 的「Codex 官方 `.rules`(手动配置)」小节。
|
|
131
|
+
```bash
|
|
132
|
+
ling spec init --spec-workspace
|
|
133
|
+
```
|
|
130
134
|
|
|
131
|
-
|
|
135
|
+
`spec doctor` 用于检查当前项目的 Spec 状态。
|
|
132
136
|
|
|
133
|
-
|
|
134
|
-
- 终端可读性:模板文本与脚本输出避免使用 Emoji 或装饰性 Unicode 字符,统一采用纯 ASCII 标记,提升 Windows/WSL/Linux/macOS 的显示一致性。
|
|
137
|
+
## 常用命令
|
|
135
138
|
|
|
136
|
-
|
|
139
|
+
| 命令 | 用途 |
|
|
140
|
+
| --- | --- |
|
|
141
|
+
| `ling init` | 在项目内安装目标资产 |
|
|
142
|
+
| `ling update` | 更新当前项目已安装目标 |
|
|
143
|
+
| `ling doctor` | 诊断当前项目安装状态 |
|
|
144
|
+
| `ling status` | 输出项目安装状态 |
|
|
145
|
+
| `ling global sync` | 全局同步 Skills |
|
|
146
|
+
| `ling global status` | 查看全局 Skills 状态 |
|
|
147
|
+
| `ling spec enable` | 启用全局 Spec 工具箱 |
|
|
148
|
+
| `ling spec init` | 在当前项目初始化 Spec |
|
|
149
|
+
| `ling spec doctor` | 检查当前项目 Spec 状态 |
|
|
150
|
+
| `ling update-all` | 批量更新已登记项目 |
|
|
137
151
|
|
|
138
|
-
|
|
152
|
+
常用示例:
|
|
139
153
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
154
|
+
```bash
|
|
155
|
+
ling init --targets gemini,antigravity,codex --path ./myapp
|
|
156
|
+
ling init --target antigravity --path ./myapp
|
|
157
|
+
ling init --target codex --force --path ./myapp
|
|
158
|
+
ling update --path ./myapp
|
|
159
|
+
ling doctor --target codex --fix --path ./myapp
|
|
160
|
+
ling spec enable
|
|
161
|
+
ling spec init --csv-only --path ./myapp
|
|
162
|
+
ling update-all --targets antigravity,codex
|
|
163
|
+
ling global sync --quiet --dry-run
|
|
164
|
+
```
|
|
143
165
|
|
|
144
|
-
##
|
|
166
|
+
## 文档
|
|
145
167
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
| Workflows(工作流) | 12 | 斜杠命令流程 |
|
|
168
|
+
- [技术说明](docs/TECH.md)
|
|
169
|
+
- [设计规划](docs/PLAN.md)
|
|
170
|
+
- [贡献说明](CONTRIBUTING.md)
|
|
171
|
+
- [更新日志](CHANGELOG.md)
|
|
151
172
|
|
|
152
|
-
##
|
|
173
|
+
## 使用说明
|
|
153
174
|
|
|
154
|
-
|
|
175
|
+
- `ling` 的仓库模板源是 `.agents/`
|
|
176
|
+
- 文本与模板资源使用 UTF-8 与 LF
|
|
177
|
+
- 不会自动写入全局 `~/.codex/rules`
|
|
178
|
+
- 如果 AI 编辑器依赖索引,请不要把 `.agent/`、`.agents/` 放进项目 `.gitignore`
|
|
155
179
|
|
|
156
|
-
|
|
180
|
+
版本约定:
|
|
157
181
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
AI:正在应用 @security-auditor + @backend-specialist...
|
|
182
|
+
- npm 版本遵循 SemVer
|
|
183
|
+
- Git tag 和 `ling --version` 显示为 `ling-<SemVer>`
|
|
161
184
|
|
|
162
|
-
|
|
163
|
-
AI:正在使用 @frontend-specialist...
|
|
185
|
+
源码方式运行:
|
|
164
186
|
|
|
165
|
-
|
|
166
|
-
|
|
187
|
+
```bash
|
|
188
|
+
git clone https://github.com/MisonL/Ling.git
|
|
189
|
+
cd Ling
|
|
190
|
+
npm install
|
|
191
|
+
node bin/ling.js init --target codex --path /path/to/your-project
|
|
167
192
|
```
|
|
168
193
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
- 静默分析请求
|
|
172
|
-
- 自动检测领域(前端、后端、安全等)
|
|
173
|
-
- 选择最佳专家
|
|
174
|
-
- 告知你正在应用哪方面的专业知识
|
|
175
|
-
- 无需了解系统架构即可获得专家级响应
|
|
176
|
-
|
|
177
|
-
**优势:**
|
|
194
|
+
## 包含内容
|
|
178
195
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
196
|
+
| 组件 | 数量 | 描述 |
|
|
197
|
+
| --- | --- | --- |
|
|
198
|
+
| Agents(智能体) | 20 | 专家级 AI 人设(前端、后端、安全、产品、QA 等) |
|
|
199
|
+
| Skills(技能) | 49 | 特定领域的知识模块(以 `SKILL.md` 为准,含子技能目录) |
|
|
200
|
+
| Workflows(工作流) | 12 | 斜杠命令流程 |
|
|
183
201
|
|
|
184
|
-
|
|
202
|
+
## 工作流与命令
|
|
185
203
|
|
|
186
|
-
|
|
204
|
+
工作流通过斜杠命令触发:
|
|
187
205
|
|
|
188
206
|
| 命令 | 描述 |
|
|
189
207
|
| --- | --- |
|
|
@@ -200,75 +218,9 @@ AI:正在使用 @debugger 进行系统化分析...
|
|
|
200
218
|
| `/test` | 生成并运行测试 |
|
|
201
219
|
| `/ui-ux-pro-max` | 50 种风格的设计 |
|
|
202
220
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
```
|
|
206
|
-
/brainstorm 认证系统
|
|
207
|
-
/create 带 Hero 部分的着陆页
|
|
208
|
-
/debug 为什么登录失败
|
|
209
|
-
```
|
|
221
|
+
技能会按上下文自动加载,不需要手工管理大多数 Skill。
|
|
210
222
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
技能会根据任务上下文自动加载。AI 会阅读技能描述并应用相关知识。
|
|
214
|
-
|
|
215
|
-
## CLI 工具
|
|
216
|
-
|
|
217
|
-
CLI(命令行界面)工具:
|
|
218
|
-
|
|
219
|
-
| 命令 | 描述 |
|
|
220
|
-
| --- | --- |
|
|
221
|
-
| `ling init` | 安装指定目标:gemini/codex |
|
|
222
|
-
| `ling update` | 更新当前项目已安装目标 |
|
|
223
|
-
| `ling update-all` | 批量更新所有已登记工作区 |
|
|
224
|
-
| `ling doctor` | 诊断安装完整性(可 `--fix` 自愈) |
|
|
225
|
-
| `ling global sync` | 全局同步 Skills(默认同步 codex + gemini;其中 gemini 同步到 gemini-cli 与 antigravity) |
|
|
226
|
-
| `ling global status` | 查看全局 Skills 安装状态 |
|
|
227
|
-
| `ling exclude` | 管理全局索引排除清单 |
|
|
228
|
-
| `ling status` | 检查安装状态 |
|
|
229
|
-
|
|
230
|
-
### 常用选项
|
|
231
|
-
|
|
232
|
-
```bash
|
|
233
|
-
ling init --target gemini --path ./myapp # 安装 Gemini 到指定目录
|
|
234
|
-
ling init --target codex --path ./myapp # 安装 Codex 到指定目录
|
|
235
|
-
ling init --targets gemini,codex --path ./myapp # 一次安装多个目标
|
|
236
|
-
ling init --non-interactive --target codex # 非交互模式必须显式指定目标
|
|
237
|
-
ling init --target codex --no-index --path ./tmp-workspace # 安装但不写入全局索引
|
|
238
|
-
ling init --branch dev --force # 覆盖安装并指定分支
|
|
239
|
-
ling init --quiet --dry-run # 预览操作而不执行
|
|
240
|
-
ling update --target codex --path ./myapp # 更新指定目标(默认会刷新索引)
|
|
241
|
-
ling update --target codex --no-index --path ./myapp # 更新但不刷新索引
|
|
242
|
-
ling doctor --target codex --fix --path ./myapp # 检查并自动修复
|
|
243
|
-
ling update-all --targets codex # 批量更新所有登记工作区里的 codex 目标
|
|
244
|
-
ling update-all --prune-missing # 清理索引中已失效的路径
|
|
245
|
-
ling exclude list # 查看排除清单
|
|
246
|
-
ling exclude add --path /path/to/dir # 新增排除路径
|
|
247
|
-
ling exclude remove --path /path/to/dir # 删除排除路径
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
### 状态命令约定
|
|
251
|
-
|
|
252
|
-
- `ling status --quiet`:输出 `installed` / `broken` / `missing`
|
|
253
|
-
- `ling global status --quiet`:输出 `installed` / `broken` / `missing`
|
|
254
|
-
- 退出码:`0=installed`,`1=broken`,`2=missing`
|
|
255
|
-
- `status` 面向自动化健康判断;如需问题明细,使用 `ling doctor`
|
|
256
|
-
|
|
257
|
-
### 批量更新机制
|
|
258
|
-
|
|
259
|
-
- 执行 `ling init` / `ling update` 时,会把工作区路径登记到全局索引文件:
|
|
260
|
-
- macOS / Linux / WSL: `~/.ling/workspaces.json`
|
|
261
|
-
- Windows PowerShell / CMD: `%USERPROFILE%\.ling\workspaces.json`
|
|
262
|
-
- 默认会自动排除灵轨工具包源码目录和系统临时目录(如 macOS `/var/folders/...`、`/tmp`、`/private/tmp`,Linux `/tmp`,Windows `%TEMP%`)。
|
|
263
|
-
- 可通过 `--no-index` 让 `init/update` 跳过索引登记(适合临时验证目录)。
|
|
264
|
-
- `ling update` 只依赖当前目录(或 `--path` 指定目录)的已安装目标,不依赖全局索引。
|
|
265
|
-
- 执行 `ling update-all` 时,会遍历索引并批量更新每个工作区(可通过 `--targets` 限定目标)。
|
|
266
|
-
- 可用 `--prune-missing` 自动移除索引里已失效的工作区路径。
|
|
267
|
-
- 对于历史项目(尚未登记,或曾经 `--no-index` 跳过登记),可在该项目执行一次不带 `--no-index` 的 `ling update`(或 `ling init --force`)后纳入索引。
|
|
268
|
-
- 可通过 `ling exclude add/remove/list` 维护自定义排除路径(支持排除整棵目录树)。
|
|
269
|
-
- 也可通过环境变量 `LING_INDEX_PATH` 指定自定义索引路径。
|
|
270
|
-
|
|
271
|
-
### 开发维护命令
|
|
223
|
+
## 开发维护命令
|
|
272
224
|
|
|
273
225
|
```bash
|
|
274
226
|
npm run clean # 清理本地生成产物(如 web/.next、web/node_modules)
|
|
@@ -287,26 +239,17 @@ npm run lint
|
|
|
287
239
|
|
|
288
240
|
## 卸载
|
|
289
241
|
|
|
290
|
-
### 卸载本机全局 CLI
|
|
291
|
-
|
|
292
242
|
```bash
|
|
293
243
|
npm uninstall -g @mison/ling
|
|
294
244
|
```
|
|
295
245
|
|
|
296
|
-
|
|
246
|
+
旧包和上游旧包如已安装,可一并清理:
|
|
297
247
|
|
|
298
248
|
```bash
|
|
299
249
|
npm uninstall -g @mison/ag-kit-cn
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
如果你还安装过上游英文版,可一并清理:
|
|
303
|
-
|
|
304
|
-
```bash
|
|
305
250
|
npm uninstall -g antigravity-kit @vudovn/ag-kit
|
|
306
251
|
```
|
|
307
252
|
|
|
308
|
-
### 卸载某个项目内的灵轨
|
|
309
|
-
|
|
310
253
|
macOS / Linux / WSL:
|
|
311
254
|
|
|
312
255
|
```bash
|
|
@@ -331,13 +274,13 @@ rmdir /s /q .agents-backup
|
|
|
331
274
|
rmdir /s /q .codex
|
|
332
275
|
```
|
|
333
276
|
|
|
334
|
-
|
|
277
|
+
可选:把某个项目移出批量更新索引
|
|
335
278
|
|
|
336
279
|
```bash
|
|
337
280
|
ling exclude add --path /path/to/your-project
|
|
338
281
|
```
|
|
339
282
|
|
|
340
|
-
|
|
283
|
+
全局卸载只会移除 `ling` 命令,不会删除你本地 clone 的源码目录。
|
|
341
284
|
|
|
342
285
|
## 请我喝咖啡
|
|
343
286
|
|
package/bin/adapters/gemini.js
CHANGED
|
@@ -7,7 +7,11 @@ const GitHelper = require("../utils/git-helper");
|
|
|
7
7
|
|
|
8
8
|
class GeminiAdapter extends BaseAdapter {
|
|
9
9
|
get targetName() {
|
|
10
|
-
return "gemini";
|
|
10
|
+
return this.options.targetName || "gemini";
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
get targetLabel() {
|
|
14
|
+
return this.targetName === "antigravity" ? "Antigravity" : "Gemini";
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
getInstalledVersion() {
|
|
@@ -108,7 +112,7 @@ class GeminiAdapter extends BaseAdapter {
|
|
|
108
112
|
this.log(`[clean] 已从 .gitignore 移除 ${cleanupResult.removedCount} 条规则`);
|
|
109
113
|
}
|
|
110
114
|
|
|
111
|
-
this.log(
|
|
115
|
+
this.log(`[ok] [${this.targetLabel}] 安装完成 (.agent)`);
|
|
112
116
|
} finally {
|
|
113
117
|
if (cleanup) cleanup();
|
|
114
118
|
}
|
package/bin/core/generator.js
CHANGED
|
@@ -37,6 +37,7 @@ class RuleGenerator {
|
|
|
37
37
|
agentsMd += `1. Managed resources are synchronized under \`.agents/skills\`.\n`;
|
|
38
38
|
agentsMd += `2. Do not rename managed skill folders manually.\n`;
|
|
39
39
|
agentsMd += `3. Use \`ling doctor --target codex --fix\` to recover missing managed artifacts.\n`;
|
|
40
|
+
agentsMd += `4. If \`issues.csv\` exists, treat it as the task tracking source of truth and keep at most one task in \`进行中\`.\n`;
|
|
40
41
|
|
|
41
42
|
// 3. Generate risk controls
|
|
42
43
|
let lingRules = `# Ling Risk Controls (Codex Managed)\n\n`;
|