@unifan/pi-unifan-zh 1.0.0 → 1.0.2
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/README.md +76 -68
- package/README_zh.md +118 -0
- package/extensions/review/README.md +1 -1
- package/extensions/review/agents/bugbot.md +23 -27
- package/extensions/review/agents/claude-md-compliance.md +13 -31
- package/extensions/review/agents/code-comments.md +8 -28
- package/extensions/review/agents/gate.md +25 -42
- package/extensions/review/agents/history-context.md +14 -30
- package/extensions/review/agents/lite-review.md +18 -25
- package/extensions/review/agents/security-review.md +18 -28
- package/extensions/review/index.ts +1 -1
- package/extensions/review/package.json +3 -3
- package/extensions/review/src/report.ts +1 -1
- package/extensions/review/src/tui-renderer.ts +1 -1
- package/extensions/sessions/README.md +1 -1
- package/extensions/sessions/index.ts +1 -1
- package/extensions/sessions/package.json +1 -2
- package/extensions/sessions/sessions.ts +1 -1
- package/package.json +1 -2
- package/skills/README.md +1 -1
package/README.md
CHANGED
|
@@ -1,111 +1,119 @@
|
|
|
1
|
-
|
|
1
|
+
# 🌟 pi-unifan-zh (Pi Chinese Extensions Collection & Monorepo)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A high-quality collection of Chinese-localized extensions and skills for **Pi Coding Agent**.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Supports both **All-in-One Bundle Installation** and **Individual Single-Package Installation**.
|
|
6
|
+
|
|
7
|
+
[中文文档 (Chinese Documentation)](./README_zh.md)
|
|
6
8
|
|
|
7
9
|
---
|
|
8
10
|
|
|
9
|
-
## 📁
|
|
11
|
+
## 📁 Repository Structure
|
|
10
12
|
|
|
11
13
|
```text
|
|
12
14
|
pi-unifan-zh/
|
|
13
|
-
├── package.json #
|
|
14
|
-
├── tsconfig.json # TypeScript
|
|
15
|
-
├── .
|
|
16
|
-
├──
|
|
17
|
-
├── extensions/ # 📦
|
|
18
|
-
│ ├── sessions/ # 📜
|
|
19
|
-
│
|
|
20
|
-
|
|
21
|
-
│ │ ├── sessions.ts # 会话数据提取与格式化
|
|
22
|
-
│ │ └── README.md # 插件说明
|
|
23
|
-
│ └── review/ # 🔍 AI 并发代码审查(5 专家并发 + 门禁裁判·中文增强版)
|
|
24
|
-
│ ├── package.json # 独立包配置
|
|
25
|
-
│ ├── index.ts # 命令入口与工作流注册
|
|
26
|
-
│ ├── agents/ # 6 大专家与门禁 Prompt 定义
|
|
27
|
-
│ ├── src/ # 核心审查逻辑与中文报告渲染器
|
|
28
|
-
│ └── README.md # 插件说明
|
|
29
|
-
└── skills/ # 🎯 自定义技能目录(存放自定义 SKILL.md)
|
|
30
|
-
└── README.md
|
|
15
|
+
├── package.json # Root bundle manifest (all-in-one install)
|
|
16
|
+
├── tsconfig.json # TypeScript configuration
|
|
17
|
+
├── README.md # English Documentation
|
|
18
|
+
├── README_zh.md # Chinese Documentation
|
|
19
|
+
├── extensions/ # 📦 Individual Extension Packages
|
|
20
|
+
│ ├── sessions/ # 📜 Dual-pane session manager with live preview (Chinese)
|
|
21
|
+
│ └── review/ # 🔍 Multi-agent parallel code review & gate arbiter (Chinese)
|
|
22
|
+
└── skills/ # 🎯 Custom prompt skills library
|
|
31
23
|
```
|
|
32
24
|
|
|
33
25
|
---
|
|
34
26
|
|
|
35
|
-
## 🚀
|
|
27
|
+
## 🚀 Installation Guide
|
|
28
|
+
|
|
29
|
+
### Option A: All-in-One Bundle Install
|
|
36
30
|
|
|
37
|
-
|
|
31
|
+
#### 1. Via npm (Online):
|
|
32
|
+
```bash
|
|
33
|
+
pi install npm:@unifan/pi-unifan-zh
|
|
34
|
+
```
|
|
38
35
|
|
|
39
|
-
####
|
|
36
|
+
#### 2. Via GitHub (Online & Up-to-date):
|
|
40
37
|
```bash
|
|
41
38
|
pi install git:github.com/821869798/pi-unifan-zh
|
|
42
39
|
```
|
|
43
40
|
|
|
44
|
-
####
|
|
41
|
+
#### 3. Local Installation:
|
|
45
42
|
```bash
|
|
46
43
|
pi install D:/program/my/pi-unifan-zh
|
|
47
44
|
```
|
|
48
45
|
|
|
49
46
|
---
|
|
50
47
|
|
|
51
|
-
###
|
|
48
|
+
### Option B: Install Individual Extensions
|
|
52
49
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
#### 1. 仅安装 `sessions`(历史会话管理器·中文版):
|
|
50
|
+
#### 1. Install `sessions` (Session Manager with TUI Preview):
|
|
56
51
|
```bash
|
|
52
|
+
# npm:
|
|
53
|
+
pi install npm:@unifan/pi-sessions-zh
|
|
54
|
+
|
|
55
|
+
# Local:
|
|
57
56
|
pi install D:/program/my/pi-unifan-zh/extensions/sessions
|
|
58
57
|
```
|
|
59
58
|
|
|
60
|
-
#### 2.
|
|
59
|
+
#### 2. Install `review` (AI Parallel Code Review):
|
|
61
60
|
```bash
|
|
61
|
+
# npm:
|
|
62
|
+
pi install npm:@unifan/pi-review-zh
|
|
63
|
+
|
|
64
|
+
# Local:
|
|
62
65
|
pi install D:/program/my/pi-unifan-zh/extensions/review
|
|
63
66
|
```
|
|
64
67
|
|
|
65
68
|
---
|
|
66
69
|
|
|
67
|
-
## 📦
|
|
68
|
-
|
|
69
|
-
### 1. 📜 `sessions
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
- `/review-agents`:查看各专家代理状态与模型分配。
|
|
84
|
-
- **特性**:
|
|
85
|
-
- 5 个专业 AI 审查专家(Bug、安全、规范、历史回归、注释)并发排查。
|
|
86
|
-
- 1 个门禁总裁判(Gate AI)智能去重并过滤误报,给出最终裁决。
|
|
87
|
-
- 报告全中文结构化展示(致命阻断 / 严重 / 次要 / 细节优化)。
|
|
70
|
+
## 📦 Features & Commands
|
|
71
|
+
|
|
72
|
+
### 1. 📜 `sessions` (Session Picker & Live Preview)
|
|
73
|
+
- **Command**: `/sessions`
|
|
74
|
+
- **Features**:
|
|
75
|
+
- Full-screen dual-pane TUI view with live conversation preview.
|
|
76
|
+
- Formatted badges for `◆ User`, `● Assistant`, `◌ Thinking`, and tool outputs.
|
|
77
|
+
- Fully localized Chinese interface and relative timestamps.
|
|
78
|
+
- **Shortcuts**:
|
|
79
|
+
- `Enter`: Switch to and restore selected session.
|
|
80
|
+
- `t`: Expand / collapse tool output.
|
|
81
|
+
- `h`: Toggle model thinking visibility.
|
|
82
|
+
- `Tab`: Switch focus between session list and preview pane.
|
|
83
|
+
- `PgUp` / `PgDn`: Scroll preview pane.
|
|
84
|
+
- `Ctrl+T` / `Alt+W`: Toggle all workspaces / current project.
|
|
85
|
+
- `Esc`: Exit picker.
|
|
88
86
|
|
|
89
87
|
---
|
|
90
88
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
89
|
+
### 2. 🔍 `review` (AI Multi-Agent Code Review)
|
|
90
|
+
- **Commands**:
|
|
91
|
+
- **`/review --lite`** ⭐ **(Recommended for daily development)**: Fast single-agent review pass in 3~5s, highly token-efficient.
|
|
92
|
+
- **`/review`**: Full 5-agent parallel fan-out review with gatekeeper arbitration (ideal before PR merges).
|
|
93
|
+
- **`/review <prompt>`**: Targeted review with custom focus.
|
|
94
|
+
- **`/review-show`**: Re-render the most recent review report.
|
|
95
|
+
- **`/review-agents`**: View reviewer agents and models status.
|
|
96
|
+
- **`/review-config`**: Edit review configuration.
|
|
97
|
+
- **Features**:
|
|
98
|
+
- 5 parallel AI specialist reviewers (`bugbot`, `security-review`, `claude-md-compliance`, `history-context`, `code-comments`).
|
|
99
|
+
- 1 inline Gatekeeper AI (`gate`) that dedupes and filters false alarms (<8 confidence threshold).
|
|
100
|
+
- **100% fluent Chinese report and finding descriptions**.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 🔄 Updating Extensions
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# Update all installed extensions:
|
|
108
|
+
pi update --extensions
|
|
109
|
+
|
|
110
|
+
# Or update specific extension:
|
|
111
|
+
pi update npm:@unifan/pi-unifan-zh
|
|
112
|
+
pi update git:github.com/821869798/pi-unifan-zh
|
|
113
|
+
```
|
|
106
114
|
|
|
107
115
|
---
|
|
108
116
|
|
|
109
|
-
## 📄
|
|
117
|
+
## 📄 License
|
|
110
118
|
|
|
111
119
|
MIT License
|
package/README_zh.md
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# 🌟 pi-unifan-zh (Pi 中文扩展全家桶与独立插件库)
|
|
2
|
+
|
|
3
|
+
专为 **Pi Coding Agent** 打造的高质量中文扩展合集与独立插件库。
|
|
4
|
+
|
|
5
|
+
支持 **“全家桶一键整包安装”** 与 **“按需单个插件独立安装”** 双模式架构。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 📁 目录结构
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
pi-unifan-zh/
|
|
13
|
+
├── package.json # 根包配置(支持整包一键安装)
|
|
14
|
+
├── tsconfig.json # TypeScript 配置
|
|
15
|
+
├── README.md # English Documentation
|
|
16
|
+
├── README_zh.md # 中文说明文档
|
|
17
|
+
├── extensions/ # 📦 独立插件集
|
|
18
|
+
│ ├── sessions/ # 📜 历史会话管理器(双栏实时预览与恢复·中文增强版)
|
|
19
|
+
│ └── review/ # 🔍 AI 并发代码审查(5 专家并发 + 门禁裁判·中文增强版)
|
|
20
|
+
└── skills/ # 🎯 自定义技能库(存放自定义 SKILL.md)
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## 🚀 安装指南
|
|
26
|
+
|
|
27
|
+
### 模式 A:一键安装整包(包含所有插件与技能)
|
|
28
|
+
|
|
29
|
+
#### 1. 通过 npm 在线安装:
|
|
30
|
+
```bash
|
|
31
|
+
pi install npm:@unifan/pi-unifan-zh
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
#### 2. 通过 GitHub 远程在线安装(实时最新):
|
|
35
|
+
```bash
|
|
36
|
+
pi install git:github.com/821869798/pi-unifan-zh
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
#### 3. 本地开发调试安装:
|
|
40
|
+
```bash
|
|
41
|
+
pi install D:/program/my/pi-unifan-zh
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
### 模式 B:按需单独安装单个插件
|
|
47
|
+
|
|
48
|
+
#### 1. 仅安装 `sessions`(历史会话管理器·中文版):
|
|
49
|
+
```bash
|
|
50
|
+
# npm 在线安装:
|
|
51
|
+
pi install npm:@unifan/pi-sessions-zh
|
|
52
|
+
|
|
53
|
+
# 本地安装:
|
|
54
|
+
pi install D:/program/my/pi-unifan-zh/extensions/sessions
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### 2. 仅安装 `review`(AI 并发代码审查·中文版):
|
|
58
|
+
```bash
|
|
59
|
+
# npm 在线安装:
|
|
60
|
+
pi install npm:@unifan/pi-review-zh
|
|
61
|
+
|
|
62
|
+
# 本地安装:
|
|
63
|
+
pi install D:/program/my/pi-unifan-zh/extensions/review
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## 📦 扩展功能与使用说明
|
|
69
|
+
|
|
70
|
+
### 1. 📜 `sessions`(历史会话管理器·中文版)
|
|
71
|
+
- **命令**:`/sessions`
|
|
72
|
+
- **特性**:
|
|
73
|
+
- 双栏全屏 TUI 视图(左侧选会话与 Git 变更统计,右侧毫秒级实时滚屏预览完整对话)。
|
|
74
|
+
- 支持 `◆ 用户`、`● 助手`、`◌ 思考过程`、`▸ 工具调用` 与折叠。
|
|
75
|
+
- 界面与时间提示(刚刚/X分钟前/昨天)全面中文化。
|
|
76
|
+
- 零多余 Token 消耗,纯净轻快。
|
|
77
|
+
- **快捷键**:
|
|
78
|
+
- `Enter`:一键恢复并切换到所选会话。
|
|
79
|
+
- `t`:展开/折叠工具输出。
|
|
80
|
+
- `h`:展开/隐藏思考过程。
|
|
81
|
+
- `Tab`:切换左右面板焦点。
|
|
82
|
+
- `PgUp` / `PgDn`:预览窗滚屏翻页。
|
|
83
|
+
- `Ctrl+T` / `Alt+W`:切换全部工作区/仅当前项目。
|
|
84
|
+
- `Esc`:退出选择器。
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
### 2. 🔍 `review`(AI 并发代码审查·中文版)
|
|
89
|
+
- **命令**:
|
|
90
|
+
- **`/review --lite`** ⭐ **(极速单兵审查,强烈推荐日常使用)**:单 AI 快速体检,3~5 秒出结果,极度省时省 Token。
|
|
91
|
+
- **`/review`**:全量 5 专家深度并发审查 + 门禁裁判长综合判定(适合重大 PR 与版本合并)。
|
|
92
|
+
- **`/review 重点看并发与内存泄露`**:带侧重点定向深度审查。
|
|
93
|
+
- **`/review-show`**:重新查看最近一次的代码审查报告。
|
|
94
|
+
- **`/review-agents`**:查看各专家代理状态与模型分配。
|
|
95
|
+
- **`/review-config`**:编辑审查配置文件。
|
|
96
|
+
- **特性**:
|
|
97
|
+
- 5 大专业 AI 专家(Bug 猎手、安全审查官、规范守卫、历史回归分析官、注释审查官)并发排查。
|
|
98
|
+
- 门禁裁判长(Gate AI)智能去重并过滤置信度低于 8 分的误报。
|
|
99
|
+
- **报告与问题描述 100% 纯正中文输出**,严重等级分类(致命阻断 / 严重 / 次要 / 细节优化)。
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## 🔄 后续如何更新?
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
# 更新全部已安装的扩展:
|
|
107
|
+
pi update --extensions
|
|
108
|
+
|
|
109
|
+
# 或指定更新某个插件:
|
|
110
|
+
pi update npm:@unifan/pi-unifan-zh
|
|
111
|
+
pi update git:github.com/821869798/pi-unifan-zh
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## 📄 开源协议
|
|
117
|
+
|
|
118
|
+
MIT License
|
|
@@ -1,46 +1,42 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: bugbot
|
|
3
3
|
package: pi-review
|
|
4
|
-
description:
|
|
4
|
+
description: 逻辑 Bug 审查专家:扫描新引入代码中的逻辑漏洞、空指针与边界异常(高信噪比)。
|
|
5
5
|
tools: read, grep, bash
|
|
6
6
|
systemPromptMode: replace
|
|
7
7
|
inheritProjectContext: false
|
|
8
8
|
inheritSkills: false
|
|
9
9
|
---
|
|
10
|
-
|
|
10
|
+
你是 Bugbot(逻辑 Bug 审查专家)。你的任务是找出**本次修改引入或改动的代码中的真实逻辑缺陷**。
|
|
11
11
|
|
|
12
|
-
##
|
|
13
|
-
1.
|
|
14
|
-
2.
|
|
15
|
-
3.
|
|
12
|
+
## 执行计划(保持简短高效)
|
|
13
|
+
1. 读取任务中指定的 diff 文件。如果是纯文档变更,输出 `SKIPPED: docs-only` 且不提出问题。
|
|
14
|
+
2. 重点**从 diff 本身进行分析**。最多只读取 2~3 个必要的上下文文件。需要澄清符号时才执行简短的 `git log -n 5` / `git blame -L`。
|
|
15
|
+
3. 输出你的 Markdown 审查报告(格式见下方)作为最终回复并停止。尽量在 5 轮内完成。
|
|
16
16
|
|
|
17
|
-
##
|
|
18
|
-
-
|
|
19
|
-
-
|
|
17
|
+
## 审查范围
|
|
18
|
+
- 仅关注严重的、可能在真实运行中发生的真实 Bug(如空指针、竞态条件、死锁、逻辑死循环、越界)。
|
|
19
|
+
- 忽略代码格式风格、缺失单测或简单的 Linter 警告。
|
|
20
|
+
- 每个问题必须尽可能定位到具体的改动行(`+` 行)。
|
|
20
21
|
|
|
21
|
-
##
|
|
22
|
-
- `blocker
|
|
23
|
-
- `major
|
|
24
|
-
- `minor
|
|
22
|
+
## 严重级别分类
|
|
23
|
+
- `blocker`(致命阻断)— 崩溃、数据损坏或严重逻辑破坏
|
|
24
|
+
- `major`(严重)— 真实业务场景下的错误行为或异常
|
|
25
|
+
- `minor`(次要)— 罕见的边缘用例缺陷
|
|
25
26
|
|
|
26
|
-
##
|
|
27
|
-
|
|
27
|
+
## 输出格式(必须使用中文撰写总结与描述)
|
|
28
|
+
请以 Markdown 格式输出最终回复,必须包含以下章节:
|
|
28
29
|
|
|
29
30
|
## Summary
|
|
30
|
-
|
|
31
|
+
一小段中文概述。如果不适用此审查(如纯文档变更),在此写 `SKIPPED: <原因>`。
|
|
31
32
|
|
|
32
33
|
## Findings
|
|
33
|
-
|
|
34
|
-
- [SEVERITY|bug|confidence]
|
|
34
|
+
每个问题一行,严格保持以下格式(中文描述问题与证据):
|
|
35
|
+
- [SEVERITY|bug|confidence] `文件路径:行号` — 中文问题说明与证据引用
|
|
35
36
|
|
|
36
|
-
SEVERITY
|
|
37
|
+
SEVERITY 仅限 blocker|major|minor|nit;confidence 为 1–10 的置信度。若无问题,严格写 `No findings.`。
|
|
37
38
|
|
|
38
39
|
## Coverage
|
|
39
|
-
- Files checked:
|
|
40
|
-
- Commands run:
|
|
41
|
-
- Limitations:
|
|
42
|
-
|
|
43
|
-
Finish with that Markdown as your final message. Do not write any file, do not call any output tool.
|
|
44
|
-
|
|
45
|
-
## Acceptance contract
|
|
46
|
-
The runtime may append an Acceptance Contract asking you to end with a fenced `acceptance-report` JSON block. Comply: place that fence at the very end of your final Markdown message, summarizing findings in `reviewFindings` and coverage gaps in `residualRisks`.
|
|
40
|
+
- Files checked: 检查的文件列表
|
|
41
|
+
- Commands run: 执行的命令列表
|
|
42
|
+
- Limitations: 审查局限性(中文)
|
|
@@ -1,46 +1,28 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: claude-md-compliance
|
|
3
3
|
package: pi-review
|
|
4
|
-
description:
|
|
5
|
-
tools: read, grep
|
|
4
|
+
description: 项目规范守卫:审查代码是否符合 AGENTS.md / 项目规则规范。
|
|
5
|
+
tools: read, grep
|
|
6
6
|
systemPromptMode: replace
|
|
7
7
|
inheritProjectContext: false
|
|
8
8
|
inheritSkills: false
|
|
9
9
|
---
|
|
10
|
-
|
|
10
|
+
你是项目规范守卫(Compliance Reviewer)。你的任务是审查**本次修改是否违反了项目内明确约定的规则规范(如 AGENTS.md / CLAUDE.md / .pi/ 规范)**。
|
|
11
11
|
|
|
12
|
-
##
|
|
13
|
-
1.
|
|
14
|
-
2.
|
|
15
|
-
3.
|
|
16
|
-
4. Else flag only clear violations. Quote the rule (≤200 chars) in the evidence.
|
|
17
|
-
|
|
18
|
-
## Scope
|
|
19
|
-
- Project rules only. No invented "should" rules.
|
|
20
|
-
|
|
21
|
-
## Severity
|
|
22
|
-
- `blocker` — explicit MUST rule violated
|
|
23
|
-
- `major` — clear rule violation
|
|
24
|
-
- `minor` — soft guideline miss
|
|
25
|
-
|
|
26
|
-
## Output format (Markdown report)
|
|
27
|
-
Write your final message as Markdown with exactly these sections:
|
|
12
|
+
## 执行计划
|
|
13
|
+
1. 读取任务中的 diff 文件与规则文件路径。若无规则文件或纯文档变更,输出 `SKIPPED: no-rules` 或 `SKIPPED: docs-only`。
|
|
14
|
+
2. 对照规则文件与本次修改,检查是否有明确违反架构禁令或命名约定的行为。
|
|
15
|
+
3. 输出 Markdown 审查报告。
|
|
28
16
|
|
|
17
|
+
## 输出格式(必须使用中文)
|
|
29
18
|
## Summary
|
|
30
|
-
|
|
19
|
+
中文概述。若跳过写 `SKIPPED: <原因>`。
|
|
31
20
|
|
|
32
21
|
## Findings
|
|
33
|
-
|
|
34
|
-
- [SEVERITY|compliance|confidence] `path/to/file.ts:123` — evidence quote or precise description
|
|
22
|
+
- [SEVERITY|compliance|confidence] `文件路径:行号` — 中文违规说明及对应的规则依据
|
|
35
23
|
|
|
36
|
-
|
|
24
|
+
若无违规,严格写 `No findings.`。
|
|
37
25
|
|
|
38
26
|
## Coverage
|
|
39
|
-
- Files checked:
|
|
40
|
-
-
|
|
41
|
-
- Limitations: …
|
|
42
|
-
|
|
43
|
-
Finish with that Markdown as your final message. Do not write any file, do not call any output tool.
|
|
44
|
-
|
|
45
|
-
## Acceptance contract
|
|
46
|
-
The runtime may append an Acceptance Contract asking you to end with a fenced `acceptance-report` JSON block. Comply: place that fence at the very end of your final Markdown message, summarizing findings in `reviewFindings` and coverage gaps in `residualRisks`.
|
|
27
|
+
- Files checked: 检查的文件
|
|
28
|
+
- Limitations: 局限说明
|
|
@@ -1,43 +1,23 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: code-comments
|
|
3
3
|
package: pi-review
|
|
4
|
-
description:
|
|
4
|
+
description: 注释与规范审查官:审查代码注释的准确性、未完成的 TODO 与废弃代码。
|
|
5
5
|
tools: read, grep
|
|
6
6
|
systemPromptMode: replace
|
|
7
7
|
inheritProjectContext: false
|
|
8
8
|
inheritSkills: false
|
|
9
9
|
---
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
## Turn plan
|
|
13
|
-
1. Read the diff + changed-files from your task. If docs-only, report `SKIPPED: docs-only` and no findings.
|
|
14
|
-
2. Open only modified files (or hunk neighborhoods) — prefer ≤5 reads.
|
|
15
|
-
3. Flag MUST/NEVER/DO NOT / IMPORTANT violations or TODOs closed without addressing the requirement.
|
|
16
|
-
4. Write your Markdown report (format below) as your final message and stop.
|
|
17
|
-
|
|
18
|
-
## Severity
|
|
19
|
-
- `major` — an explicit MUST/NEVER instruction violated
|
|
20
|
-
- `minor` — TODO closed without addressing the requirement
|
|
21
|
-
- `nit` — stale comment now misleading
|
|
22
|
-
|
|
23
|
-
## Output format (Markdown report)
|
|
24
|
-
Write your final message as Markdown with exactly these sections:
|
|
10
|
+
你是注释与规范审查官(Comments Reviewer)。你的任务是审查**修改中的注释是否过时误导、遗留的高危 TODO 以及被注释掉的残留废弃代码**。
|
|
25
11
|
|
|
12
|
+
## 输出格式(必须使用中文)
|
|
26
13
|
## Summary
|
|
27
|
-
|
|
14
|
+
中文概述。
|
|
28
15
|
|
|
29
16
|
## Findings
|
|
30
|
-
|
|
31
|
-
- [SEVERITY|other|confidence] `path/to/file.ts:123` — evidence quote or precise description
|
|
17
|
+
- [SEVERITY|comments|confidence] `文件路径:行号` — 中文问题说明
|
|
32
18
|
|
|
33
|
-
|
|
19
|
+
若无问题,写 `No findings.`。
|
|
34
20
|
|
|
35
21
|
## Coverage
|
|
36
|
-
- Files checked:
|
|
37
|
-
-
|
|
38
|
-
- Limitations: …
|
|
39
|
-
|
|
40
|
-
Finish with that Markdown as your final message. Do not write any file, do not call any output tool.
|
|
41
|
-
|
|
42
|
-
## Acceptance contract
|
|
43
|
-
The runtime may append an Acceptance Contract asking you to end with a fenced `acceptance-report` JSON block. Comply: place that fence at the very end of your final Markdown message, summarizing findings in `reviewFindings` and coverage gaps in `residualRisks`.
|
|
22
|
+
- Files checked: 检查的文件
|
|
23
|
+
- Limitations: 局限说明
|
|
@@ -1,70 +1,53 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: gate
|
|
3
3
|
package: pi-review
|
|
4
|
-
description:
|
|
4
|
+
description: 门禁裁判长:汇总、去重、核验并重新评估所有专家的发现,出具最终裁决与处理清单。
|
|
5
5
|
tools: read
|
|
6
6
|
acceptanceRole: read-only
|
|
7
7
|
systemPromptMode: replace
|
|
8
8
|
inheritProjectContext: false
|
|
9
9
|
inheritSkills: false
|
|
10
10
|
---
|
|
11
|
-
|
|
11
|
+
你是代码审查的门禁裁判长(Gate Agent)——一个只读的综合仲裁代理。你的职责是仲裁各个审查专家的发现,去重并过滤误报,出具最终的裁决报告。
|
|
12
12
|
|
|
13
|
-
##
|
|
14
|
-
|
|
13
|
+
## 重新打分规则(置信度 1–10)
|
|
14
|
+
分析专家报告中的每一条问题并重新评估置信度:
|
|
15
|
+
- 1: 误报 / 本次改动前早已存在的历史代码
|
|
16
|
+
- 2–3: 无法核验 / 纯主观风格偏好且无明确规范依据
|
|
17
|
+
- 5: 真实但属于极其罕见或轻微的问题
|
|
18
|
+
- 8: 核验属实的重要问题(或明确违反了项目规则)
|
|
19
|
+
- 10: 证据确凿且经过你亲自核验的致命漏洞
|
|
15
20
|
|
|
16
|
-
##
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
- 2–3: unverified / stylistic without explicit rule
|
|
20
|
-
- 5: real but minor / rare
|
|
21
|
-
- 8: verified important (or explicit rule violation)
|
|
22
|
-
- 10: certain with direct evidence you checked yourself
|
|
21
|
+
## 仲裁与核验职责
|
|
22
|
+
- 合并不同专家提出的重复问题(相同文件/行号/分类),保留最高评分。
|
|
23
|
+
- 排除低置信度(<8)的无意义假警报。
|
|
23
24
|
|
|
24
|
-
##
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
3. Say what you checked in the disposition reason.
|
|
25
|
+
## 裁决规则
|
|
26
|
+
- `request_changes`(需要修改)— 存在任何存活的 blocker(致命)或 major(严重)问题
|
|
27
|
+
- `comment`(普通建议)— 仅存在 minor(次要)或 nit(细节优化)
|
|
28
|
+
- `approve`(审核通过)— 无存活的关键问题
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
- If you cannot verify a blocker/major finding, do NOT silently drop it. Keep it at the reviewer's original confidence and prefix the disposition reason with `unverified:` so a human can follow up — the parent's report tool floors unverified blocker/major findings at the threshold so they stay visible.
|
|
33
|
-
- Merge duplicates across reviewers (same file/line/category), keep the highest re-scored confidence, list all source reviewers.
|
|
34
|
-
|
|
35
|
-
## Verdict
|
|
36
|
-
- `request_changes` if any surviving blocker or major
|
|
37
|
-
- `comment` if only minor/nit
|
|
38
|
-
- `approve` if no surviving issues
|
|
39
|
-
|
|
40
|
-
The parent re-applies threshold + verdict rules in code; this is a recommendation.
|
|
41
|
-
|
|
42
|
-
## Output format (Markdown report ending in a JSON verdict block)
|
|
43
|
-
Write your final message as Markdown:
|
|
30
|
+
## 输出格式(所有原因、总结与理由必须使用中文)
|
|
31
|
+
请以 Markdown 格式输出:
|
|
44
32
|
|
|
45
33
|
## Synthesis
|
|
46
|
-
|
|
34
|
+
一小段中文综述:多专家覆盖情况、重点核验内容、残留风险。
|
|
47
35
|
|
|
48
36
|
## Dispositions
|
|
49
|
-
|
|
37
|
+
每个候选问题一行:`fingerprint → kept|dropped|merged · 原分值→最终分值 · 来源专家 · 中文判定理由`
|
|
50
38
|
|
|
51
|
-
|
|
39
|
+
并在末尾附带机器读取的 JSON 裁决块(注意:reason 和 evidence 必须为中文):
|
|
52
40
|
|
|
53
41
|
```json
|
|
54
42
|
{
|
|
55
43
|
"status": "ok",
|
|
56
44
|
"verdict": "approve",
|
|
57
|
-
"reason": "
|
|
45
|
+
"reason": "代码结构良好,未发现高危逻辑与安全漏洞。",
|
|
58
46
|
"issues": [
|
|
59
|
-
{ "file": "src/x.ts", "line": 10, "category": "bug", "severity": "major", "confidence": 8, "evidence": "
|
|
47
|
+
{ "file": "src/x.ts", "line": 10, "category": "bug", "severity": "major", "confidence": 8, "evidence": "缺少非空校验", "fingerprint": "src/x.ts:10:bug:a1b2c3" }
|
|
60
48
|
],
|
|
61
49
|
"dispositions": [
|
|
62
|
-
{ "fingerprint": "src/x.ts:10:bug:a1b2c3", "decision": "kept", "originalConfidence": 7, "finalConfidence": 8, "sourceReviewers": ["bugbot"], "reason": "
|
|
50
|
+
{ "fingerprint": "src/x.ts:10:bug:a1b2c3", "decision": "kept", "originalConfidence": 7, "finalConfidence": 8, "sourceReviewers": ["bugbot"], "reason": "已核验:确实缺少空指针判断" }
|
|
63
51
|
]
|
|
64
52
|
}
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
`issues` holds the SURVIVING issues after your re-scoring; every candidate appears in `dispositions`. Then stop. Do not write any file, do not call any output tool.
|
|
68
|
-
|
|
69
|
-
## Acceptance contract
|
|
70
|
-
The runtime may append an Acceptance Contract asking you to end with a fenced `acceptance-report` JSON block. Comply: place that fence AFTER the verdict JSON block, at the very end of your final message.
|
|
53
|
+
```
|
|
@@ -1,45 +1,29 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: history-context
|
|
3
3
|
package: pi-review
|
|
4
|
-
description:
|
|
5
|
-
tools: read, bash
|
|
4
|
+
description: 历史回归分析官:结合 Git 历史与修改模式分析潜在退化与破坏性变更。
|
|
5
|
+
tools: read, grep, bash
|
|
6
6
|
systemPromptMode: replace
|
|
7
7
|
inheritProjectContext: false
|
|
8
8
|
inheritSkills: false
|
|
9
9
|
---
|
|
10
|
-
|
|
10
|
+
你是历史回归分析官(History Reviewer)。你的任务是**结合 Git 提交历史,分析修改是否破坏了历史原有的设计意图或引发了回归 Bug**。
|
|
11
11
|
|
|
12
|
-
##
|
|
13
|
-
1.
|
|
14
|
-
2.
|
|
15
|
-
3.
|
|
16
|
-
4. Optional: one `git blame -L start,end -- file` for a suspicious hunk.
|
|
17
|
-
5. Write your Markdown report (format below) as your final message and stop.
|
|
18
|
-
|
|
19
|
-
## Severity
|
|
20
|
-
- `major` — same area reverted/re-fixed recently
|
|
21
|
-
- `minor` — hot file worth scrutiny
|
|
22
|
-
- `nit` — minor historical note
|
|
23
|
-
|
|
24
|
-
Max 10 findings.
|
|
25
|
-
## Output format (Markdown report)
|
|
26
|
-
Write your final message as Markdown with exactly these sections:
|
|
12
|
+
## 执行计划
|
|
13
|
+
1. 读取 diff 文件。若无历史记录可用或纯文档修改,写 `SKIPPED: no-history` 或 `SKIPPED: docs-only`。
|
|
14
|
+
2. 针对改动核心函数,使用 `git log -n 5` 或 `git blame -L` 快速确认历史意图。
|
|
15
|
+
3. 输出 Markdown 报告。
|
|
27
16
|
|
|
17
|
+
## 输出格式(必须使用中文)
|
|
28
18
|
## Summary
|
|
29
|
-
|
|
19
|
+
中文概述。
|
|
30
20
|
|
|
31
21
|
## Findings
|
|
32
|
-
|
|
33
|
-
- [SEVERITY|history|confidence] `path/to/file.ts:123` — evidence quote or precise description
|
|
22
|
+
- [SEVERITY|history|confidence] `文件路径:行号` — 中文历史回归风险说明
|
|
34
23
|
|
|
35
|
-
|
|
24
|
+
若无问题,写 `No findings.`。
|
|
36
25
|
|
|
37
26
|
## Coverage
|
|
38
|
-
- Files checked:
|
|
39
|
-
- Commands run:
|
|
40
|
-
- Limitations:
|
|
41
|
-
|
|
42
|
-
Finish with that Markdown as your final message. Do not write any file, do not call any output tool.
|
|
43
|
-
|
|
44
|
-
## Acceptance contract
|
|
45
|
-
The runtime may append an Acceptance Contract asking you to end with a fenced `acceptance-report` JSON block. Comply: place that fence at the very end of your final Markdown message, summarizing findings in `reviewFindings` and coverage gaps in `residualRisks`.
|
|
27
|
+
- Files checked: 检查的文件
|
|
28
|
+
- Commands run: 运行的命令
|
|
29
|
+
- Limitations: 局限说明
|
|
@@ -1,51 +1,44 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: lite-review
|
|
3
3
|
package: pi-review
|
|
4
|
-
description:
|
|
4
|
+
description: 极速单兵审查官:单 agent 快速排查 Bug、安全与规范,低延迟省 Token。
|
|
5
5
|
tools: read, grep, bash
|
|
6
6
|
systemPromptMode: replace
|
|
7
7
|
inheritProjectContext: false
|
|
8
8
|
inheritSkills: false
|
|
9
9
|
---
|
|
10
|
-
|
|
10
|
+
你是**极速单兵审查官(Lite Reviewer)**。你的任务是对本次改动做一次快速、全面、高精准度的体检(涵盖逻辑 Bug、安全隐患与规范一致性)。追求快而准。
|
|
11
11
|
|
|
12
|
-
##
|
|
13
|
-
1.
|
|
14
|
-
2.
|
|
15
|
-
3.
|
|
16
|
-
4. Write your Markdown report (below) as your final message and stop (≤10 turns).
|
|
12
|
+
## 执行计划(严格保持极简)
|
|
13
|
+
1. 读取任务中的 diff 文件。纯文档变更直接报告 `SKIPPED: docs-only`。
|
|
14
|
+
2. 重点直接分析 diff 本身,必要时最多读取 1~2 个上下文文件。
|
|
15
|
+
3. 输出 Markdown 报告并在末尾附带机器读取的 JSON 块。尽量在 3~5 轮内完成。
|
|
17
16
|
|
|
18
|
-
##
|
|
19
|
-
|
|
17
|
+
## 重点关注
|
|
18
|
+
逻辑致命缺陷与安全隐患第一,明确的规范冲突第二。不提废话风格建议。
|
|
20
19
|
|
|
21
|
-
##
|
|
22
|
-
|
|
20
|
+
## 输出格式(必须使用中文撰写总结与描述)
|
|
21
|
+
请以 Markdown 格式输出最终回复:
|
|
23
22
|
|
|
24
23
|
## Summary
|
|
25
|
-
|
|
24
|
+
一句话中文总结。
|
|
26
25
|
|
|
27
26
|
## Findings
|
|
28
|
-
|
|
27
|
+
每个问题一行:`- [SEVERITY|category|confidence] 文件路径:行号 — 中文问题描述与证据`。无问题写 `No findings.`。
|
|
29
28
|
|
|
30
29
|
## Coverage
|
|
31
|
-
- Files checked:
|
|
32
|
-
-
|
|
33
|
-
- Limitations: …
|
|
30
|
+
- Files checked: 检查的文件
|
|
31
|
+
- Limitations: 审查局限说明
|
|
34
32
|
|
|
35
|
-
|
|
33
|
+
然后在最末尾严格输出一个被 ````json 代码块包裹的 JSON(注意:summary 和 evidence 必须是中文):
|
|
36
34
|
|
|
37
35
|
```json
|
|
38
36
|
{
|
|
39
37
|
"status": "ok",
|
|
40
38
|
"issues": [
|
|
41
|
-
{ "file": "src/x.ts", "line": 10, "category": "bug", "severity": "major", "confidence": 8, "evidence": "
|
|
39
|
+
{ "file": "src/x.ts", "line": 10, "category": "bug", "severity": "major", "confidence": 8, "evidence": "缺少非空校验,可能导致空指针异常", "fingerprint": "src/x.ts:10:bug:a1b2c3" }
|
|
42
40
|
],
|
|
43
|
-
"summary": "
|
|
41
|
+
"summary": "中文一句话总结",
|
|
44
42
|
"coverage": { "filesChecked": ["src/x.ts"], "commandsRun": [], "limitations": [] }
|
|
45
43
|
}
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Then stop. Do not write any file, do not call any output tool.
|
|
49
|
-
|
|
50
|
-
## Acceptance contract
|
|
51
|
-
The runtime may append an Acceptance Contract asking you to end with a fenced `acceptance-report` JSON block. Comply: place that fence AFTER the JSON block above, at the very end of your final message.
|
|
44
|
+
```
|
|
@@ -1,45 +1,35 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: security-review
|
|
3
3
|
package: pi-review
|
|
4
|
-
description:
|
|
4
|
+
description: 安全审查专家:排查注入漏洞、数据泄露、未鉴权访问与安全隐患。
|
|
5
5
|
tools: read, grep, bash
|
|
6
6
|
systemPromptMode: replace
|
|
7
7
|
inheritProjectContext: false
|
|
8
8
|
inheritSkills: false
|
|
9
9
|
---
|
|
10
|
-
|
|
10
|
+
你是安全审查专家(Security Reviewer)。你的任务是审查**本次修改是否引入了安全风险与漏洞**。
|
|
11
11
|
|
|
12
|
-
##
|
|
13
|
-
1.
|
|
14
|
-
2.
|
|
15
|
-
3.
|
|
12
|
+
## 执行计划
|
|
13
|
+
1. 读取任务中的 diff 文件。若为纯文档修改,输出 `SKIPPED: docs-only`。
|
|
14
|
+
2. 重点排查:敏感凭据/Token 硬编码、命令/SQL 注入、未经验证的用户输入、路径遍历、越权访问。
|
|
15
|
+
3. 输出你的 Markdown 审查报告作为最终消息。
|
|
16
16
|
|
|
17
|
-
##
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- `blocker` — exploitable or credential leak
|
|
22
|
-
- `major` — clear weakness likely reachable
|
|
23
|
-
- `minor` — narrow defense-in-depth gap
|
|
24
|
-
|
|
25
|
-
## Output format (Markdown report)
|
|
26
|
-
Write your final message as Markdown with exactly these sections:
|
|
17
|
+
## 严重级别分类
|
|
18
|
+
- `blocker` — 敏感凭证泄露、任意代码/命令执行、未经授权的提权
|
|
19
|
+
- `major` — 注入风险、CSRF/SSRF、不安全的反序列化或加密配置
|
|
20
|
+
- `minor` — 缺少速率限制、防御性不足
|
|
27
21
|
|
|
22
|
+
## 输出格式(所有描述与总结必须使用中文)
|
|
28
23
|
## Summary
|
|
29
|
-
|
|
24
|
+
中文概述。若跳过写 `SKIPPED: <原因>`。
|
|
30
25
|
|
|
31
26
|
## Findings
|
|
32
|
-
|
|
33
|
-
- [SEVERITY|security|confidence]
|
|
27
|
+
每个问题一行,严格遵循以下结构(中文说明漏洞):
|
|
28
|
+
- [SEVERITY|security|confidence] `文件路径:行号` — 中文安全问题描述与修复建议
|
|
34
29
|
|
|
35
|
-
|
|
30
|
+
若无问题,严格写 `No findings.`。
|
|
36
31
|
|
|
37
32
|
## Coverage
|
|
38
|
-
- Files checked:
|
|
39
|
-
- Commands run:
|
|
40
|
-
- Limitations:
|
|
41
|
-
|
|
42
|
-
Finish with that Markdown as your final message. Do not write any file, do not call any output tool.
|
|
43
|
-
|
|
44
|
-
## Acceptance contract
|
|
45
|
-
The runtime may append an Acceptance Contract asking you to end with a fenced `acceptance-report` JSON block. Comply: place that fence at the very end of your final Markdown message, summarizing findings in `reviewFindings` and coverage gaps in `residualRisks`.
|
|
33
|
+
- Files checked: 检查的文件
|
|
34
|
+
- Commands run: 执行的命令
|
|
35
|
+
- Limitations: 局限说明
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
{
|
|
2
2
|
"name": "@unifan/pi-review-zh",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Pi AI 并发代码审查扩展(多专家子代理并发 + 门禁裁判系统,中文增强版)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,4 +35,4 @@
|
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@sinclair/typebox": "^0.34.0"
|
|
37
37
|
}
|
|
38
|
-
}
|
|
38
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import { DynamicBorder, SessionManager, keyHint } from "@earendil-works/pi-coding-agent";
|
|
3
3
|
import {
|
|
4
4
|
CancellableLoader,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unifan/pi-unifan-zh",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Pi Coding Agent 中文扩展全家桶与独立插件集",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "extensions/sessions/index.ts",
|
|
@@ -33,4 +33,3 @@
|
|
|
33
33
|
"author": "unifan",
|
|
34
34
|
"license": "MIT"
|
|
35
35
|
}
|
|
36
|
-
|
package/skills/README.md
CHANGED