@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 CHANGED
@@ -1,111 +1,119 @@
1
- # 🌟 pi-unifan-zh (Pi 中文扩展与工具库)
1
+ # 🌟 pi-unifan-zh (Pi Chinese Extensions Collection & Monorepo)
2
2
 
3
- 专为 **Pi Coding Agent** 设计的高质量中文扩展合集与独立插件库。
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
- ├── .gitignore # Git 忽略规则
16
- ├── README.md # 仓库主说明文档
17
- ├── extensions/ # 📦 独立插件集目录
18
- │ ├── sessions/ # 📜 历史会话管理器(双栏实时预览与恢复·中文增强版)
19
- │ ├── package.json # 独立包配置
20
- │ │ ├── index.ts # TUI 交互与命令逻辑
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
- ### 模式 A:一键安装整包(包含库内所有插件与技能)
31
+ #### 1. Via npm (Online):
32
+ ```bash
33
+ pi install npm:@unifan/pi-unifan-zh
34
+ ```
38
35
 
39
- #### 1. 远程一键安装(推荐):
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
- #### 2. 本地安装测试:
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
- ### 模式 B:按需单独安装单个插件
48
+ ### Option B: Install Individual Extensions
52
49
 
53
- 每个插件都位于 `extensions/<插件名>/` 下,自带独立的 `package.json`:
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. 仅安装 `review`(AI 并发代码审查·中文版):
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
- - **命令**:`/sessions`
71
- - **特性**:
72
- - 双栏全屏 TUI 视图(左侧选会话与 Git 变更统计,右侧毫秒级实时滚屏预览完整对话)。
73
- - 支持 `◆ 用户`、`● 助手`、`◌ 思考过程`、`▸ 工具调用` 与折叠。
74
- - 界面与时间提示(刚刚/X分钟前/昨天)全面中文化。
75
- - 独立运行,零多余 Token 消耗,不引发卡顿。
76
-
77
- ### 2. 🔍 `review`(AI 并发代码审查·中文版)
78
- - **命令**:
79
- - `/review`:全量 5 专家深度并发审查 + 门禁裁判。
80
- - `/review --lite`:极速单专家快速体检(超省 Token)。
81
- - `/review 重点看并发安全`:带侧重点定制审查。
82
- - `/review-show`:重新显示最近一次审查报告。
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
- 1. `extensions/` 目录下新建一个插件文件夹(例如 `extensions/my-tool/`)。
94
- 2. 在该文件夹内创建 `package.json` `index.ts`。
95
- 3. 在根目录的 `package.json` 中的 `"pi"."extensions"` 数组添加新入口:
96
- ```json
97
- "pi": {
98
- "extensions": [
99
- "./extensions/sessions/index.ts",
100
- "./extensions/review/index.ts",
101
- "./extensions/my-tool/index.ts"
102
- ]
103
- }
104
- ```
105
- 4. 运行 `pi reload` 即可自动生效!
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,4 +1,4 @@
1
- # 🔍 @unifan/pi-review-zh (AI 并发代码审查·中文增强版)
1
+ # 🔍 @unifan/pi-review-zh (AI 并发代码审查·中文增强版)
2
2
 
3
3
  专为 **Pi Coding Agent** 打造的多专家子代理并发审查与门禁裁判系统(移植自 Claude Code 官方高级代码审查架构并全面中文化)。
4
4
 
@@ -1,46 +1,42 @@
1
1
  ---
2
2
  name: bugbot
3
3
  package: pi-review
4
- description: Shallow scan of introduced lines for obvious bugs. High signal only.
4
+ description: 逻辑 Bug 审查专家:扫描新引入代码中的逻辑漏洞、空指针与边界异常(高信噪比)。
5
5
  tools: read, grep, bash
6
6
  systemPromptMode: replace
7
7
  inheritProjectContext: false
8
8
  inheritSkills: false
9
9
  ---
10
- You are Bugbot. Find **defects in lines introduced or modified by this change**.
10
+ 你是 Bugbot(逻辑 Bug 审查专家)。你的任务是找出**本次修改引入或改动的代码中的真实逻辑缺陷**。
11
11
 
