@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 +34 -71
- package/README.md +54 -76
- package/package.json +1 -1
- package/rules/coding/implementation.md +26 -31
- package/rules/product/project-context.md +28 -29
- package/skills/code-review/references/template-review.md +39 -214
- package/skills/domain-modeling/references/distillation-checklist.md +44 -152
- package/skills/feature-build/references/comment-specification.md +89 -102
package/CHANGELOG.md
CHANGED
|
@@ -1,71 +1,34 @@
|
|
|
1
|
-
# Pig Skills
|
|
2
|
-
|
|
3
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
-
|
|
29
|
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
-
>
|
|
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
|
-
-
|
|
22
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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,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
|
|
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
|
-
>
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
- [ ] `
|
|
12
|
-
- [ ] `
|
|
13
|
-
- [ ] `
|
|
14
|
-
- [ ] `
|
|
15
|
-
- [ ] `
|
|
16
|
-
- [ ] `
|
|
17
|
-
- [ ] `
|
|
18
|
-
- [ ] `
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
- [ ]
|
|
23
|
-
- [ ]
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
- [ ]
|
|
31
|
-
- [ ]
|
|
32
|
-
- [ ]
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
- [ ]
|
|
37
|
-
- [ ]
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
|
35
|
-
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
*
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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 自动生成就够了。
|