6aspec 3.0.0-dev.32 → 3.0.0-dev.33

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.
@@ -0,0 +1,111 @@
1
+ # Code Review Command SOP
2
+
3
+ 用于 `/6aspec:review` 与 `$6aspec-review` 的统一执行流程。
4
+
5
+ > 执行模型:主 agent 作为协调者,先建立任务队列,再派发 `6aspec-code-reviewer` 子 agent 执行审查;主 agent 只管理队列与状态,不直接产出审查结论。
6
+
7
+ ## 输入
8
+
9
+ 用户可以提供以下参数(均可选):
10
+ - `<description>` — 变更描述
11
+ - `--diff <file>` — 本次变更的 unified diff 文件路径(优先)
12
+ - `--base <SHA>` — 起始 commit(用于指定 git 范围)
13
+ - `--head <SHA>` — 结束 commit(用于指定 git 范围)
14
+ - `--plan <file>` — 需求/计划文件路径(可为 specs/design/rules/task 清单等)
15
+
16
+ 默认行为:
17
+ - 如果未提供 `--diff/--base/--head`,不传 SHA,让子 agent 审查当前工作区未提交变更。
18
+
19
+ ---
20
+
21
+ ## 步骤
22
+
23
+ 1. **解析输入并归一化**
24
+
25
+ - 解析 `<description>`、`--diff`、`--base`、`--head`、`--plan`。
26
+ - 归一化规则:
27
+ - 提供了 `--diff`:优先使用 `DIFF`。
28
+ - 未提供 `--diff` 且提供了 `--base/--head`:使用 git 提交范围。
29
+ - 三者都未提供:不传 `BASE_SHA/HEAD_SHA`,交由子 agent 走“未提交变更”分支。
30
+
31
+ 2. **准备审查输入材料**
32
+
33
+ - 使用 git 范围时,可先执行:
34
+ ```bash
35
+ git log --oneline -10
36
+ ```
37
+ 用于向用户展示最近提交,确认审查范围。
38
+ - 组装将传给子 agent 的统一输入:
39
+ - `变更描述`:用户提供值,或默认 `当前代码变更`
40
+ - `需求/计划`:`--plan` 文件路径,或 `无`
41
+ - `DIFF`:`--diff` 文件内容(如提供)
42
+ - `BASE_SHA` / `HEAD_SHA`:仅在显式给定 git 范围时传入
43
+
44
+ 3. **建立任务队列(外部状态锚点)**
45
+
46
+ 按固定顺序建立任务队列(宿主支持 `TaskCreate` 时必须使用;若宿主不支持 `TaskCreate`,则用等价的显式文本清单维护状态):
47
+
48
+ - `REVIEW-001: 准备审查输入`
49
+ - `REVIEW-002: 调用 code-reviewer`
50
+ - `REVIEW-003: 回传审查报告`
51
+
52
+ 任务状态统一使用:`todo` / `in_progress` / `completed` / `blocked`。
53
+
54
+ 4. **按队列串行执行**
55
+
56
+ **a. 执行 REVIEW-001(准备输入)**
57
+ - 标记 `in_progress`。
58
+ - 完成步骤 1、2 的归一化与输入组装。
59
+ - 标记 `completed`。
60
+
61
+ **b. 执行 REVIEW-002(派发子 agent)**
62
+ - 标记 `in_progress`。
63
+ - 调用 `6aspec-code-reviewer`,传入:
64
+
65
+ ```
66
+ 变更描述:[用户提供的描述,或"当前代码变更"]
67
+ 需求/计划:[--plan 指定的文件路径,或"无"]
68
+ DIFF:[--diff 指定文件内容(如提供)]
69
+ BASE_SHA:[base SHA(如使用 git)]
70
+ HEAD_SHA:[head SHA(如使用 git)]
71
+ ```
72
+
73
+ - 处理子 agent 返回状态:
74
+ - `DONE`:标记 `REVIEW-002` 为 `completed`,进入 `REVIEW-003`。
75
+ - `DONE_WITH_CONCERNS`:同样标记 `completed`,保留 concerns 原文并进入 `REVIEW-003`。
76
+ - `NEEDS_CONTEXT`:补充缺失上下文后重新调用;最多重试 2 次。
77
+ - `BLOCKED`:标记 `blocked`,暂停并向用户报告阻塞原因。
78
+ - 若返回为空、结构不完整或明显未执行审查:按 `NEEDS_CONTEXT` 路径重试;超过 2 次仍失败则标记 `blocked` 并暂停。
79
+
80
+ **c. 执行 REVIEW-003(回传结果)**
81
+ - 标记 `in_progress`。
82
+ - 直接展示 `6aspec-code-reviewer` 返回的完整审查报告(可补充 1-3 行摘要,但不得替换原报告)。
83
+ - 标记 `completed`。
84
+
85
+ 5. **结束态处理**
86
+
87
+ - 若 3 个任务均 `completed`:输出“审查完成”。
88
+ - 若存在 `blocked`:输出“审查暂停”,并给出阻塞原因与下一步选项。
89
+
90
+ ---
91
+
92
+ ## 防护措施
93
+
94
+ - 必须先建立任务队列,再派发子 agent;不得跳步。
95
+ - 主 agent 只做协调,不直接执行代码审查并给结论。
96
+ - 串行执行,不并行派发多个 code-reviewer agent。
97
+ - 子 agent 返回 `BLOCKED` 时必须暂停并向用户报告,不得无限重试。
98
+ - `REVIEW-002` 未完成前,不得提前输出审查结论。
99
+
100
+ ---
101
+
102
+ ## 使用示例
103
+
104
+ ```bash
105
+ /6aspec:review
106
+ /6aspec:review 实现了用户认证功能
107
+ /6aspec:review --diff /tmp/change.patch
108
+ /6aspec:review --base HEAD~1 --head HEAD
109
+ /6aspec:review --base abc1234 --head def5678
110
+ /6aspec:review --plan 6aspecdoc/brown/add-user-auth/artifacts/specs.md
111
+ ```
@@ -3,66 +3,6 @@ name: "6aspec-review"
3
3
  description: "独立代码审查。用于审查指定 diff 文件、指定 git 提交范围或当前工作区未提交变更,并输出完整审查报告。"