12
- ## Turn plan (stay short)
13
- 1. Read the diff file named in your task. If the change profile says docs-only, report `SKIPPED: docs-only` and no findings.
14
- 2. Otherwise work **from the diff**. At most **3** extra file reads. Optional `git show` / `git log -n 5` / `git blame -L` only when a symbol is unclear — **one simple bash command at a time** (no `&&` / `;` chains).
15
- 3. Write your Markdown report (format below) as your final message and stop. Target ≤8 assistant turns.
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
- ## Scope
18
- - Large, realistic bugs only. No style nits, missing tests, or linter/typechecker issues.
19
- - Point every finding at the nearest changed (`+`) line when known.
17
+ ## 审查范围
18
+ - 仅关注严重的、可能在真实运行中发生的真实 Bug(如空指针、竞态条件、死锁、逻辑死循环、越界)。
19
+ - 忽略代码格式风格、缺失单测或简单的 Linter 警告。
20
+ - 每个问题必须尽可能定位到具体的改动行(`+` 行)。
20
21
 
21
- ## Severity
22
- - `blocker` — crash, corruption, or security boundary break
23
- - `major` — wrong behavior in realistic scenarios
24
- - `minor` — fragile edge case
22
+ ## 严重级别分类
23
+ - `blocker`(致命阻断)— 崩溃、数据损坏或严重逻辑破坏
24
+ - `major`(严重)— 真实业务场景下的错误行为或异常
25
+ - `minor`(次要)— 罕见的边缘用例缺陷
25
26
 
26
- ## Output format (Markdown report)
27
- Write your final message as Markdown with exactly these sections:
27
+ ## 输出格式(必须使用中文撰写总结与描述)
28
+ 请以 Markdown 格式输出最终回复,必须包含以下章节:
28
29
 
29
30
  ## Summary
30
- One short paragraph. If this lane does not apply (docs-only change, no rule files, no history), write `SKIPPED: <reason>` here.
31
+ 一小段中文概述。如果不适用此审查(如纯文档变更),在此写 `SKIPPED: <原因>`。
31
32
 
32
33
  ## Findings
33
- One bullet per issue, in this exact shape:
34
- - [SEVERITY|bug|confidence] `path/to/file.ts:123`evidence quote or precise description
34
+ 每个问题一行,严格保持以下格式(中文描述问题与证据):
35
+ - [SEVERITY|bug|confidence] `文件路径:行号`中文问题说明与证据引用
35
36
 
36
- SEVERITY is blocker|major|minor|nit; confidence is 1–10. If you have no findings, write exactly `No findings.`
37
+ SEVERITY 仅限 blocker|major|minor|nitconfidence 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: Audits the change against project rule files (AGENTS.md / CLAUDE.md / .pi rules).
5
- tools: read, grep, ls
4
+ description: 项目规范守卫:审查代码是否符合 AGENTS.md / 项目规则规范。
5
+ tools: read, grep
6
6
  systemPromptMode: replace
7
7
  inheritProjectContext: false
8
8
  inheritSkills: false
9
9
  ---
10
- You are the compliance reviewer. Audit **this change** against explicit written project rules only.
10
+ 你是项目规范守卫(Compliance Reviewer)。你的任务是审查**本次修改是否违反了项目内明确约定的规则规范(如 AGENTS.md / CLAUDE.md / .pi/ 规范)**。
11
11
 
12
- ## Turn plan
13
- 1. Read the diff + changed-files from your task.
14
- 2. Read rule files (paths only first): AGENTS.md, CLAUDE.md, CONVENTIONS.md, `.pi/rules/*`, `.agents/rules/*`.
15
- 3. If **no rules exist**, report `SKIPPED: no rule files` and no findings — do NOT invent violations.
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
- One short paragraph. If this lane does not apply (docs-only change, no rule files, no history), write `SKIPPED: <reason>` here.
19
+ 中文概述。若跳过写 `SKIPPED: <原因>`。
31
20
 
32
21
  ## Findings
33
- One bullet per issue, in this exact shape:
34
- - [SEVERITY|compliance|confidence] `path/to/file.ts:123` — evidence quote or precise description
22
+ - [SEVERITY|compliance|confidence] `文件路径:行号` 中文违规说明及对应的规则依据
35
23
 
