@pigcloud/skills 1.0.6 → 1.0.7

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/CHANGELOG.md CHANGED
@@ -1,71 +1,34 @@
1
- # Pig Skills CHANGELOG
2
-
3
- > 鐗堟湰鍙樻洿璁板綍锛岄伒寰?Semantic Versioning
4
-
5
- ---
6
-
7
- ## [1.1.1] - 2026-06-18
8
-
9
- ### Changed
10
- - Made postinstall client-aware so it can auto-install into the detected client(s) from `INIT_CWD`.
11
- - Kept Codex as the only client with a real command pack so `/spec-refinement` remains the executable entry instead of a fake alias.
12
- - Extended `pig-skills auto` to install the matching client folders for Codex, Claude Code, Trae, Cursor, Copilot, and Windsurf.
13
- - Clarified in the README and usage docs that only Codex gets `/spec-refinement`-style command files, while other clients receive skills and rules.
14
- - Unified the usage guides around the same client-detection and knowledge-capture model.
15
-
16
- ## [1.1.0] - 2026-06-18
17
-
18
- ### Changed
19
- - 閲嶆瀯 skill 浣撶郴璇存槑锛屾寜褰撳墠 13 涓?skill 閲嶆柊姊崇悊 README 鍜屼娇鐢ㄦ柟寮?
20
- - 琛ュ厖缁熶竴鏍¢獙鍏ュ彛 `validate-skills.js`锛屽苟澧炲姞 Windows / macOS / Linux 澹?
21
- - 灏嗕究鎼?Python 绾冲叆浠撳簱鍐咃紝閬垮厤渚濊禆绯荤粺鐜
22
- - 缁熶竴 `spec-refinement`銆乣knowledge-capture`銆乣workflow-router` 绛夐珮棰?skill 鐨勮瘑鍒笌闂ㄧ琛ㄨ揪
23
- - 鏀剁缉 skill frontmatter锛屾寜瀹樻柟 validator 瑙勮寖淇濈暀鏈€灏忓瓧娈?
24
- - 灏?`handover` 鍚堝苟杩?`knowledge-capture`锛屽垹闄ょ嫭绔嬩氦鎺?skill
25
-
26
- ### Added
27
- - `validate-skills.js`
28
- - `validate-skills.cmd`
29
- - `validate-skills.sh`
30
- - `.tools/python.cmd`
31
- - `.tools/python.sh`
32
-
33
- ## [1.0.0] - 2024-01-20
34
-
35
- ### Added
36
- - 鍒濆鍙戝竷锛屽寘鍚?12 涓鏋剁粦瀹氭妧鑳?
37
- - OpenSpec 鏍囧噯鍖栬鑼?
38
- - 涓夊眰娓愯繘寮忓姞杞芥満鍒?
39
- - 璺ㄥ伐鍏峰吋瀹规敮鎸侊紙Trae/Cursor/Claude Code/Copilot/Windsurf锛?
40
- - CLI 宸ュ叿锛坧ig-skills 鍛戒护锛?
41
-
42
- ### Skills
43
- - **Core**: workflow-router, technical-design, feature-build, code-review
44
- - **Analysis**: spec-refinement, domain-modeling
45
- - **Integration**: api-contract-docs, test-design
46
- - **Collaboration**: knowledge-capture
47
- - **Infrastructure**: project-bootstrap, environment-deploy
48
-
49
- ### Core Bindings
50
- - Controller 鈫?Service 鈫?Mapper 鍒嗗眰
51
- - MpRealDelEntity / MpLogicDelEntity 鍩虹被
52
- - Result<T> 缁熶竴杩斿洖
53
- - BizException 寮傚父浣撶郴
54
- - Lambda 鏌ヨ琛ㄨ揪寮?
55
-
56
- ---
57
-
58
- ## 璁″垝鏇存柊
59
-
60
- ### [1.2.0] - TBD
61
- - 鎶€鑳芥ā鏉垮彲瑙嗗寲
62
- - 鎶€鑳界粍鍚堢紪鎺掑櫒
63
- - 鏇村妗嗘灦鐗瑰畾瑙勫垯
64
-
65
- ### [2.0.0] - TBD
66
- - 鎶€鑳藉彂甯冨钩鍙?
67
- - 鎶€鑳借闃呮満鍒?
68
- - 澶氭鏋舵敮鎸?
69
-
70
-
71
-
1
+ # Pig Skills Changelog
2
+
3
+ > 版本变更记录,遵循 Semantic Versioning
4
+
5
+ ## [1.1.1] - 2026-06-18
6
+
7
+ - 调整 postinstall,让它能根据当前客户端自动安装到对应工作区。
8
+ - 保持 Codex 的命令包入口可用,让 `/spec-refinement` 仍然是可执行入口。
9
+ - 扩展 `pig-skills auto`,支持 Codex、Claude Code、Trae、Cursor、Copilot 和 Windsurf。
10
+ - README 和使用文档中统一说明:不同客户端共享同一套 skills rules,但命令入口不同。
11
+ - 统一客户端检测、知识沉淀和交付说明。
12
+
13
+ ## [1.1.0] - 2026-06-18
14
+
15
+ - 重构技能体系说明,按当前 13 个 skill 重新整理 README 和使用方式。
16
+ - 补充统一校验入口 `validate-skills.js`,并增加 Windows / macOS / Linux 支持。
17
+ - 将便携 Python 纳入仓库内,避免依赖系统环境。
18
+ - 统一 `spec-refinement`、`knowledge-capture`、`workflow-router` 等高频 skill 的识别与门禁表达。
19
+ - 收缩 skill frontmatter,按官方 validator 规范保留最小字段。
20
+ - `handover` 合并入 `knowledge-capture`,删除独立交接 skill。
21
+
22
+ ## [1.0.6] - 2026-06-23
23
+
24
+ - 将包名迁移为 `@pigcloud/skills`。
25
+ - 统一 Codex、Trae、Claude Code 的安装和更新说明。
26
+ - 收拢技能命名,让名称更直观、更容易理解。
27
+
28
+ ## [1.0.5] - 2026-06-18
29
+
30
+ - 初始发布,包含 12 个框架绑定技能。
31
+ - 建立 OpenSpec 标准化说明。
32
+ - 引入三层渐进式加载机制。
33
+ - 支持 Trae / Cursor / Claude Code / Copilot / Windsurf 等工具。
34
+ - 提供 `pig-skills` CLI 工具。
package/README.md CHANGED
@@ -1,76 +1,54 @@
1
- # @pigcloud/skills
2
-
3
- > 涓€涓潰鍚戜骇鍝併€佺爺鍙戙€佹祴璇曞崗浣滅殑 AI 鎶€鑳藉寘銆俙skills/` 璐熻矗浠诲姟杈圭晫涓庝氦鎺ワ紝`rules/` 璐熻矗瑙勫垯绾︽潫涓庢牎楠岋紝`workflow-router` 璐熻矗闃舵璺敱锛宍CI / Test / Evidence` 璐熻矗浜や粯闂幆銆?
4
-
5
- ## 杩欏绯荤粺鍋氫粈涔?
6
-
7
- - 鍏堣矾鐢憋紝鍐嶆墽琛?
8
- - 鍏堢害鏉燂紝鍐嶇敓鎴?
9
- - 鍏堝鐢紝鍐嶆敼鍐?
10
- - 鍏堥獙璇侊紝鍐嶇粨璁?
11
-
12
- ## 鏍稿績灞?
13
-
14
- 1. `workflow-router`锛氳瘑鍒换鍔$被鍨嬪苟閫夋嫨涓嬩竴闃舵
15
- 2. `skills/`锛氬彲澶嶇敤鐨勮兘鍔涙ā鍧?
16
- 3. `rules/`锛氶」鐩害鏉熴€佽竟鐣屽拰纭牎楠?
17
- 4. `CI / Test / Evidence`锛氬彲楠岃瘉鐨勪氦浠橀棬绂?
18
-
19
- ## 甯哥敤鍏ュ彛
20
-
21
- - 瑙勬牸婢勬竻锛歚spec-refinement`
22
- - 闃舵璺敱锛歚workflow-router`
23
- - 璁捐涓庡疄鐜帮細`technical-design` / `feature-build`
24
- - 瀹℃煡涓庨獙璇侊細`code-review` / `security-audit` / `performance-audit`
25
- - 浜嬪疄鎶藉彇锛歚business-fact-extraction`
26
- - 鐭ヨ瘑娌夋穩锛歚knowledge-capture`
27
-
28
- ## 瀹夎
29
-
30
- ```bash
31
- npm install -g @pigcloud/skills
32
- ```
33
-
34
- ## 瀹㈡埛绔帴鍏?
35
-
36
- - Codex锛氳 [docs/CODEX-APP-GUIDE.md](docs/CODEX-APP-GUIDE.md)
37
- - Trae锛氳 [docs/TRAE-GUIDE.md](docs/TRAE-GUIDE.md)
38
- - Claude Code锛氳 [docs/CLAUDE-CODE-GUIDE.md](docs/CLAUDE-CODE-GUIDE.md)
39
- - 缁熶竴瀹夎鎸囧崡锛氳 [docs/client-installation-guide.md](docs/client-installation-guide.md)
40
-
41
- ## 娌荤悊姒傝
42
-
43
- - 绯荤粺鎬昏锛氳 [docs/agent-governance-overview.md](docs/agent-governance-overview.md)
44
- - 鎶€鑳芥墿灞曟寚鍗楋細瑙?[docs/skills-extension-guide.md](docs/skills-extension-guide.md)
45
-
46
- ## 鏍¢獙
47
-
48
- ```bash
49
- node validate-skills.js
50
- node scripts/validate-skill-shapes.js
51
- node scripts/validate-rules.js
52
- node scripts/validate-skill-stop-rules.js
53
- node scripts/validate-skill-replay-signals.js
54
- node self-test-skills.js
55
- ```
56
-
57
- ## 鐩綍璇存槑
58
-
59
- - `skills/`锛氭妧鑳芥鏂?
60
- - `skills/references/`锛氱紪鍐欐爣鍑嗐€佸弬鑰冪煩闃点€佸姞杞芥槧灏?
61
- - `rules/`锛氳鍒欏叆鍙d笌瑙勫垯鍖?
62
- - `docs/`锛氬畨瑁呫€佹不鐞嗗拰宸ヤ綔娴佽鏄?
63
- - `bin/`锛欳LI銆佽嚜鍔ㄥ畨瑁呫€乸ostinstall
64
-
65
- ## 鍏ュ彛鏂囨。
66
-
67
- - [AGENTS.md](AGENTS.md)
68
- - [docs/README.md](docs/README.md)
69
- - [docs/client-installation-guide.md](docs/client-installation-guide.md)
70
- - [docs/agent-governance-overview.md](docs/agent-governance-overview.md)
71
- - [docs/skills-extension-guide.md](docs/skills-extension-guide.md)
72
- - [skills/references/skill-authoring-standard.md](skills/references/skill-authoring-standard.md)
73
- - [skills/references/skill-reference-matrix.md](skills/references/skill-reference-matrix.md)
74
- - [skills/references/rule-loading-map.md](skills/references/rule-loading-map.md)
75
-
76
-
1
+ # @pigcloud/skills
2
+
3
+ > 一个面向产品、研发、测试协作的 AI 技能包。`skills/` 负责任务边界与交接,`rules/` 负责规则约束与校验,`workflow-router` 负责阶段路由,`CI / Test / Evidence` 负责交付闭环。
4
+
5
+ ## 这套系统做什么
6
+
7
+ - 先路由,再执行
8
+ - 先约束,再生成
9
+ - 先复用,再改造
10
+ - 先验证,再结论
11
+
12
+ ## 核心层
13
+
14
+ 1. `workflow-router`:识别任务类型并选择下一阶段
15
+ 2. `skills/`:可复用的能力模块
16
+ 3. `rules/`:项目约束、边界和硬校验
17
+ 4. `CI / Test / Evidence`:可验证的交付门槛
18
+
19
+ ## 常用入口
20
+
21
+ - 规格细化:`spec-refinement`
22
+ - 阶段路由:`workflow-router`
23
+ - 设计与实现:`technical-design` / `feature-build`
24
+ - 审查与验证:`code-review` / `security-audit` / `performance-audit`
25
+ - 事实提取:`business-fact-extraction`
26
+
27
+ ## 安装
28
+
29
+ ```bash
30
+ npm install -g @pigcloud/skills
31
+ ```
32
+
33
+ 安装后可使用 `pig-skills` CLI。
34
+
35
+ ## 目录说明
36
+
37
+ - `skills/`:技能定义与交接边界
38
+ - `skills/references/`:编写标准、参考矩阵、加载映射
39
+ - `rules/`:规则入口与规则覆盖层
40
+ - `docs/`:安装、治理和工作流说明
41
+ - `bin/`:CLI 与自动安装逻辑
42
+
43
+ ## 客户端安装指南
44
+
45
+ 具体的 Codex、Trae、Claude Code 安装方式见 [docs/client-installation-guide.md](docs/client-installation-guide.md)。
46
+
47
+ ## 相关文档
48
+
49
+ - [README.en.md](README.en.md)
50
+ - [docs/README.md](docs/README.md)
51
+ - [docs/client-installation-guide.md](docs/client-installation-guide.md)
52
+ - [skills/references/skill-reference-matrix.md](skills/references/skill-reference-matrix.md)
53
+ - [skills/references/rule-loading-map.md](skills/references/rule-loading-map.md)
54
+ - [rules/index.md](rules/index.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pigcloud/skills",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "面向 Codex、Trae 和 Claude Code 的 AI 技能包,提供共享技能、规则约束、工作流路由和 Pig Cloud 专属覆盖层。",
5
5
  "author": "Pig Skills Maintainers",
6
6
  "license": "MIT",
@@ -1,31 +1,26 @@
1
- # Coding Implementation Rules
2
-
3
- ## 榛樿鍋氭硶
4
-
5
- - Implement only the confirmed scope.
6
- - Keep the change small, reviewable, and verifiable.
7
- - Preserve the agreed boundary while coding.
8
- - Prefer one implementation path over speculative alternatives unless the task explicitly asks for options.
9
-
10
- ## 绂佸尯
11
-
12
- - Do not rewrite the spec-refinement while implementing.
13
- - Do not widen the scope because implementation is difficult.
14
- - Do not skip validation.
15
- - Do not bundle unrelated cleanup into the same change unless it reduces risk.
16
-
17
- ## 妫€鏌?
18
-
19
- - Does the code stay within scope?
20
- - Can the result be validated locally?
21
- - Is the implementation easy to review in one pass?
22
- - Would the diff still make sense if the task title were removed?
23
-
24
- ## 鍥炴斁淇″彿
25
-
26
- - Trigger when the request is about delivery, refactor, or code changes.
27
-
28
- ## References
29
-
30
- - `coding/index.md`
31
-
1
+ # Coding Implementation Rules
2
+
3
+ ## 默认做法
4
+
5
+ - Implement only the confirmed scope.
6
+ - Keep the change small, reviewable, and verifiable.
7
+ - Preserve the agreed boundary while coding.
8
+ - Prefer one implementation path over speculative alternatives unless the task explicitly asks for options.
9
+
10
+ ## 禁区
11
+
12
+ - Do not rewrite the spec-refinement while implementing.
13
+ - Do not widen the scope because implementation is difficult.
14
+ - Do not skip validation.
15
+ - Do not bundle unrelated cleanup into the same change unless it reduces risk.
16
+
17
+ ## 检查
18
+
19
+ - Does the code stay within scope?
20
+ - Can the result be validated locally?
21
+ - Is the implementation easy to review in one pass?
22
+ - Would the diff still make sense if the task title were removed?
23
+
24
+ ## 回放信号
25
+
26
+ - Trigger when the task is about implementing a confirmed change.
@@ -1,30 +1,29 @@
1
- # Project Context Rules
2
-
3
- ## 榛樿鍋氭硶
4
-
5
- - Capture what the current project already guarantees before rewriting the requirement.
6
- - Separate product intent, existing project facts, and assumptions.
7
- - Prefer current repo docs, release notes, and existing behavior over memory.
8
- - Record conflicts when product demand does not match current project facts.
9
-
10
- ## 绂佸尯
11
-
12
- - Do not turn implementation details into product requirements.
13
- - Do not ignore existing project facts when they are available.
14
- - Do not hide conflicts behind vague wording.
15
-
16
- ## 妫€鏌?
17
-
18
- - Are product intent and project facts separated?
19
- - Are conflicts and open questions explicit?
1
+ # Project Context Rules
2
+
3
+ ## 项目上下文规则
4
+
5
+ - Capture what the current project already guarantees before rewriting the requirement.
6
+ - Separate product intent, existing project facts, and assumptions.
7
+ - Prefer current repo docs, release notes, and existing behavior over memory.
8
+ - Record conflicts when product demand does not match current project facts.
9
+
10
+ ## 禁区
11
+
12
+ - Do not turn implementation details into product requirements.
13
+ - Do not ignore existing project facts when they are available.
14
+ - Do not hide conflicts behind vague wording.
15
+
16
+ ## 检查项
17
+
18
+ - Are product intent and project facts separated?
19
+ - Are conflicts and open questions explicit?
20
20
  - Does the output still work for spec-refinement?
21
- - Is the project context based on current evidence?
22
-
23
- ## 鍥炴斁淇″彿
24
-
25
- - Trigger when the task needs product understanding aligned with the current project state.
26
-
27
- ## References
28
-
29
- - `product/index.md`
30
-
21
+ - Is the project context based on current evidence?
22
+
23
+ ## 触发信号
24
+
25
+ - Trigger when the task needs product understanding aligned with the current project state.
26
+
27
+ ## References
28
+
29
+ - `product/index.md`
@@ -1,214 +1,39 @@
1
- # 代码评审报告模板
2
-
3
- > 用于 code-review Skill 输出的标准格式
4
-
5
- ---
6
-
7
- ## 模板内容
8
-
9
- ```markdown
10
- # 代码评审报告
11
-
12
- ## 评审概要
13
-
14
- | 字段 | 内容 |
15
- |------|------|
16
- | 评审时间 | {datetime} |
17
- | 评审文件数 | {count} |
18
- | 变更行数 | +{add} / -{del} |
19
- | 评审耗时 | {duration} |
20
- | 规则覆盖率 | {coverage}% |
21
- | Rubric 评分 | {score}/10 |
22
-
23
- ---
24
-
25
- ## 问题列表
26
-
27
- ### P0 问题(阻断性 - 必须修复)
28
-
29
- #### 问题 #1
30
-
31
- | 字段 | 内容 |
32
- |------|------|
33
- | 文件 | `{filePath}` |
34
- | 行号 | {lineNumber} |
35
- | 规则 | {ruleId}: {ruleName} |
36
- | 类型 | MUST / NEVER |
37
- | 问题 | {问题描述} |
38
- | 代码 | `{问题代码片段}` |
39
- | 修复 | `{修复建议}` |
40
- | 依据 | [规则定义](references/rules.md#{ruleId}) |
41
-
42
- ---
43
-
44
- ### P1 问题(严重 - 必须修复)
45
-
46
- #### 问题 #2
47
-
48
- | 字段 | 内容 |
49
- |------|------|
50
- | 文件 | `{filePath}` |
51
- | 行号 | {lineNumber} |
52
- | 规则 | {ruleId}: {ruleName} |
53
- | 类型 | MUST / NEVER |
54
- | 问题 | {问题描述} |
55
- | 代码 | `{问题代码片段}` |
56
- | 修复 | `{修复建议}` |
57
- | 依据 | [规则定义](references/rules.md#{ruleId}) |
58
-
59
- ---
60
-
61
- ### P2 问题(最佳实践 - 建议修复)
62
-
63
- #### 问题 #3
64
-
65
- | 字段 | 内容 |
66
- |------|------|
67
- | 文件 | `{filePath}` |
68
- | 行号 | {lineNumber} |
69
- | 规则 | {ruleId}: {ruleName} |
70
- | 问题 | {问题描述} |
71
- | 修复 | `{修复建议}` |
72
-
73
- ---
74
-
75
- ### P3 问题(建议改进)
76
-
77
- #### 问题 #4
78
-
79
- | 字段 | 内容 |
80
- |------|------|
81
- | 文件 | `{filePath}` |
82
- | 规则 | {ruleId}: {ruleName} |
83
- | 问题 | {问题描述} |
84
- | 建议 | `{改进建议}` |
85
-
86
- ---
87
-
88
- ## 跨模块影响分析
89
-
90
- ### 变更文件
91
-
92
- | 文件 | 类型 | 模块 |
93
- |------|------|------|
94
- | `{filePath}` | 新增 / 修改 / 删除 | `{module}` |
95
-
96
- ### 影响模块
97
-
98
- | 模块 | 影响类型 | 变更内容 | 建议 |
99
- |------|----------|----------|------|
100
- | `{module}` | API变更 / 依赖变更 / 数据变更 | `{content}` | `{suggestion}` |
101
-
102
- ### 依赖关系图
103
-
104
- ```
105
- {moduleA} → {moduleB} → {moduleC}
106
-
107
- {moduleD}
108
- ```
109
-
110
- ---
111
-
112
- ## 安全检查结果
113
-
114
- | 维度 | 结果 | 问题数 | 详情 |
115
- |------|------|--------|------|
116
- | 硬编码 | ✅ / ⚠️ | {count} | {details} |
117
- | 日志 | ✅ / ⚠️ | {count} | {details} |
118
- | SQL注入 | ✅ / ⚠️ | {count} | {details} |
119
- | XSS | ✅ / ⚠️ | {count} | {details} |
120
-
121
- ---
122
-
123
- ## 性能检查结果
124
-
125
- | 维度 | 结果 | 问题数 | 详情 |
126
- |------|------|--------|------|
127
- | N+1查询 | ✅ / ⚠️ | {count} | {details} |
128
- | Left-fuzzy LIKE | ✅ / ⚠️ | {count} | {details} |
129
- | 批量操作 | ✅ / ⚠️ | {count} | {details} |
130
-
131
- ---
132
-
133
- ## Rubric 自检结果
134
-
135
- | 规则 | 结果 | 说明 |
136
- |------|------|------|
137
- | R1: 渐进式加载 | ✅ / ⚠️ | {message} |
138
- | R2: 规则覆盖率 | ✅ / ⚠️ | {coverage}% |
139
- | R3: 位置准确性 | ✅ / ⚠️ | 偏差 {diff} 行 |
140
- | R4: 可解释性 | ✅ / ⚠️ | {coverage}% |
141
- | R5: 问题分级 | ✅ / ⚠️ | {message} |
142
- | R6: 跨模块影响 | ✅ / ⚠️ | {message} |
143
- | R7: 输出格式 | ✅ / ⚠️ | {message} |
144
- | R8: 确认节点 | ✅ / ⚠️ | {message} |
145
- | R9: Pre-Delivery | ✅ / ⚠️ | {message} |
146
- | R10: 反 Slop | ✅ / ⚠️ | {message} |
147
-
148
- ---
149
-
150
- ## 评审结论
151
-
152
- | 结论 | 条件 | 当前状态 |
153
- |------|------|----------|
154
- | ✅ 通过 | 0 个 P0/P1 问题 | {status} |
155
- | ⚠️ 需修改后通过 | 有 P0/P1 问题,修复后重新评审 | {status} |
156
- | ❌ 不通过 | >5 个 P0 问题 | {status} |
157
-
158
- ---
159
-
160
- ## 下一步建议
161
-
162
- 1. {修复建议1}
163
- 2. {修复建议2}
164
- 3. 执行 `mvn compile -q` 验证编译
165
- 4. 执行 `mvn test -q` 验证测试
166
- 5. 重新提交评审
167
-
168
- ---
169
-
170
- ## 评审人
171
-
172
- | 字段 | 内容 |
173
- |------|------|
174
- | 评审工具 | pig-skills code-review v{version} |
175
- | 评审模型 | {model} |
176
- | Rubric 评分 | {score}/10 |
177
-
178
- ---
179
-
180
- *报告生成时间: {timestamp}*
181
- ```
182
-
183
- ---
184
-
185
- ## 使用说明
186
-
187
- ### 填充变量
188
-
189
- | 变量 | 来源 |
190
- |------|------|
191
- | `{datetime}` | 当前时间 |
192
- | `{count}` | Git diff 文件数 |
193
- | `{add}` / `{del}` | Git diff 行数统计 |
194
- | `{duration}` | 评审耗时 |
195
- | `{coverage}` | lint 脚本计算 |
196
- | `{score}` | Rubric 自检结果 |
197
- | `{filePath}` | 变更文件路径 |
198
- | `{lineNumber}` | lint 脚本定位 |
199
- | `{ruleId}` | 规则ID(MUST-001 等) |
200
- | `{ruleName}` | 规则名称 |
201
- | `{module}` | 模块名称(包路径) |
202
-
203
- ### 输出位置
204
-
205
- ```
206
- .agents/specs/REVIEW-{timestamp}.md
207
- ```
208
-
209
- ### 命名规则
210
-
211
- ```
212
- REVIEW-{YYYYMMDD}-{HHMMSS}.md
213
- 例如: REVIEW-20260616-143000.md
214
- ```
1
+ # 代码审查报告模板
2
+
3
+ > 代码审查结果的标准输出格式,用于保持结论清晰、可复核、可归档。
4
+
5
+ ---
6
+
7
+ ## 基本信息
8
+
9
+ | 字段 | 说明 |
10
+ |------|------|
11
+ | 审查时间 | {datetime} |
12
+ | 审查对象 | {repo / branch / pr} |
13
+ | 审查人 | {reviewer} |
14
+ | 审查范围 | {diff / files / modules} |
15
+
16
+ ## 结论摘要
17
+
18
+ - 总体结论:{pass / pass with comments / fail}
19
+ - 风险等级:{low / medium / high}
20
+ - 是否建议合并:{yes / no}
21
+
22
+ ## 发现项
23
+
24
+ | 等级 | 文件 | 问题 | 建议 |
25
+ |------|------|------|------|
26
+ | P0 | {file} | {issue} | {fix} |
27
+ | P1 | {file} | {issue} | {fix} |
28
+ | P2 | {file} | {issue} | {fix} |
29
+
30
+ ## 验证信息
31
+
32
+ - 已运行的检查:{lint / test / manual check}
33
+ - 未覆盖的风险:{gaps}
34
+ - 需要补充的证据:{evidence}
35
+
36
+ ## 备注
37
+
38
+ - 如果没有发现问题,也要明确说明“未发现阻断项”。
39
+ - 如果有假设,要明确标注假设来源。
@@ -1,152 +1,44 @@
1
- # 蒸馏质量验收检查清单
2
-
3
- > 用于验证蒸馏产物是否符合规范
4
-
5
- ---
6
-
7
- ## 静态检查清单
8
-
9
- ### 目录结构检查
10
-
11
- - [ ] `distilled/` 目录存在
12
- - [ ] `README.md` 存在且内容完整
13
- - [ ] `00-overview.md` 存在且包含"给 AI 的关键约定"
14
- - [ ] `01-glossary.md` 存在
15
- - [ ] `domain/_index.md` 存在
16
- - [ ] `domain/<对象>.md` 每个核心对象一个文件
17
- - [ ] `api/_index.md` 存在且包含典型编排
18
- - [ ] `api/<域>/<用例>.md` 每个用例一个文件
19
- - [ ] `reference/schema/*.md` 字段级 Schema
20
- - [ ] `reference/enums.md` 存在
21
- - [ ] `reference/error-codes.md` 存在
22
- - [ ] `reference/model-code-conflicts.md` 存在
23
- - [ ] `requirements/_index.md` 存在
24
-
25
- ---
26
-
27
- ### 领域对象检查
28
-
29
- - [ ] 每个对象有"一句话定义"
30
- - [ ] 每个对象有"业务语义"段落
31
- - [ ] 每个对象有"生命周期/状态"段落
32
- - [ ] 每个对象有"关键属性"表(语义级)
33
- - [ ] 每个对象有"组合/关系"说明
34
- - [ ] 每个对象有"核心业务规则"段落
35
- - [ ] 每条规则有执行方标注(【服务端强制】/【调用方需预判】等)
36
- - [ ] 每个对象有"相关能力"链接
37
- - [ ] 每个对象有"明细索引"
38
-
39
- ---
40
-
41
- ### API 接口检查
42
-
43
- - [ ] 每个接口有"业务场景"说明
44
- - [ ] 每个接口有"能力边界"说明(做什么/不做什么)
45
- - [ ] 每个接口有"输入"表(参数/类型/必填/说明/约束)
46
- - [ ] 每个接口有"输出"表(字段/说明)
47
- - [ ] 每个接口有"关键规则"段落
48
- - [ ] 每条规则有执行方标注
49
- - [ ] 每个接口有"涉及的数据对象"链接
50
- - [ ] 每个接口有"可能的错误"表
51
- - [ ] 每个接口有"调用示例"(真实可用)
52
- - [ ] 每个接口有"写权限分级"
53
-
54
- ---
55
-
56
- ### 明细层检查
57
-
58
- - [ ] Schema 表有"对应领域属性/API字段"列
59
- - [ ] 枚举表有 ✅/⚠️ 标记
60
- - [ ] 错误码表有"AI 应如何向用户解释"列
61
- - [ ] 冲突清单有"本体/需求"、"代码"、"AI 影响"三列
62
-
63
- ---
64
-
65
- ### 交叉引用检查
66
-
67
- - [ ] 所有链接使用 `[[slug]]` 格式
68
- - [ ] 对象↔接口↔Schema 三者互相链接
69
- - [ ] 无明显断链(链接目标不存在但未标记"待补")
70
-
71
- ---
72
-
73
- ### 命名规范检查
74
-
75
- - [ ] 文件名使用小写 kebab-case
76
- - [ ] API 字段沿用代码实际返回的命名
77
- - [ ] 枚举值使用业务实际值(含中文)
78
-
79
- ---
80
-
81
- ## 动态验证清单
82
-
83
- ### 读/查询场景
84
-
85
- | 测试 | 验证内容 | 结果 |
86
- |------|----------|------|
87
- | 名称→ID 解析 | AI 能正确调用主数据接口解析名称 | ✅/❌ |
88
- | 查询参数 | AI 能正确构造查询参数 | ✅/❌ |
89
- | 结果解读 | AI 能正确解读返回结果 | ✅/❌ |
90
-
91
- ### 写/录入场景
92
-
93
- | 测试 | 验证内容 | 结果 |
94
- |------|----------|------|
95
- | 必填字段 | AI 能识别必填字段并提示用户 | ✅/❌ |
96
- | 用例编排 | AI 能按正确顺序调用接口 | ✅/❌ |
97
- | 服务端维护字段 | AI 不传入服务端维护字段 | ✅/❌ |
98
- | 回显确认 | 写操作前回显给用户确认 | ✅/❌ |
99
-
100
- ### 统计场景
101
-
102
- | 测试 | 验证内容 | 结果 |
103
- |------|----------|------|
104
- | 口径理解 | AI 能正确理解统计接口口径 | ✅/❌ |
105
- | 参数构造 | AI 能正确构造统计参数 | ✅/❌ |
106
-
107
- ### 规则反例场景
108
-
109
- | 测试 | 验证内容 | 结果 |
110
- |------|----------|------|
111
- | 规则预判 | AI 能预判违反规则的错误 | ✅/❌ |
112
- | 错误解释 | AI 能根据 error-codes.md 解释错误 | ✅/❌ |
113
-
114
- ---
115
-
116
- ## 验证结论
117
-
118
- | 检查项 | 通过数 | 总数 | 通过率 |
119
- |--------|--------|------|--------|
120
- | 目录结构 | | 13 | |
121
- | 领域对象 | | 9 | |
122
- | API 接口 | | 10 | |
123
- | 明细层 | | 4 | |
124
- | 交叉引用 | | 3 | |
125
- | 命名规范 | | 3 | |
126
- | 动态验证 | | 12 | |
127
-
128
- **总通过率要求**: >= 90%
129
-
130
- ---
131
-
132
- ## 验证记录
133
-
134
- | 日期 | 验证人 | 通过率 | 备注 |
135
- |------|--------|--------|------|
136
- | | | | |
137
-
138
- ---
139
-
140
- ## 发现的问题
141
-
142
- 1.
143
- 2.
144
- 3.
145
-
146
- ---
147
-
148
- ## 修复计划
149
-
150
- | 问题 | 修复方案 | 状态 |
151
- |------|----------|------|
152
- | | | 待修复/已修复 |
1
+ # 领域提炼检查清单
2
+
3
+ > 用于检查领域建模提炼结果是否满足规范、是否可交接、是否可复用。
4
+
5
+ ---
6
+
7
+ ## 目录结构
8
+
9
+ - [ ] `distilled/` 目录已创建
10
+ - [ ] `README.md` 已说明提炼目标
11
+ - [ ] `00-overview.md` 已说明 AI 的关键约束
12
+ - [ ] `01-glossary.md` 已收录术语
13
+ - [ ] `domain/_index.md` 已建立索引
14
+ - [ ] `domain/<name>.md` 每个核心域有独立文件
15
+ - [ ] `api/_index.md` 已建立接口索引
16
+ - [ ] `api/<group>/<name>.md` 每个接口组都有独立文件
17
+ - [ ] `reference/schema/*.md` 字段级 Schema 已整理
18
+ - [ ] `reference/enums.md` 枚举已整理
19
+
20
+ ## 内容检查
21
+
22
+ - [ ] 领域边界已明确
23
+ - [ ] 核心概念已抽取
24
+ - [ ] 术语表与代码命名一致
25
+ - [ ] 当前事实与推断已区分
26
+ - [ ] 关键不变量已记录
27
+
28
+ ## 证据检查
29
+
30
+ - [ ] 每个结论都有代码、文档或会议纪要支撑
31
+ - [ ] 关键例子可追溯到原始来源
32
+ - [ ] 没有把猜测写成事实
33
+
34
+ ## 交接检查
35
+
36
+ - [ ] 输出可以交给 `spec-refinement`
37
+ - [ ] 输出可以交给 `technical-design`
38
+ - [ ] 输出可以交给 `knowledge-capture`
39
+ - [ ] 文件命名遵守 kebab-case
40
+
41
+ ## 备注
42
+
43
+ - 如果某个目录暂时没有内容,也要在索引里明确说明。
44
+ - 如果有未确认项,单独列在“待确认”区域,不要隐藏。
@@ -1,102 +1,89 @@
1
- # 娉ㄩ噴瑙勮寖
2
-
3
- > 浠g爜娉ㄩ噴鏍囧噯锛岀敤浜庝繚鎸佸彲璇绘€у拰鍙淮鎶ゆ€с€傝繖閲屽彧淇濈暀娉ㄩ噴瀵嗗害銆佹ā鏉垮拰妫€鏌ラ」锛涘叿浣撲笟鍔?鍒嗗眰鍩虹嚎浼樺厛寮曠敤 [rules/overlays/pig-cloud.md](/D:/work/java/pig-skills/rules/overlays/pig-cloud.md) 鍙婂叾瀛愯鍒欍€?
4
- ## Class Comment
5
-
6
- ### 蹇呰鍐呭
7
-
8
- | 鍐呭 | 璇存槑 |
9
- |------|------|
10
- | 绫昏鏄?| 涓€鍙ヨ瘽鎻忚堪鑱岃矗 |
11
- | 浣滆€?| 鍒涘缓鑰?|
12
- | 鏃ユ湡 | 鍒涘缓鏃ユ湡 |
13
- | 鐗堟湰 | 鍙€?|
14
-
15
- ### 妯℃澘
16
-
17
- ```java
18
- /**
19
- * 璁㈠崟鏈嶅姟瀹炵幇绫伙紝澶勭悊璁㈠崟鐩稿叧涓氬姟閫昏緫
20
- *
21
- * @author zhangsan
22
- * @date 2026-06-16
23
- */
24
- @Service
25
- @RequiredArgsConstructor
26
- public class OrderServiceImpl implements OrderService {
27
- }
28
- ```
29
-
30
- ## Method Comment
31
-
32
- ### 蹇呰鍐呭
33
-
34
- | 鍐呭 | 璇存槑 |
35
- |------|------|
36
- | 鏂规硶璇存槑 | 涓€鍙ヨ瘽鎻忚堪鍔熻兘 |
37
- | 鍙傛暟璇存槑 | 姣忎釜鍙傛暟鐨勫惈涔?|
38
- | 杩斿洖璇存槑 | 杩斿洖鍊煎惈涔?|
39
- | 寮傚父璇存槑 | 鍙兘鎶涘嚭鐨勫紓甯?|
40
- | 鍓嶇疆鏉′欢 | 鎵ц鍓嶉渶瑕佹弧瓒崇殑鏉′欢 |
41
- | 鍚庣疆鏉′欢 | 鎵ц鍚庣殑鐘舵€佸彉鍖?|
42
-
43
- ### 妯℃澘
44
-
45
- ```java
46
- /**
47
- * 鍒涘缓璁㈠崟锛屾牎楠屽簱瀛樺苟鐢熸垚璁㈠崟璁板綍
48
- *
49
- * @param dto 璁㈠崟鍒涘缓璇锋眰DTO
50
- * @return 璁㈠崟ID
51
- * @throws BusinessException 搴撳瓨涓嶈冻鏃舵姏鍑?
52
- */
53
- public Result<Long> create(OrderCreateDTO dto) {
54
- }
55
- ```
56
-
57
- ## Logic Comment
58
-
59
- ### 閫傜敤鍦烘櫙
60
-
61
- - 澶氭潯浠跺垽鏂?- 鐘舵€佹祦杞?- 澶嶆潅璁$畻
62
- - 澶栭儴璋冪敤
63
- - 鏁版嵁杞崲
64
- - 鍒嗛〉/鎵归噺閫昏緫
65
-
66
- ### 瑙勫垯
67
-
68
- - 鐢?`Step 1/2/3` 鏍囪娴佺▼
69
- - 鍙В閲婁笟鍔℃剰鍥撅紝涓嶈В閲婃樉鑰屾槗瑙佺殑璇硶
70
- - 澶嶆潅閫昏緫蹇呴』鐣欎笅鑳界湅鎳傜殑涓婁笅鏂?
71
- ## External Call Comment
72
-
73
- ### 蹇呰鍐呭
74
-
75
- - 璋冪敤鐩殑
76
- - 璋冪敤鎺ュ彛
77
- - 浼犲叆鍙傛暟
78
- - 棰勬湡杩斿洖
79
- - 寮傚父澶勭悊
80
-
81
- ### 绀轰緥
82
-
83
- ```java
84
- // 杩滅▼璋冪敤锛氭煡璇㈢敤鎴蜂俊鎭紝鐢ㄤ簬璁㈠崟鍒涘缓鍓嶆牎楠?UserDTO user = userApi.findById(dto.getUserId()).assertSucceed();
85
- ```
86
-
87
- ## Comment Density
88
-
89
- | 灞傜骇 | 寤鸿瀵嗗害 |
90
- |------|---------|
91
- | Entity | 绫绘敞閲?+ 瀛楁娉ㄩ噴 |
92
- | DTO/VO | 绫绘敞閲?+ 瀛楁娉ㄩ噴 |
93
- | Mapper | 绫绘敞閲婂嵆鍙?|
94
- | Service | 绫绘敞閲?+ 鏂规硶娉ㄩ噴 + 閫昏緫娉ㄩ噴 |
95
- | Controller | 绫绘敞閲?+ 鏂规硶娉ㄩ噴 |
96
- | Convert | 绫绘敞閲婂嵆鍙?|
97
-
98
- ## Anti-rationalization
99
-
100
- - 浠g爜寰堟竻妤氾紝涓嶉渶瑕佹敞閲?- 娉ㄩ噴浼氳繃鏃讹紝鎵€浠ヤ笉鍐?- 浠ュ悗鍐嶈ˉ娉ㄩ噴
101
- - IDE 鍙互鑷姩鐢熸垚灏卞浜?
102
-
1
+ # 注释规范
2
+
3
+ > 代码注释标准,用于保持可读性和可维护性。这里只保留注释密度、模板和检查项;具体业务分层基线优先引用 `rules/overlays/pig-cloud.md` 及其子规则。
4
+
5
+ ## Class Comment
6
+
7
+ ### 必要内容
8
+
9
+ | 内容 | 说明 |
10
+ |------|------|
11
+ | 类说明 | 一句话描述职责 |
12
+ | 作者 | 创建者 |
13
+ | 日期 | 创建日期 |
14
+ | 版本 | 可选 |
15
+
16
+ ### 模板
17
+
18
+ ```java
19
+ /**
20
+ * 用户服务。
21
+ *
22
+ * <p>负责用户查询、创建与基础校验。</p>
23
+ */
24
+ ```
25
+
26
+ ## Method Comment
27
+
28
+ ### 必要内容
29
+
30
+ | 内容 | 说明 |
31
+ |------|------|
32
+ | 方法说明 | 方法做什么 |
33
+ | 参数说明 | 每个参数的含义 |
34
+ | 返回说明 | 返回值含义 |
35
+ | 异常说明 | 可能抛出的异常 |
36
+ | 前置条件 | 调用前要满足什么 |
37
+ | 后置条件 | 执行后的状态变化 |
38
+
39
+ ### 模板
40
+
41
+ ```java
42
+ /**
43
+ * 根据用户 ID 查询用户信息。
44
+ *
45
+ * @param userId 用户 ID
46
+ * @return 用户信息
47
+ * @throws BusinessException 用户不存在时抛出
48
+ */
49
+ ```
50
+
51
+ ## Inline Comment
52
+
53
+ ### 使用场景
54
+
55
+ - 多条件判断
56
+ - 状态流转
57
+ - 复杂计算
58
+ - 需要解释意图但代码本身又不适合再拆函数的地方
59
+
60
+ ### 规则
61
+
62
+ - 注释要解释“为什么”,不要重复“是什么”。
63
+ - 复杂逻辑必须留下能看懂的上下文。
64
+ - 用短句说明约束、边界和原因。
65
+
66
+ ## 示例
67
+
68
+ ```java
69
+ // 远程调用:查询用户信息,用于订单创建前校验
70
+ UserDTO user = userApi.findById(dto.getUserId()).assertSucceed();
71
+ ```
72
+
73
+ ## 注释密度
74
+
75
+ | 场景 | 建议 |
76
+ |------|------|
77
+ | Entity | 类注释 + 字段注释 |
78
+ | DTO/VO | 类注释 + 字段注释 |
79
+ | Mapper | 类注释即可 |
80
+ | Service | 类注释 + 方法注释 + 逻辑注释 |
81
+ | Controller | 类注释 + 方法注释 |
82
+ | Convert | 类注释即可 |
83
+
84
+ ## 不建议
85
+
86
+ - 代码很清楚,不需要注释。
87
+ - 注释会过时,所以不注释。
88
+ - 以后再补注释。
89
+ - IDE 自动生成就够了。