4
4
  ---
5
5
 
6
- # 操作流程
7
-
8
- 对当前代码变更进行独立审查。好的
9
-
10
- ## 步骤
11
-
12
- ### 1. 解析输入
13
-
14
- 用户可以提供以下参数(均可选):
15
- - `<description>` — 变更描述
16
- - `--diff <file>` — 本次变更的 unified diff 文件路径(优先)
17
- - `--base <SHA>` — 起始 commit(用于指定 git 范围)
18
- - `--head <SHA>` — 结束 commit(用于指定 git 范围)
19
- - `--plan <file>` — 需求/计划文件路径
20
-
21
- 如果未提供 `--diff/--base/--head`,不传 SHA,让子 agent 审查当前工作区未提交变更。
22
-
23
- ### 2. 确定变更来源
24
-
25
- - 如果提供了 `--diff`:读取 diff 文件内容作为 `DIFF`,并直接进入步骤 3。
26
- - 否则:
27
- - 如果提供了 `--base/--head`:使用 git 范围。
28
- - 如果未提供 `--base/--head`:不传 SHA(由子 agent 审查未提交变更)。
29
-
30
- ### 3. (可选)展示 git 范围
31
-
32
- 当使用 git 范围时:
33
-
34
- ```bash
35
- git log --oneline -10
36
- ```
37
-
38
- 显示最近 10 条 commit,帮助用户确认审查范围。
39
-
40
- 如果用户未指定 SHA,使用:
41
- - 不设置 BASE_SHA/HEAD_SHA
42
-
43
- ### 4. 派发 6aspec-code-reviewer agent
44
-
45
- 调用 `6aspec-code-reviewer` agent,传入:
46
-
47
- ```
48
- 变更描述:[用户提供的描述,或"当前代码变更"]
49
- 需求/计划:[--plan 指定的文件路径,或"无"]
50
- DIFF:[--diff 指定文件内容(如提供)]
51
- BASE_SHA:[base SHA(如使用 git)]
52
- HEAD_SHA:[head SHA(如使用 git)]
53
- ```
54
-
55
- ### 5. 展示审查结果
56
-
57
- 直接展示 agent 返回的完整审查报告。
58
-
59
- ## 使用示例
60
-
61
- ```
62
- /6aspec:review
63
- /6aspec:review 实现了用户认证功能
64
- /6aspec:review --diff /tmp/change.patch
65
- /6aspec:review --base HEAD~1 --head HEAD
66
- /6aspec:review --base abc1234 --head def5678
67
- /6aspec:review --plan 6aspecdoc/brown/add-user-auth/artifacts/specs.md
68
- ```
6
+ 1. Immediate response upon activation: **6aspec-review** has been activated
7
+ 2. Read file: `.6aspec/rules/common/code-review-command-sop.md`
8
+ 3. Strictly follow the SOP defined in that file
@@ -3,66 +3,6 @@ name: "6aspec:review"
3
3
  description: 独立代码审查命令,不绑定任何流程,随时可用
4
4
  ---
5
5
 
