@unifan/pi-unifan-zh 1.0.13 → 1.0.14
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.md +171 -0
- package/CLAUDE.md +3 -0
- package/README.md +39 -34
- package/README_zh.md +40 -35
- package/extensions/review/package.json +1 -1
- package/extensions/review/src/directive.ts +2 -0
- package/package.json +1 -1
package/AGENTS.md
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# 📖 Pi Unifan 中文扩展套件开发与发布指南 (AGENTS.md)
|
|
2
|
+
|
|
3
|
+
> 本文档面向所有参与 `@unifan/pi-unifan-zh` 项目开发、维护与发版的 AI 智能体(Agents)及开发者。修改代码或发布版本前必须严格遵守本文档所列出的规范与铁律。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 🏗️ 一、项目架构与包结构
|
|
8
|
+
|
|
9
|
+
本项目是一个 Monorepo 架构的 Pi Coding Agent 中文扩展全家桶,包含 3 大核心扩展与技能库:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
pi-unifan-zh/
|
|
13
|
+
├── package.json # 聚合主包: @unifan/pi-unifan-zh
|
|
14
|
+
├── AGENTS.md # 本开发与维护规范指南
|
|
15
|
+
├── README_zh.md # 中文用户使用手册
|
|
16
|
+
├── extensions/
|
|
17
|
+
│ ├── sessions/ # ① 会话管理扩展 (/sessions)
|
|
18
|
+
│ │ ├── index.ts # 双栏实时预览 TUI 交互逻辑
|
|
19
|
+
│ │ ├── sessions.ts # 会话解析、时间格式化与搜索过滤
|
|
20
|
+
│ │ └── package.json
|
|
21
|
+
│ ├── review/ # ② 代码审查全能扩展 (/review, /review-lite, /review-perf, /review-full)
|
|
22
|
+
│ │ ├── index.ts # 斜杠命令注册与自动补全
|
|
23
|
+
│ │ ├── agents/ # 独立子代理提示词 (UTF-8 无 BOM)
|
|
24
|
+
│ │ │ ├── bugbot.md # 逻辑缺陷专家
|
|
25
|
+
│ │ │ ├── security-review.md # 安全隐患专家
|
|
26
|
+
│ │ │ ├── lite-review.md # 极速单兵审查官
|
|
27
|
+
│ │ │ ├── perf-review.md # 性能与基准测试专家
|
|
28
|
+
│ │ │ ├── gate.md # 门禁裁判长仲裁模型
|
|
29
|
+
│ │ │ ├── claude-md-compliance.md # 规范合规专家
|
|
30
|
+
│ │ │ ├── history-context.md # 历史上下文专家
|
|
31
|
+
│ │ │ └── code-comments.md # 注释检查专家
|
|
32
|
+
│ │ ├── src/
|
|
33
|
+
│ │ │ ├── directive.ts # 工作流脚本生成 (带自动重试与容错)
|
|
34
|
+
│ │ │ ├── review-run.ts # 运行编排与路由分发
|
|
35
|
+
│ │ │ ├── report.ts # 报告拼装与 Markdown 渲染
|
|
36
|
+
│ │ │ └── config.ts # 默认配置 (门禁模型继承 inherit)
|
|
37
|
+
│ │ └── package.json # 独立子包: @unifan/pi-review-zh
|
|
38
|
+
│ └── commit/ # ③ 智能 Git 提交助手 (/commit, /commit-push)
|
|
39
|
+
│ ├── index.ts # 一键提交与推流命令
|
|
40
|
+
│ ├── src/
|
|
41
|
+
│ │ ├── git.ts # Git 执行引擎 (含自动变基 pull --rebase)
|
|
42
|
+
│ │ └── prompt.ts # Conventional Commits 中文提示词
|
|
43
|
+
│ └── package.json # 独立子包: @unifan/pi-commit-zh
|
|
44
|
+
└── skills/ # 内置专业技能集
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 🛡️ 二、开发规范与核心铁律(Hard Rules)
|
|
50
|
+
|
|
51
|
+
参与本仓库开发时,**必须严格遵守以下 5 条铁律**:
|
|
52
|
+
|
|
53
|
+
### 1. 纯正中文语言约束(Strict Chinese Output)
|
|
54
|
+
* 所有面向用户的 UI 交互、待办清单(Checklist)、状态通知(Notify)、错误提示、TUI 卡片以及 Subagent 的 System Prompt,**必须 100% 使用纯正中文**。
|
|
55
|
+
* 严禁夹杂未经翻译的英文模板或生硬机翻长句。
|
|
56
|
+
|
|
57
|
+
### 2. Windows 环境 UTF-8 严禁带 BOM(Zero UTF-8 BOM Rule)
|
|
58
|
+
* **背景**:Windows PowerShell 默认的 `[System.Text.Encoding]::UTF8` 会写入 3 字节的 BOM 头(`0xEF 0xBB 0xBF`),这会导致 Pi 的 YAML Frontmatter 解析器失效,将所有 Subagent 识别为未知代理。
|
|
59
|
+
* **规则**:生成或修改任何 `.md`、`.ts`、`.json` 文件时,**必须显式使用无 BOM 的 UTF-8 编码**:
|
|
60
|
+
```powershell
|
|
61
|
+
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
|
|
62
|
+
[System.IO.File]::WriteAllText($filePath, $content, $utf8NoBom)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### 3. 模型自适应继承(Model Inheritance & No Hardcoding)
|
|
66
|
+
* **严禁硬编码特定模型**:Subagent 与门禁裁判长(Gate)的默认模型必须设置为 `"inherit"`,以自动跟随用户主会话所使用的模型(如 Gemini、OpenAI、Claude、DeepSeek、代理渠道等)。
|
|
67
|
+
* **严禁硬编码 `thinking: "low"`**:部分模型不支持分档思考,强制注入 `"low"` 会导致 `pi-subagents` 抛出 `No usable subagent models remain` 错误。
|
|
68
|
+
|
|
69
|
+
### 4. Git 提交信息标准(Conventional Commits 1.0.0)
|
|
70
|
+
* **格式**:`<type>(<scope>): <中文描述>` 或 `<type>: <中文描述>`
|
|
71
|
+
* **标点约束**:括号 `()` 与冒号空格 `: ` **必须严格使用半角英文符号**(严禁全角符号,以保证 CI / Commitlint 正则解析)。
|
|
72
|
+
* **严禁 Emoji**:保持严肃、专业的纯文本工程风格。
|
|
73
|
+
* **11 大标准分类**:
|
|
74
|
+
* `feat`: 新增功能/新模块
|
|
75
|
+
* `fix`: 修复Bug/缺陷
|
|
76
|
+
* `perf`: 性能优化/降低GC/提高帧率
|
|
77
|
+
* `refactor`: 代码重构
|
|
78
|
+
* `ci`: CI/CD持续集成与工作流
|
|
79
|
+
* `build`: 构建系统与依赖包
|
|
80
|
+
* `chore`: 杂项与版本升级(如 `chore(release): 升级版本号至 vX.Y.Z`)
|
|
81
|
+
* `docs`: 文档/注释
|
|
82
|
+
* `test`: 单元测试/基准测试
|
|
83
|
+
* `style`: 代码格式调整
|
|
84
|
+
* `revert`: 代码回滚
|
|
85
|
+
|
|
86
|
+
### 5. 多 Agent 容错与重试保护(Fault Tolerance)
|
|
87
|
+
* **网络抖动重试**:`runs.all` 并发调用必须包裹 `try-catch` 并在发生网络断连时自动延迟 800ms 重试一次。
|
|
88
|
+
* **门禁熔断保护**:门禁裁判长(Gate)发生异常时必须兜底捕获,**绝对不能抛出未捕获异常导致已完成的 Reviewer 成果丢失**。
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## 🚀 三、发版与发布指南(Release & Publish Workflow)
|
|
93
|
+
|
|
94
|
+
当完成功能开发、修复或提示词更新后,严格按照以下步骤完成发版:
|
|
95
|
+
|
|
96
|
+
### 1. 本地代码检查与 BOM 修复
|
|
97
|
+
```powershell
|
|
98
|
+
$utf8NoBom = New-Object System.Text.UTF8Encoding($false)
|
|
99
|
+
Get-ChildItem -Path "D:\program\my\pi-unifan-zh" -Recurse -Include "*.md","*.ts","*.json" | ForEach-Object {
|
|
100
|
+
$bytes = [System.IO.File]::ReadAllBytes($_.FullName)
|
|
101
|
+
if ($bytes.Length -ge 3 -and $bytes[0] -eq 0xEF -and $bytes[1] -eq 0xBB -and $bytes[2] -eq 0xBF) {
|
|
102
|
+
$content = [System.IO.File]::ReadAllText($_.FullName)
|
|
103
|
+
if ($content.StartsWith([char]0xFEFF)) { $content = $content.Substring(1) }
|
|
104
|
+
[System.IO.File]::WriteAllText($_.FullName, $content, $utf8NoBom)
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 2. Git 提交业务改动
|
|
110
|
+
```bash
|
|
111
|
+
git add .
|
|
112
|
+
git commit -m "feat(xxx): 描述本次修改内容"
|
|
113
|
+
git push origin main
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### 3. npm Monorepo 批量版本升级与发布
|
|
117
|
+
```powershell
|
|
118
|
+
# 1. 升级并发布根主包 (@unifan/pi-unifan-zh)
|
|
119
|
+
cd D:\program\my\pi-unifan-zh
|
|
120
|
+
npm version patch
|
|
121
|
+
npm publish --access public
|
|
122
|
+
|
|
123
|
+
# 2. 升级并发布 review 子包 (@unifan/pi-review-zh)(如有修改)
|
|
124
|
+
cd D:\program\my\pi-unifan-zh\extensions\review
|
|
125
|
+
npm version patch
|
|
126
|
+
npm publish --access public
|
|
127
|
+
|
|
128
|
+
# 3. 升级并发布 commit 子包 (@unifan/pi-commit-zh)(如有修改)
|
|
129
|
+
cd D:\program\my\pi-unifan-zh\extensions\commit
|
|
130
|
+
npm version patch
|
|
131
|
+
npm publish --access public
|
|
132
|
+
|
|
133
|
+
# 4. 提交版本号变更到 Git 远端
|
|
134
|
+
cd D:\program\my\pi-unifan-zh
|
|
135
|
+
git add .
|
|
136
|
+
git commit -m "chore(release): 升级版本号至 vX.Y.Z"
|
|
137
|
+
git push origin main
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### 4. 本地环境即时同步验证
|
|
141
|
+
发布成功后,在本地 Pi 环境中执行更新命令,验证最新功能:
|
|
142
|
+
```bash
|
|
143
|
+
pi update npm:@unifan/pi-unifan-zh
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## ⌨️ 四、常用测试与验证命令
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
# 测试会话管理器
|
|
152
|
+
/sessions
|
|
153
|
+
|
|
154
|
+
# 测试极速代码审查
|
|
155
|
+
/review-lite
|
|
156
|
+
|
|
157
|
+
# 测试性能专项审查
|
|
158
|
+
/review-perf
|
|
159
|
+
|
|
160
|
+
# 测试日常代码审查 (3专家)
|
|
161
|
+
/review
|
|
162
|
+
|
|
163
|
+
# 测试全量深度审查 (6专家)
|
|
164
|
+
/review-full
|
|
165
|
+
|
|
166
|
+
# 测试智能代码提交
|
|
167
|
+
/commit
|
|
168
|
+
|
|
169
|
+
# 测试智能提交并自动推流
|
|
170
|
+
/commit-push
|
|
171
|
+
```
|
package/CLAUDE.md
ADDED
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A high-quality collection of Chinese-localized extensions and skills for **Pi Co
|
|
|
4
4
|
|
|
5
5
|
Supports both **All-in-One Bundle Installation** and **Individual Single-Package Installation**.
|
|
6
6
|
|
|
7
|
-
[
|
|
7
|
+
[中文说明文档 (Chinese Documentation)](./README_zh.md) | [开发与发版指南 (Developer & Agent Guide)](./AGENTS.md)
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
@@ -14,11 +14,13 @@ Supports both **All-in-One Bundle Installation** and **Individual Single-Package
|
|
|
14
14
|
pi-unifan-zh/
|
|
15
15
|
├── package.json # Root bundle manifest (all-in-one install)
|
|
16
16
|
├── tsconfig.json # TypeScript configuration
|
|
17
|
+
├── AGENTS.md # Developer and AI agent guidelines
|
|
17
18
|
├── README.md # English Documentation
|
|
18
19
|
├── README_zh.md # Chinese Documentation
|
|
19
20
|
├── extensions/ # 📦 Individual Extension Packages
|
|
20
|
-
│ ├── sessions/ # 📜 Dual-pane session manager with live preview (Chinese)
|
|
21
|
-
│
|
|
21
|
+
│ ├── sessions/ # 📜 ① Dual-pane session manager with live preview (Chinese)
|
|
22
|
+
│ ├── review/ # 🔍 ② AI multi-agent code review suite (Daily/Lite/Perf/Full)
|
|
23
|
+
│ └── commit/ # 📦 ③ Intelligent Conventional Commits assistant (Chinese)
|
|
22
24
|
└── skills/ # 🎯 Custom prompt skills library
|
|
23
25
|
```
|
|
24
26
|
|
|
@@ -26,14 +28,14 @@ pi-unifan-zh/
|
|
|
26
28
|
|
|
27
29
|
## 🚀 Installation Guide
|
|
28
30
|
|
|
29
|
-
### Option A: All-in-One Bundle Install
|
|
31
|
+
### Option A: All-in-One Bundle Install (Recommended ⭐)
|
|
30
32
|
|
|
31
|
-
#### 1. Via npm
|
|
33
|
+
#### 1. Via npm:
|
|
32
34
|
```bash
|
|
33
35
|
pi install npm:@unifan/pi-unifan-zh
|
|
34
36
|
```
|
|
35
37
|
|
|
36
|
-
#### 2. Via GitHub
|
|
38
|
+
#### 2. Via GitHub:
|
|
37
39
|
```bash
|
|
38
40
|
pi install git:github.com/821869798/pi-unifan-zh
|
|
39
41
|
```
|
|
@@ -49,20 +51,17 @@ pi install D:/program/my/pi-unifan-zh
|
|
|
49
51
|
|
|
50
52
|
#### 1. Install `sessions` (Session Manager with TUI Preview):
|
|
51
53
|
```bash
|
|
52
|
-
# npm:
|
|
53
54
|
pi install npm:@unifan/pi-sessions-zh
|
|
54
|
-
|
|
55
|
-
# Local:
|
|
56
|
-
pi install D:/program/my/pi-unifan-zh/extensions/sessions
|
|
57
55
|
```
|
|
58
56
|
|
|
59
|
-
#### 2. Install `review` (AI Parallel Code Review):
|
|
57
|
+
#### 2. Install `review` (AI Parallel Code Review Suite):
|
|
60
58
|
```bash
|
|
61
|
-
# npm:
|
|
62
59
|
pi install npm:@unifan/pi-review-zh
|
|
60
|
+
```
|
|
63
61
|
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
#### 3. Install `commit` (Intelligent Git Commit Assistant):
|
|
63
|
+
```bash
|
|
64
|
+
pi install npm:@unifan/pi-commit-zh
|
|
66
65
|
```
|
|
67
66
|
|
|
68
67
|
---
|
|
@@ -86,34 +85,40 @@ pi install D:/program/my/pi-unifan-zh/extensions/review
|
|
|
86
85
|
|
|
87
86
|
---
|
|
88
87
|
|
|
89
|
-
### 2. 🔍 `review` (AI
|
|
90
|
-
- **
|
|
91
|
-
- **`/review
|
|
92
|
-
- **`/review
|
|
93
|
-
- **`/review
|
|
88
|
+
### 2. 🔍 `review` (AI Code Review Suite)
|
|
89
|
+
- **Review Modes**:
|
|
90
|
+
- **`/review-lite`** ⭐ **(Recommended for daily development)**: Fast single-agent review pass in 2~3s, highly token-efficient.
|
|
91
|
+
- **`/review-perf`** 🔥 **(Performance & Benchmark Reviewer)**: Deep-dive inspection for GC allocation, hot loops, algorithmic complexity, and benchmark probes.
|
|
92
|
+
- **`/review`** 🔍 **(Daily 3-Expert Review)**: Bugbot + Security + Compliance + Gatekeeper with low latency.
|
|
93
|
+
- **`/review-full`** 🏥 **(Full 6-Expert Consultation)**: Full multi-agent parallel audit (ideal for major releases and PR merges).
|
|
94
|
+
- **Utility Commands**:
|
|
94
95
|
- **`/review-show`**: Re-render the most recent review report.
|
|
95
96
|
- **`/review-agents`**: View reviewer agents and models status.
|
|
96
97
|
- **`/review-config`**: Edit review configuration.
|
|
97
|
-
- **Features**:
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
- **100%
|
|
98
|
+
- **Key Features**:
|
|
99
|
+
- **Model Inheritance**: Gate automatically inherits the active session model (`inherit`), avoiding missing model errors.
|
|
100
|
+
- **Fault Tolerance & Auto-Retry**: Automatically retries on transient stream drops and preserves all completed reviewer findings even if the gate fails.
|
|
101
|
+
- **100% Fluent Chinese Output**.
|
|
101
102
|
|
|
102
103
|
---
|
|
103
104
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
105
|
+
### 3. 📦 `commit` (Intelligent Conventional Commits Assistant)
|
|
106
|
+
- **Commands**:
|
|
107
|
+
- **`/commit`**: Analyzes `git diff`, generates standardized Conventional Commits in fluent Chinese, and commits in 1 second.
|
|
108
|
+
- **`/commit-push`** 🚀: Generates Chinese commit and automatically executes `git push` to remote.
|
|
109
|
+
- **Usage & Flags**:
|
|
110
|
+
- `/commit`: Smart commit (commits staged changes if staged, or auto-stages all if unstaged).
|
|
111
|
+
- `/commit -a` / `/commit --all`: Auto-stages all workspace changes (`git add -A`) and commits.
|
|
112
|
+
- `/commit <hint>`: Guides commit message generation with user instructions.
|
|
113
|
+
- **Key Engineering Standards**:
|
|
114
|
+
- **11 Standard Types**: `feat`, `fix`, `perf`, `refactor`, `ci`, `build`, `chore`, `docs`, `test`, `style`, `revert`.
|
|
115
|
+
- **Strict ASCII Punctuation**: Parentheses `()` and colon `: ` strictly use ASCII half-width characters for CI / Commitlint compliance.
|
|
116
|
+
- **No Emoji**: Clean, professional plain text commit style.
|
|
117
|
+
- **Smart Auto-Rebase on Push**: In `/commit-push`, if remote contains unpulled commits, it automatically runs `git pull --rebase` and retries push, keeping a clean linear git history.
|
|
118
|
+
- **Unpushed Commits Sync**: Automatically pushes unpushed local commits even if the working tree is clean.
|
|
114
119
|
|
|
115
120
|
---
|
|
116
121
|
|
|
117
122
|
## 📄 License
|
|
118
123
|
|
|
119
|
-
MIT License
|
|
124
|
+
MIT License.
|
package/README_zh.md
CHANGED
|
@@ -12,12 +12,14 @@
|
|
|
12
12
|
pi-unifan-zh/
|
|
13
13
|
├── package.json # 根包配置(支持整包一键安装)
|
|
14
14
|
├── tsconfig.json # TypeScript 配置
|
|
15
|
+
├── AGENTS.md # 开发者与智能体规范指南
|
|
15
16
|
├── README.md # English Documentation
|
|
16
17
|
├── README_zh.md # 中文说明文档
|
|
17
18
|
├── extensions/ # 📦 独立插件集
|
|
18
|
-
│ ├── sessions/ # 📜 历史会话管理器(双栏实时预览与恢复·中文增强版)
|
|
19
|
-
│
|
|
20
|
-
└──
|
|
19
|
+
│ ├── sessions/ # 📜 ① 历史会话管理器(双栏实时预览与恢复·中文增强版)
|
|
20
|
+
│ ├── review/ # 🔍 ② AI 代码审查套件(日常3专家 / 极速单兵 / 性能探针 / 全量会诊)
|
|
21
|
+
│ └── commit/ # 📦 ③ 智能 Git 提交助手(Conventional Commits 纯中文规范版)
|
|
22
|
+
└── skills/ # 🎯 自定义技能库
|
|
21
23
|
```
|
|
22
24
|
|
|
23
25
|
---
|
|
@@ -26,12 +28,12 @@ pi-unifan-zh/
|
|
|
26
28
|
|
|
27
29
|
### 模式 A:一键安装整包(包含所有插件与技能)
|
|
28
30
|
|
|
29
|
-
#### 1. 通过 npm
|
|
31
|
+
#### 1. 通过 npm 在线安装(推荐 ⭐):
|
|
30
32
|
```bash
|
|
31
33
|
pi install npm:@unifan/pi-unifan-zh
|
|
32
34
|
```
|
|
33
35
|
|
|
34
|
-
#### 2. 通过 GitHub
|
|
36
|
+
#### 2. 通过 GitHub 远程在线安装:
|
|
35
37
|
```bash
|
|
36
38
|
pi install git:github.com/821869798/pi-unifan-zh
|
|
37
39
|
```
|
|
@@ -47,25 +49,22 @@ pi install D:/program/my/pi-unifan-zh
|
|
|
47
49
|
|
|
48
50
|
#### 1. 仅安装 `sessions`(历史会话管理器·中文版):
|
|
49
51
|
```bash
|
|
50
|
-
# npm 在线安装:
|
|
51
52
|
pi install npm:@unifan/pi-sessions-zh
|
|
52
|
-
|
|
53
|
-
# 本地安装:
|
|
54
|
-
pi install D:/program/my/pi-unifan-zh/extensions/sessions
|
|
55
53
|
```
|
|
56
54
|
|
|
57
|
-
#### 2. 仅安装 `review`(AI
|
|
55
|
+
#### 2. 仅安装 `review`(AI 代码审查系统·中文版):
|
|
58
56
|
```bash
|
|
59
|
-
# npm 在线安装:
|
|
60
57
|
pi install npm:@unifan/pi-review-zh
|
|
58
|
+
```
|
|
61
59
|
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
#### 3. 仅安装 `commit`(智能 Git 提交助手·中文版):
|
|
61
|
+
```bash
|
|
62
|
+
pi install npm:@unifan/pi-commit-zh
|
|
64
63
|
```
|
|
65
64
|
|
|
66
65
|
---
|
|
67
66
|
|
|
68
|
-
## 📦
|
|
67
|
+
## 📦 扩展功能与核心命令
|
|
69
68
|
|
|
70
69
|
### 1. 📜 `sessions`(历史会话管理器·中文版)
|
|
71
70
|
- **命令**:`/sessions`
|
|
@@ -85,34 +84,40 @@ pi install D:/program/my/pi-unifan-zh/extensions/review
|
|
|
85
84
|
|
|
86
85
|
---
|
|
87
86
|
|
|
88
|
-
### 2. 🔍 `review`(AI
|
|
89
|
-
-
|
|
90
|
-
- **`/review
|
|
91
|
-
- **`/review
|
|
92
|
-
- **`/review
|
|
87
|
+
### 2. 🔍 `review`(AI 并发代码审查套件·中文版)
|
|
88
|
+
- **四大审查命令模式**:
|
|
89
|
+
- **`/review-lite`** ⭐ **(极速单兵审查,强烈推荐日常使用)**:单 AI 快速体检,2~3 秒出结果,极度省时省 Token。
|
|
90
|
+
- **`/review-perf`** 🔥 **(专项性能审查与基准测试)**:专项深度排查 GC 堆内存分配、Update/帧循环热点、算法复杂度与 Benchmark 探针。
|
|
91
|
+
- **`/review`** 🔍 **(日常 3 大核心专家审查)**:Bug 猎手 + 安全审查 + 规范合规 + 门禁裁判长(低延迟抗超时)。
|
|
92
|
+
- **`/review-full`** 🏥 **(全量 6 专家深度会诊)**:全套专家并发会诊(适合重大 PR 与版本合并,支持 `--full`)。
|
|
93
|
+
- **辅助命令**:
|
|
93
94
|
- **`/review-show`**:重新查看最近一次的代码审查报告。
|
|
94
95
|
- **`/review-agents`**:查看各专家代理状态与模型分配。
|
|
95
96
|
- **`/review-config`**:编辑审查配置文件。
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
97
|
+
- **核心亮点**:
|
|
98
|
+
- **门禁自适应继承**:门禁裁判长(Gate)自适应继承当前主会话模型,绝不报错 `Unknown subagent model`。
|
|
99
|
+
- **自动网络重试与熔断保护**:并发网络抖动自动重试,即使门禁异常也能完整保留前面所有专家的审查成果,绝不浪费 Token!
|
|
100
|
+
- **报告 100% 纯正中文输出**。
|
|
100
101
|
|
|
101
102
|
---
|
|
102
103
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
104
|
+
### 3. 📦 `commit`(智能 Git 提交助手·中文版)
|
|
105
|
+
- **命令**:
|
|
106
|
+
- **`/commit`**:自动分析暂存区/工作区代码变动(`git diff`),生成标准的 Conventional Commits 纯中文提交信息并 1 秒完成提交。
|
|
107
|
+
- **`/commit-push`** 🚀:自动生成中文 Commit 提交,并**自动执行 `git push` 推送**到远端分支。
|
|
108
|
+
- **常用参数与用法**:
|
|
109
|
+
- `/commit`:智能提交(有暂存只提暂存,无暂存自动暂存全量)。
|
|
110
|
+
- `/commit -a` 或 `/commit --all`:自动强制暂存所有工作区修改(`git add -A`)并提交。
|
|
111
|
+
- `/commit 修复了技能释放异常`:带提示词定向引导生成提交信息。
|
|
112
|
+
- **核心工程规范**:
|
|
113
|
+
- **11 大标准分类**:`feat`, `fix`, `perf`, `refactor`, `ci`, `build`, `chore`, `docs`, `test`, `style`, `revert`。
|
|
114
|
+
- **严格半角英文标点**:括号 `()` 与冒号空格 `: ` 严格使用英文半角字符,确保 CI / Commitlint 正则解析合规。
|
|
115
|
+
- **严禁 Emoji**:保持严谨、专业的纯文本工程风格。
|
|
116
|
+
- **智能自动变基(Auto Rebase)**:在 `/commit-push` 时,若远端有别人先提交的代码被拒绝,**自动在后台执行 `git pull --rebase` 变基并自动重试推送**,Git 历史保持一条干净直线!
|
|
117
|
+
- **未推送提交自动同步**:即使当前工作区干净,若检测到本地有尚未 push 的历史 Commit,`/commit-push` 也会自动将其推送至远端!
|
|
113
118
|
|
|
114
119
|
---
|
|
115
120
|
|
|
116
|
-
## 📄
|
|
121
|
+
## 📄 开源许可证
|
|
117
122
|
|
|
118
|
-
MIT License
|
|
123
|
+
本项目基于 [MIT License](./LICENSE) 协议开源。
|
|
@@ -237,6 +237,8 @@ export function buildWorkflowScript(input: {
|
|
|
237
237
|
const READ_ONLY_PREFIX =
|
|
238
238
|
"只读任务(READ-ONLY)——仅执行审查分析与基准测试。严禁修改源码文件。仅返回审查发现。所有分析总结、问题描述与建议必须使用纯正中文。";
|
|
239
239
|
|
|
240
|
+
const lines: string[] = [];
|
|
241
|
+
lines.push("");
|
|
240
242
|
lines.push("let reviewers;");
|
|
241
243
|
lines.push("try {");
|
|
242
244
|
lines.push(" reviewers = await runs.all([");
|