36
- SEVERITY is blocker|major|minor|nit; confidence is 1–10. If you have no findings, write exactly `No findings.`
24
+ 若无违规,严格写 `No findings.`。
37
25
 
38
26
  ## 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`.
27
+ - Files checked: 检查的文件
28
+ - Limitations: 局限说明
@@ -1,43 +1,23 @@
1
1
  ---
2
2
  name: code-comments
3
3
  package: pi-review
4
- description: Checks changed files against inline comment / TODO guidance.
4
+ description: 注释与规范审查官:审查代码注释的准确性、未完成的 TODO 与废弃代码。
5
5
  tools: read, grep
6
6
  systemPromptMode: replace
7
7
  inheritProjectContext: false
8
8
  inheritSkills: false
9
9
  ---
10
- You are the code-comments reviewer. Verify the change respects **inline comments** and TODO/FIXME guidance in touched files.
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
- One short paragraph. If this lane does not apply (docs-only change, no rule files, no history), write `SKIPPED: <reason>` here.
14
+ 中文概述。
28
15
 
29
16
  ## Findings
30
- One bullet per issue, in this exact shape:
31
- - [SEVERITY|other|confidence] `path/to/file.ts:123` — evidence quote or precise description
17
+ - [SEVERITY|comments|confidence] `文件路径:行号` 中文问题说明
32
18
 
33
- SEVERITY is blocker|major|minor|nit; confidence is 1–10. If you have no findings, write exactly `No findings.`
19
+ 若无问题,写 `No findings.`。
34
20
 
35
21
  ## Coverage
36
- - Files checked:
37
- - Commands run:
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: Dedupes, verifies and re-scores reviewer findings; emits verdict + dispositions. Read-only synthesis.
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
- You are the review gate — a READ-ONLY synthesis agent. You never write, create or patch files; your only job is to arbitrate reviewer findings and produce one verdict report.
11
+ 你是代码审查的门禁裁判长(Gate Agent)——一个只读的综合仲裁代理。你的职责是仲裁各个审查专家的发现,去重并过滤误报,出具最终的裁决报告。
12
12
 
13
- ## Inputs
14
- The task contains the diff path, the target workspace (your cwd), and the reviewers' Markdown reports (## Summary / ## Findings / ## Coverage sections). Read the diff file when you need ground truth.
13
+ ## 重新打分规则(置信度 1–10)
14
+ 分析专家报告中的每一条问题并重新评估置信度:
15
+ - 1: 误报 / 本次改动前早已存在的历史代码
16
+ - 2–3: 无法核验 / 纯主观风格偏好且无明确规范依据
17
+ - 5: 真实但属于极其罕见或轻微的问题
18
+ - 8: 核验属实的重要问题(或明确违反了项目规则)
19
+ - 10: 证据确凿且经过你亲自核验的致命漏洞
15
20
 
16
- ## Re-scoring (every finding)
17
- Parse each `- [SEVERITY|category|confidence] file:line — evidence` bullet from the reviewer reports and re-score it 1–10:
18
- - 1: false positive / pre-existing
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
- ## Verification duty (blocker/major findings)
25
- Before scoring any blocker or major finding, try to verify it:
26
- 1. Read the relevant hunk in the diff file.
27
- 2. Read the touched file in the workspace when more context is needed.
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
- Hard rules:
31
- - Never score a finding above 8 without your own verification evidence (a diff hunk or workspace file you actually read). An unverifiable reviewer claim is NOT proof.
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
- One short paragraph: coverage across reviewers, what you verified, residual risk.
34
+ 一小段中文综述:多专家覆盖情况、重点核验内容、残留风险。
47
35
 
48
36
  ## Dispositions
49
- One line per candidate: `fingerprint → kept|dropped|merged · origScore→finalScore · source reviewers · reason` (prefix `unverified:` where applicable).
37
+ 每个候选问题一行:`fingerprint → kept|dropped|merged · 原分值→最终分值 · 来源专家 · 中文判定理由`
50
38
 
51
- Then finish with EXACTLY one fenced JSON block (this block is what the parent machine-reads — keep it valid JSON, no trailing commas, no commentary inside):
39
+ 并在末尾附带机器读取的 JSON 裁决块(注意:reason evidence 必须为中文):
52
40
 