6
- # Code Review
7
-
8
- 对当前代码变更进行独立审查。
9
-
10
- ## 步骤
11
-
12
- ### 1. 解析输入
13
-
14
- 用户可以提供以下参数(均可选):
15
- - `<description>` — 变更描述
16
- - `--diff <file>` — 本次变更的 unified diff 文件路径(优先)
17
- - `--base <SHA>` — 起始 commit(用于指定 git 范围)
18
- - `--head <SHA>` — 结束 commit(用于指定 git 范围)
19
- - `--plan <file>` — 需求/计划文件路径
20
-
21
- 如果未提供 `--diff/--base/--head`,不传 SHA,让子 agent 审查当前工作区未提交变更。
22
-
23
- ### 2. 确定变更来源
24
-
25
- - 如果提供了 `--diff`:读取 diff 文件内容作为 `DIFF`,并直接进入步骤 3。
26
- - 否则:
27
- - 如果提供了 `--base/--head`:使用 git 范围。
28
- - 如果未提供 `--base/--head`:不传 SHA(由子 agent 审查未提交变更)。
29
-
30
- ### 3. (可选)展示 git 范围
31
-
32
- 当使用 git 范围时:
33
-
34
- ```bash
35
- git log --oneline -10
36
- ```
37
-
38
- 显示最近 10 条 commit,帮助用户确认审查范围。
39
-
40
- 如果用户未指定 SHA,使用:
41
- - 不设置 BASE_SHA/HEAD_SHA
42
-
43
- ### 4. 派发 6aspec-code-reviewer agent
44
-
45
- 调用 `6aspec-code-reviewer` agent,传入:
46
-
47
- ```
48
- 变更描述:[用户提供的描述,或"当前代码变更"]
49
- 需求/计划:[--plan 指定的文件路径,或"无"]
50
- DIFF:[--diff 指定文件内容(如提供)]
51
- BASE_SHA:[base SHA(如使用 git)]
52
- HEAD_SHA:[head SHA(如使用 git)]
53
- ```
54
-
55
- ### 5. 展示审查结果
56
-
57
- 直接展示 agent 返回的完整审查报告。
58
-
59
- ## 使用示例
60
-
61
- ```
62
- /6aspec:review
63
- /6aspec:review 实现了用户认证功能
64
- /6aspec:review --diff /tmp/change.patch
65
- /6aspec:review --base HEAD~1 --head HEAD
66
- /6aspec:review --base abc1234 --head def5678
67
- /6aspec:review --plan 6aspecdoc/brown/add-user-auth/artifacts/specs.md
68
- ```
6
+ 1. Immediate response upon activation: **6aspec:review** has been activated
7
+ 2. Read file: `.6aspec/rules/common/code-review-command-sop.md`
8
+ 3. Strictly follow the SOP defined in that file
@@ -3,66 +3,6 @@ description: 独立代码审查(优先 DIFF,其次 git diff),不绑定
3
3
  alwaysApply: false
4
4
  ---
5
5
 
6
- # Code Review
7
-
8
- 对当前代码变更进行独立审查。
9
-
10
- ## 步骤
11
-
12
- ### 1. 解析输入
13
-
14
- 用户可以提供以下参数(均可选):
15
- - `<description>` — 变更描述
16
- - `--diff <file>` — 本次变更的 unified diff 文件路径(优先)
17
- - `--base <SHA>` — 起始 commit(用于指定 git 范围)
18
- - `--head <SHA>` — 结束 commit(用于指定 git 范围)
19
- - `--plan <file>` — 需求/计划文件路径
20
-
21
- 如果未提供 `--diff/--base/--head`,不传 SHA,让子 agent 审查当前工作区未提交变更。
22
-
23
- ### 2. 确定变更来源
24
-
25
- - 如果提供了 `--diff`:读取 diff 文件内容作为 `DIFF`,并直接进入步骤 3。
26
- - 否则:
27
- - 如果提供了 `--base/--head`:使用 git 范围。
28
- - 如果未提供 `--base/--head`:不传 SHA(由子 agent 审查未提交变更)。
29
-
30
- ### 3. (可选)展示 git 范围
31
-
32
- 当使用 git 范围时:
33
-
34
- ```bash
35
- git log --oneline -10
36
- ```
37
-
38
- 显示最近 10 条 commit,帮助用户确认审查范围。
39
-
40
- 如果用户未指定 SHA,使用:
41
- - 不设置 BASE_SHA/HEAD_SHA
42
-
43
- ### 4. 派发 6aspec-code-reviewer agent
44
-
45
- 调用 `6aspec-code-reviewer` agent,传入:
46
-
47
- ```
48
- 变更描述:[用户提供的描述,或"当前代码变更"]
49
- 需求/计划:[--plan 指定的文件路径,或"无"]
50
- DIFF:[--diff 指定文件内容(如提供)]
51
- BASE_SHA:[base SHA(如使用 git)]
52
- HEAD_SHA:[head SHA(如使用 git)]
53
- ```
54
-
55
- ### 5. 展示审查结果
56
-
57
- 直接展示 agent 返回的完整审查报告。
58
-
59
- ## 使用示例
60
-
61
- ```
62
- /6aspec:review
63
- /6aspec:review 实现了用户认证功能
64
- /6aspec:review --diff /tmp/change.patch
65
- /6aspec:review --base HEAD~1 --head HEAD
66
- /6aspec:review --base abc1234 --head def5678
67
- /6aspec:review --plan 6aspecdoc/brown/add-user-auth/artifacts/specs.md
68
- ```
6
+ 1. Immediate response upon activation: **6aspec:review** has been activated
7
+ 2. Read file: `.6aspec/rules/common/code-review-command-sop.md`
8
+ 3. Strictly follow the SOP defined in that file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "6aspec",
3
- "version": "3.0.0-dev.32",
3
+ "version": "3.0.0-dev.33",
4
4
  "description": "6Aspec - 轻量级 spec 驱动开发框架,支持 Cursor 和 Claude Code",
5
5
  "main": "lib/installer.js",
6
6
  "bin": {