@pigcloud/skills 1.0.6 → 1.0.8
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/codex-commands/.codex-plugin/plugin.json +35 -0
- package/codex-commands/README.md +23 -0
- package/codex-commands/commands/analyze.md +22 -0
- package/codex-commands/commands/build.md +22 -0
- package/codex-commands/commands/design.md +22 -0
- package/codex-commands/commands/distill.md +21 -0
- package/codex-commands/commands/doc.md +22 -0
- package/codex-commands/commands/infra.md +21 -0
- package/codex-commands/commands/init.md +20 -0
- package/codex-commands/commands/kb.md +20 -0
- package/codex-commands/commands/perf.md +21 -0
- package/codex-commands/commands/prd.md +22 -0
- package/codex-commands/commands/review.md +22 -0
- package/codex-commands/commands/security.md +22 -0
- package/codex-commands/commands/test.md +21 -0
- package/codex-commands/commands/workflow.md +20 -0
- package/package.json +2 -2
- 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
|
@@ -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 自动生成就够了。
|