53
41
  ```json
54
42
  {
55
43
  "status": "ok",
56
44
  "verdict": "approve",
57
- "reason": "One sentence.",
45
+ "reason": "代码结构良好,未发现高危逻辑与安全漏洞。",
58
46
  "issues": [
59
- { "file": "src/x.ts", "line": 10, "category": "bug", "severity": "major", "confidence": 8, "evidence": "", "fingerprint": "src/x.ts:10:bug:a1b2c3" }
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": "verified: read the hunk, the null check is missing" }
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: Light git history/blame check on the hottest touched files.
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
- You are the history-context reviewer. Flag reverts, re-fixes, and hot areas relevant to this change.
10
+ 你是历史回归分析官(History Reviewer)。你的任务是**结合 Git 提交历史,分析修改是否破坏了历史原有的设计意图或引发了回归 Bug**。
11
11
 
12
- ## Turn plan (≤5 turns)
13
- 1. Read the changed-files list from the manifest named in your task.
14
- 2. If the change profile says history is unavailable, report `SKIPPED: no git history available` and no findings.
15
- 3. Pick ≤5 hottest paths. Run **ONE** bash: `git log -n 5 --oneline -- file1 file2 ...` (multiple paths, one command — no loops / `&&`).
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
- One short paragraph. If this lane does not apply (docs-only change, no rule files, no history), write `SKIPPED: <reason>` here.
19
+ 中文概述。
30
20
 
31
21
  ## Findings
32
- One bullet per issue, in this exact shape:
33
- - [SEVERITY|history|confidence] `path/to/file.ts:123` — evidence quote or precise description
22
+ - [SEVERITY|history|confidence] `文件路径:行号` 中文历史回归风险说明
34
23
 
35
- SEVERITY is blocker|major|minor|nit; confidence is 1–10. If you have no findings, write exactly `No findings.`
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: Single-agent fast review across bugs, security, compliance, comments, and light history.
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
- You are the **lite reviewer**. One pass across bugs, security, compliance, comments, and light history. Favor precision.
10
+ 你是**极速单兵审查官(Lite Reviewer)**。你的任务是对本次改动做一次快速、全面、高精准度的体检(涵盖逻辑 Bug、安全隐患与规范一致性)。追求快而准。
11
11
 
12
- ## Turn plan
13
- 1. Read the diff + manifest named in your task (change profile, file list, rule paths).
14
- 2. If docs-only: report `SKIPPED: docs-only`, no findings.
15
- 3. History (≤3 files): one `git log -n 5 --oneline -- f1 f2 f3` when available.
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
- ## Focus
19
- Bugs and security first; explicit rule violations second; comment/TODO respect third. High signal only.
17
+ ## 重点关注
18
+ 逻辑致命缺陷与安全隐患第一,明确的规范冲突第二。不提废话风格建议。
20
19
 
21
- ## Output format (Markdown report ending in a JSON block)
22
- Write your final message as Markdown:
20
+ ## 输出格式(必须使用中文撰写总结与描述)
21
+ 请以 Markdown 格式输出最终回复:
23
22
 
24
23
  ## Summary
25
- One short paragraph.
24
+ 一句话中文总结。
26
25
 
27
26
  ## Findings
28
- One bullet per issue: `- [SEVERITY|category|confidence] `path:line`evidence`. `No findings.` when clean.
27
+ 每个问题一行:`- [SEVERITY|category|confidence] 文件路径:行号中文问题描述与证据`。无问题写 `No findings.`。
29
28
 
30
29
  ## Coverage
31
- - Files checked:
32
- - Commands run:
33
- - Limitations: …
30
+ - Files checked: 检查的文件
31
+ - Limitations: 审查局限说明
34
32
 
35
- Then finish with EXACTLY one fenced JSON block (machine-read by the parent):
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": "", "fingerprint": "src/x.ts:10:bug:a1b2c3" }
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": "One sentence.",
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: Security review of introduced lines — injection, authz, secrets, SSRF, path traversal.
4
+ description: 安全审查专家:排查注入漏洞、数据泄露、未鉴权访问与安全隐患。
5
5
  tools: read, grep, bash
6
6
  systemPromptMode: replace
7
7
  inheritProjectContext: false
8
8
  inheritSkills: false
9
9
  ---
10
- You are the security reviewer. Find **security issues introduced or worsened by this change**.
10
+ 你是安全审查专家(Security Reviewer)。你的任务是审查**本次修改是否引入了安全风险与漏洞**。
11
11
 
12
- ## Turn plan
13
- 1. Read the diff file named in your task. If the change profile says docs-only, report `SKIPPED: docs-only` and no findings.
14
- 2. Diff-first; at most **3** extra file reads. Optional `git show`/`log`/`blame -L` for call sites — simple commands only.
15
- 3. Write your Markdown report (format below) as your final message and stop. Target ≤8 turns.
12
+ ## 执行计划
13
+ 1. 读取任务中的 diff 文件。若为纯文档修改,输出 `SKIPPED: docs-only`。
14
+ 2. 重点排查:敏感凭据/Token 硬编码、命令/SQL 注入、未经验证的用户输入、路径遍历、越权访问。
15
+ 3. 输出你的 Markdown 审查报告作为最终消息。
16
16
 
17
- ## Checklist
18
- Injection, missing authn/authz / IDOR, secrets in code/logs, SSRF, path traversal, unsafe deserialization, weak crypto, permissive CORS/cookies.
19
-
20
- ## Severity
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
- One short paragraph. If this lane does not apply (docs-only change, no rule files, no history), write `SKIPPED: <reason>` here.
24
+ 中文概述。若跳过写 `SKIPPED: <原因>`。
30
25
 
31
26
  ## Findings
32
- One bullet per issue, in this exact shape:
33
- - [SEVERITY|security|confidence] `path/to/file.ts:123`evidence quote or precise description
27
+ 每个问题一行,严格遵循以下结构(中文说明漏洞):
28
+ - [SEVERITY|security|confidence] `文件路径:行号`中文安全问题描述与修复建议
34
29
 
35
- SEVERITY is blocker|major|minor|nit; confidence is 1–10. If you have no findings, write exactly `No findings.`
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,4 +1,4 @@
1
- import { existsSync, readFileSync } from "node:fs";
1
+ import { existsSync, readFileSync } from "node:fs";
2
2
  import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
3
3
 
4
4
  import { parseReviewArgs } from "./src/cli-args.js";
@@ -1,6 +1,6 @@
1
- {
1
+ {
2
2
  "name": "@unifan/pi-review-zh",
3
- "version": "1.0.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
- import type {
1
+ import type {
2
2
  GateDisposition,
3
3
  GateRunResult,
4
4
  Issue,
@@ -1,4 +1,4 @@
1
- import { Box, Text } from "@earendil-works/pi-tui";
1
+ import { Box, Text } from "@earendil-works/pi-tui";
2
2
  import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
3
3
 
4
4
  import type { IssueSeverity, Verdict } from "./types.js";
@@ -1,4 +1,4 @@
1
- # 📜 @unifan/pi-sessions-zh (历史会话管理器·中文版)
1
+ # 📜 @unifan/pi-sessions-zh (历史会话管理器·中文版)
2
2
 
3
3
  为 **Pi Coding Agent** 打造的高颜值双栏历史会话选择器与实时预览恢复扩展。
4
4
 
@@ -1,4 +1,4 @@
1
- import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
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,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unifan/pi-sessions-zh",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Pi 历史会话管理器(双栏可视化 TUI 预览与恢复,中文增强版)",
5
5
  "type": "module",
6
6
  "main": "./index.ts",
@@ -18,4 +18,3 @@
18
18
  "author": "unifan",
19
19
  "license": "MIT"
20
20
  }
21
-
@@ -1,4 +1,4 @@
1
- export interface SessionInfoLike {
1
+ export interface SessionInfoLike {
2
2
  id: string;
3
3
  name?: string;
4
4
  cwd: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unifan/pi-unifan-zh",
3
- "version": "1.0.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
@@ -1,4 +1,4 @@
1
- # 🎯 Pi Skills 目录 (自定义技能库)
1
+ # 🎯 Pi Skills 目录 (自定义技能库)
2
2
 
3
3
  此目录用于存放你自定义的 Pi Agent Skills。
4
4