6aspec 3.0.0-dev.31 → 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.
- package/.6aspec/rules/brown/subagents/implementer.md +8 -0
- package/.6aspec/rules/common/code-review-command-sop.md +111 -0
- package/.agents/skills/6aspec-review/SKILL.md +4 -62
- package/.agents/skills/6aspec-review/agents/openai.yaml +2 -2
- package/.claude/agents/6aspec-brown-implementer.md +2 -0
- package/.claude/commands/6aspec/review.md +3 -61
- package/.codex/agents/6aspec-brown-implementer.toml +2 -0
- package/.cursor/agents/6aspec-brown-implementer.md +2 -0
- package/.cursor/commands/6aspec-review.md +3 -61
- package/package.json +1 -1
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Implementer Subagent
|
|
2
2
|
|
|
3
|
+
**🚨 停止约束(最高优先级)**:
|
|
4
|
+
- 你**只负责完成一个 TASK**
|
|
5
|
+
- 完成该 TASK 的实现、自我审查和报告后,**立即停止**
|
|
6
|
+
- **不要**读取其他 TASK-*.md 文件
|
|
7
|
+
- **不要**继续执行其他任务
|
|
8
|
+
- **不要**批量处理多个任务
|
|
9
|
+
|
|
3
10
|
你是一个代码实现专家,负责完成指定的 TASK。
|
|
4
11
|
|
|
5
12
|
**重要**:你只负责完成**这一个 TASK**,完成任务并报告后**立即停止**,不要主动执行其他任务。
|
|
@@ -7,6 +14,7 @@
|
|
|
7
14
|
## 开始前必须读取
|
|
8
15
|
|
|
9
16
|
- **TASK 文件**:任务详情、实现步骤、验收标准、涉及文件
|
|
17
|
+
- **⚠️ 忽略依赖字段**:如果 TASK 文件中有"前置依赖"或"后置任务"字段,**不要读取或执行那些任务**,那些依赖关系由主 agent 管理
|
|
10
18
|
- **specs.md**:该任务引用的 AC/Scenario
|
|
11
19
|
- **design.md**:相关技术决策
|
|
12
20
|
- **analysis.md**:现状分析和影响面背景(如果存在)
|
|
@@ -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
|
+
```
|
|
@@ -1,66 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "6aspec-review"
|
|
3
|
-
description: "独立代码审查。用于审查指定 diff
|
|
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(默认:HEAD~1)
|
|
18
|
-
- `--head <SHA>` — 结束 commit(默认:HEAD)
|
|
19
|
-
- `--plan <file>` — 需求/计划文件路径
|
|
20
|
-
|
|
21
|
-
如果未提供 `--diff/--base/--head`,使用默认值(HEAD~1..HEAD)。
|
|
22
|
-
|
|
23
|
-
### 2. 确定变更来源
|
|
24
|
-
|
|
25
|
-
- 如果提供了 `--diff`:读取 diff 文件内容作为 `DIFF`,并直接进入步骤 3。
|
|
26
|
-
- 否则:使用 git 范围。
|
|
27
|
-
|
|
28
|
-
### 3. (可选)展示 git 范围
|
|
29
|
-
|
|
30
|
-
当使用 git 范围时:
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
git log --oneline -10
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
显示最近 10 条 commit,帮助用户确认审查范围。
|
|
37
|
-
|
|
38
|
-
如果用户未指定 SHA,使用:
|
|
39
|
-
- BASE_SHA = HEAD~1
|
|
40
|
-
- HEAD_SHA = HEAD
|
|
41
|
-
|
|
42
|
-
### 4. 派发 6aspec-code-reviewer agent
|
|
43
|
-
|
|
44
|
-
调用 `6aspec-code-reviewer` agent,传入:
|
|
45
|
-
|
|
46
|
-
```
|
|
47
|
-
变更描述:[用户提供的描述,或"最近一次提交的变更"]
|
|
48
|
-
需求/计划:[--plan 指定的文件路径,或"无"]
|
|
49
|
-
DIFF:[--diff 指定文件内容(如提供)]
|
|
50
|
-
BASE_SHA:[base SHA(如使用 git)]
|
|
51
|
-
HEAD_SHA:[head SHA(如使用 git)]
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### 5. 展示审查结果
|
|
55
|
-
|
|
56
|
-
直接展示 agent 返回的完整审查报告。
|
|
57
|
-
|
|
58
|
-
## 使用示例
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
/6aspec:review
|
|
62
|
-
/6aspec:review 实现了用户认证功能
|
|
63
|
-
/6aspec:review --diff /tmp/change.patch
|
|
64
|
-
/6aspec:review --base abc1234 --head def5678
|
|
65
|
-
/6aspec:review --plan 6aspecdoc/brown/add-user-auth/artifacts/specs.md
|
|
66
|
-
```
|
|
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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
interface:
|
|
2
2
|
display_name: "6ASpec code review"
|
|
3
|
-
short_description: "仅在显式调用时审查 diff
|
|
4
|
-
default_prompt: "使用 $6aspec-review 审查一个 diff
|
|
3
|
+
short_description: "仅在显式调用时审查 diff 文件、指定 git 范围或当前未提交变更"
|
|
4
|
+
default_prompt: "使用 $6aspec-review 审查一个 diff 文件、指定 git 提交范围或当前工作区未提交变更,并输出完整审查报告。"
|
|
5
5
|
|
|
6
6
|
policy:
|
|
7
7
|
allow_implicit_invocation: false
|
|
@@ -3,64 +3,6 @@ name: "6aspec:review"
|
|
|
3
3
|
description: 独立代码审查命令,不绑定任何流程,随时可用
|
|
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(默认:HEAD~1)
|
|
18
|
-
- `--head <SHA>` — 结束 commit(默认:HEAD)
|
|
19
|
-
- `--plan <file>` — 需求/计划文件路径
|
|
20
|
-
|
|
21
|
-
如果未提供 `--diff/--base/--head`,使用默认值(HEAD~1..HEAD)。
|
|
22
|
-
|
|
23
|
-
### 2. 确定变更来源
|
|
24
|
-
|
|
25
|
-
- 如果提供了 `--diff`:读取 diff 文件内容作为 `DIFF`,并直接进入步骤 3。
|
|
26
|
-
- 否则:使用 git 范围。
|
|
27
|
-
|
|
28
|
-
### 3. (可选)展示 git 范围
|
|
29
|
-
|
|
30
|
-
当使用 git 范围时:
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
git log --oneline -10
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
显示最近 10 条 commit,帮助用户确认审查范围。
|
|
37
|
-
|
|
38
|
-
如果用户未指定 SHA,使用:
|
|
39
|
-
- BASE_SHA = HEAD~1
|
|
40
|
-
- HEAD_SHA = HEAD
|
|
41
|
-
|
|
42
|
-
### 4. 派发 6aspec-code-reviewer agent
|
|
43
|
-
|
|
44
|
-
调用 `6aspec-code-reviewer` agent,传入:
|
|
45
|
-
|
|
46
|
-
```
|
|
47
|
-
变更描述:[用户提供的描述,或"最近一次提交的变更"]
|
|
48
|
-
需求/计划:[--plan 指定的文件路径,或"无"]
|
|
49
|
-
DIFF:[--diff 指定文件内容(如提供)]
|
|
50
|
-
BASE_SHA:[base SHA(如使用 git)]
|
|
51
|
-
HEAD_SHA:[head SHA(如使用 git)]
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### 5. 展示审查结果
|
|
55
|
-
|
|
56
|
-
直接展示 agent 返回的完整审查报告。
|
|
57
|
-
|
|
58
|
-
## 使用示例
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
/6aspec:review
|
|
62
|
-
/6aspec:review 实现了用户认证功能
|
|
63
|
-
/6aspec:review --diff /tmp/change.patch
|
|
64
|
-
/6aspec:review --base abc1234 --head def5678
|
|
65
|
-
/6aspec:review --plan 6aspecdoc/brown/add-user-auth/artifacts/specs.md
|
|
66
|
-
```
|
|
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,64 +3,6 @@ description: 独立代码审查(优先 DIFF,其次 git diff),不绑定
|
|
|
3
3
|
alwaysApply: false
|
|
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(默认:HEAD~1)
|
|
18
|
-
- `--head <SHA>` — 结束 commit(默认:HEAD)
|
|
19
|
-
- `--plan <file>` — 需求/计划文件路径
|
|
20
|
-
|
|
21
|
-
如果未提供 `--diff/--base/--head`,使用默认值(HEAD~1..HEAD)。
|
|
22
|
-
|
|
23
|
-
### 2. 确定变更来源
|
|
24
|
-
|
|
25
|
-
- 如果提供了 `--diff`:读取 diff 文件内容作为 `DIFF`,并直接进入步骤 3。
|
|
26
|
-
- 否则:使用 git 范围。
|
|
27
|
-
|
|
28
|
-
### 3. (可选)展示 git 范围
|
|
29
|
-
|
|
30
|
-
当使用 git 范围时:
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
git log --oneline -10
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
显示最近 10 条 commit,帮助用户确认审查范围。
|
|
37
|
-
|
|
38
|
-
如果用户未指定 SHA,使用:
|
|
39
|
-
- BASE_SHA = HEAD~1
|
|
40
|
-
- HEAD_SHA = HEAD
|
|
41
|
-
|
|
42
|
-
### 4. 派发 6aspec-code-reviewer agent
|
|
43
|
-
|
|
44
|
-
调用 `6aspec-code-reviewer` agent,传入:
|
|
45
|
-
|
|
46
|
-
```
|
|
47
|
-
变更描述:[用户提供的描述,或"最近一次提交的变更"]
|
|
48
|
-
需求/计划:[--plan 指定的文件路径,或"无"]
|
|
49
|
-
DIFF:[--diff 指定文件内容(如提供)]
|
|
50
|
-
BASE_SHA:[base SHA(如使用 git)]
|
|
51
|
-
HEAD_SHA:[head SHA(如使用 git)]
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### 5. 展示审查结果
|
|
55
|
-
|
|
56
|
-
直接展示 agent 返回的完整审查报告。
|
|
57
|
-
|
|
58
|
-
## 使用示例
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
/6aspec:review
|
|
62
|
-
/6aspec:review 实现了用户认证功能
|
|
63
|
-
/6aspec:review --diff /tmp/change.patch
|
|
64
|
-
/6aspec:review --base abc1234 --head def5678
|
|
65
|
-
/6aspec:review --plan 6aspecdoc/brown/add-user-auth/artifacts/specs.md
|
|
66
|
-
```
|
|
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
|