@mison/ling 1.1.0 → 1.1.1
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 +15 -1
- package/bin/core/generator.js +1 -0
- package/bin/ling-cli.js +590 -76
- package/bin/utils.js +52 -9
- package/docs/TECH.md +21 -6
- package/package.json +1 -1
- package/tests/spec-init-doctor.test.js +175 -0
- package/tests/spec-profile.test.js +68 -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,19 @@
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [ling-1.1.1] - 2026-03-14
|
|
11
|
+
|
|
12
|
+
### 新增
|
|
13
|
+
|
|
14
|
+
- Spec 项目级工作区初始化与诊断:新增 `ling spec init` / `ling spec doctor`,在工作区落盘 `.ling/spec` 资产与 `issues.csv` 校验。
|
|
15
|
+
- Spec Profiles 资产:全局与项目级均包含 `profiles/`,并纳入完整性校验与回退语义。
|
|
16
|
+
- Spec 资产分支拉取:`ling spec init --branch <name>` 支持从指定分支的 `.spec/` 拉取 templates/references/profiles。
|
|
17
|
+
|
|
18
|
+
### 变更
|
|
19
|
+
|
|
20
|
+
- Spec 状态判定强化:`ling spec status` 增加文件级完整性校验,且在 `state.json` 缺失但检测到残留 artifacts 时返回 `broken` 并给出修复提示。
|
|
21
|
+
- CI 改为 npm:CI 矩阵不再依赖 bun,统一使用 `npm ci/test/run` 执行验证。
|
|
22
|
+
|
|
10
23
|
## [ling-1.1.0] - 2026-03-13
|
|
11
24
|
|
|
12
25
|
### 新增
|
|
@@ -67,7 +80,8 @@
|
|
|
67
80
|
|
|
68
81
|
本项目在 Ling 重启前的 2.x/3.x 版本记录已冻结,不再维护。
|
|
69
82
|
|
|
70
|
-
[Unreleased]: https://github.com/MisonL/Ling/compare/ling-1.1.
|
|
83
|
+
[Unreleased]: https://github.com/MisonL/Ling/compare/ling-1.1.1...HEAD
|
|
84
|
+
[ling-1.1.1]: https://github.com/MisonL/Ling/releases/tag/ling-1.1.1
|
|
71
85
|
[ling-1.1.0]: https://github.com/MisonL/Ling/releases/tag/ling-1.1.0
|
|
72
86
|
[ling-1.0.2]: https://github.com/MisonL/Ling/releases/tag/ling-1.0.2
|
|
73
87
|
[ling-1.0.1]: https://github.com/MisonL/Ling/releases/tag/ling-1.0.1
|
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`;
|