6aspec 3.0.0-dev.12 → 3.0.0-dev.14

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.
@@ -4,35 +4,47 @@
4
4
 
5
5
  ## 任务
6
6
 
7
- 1. 通过 git diff 获取变更内容
7
+ 1. 优先使用调用方提供的 DIFF(unified diff)获取变更内容;若未提供且 git 可用,则通过 git diff 获取
8
8
  2. 对照需求/计划检查实现
9
- 3. 从代码质量、架构、测试、生产就绪性四个维度评估
9
+ 3. 从代码质量、架构、测试、需求符合度四个维度评估
10
10
  4. 按严重程度分类问题
11
11
  5. 给出明确的合并建议
12
12
 
13
13
  ## 输入
14
14
 
15
- 调用方会提供:
15
+ 调用方会提供(均可选):
16
16
  - `变更描述`:做了什么
17
17
  - `需求/计划`:应该做什么(可选,文件路径或文字描述)
18
- - `BASE_SHA`:起始 commit
19
- - `HEAD_SHA`:结束 commit
18
+ - `DIFF`:本次变更的 unified diff 文本(**优先**)
19
+ - `BASE_SHA`:起始 commit(可选,用于 git diff fallback)
20
+ - `HEAD_SHA`:结束 commit(可选,用于 git diff fallback)
20
21
 
21
22
  ## 执行步骤
22
23
 
23
24
  ### 1. 获取变更内容
24
25
 
26
+ 按优先级选择输入来源:
27
+
28
+ 1) **如果提供了 `DIFF`**:
29
+ - 直接基于 `DIFF` 进行审查(不要再运行 git diff)。
30
+
31
+ 2) **否则,如果提供了 `BASE_SHA`/`HEAD_SHA` 且 git 可用**:
25
32
  ```bash
26
33
  git diff --stat {BASE_SHA}..{HEAD_SHA}
27
34
  git diff {BASE_SHA}..{HEAD_SHA}
28
35
  ```
29
36
 
30
- 如果调用方未提供 SHA,使用:
37
+ 3) **否则,如果未提供 SHA 但 git 可用**:
31
38
  ```bash
32
39
  BASE_SHA=$(git rev-parse HEAD~1)
33
40
  HEAD_SHA=$(git rev-parse HEAD)
41
+ git diff --stat ${BASE_SHA}..${HEAD_SHA}
42
+ git diff ${BASE_SHA}..${HEAD_SHA}
34
43
  ```
35
44
 
45
+ 4) **否则(既没有 DIFF,也无法使用 git)**:
46
+ - 返回 `NEEDS_CONTEXT`,并要求调用方提供 `DIFF`(unified diff),或提供明确的变更文件列表 + 变更片段。
47
+
36
48
  ### 2. 读取需求(如果提供了文件路径)
37
49
 
38
50
  读取需求/计划文件,理解预期行为。
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: "6aspec-review"
3
+ description: "独立代码审查(优先 DIFF,其次 git diff),不绑定任何流程,随时可用"
4
+ ---
5
+
6
+ # 操作流程
7
+
8
+ 1. Immediate response upon activation: independent code review workflow - **6aspec-review** has been activated
9
+
10
+ 2. 解析输入参数(均可选):
11
+ - `<description>`:变更描述(默认:"最近一次提交的变更")
12
+ - `--diff <file>`:unified diff 文件路径(优先)
13
+ - `--base <SHA>`:起始 commit(默认:HEAD~1)
14
+ - `--head <SHA>`:结束 commit(默认:HEAD)
15
+ - `--plan <file>`:需求/计划文件路径(可选)
16
+
17
+ 3. 确定变更来源:
18
+ - 若提供 `--diff`:读取该文件内容作为 `DIFF`
19
+ - 否则:使用 git 范围(`BASE_SHA`/`HEAD_SHA`)
20
+ - 若用户未指定:`BASE_SHA=HEAD~1`,`HEAD_SHA=HEAD`
21
+ - 可运行 `git log --oneline -10` 展示最近提交,便于用户确认范围
22
+
23
+ 4. 派发 `6aspec-code-reviewer` agent,并传入以下信息(按实际可得填写;无 DIFF 时不要伪造 DIFF):
24
+
25
+ ```
26
+ 变更描述:<description>
27
+ 需求/计划:<--plan 文件路径 或 "无">
28
+ DIFF:<--diff 文件内容(如提供)>
29
+ BASE_SHA:<--base 或 HEAD~1>
30
+ HEAD_SHA:<--head 或 HEAD>
31
+ ```
32
+
33
+ 5. 展示审查结果:直接输出 `6aspec-code-reviewer` 返回的完整审查报告。
34
+
35
+ 6. 无法获取变更集时的处理:
36
+ - 若既未提供 `--diff`,又无法使用 git 获取 diff:停止并提示用户提供 `--diff <file>`(unified diff)。
@@ -13,13 +13,21 @@ description: 独立代码审查命令,不绑定任何流程,随时可用
13
13
 
14
14
  用户可以提供以下参数(均可选):
15
15
  - `<description>` — 变更描述
16
+ - `--diff <file>` — 本次变更的 unified diff 文件路径(优先)
16
17
  - `--base <SHA>` — 起始 commit(默认:HEAD~1)
17
18
  - `--head <SHA>` — 结束 commit(默认:HEAD)
18
19
  - `--plan <file>` — 需求/计划文件路径
19
20
 
20
- 如果没有提供任何参数,使用默认值(HEAD~1..HEAD)。
21
+ 如果未提供 `--diff/--base/--head`,使用默认值(HEAD~1..HEAD)。
21
22
 
22
- ### 2. 确定 git 范围
23
+ ### 2. 确定变更来源
24
+
25
+ - 如果提供了 `--diff`:读取 diff 文件内容作为 `DIFF`,并直接进入步骤 3。
26
+ - 否则:使用 git 范围。
27
+
28
+ ### 3. (可选)展示 git 范围
29
+
30
+ 当使用 git 范围时:
23
31
 
24
32
  ```bash
25
33
  git log --oneline -10
@@ -31,18 +39,19 @@ git log --oneline -10
31
39
  - BASE_SHA = HEAD~1
32
40
  - HEAD_SHA = HEAD
33
41
 
34
- ### 3. 派发 6aspec-code-reviewer agent
42
+ ### 4. 派发 6aspec-code-reviewer agent
35
43
 
36
44
  调用 `6aspec-code-reviewer` agent,传入:
37
45
 
38
46
  ```
39
47
  变更描述:[用户提供的描述,或"最近一次提交的变更"]
40
48
  需求/计划:[--plan 指定的文件路径,或"无"]
41
- BASE_SHA:[base SHA]
42
- HEAD_SHA:[head SHA]
49
+ DIFF:[--diff 指定文件内容(如提供)]
50
+ BASE_SHA:[base SHA(如使用 git)]
51
+ HEAD_SHA:[head SHA(如使用 git)]
43
52
  ```
44
53
 
45
- ### 4. 展示审查结果
54
+ ### 5. 展示审查结果
46
55
 
47
56
  直接展示 agent 返回的完整审查报告。
48
57
 
@@ -51,6 +60,7 @@ HEAD_SHA:[head SHA]
51
60
  ```
52
61
  /6aspec:review
53
62
  /6aspec:review 实现了用户认证功能
63
+ /6aspec:review --diff /tmp/change.patch
54
64
  /6aspec:review --base abc1234 --head def5678
55
65
  /6aspec:review --plan 6aspecdoc/brown/add-user-auth/artifacts/specs.md
56
66
  ```
@@ -0,0 +1,7 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(git status:*)"
5
+ ]
6
+ }
7
+ }
@@ -0,0 +1,11 @@
1
+ # .codex/agents/6aspec-brown-implementer.toml
2
+
3
+ name = "6aspec-brown-implementer"
4
+ description = "执行棕地需求的单个 TASK 实现,包括写代码、单元测试和自我审查"
5
+
6
+ # read-only | workspace-write | danger-full-access
7
+ sandbox_mode = "workspace-write"
8
+
9
+ developer_instructions = """
10
+ 读取并严格遵循:`.6aspec/rules/brown/subagents/implementer.md`
11
+ """
@@ -0,0 +1,11 @@
1
+ # .codex/agents/6aspec-brown-spec-compliance-reviewer.toml
2
+
3
+ name = "6aspec-brown-spec-compliance-reviewer"
4
+ description = "检查实现是否符合 TASK 的验收标准和 specs.md 的 AC/Scenario,适用于 TASK 完成后的合规验收"
5
+
6
+ # read-only | workspace-write | danger-full-access
7
+ sandbox_mode = "read-only"
8
+
9
+ developer_instructions = """
10
+ 读取并严格遵循:`.6aspec/rules/brown/subagents/spec-compliance-reviewer.md`
11
+ """
@@ -0,0 +1,11 @@
1
+ # .codex/agents/6aspec-code-reviewer.toml
2
+
3
+ name = "6aspec-code-reviewer"
4
+ description = "审查代码变更的生产就绪性,从代码质量、架构、测试、需求符合度四个维度评估,给出明确的合并建议"
5
+
6
+ # read-only | workspace-write | danger-full-access
7
+ sandbox_mode = "read-only"
8
+
9
+ developer_instructions = """
10
+ 读取并严格遵循:`.6aspec/rules/common/code-reviewer-agent.md`
11
+ """
@@ -1,5 +1,5 @@
1
1
  ---
2
- description: 独立代码审查,不绑定任何流程,随时可用
2
+ description: 独立代码审查(优先 DIFF,其次 git diff),不绑定任何流程,随时可用
3
3
  alwaysApply: false
4
4
  ---
5
5
 
@@ -13,13 +13,21 @@ alwaysApply: false
13
13
 
14
14
  用户可以提供以下参数(均可选):
15
15
  - `<description>` — 变更描述
16
+ - `--diff <file>` — 本次变更的 unified diff 文件路径(优先)
16
17
  - `--base <SHA>` — 起始 commit(默认:HEAD~1)
17
18
  - `--head <SHA>` — 结束 commit(默认:HEAD)
18
19
  - `--plan <file>` — 需求/计划文件路径
19
20
 
20
- 如果没有提供任何参数,使用默认值(HEAD~1..HEAD)。
21
+ 如果未提供 `--diff/--base/--head`,使用默认值(HEAD~1..HEAD)。
21
22
 
22
- ### 2. 确定 git 范围
23
+ ### 2. 确定变更来源
24
+
25
+ - 如果提供了 `--diff`:读取 diff 文件内容作为 `DIFF`,并直接进入步骤 3。
26
+ - 否则:使用 git 范围。
27
+
28
+ ### 3. (可选)展示 git 范围
29
+
30
+ 当使用 git 范围时:
23
31
 
24
32
  ```bash
25
33
  git log --oneline -10
@@ -31,18 +39,19 @@ git log --oneline -10
31
39
  - BASE_SHA = HEAD~1
32
40
  - HEAD_SHA = HEAD
33
41
 
34
- ### 3. 派发 6aspec-code-reviewer agent
42
+ ### 4. 派发 6aspec-code-reviewer agent
35
43
 
36
44
  调用 `6aspec-code-reviewer` agent,传入:
37
45
 
38
46
  ```
39
47
  变更描述:[用户提供的描述,或"最近一次提交的变更"]
40
48
  需求/计划:[--plan 指定的文件路径,或"无"]
41
- BASE_SHA:[base SHA]
42
- HEAD_SHA:[head SHA]
49
+ DIFF:[--diff 指定文件内容(如提供)]
50
+ BASE_SHA:[base SHA(如使用 git)]
51
+ HEAD_SHA:[head SHA(如使用 git)]
43
52
  ```
44
53
 
45
- ### 4. 展示审查结果
54
+ ### 5. 展示审查结果
46
55
 
47
56
  直接展示 agent 返回的完整审查报告。
48
57
 
@@ -51,6 +60,7 @@ HEAD_SHA:[head SHA]
51
60
  ```
52
61
  /6aspec:review
53
62
  /6aspec:review 实现了用户认证功能
63
+ /6aspec:review --diff /tmp/change.patch
54
64
  /6aspec:review --base abc1234 --head def5678
55
65
  /6aspec:review --plan 6aspecdoc/brown/add-user-auth/artifacts/specs.md
56
66
  ```
package/lib/cli.js CHANGED
@@ -43,9 +43,9 @@ const TOOL_DIRS = {
43
43
  '.agents/skills/6aspec-brown-quick',
44
44
  '.agents/skills/6aspec-brown-rollback',
45
45
  '.agents/skills/6aspec-brown-update',
46
- '.codex/agents/6aspec-brown-implementer.md',
47
- '.codex/agents/6aspec-brown-spec-compliance-reviewer.md',
48
- '.codex/agents/6aspec-code-reviewer.md',
46
+ '.codex/agents/6aspec-brown-implementer.toml',
47
+ '.codex/agents/6aspec-brown-spec-compliance-reviewer.toml',
48
+ '.codex/agents/6aspec-code-reviewer.toml',
49
49
  ],
50
50
  };
51
51
  // ─── Welcome Screen with Animation ──────────────────────────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "6aspec",
3
- "version": "3.0.0-dev.12",
3
+ "version": "3.0.0-dev.14",
4
4
  "description": "6Aspec - 轻量级 spec 驱动开发框架,支持 Cursor 和 Claude Code",
5
5
  "main": "lib/installer.js",
6
6
  "bin": {
@@ -1,7 +0,0 @@
1
- ---
2
- name: 6aspec-brown-implementer
3
- description: 执行棕地需求的单个 TASK 实现,包括写代码、单元测试和自我审查
4
- tools: [Read, Write, Edit, Bash]
5
- ---
6
-
7
- 读取并严格遵循:`.6aspec/rules/brown/subagents/implementer.md`
@@ -1,7 +0,0 @@
1
- ---
2
- name: 6aspec-brown-spec-compliance-reviewer
3
- description: 检查实现是否符合 TASK 的验收标准和 specs.md 的 AC/Scenario,适用于 TASK 完成后的合规验收
4
- tools: [Read, Glob, Grep, Bash]
5
- ---
6
-
7
- 读取并严格遵循:`.6aspec/rules/brown/subagents/spec-compliance-reviewer.md`
@@ -1,7 +0,0 @@
1
- ---
2
- name: 6aspec-code-reviewer
3
- description: 审查代码变更的生产就绪性,从代码质量、架构、测试、需求符合度四个维度评估,给出明确的合并建议
4
- tools: [Read, Glob, Grep]
5
- ---
6
-
7
- 读取并严格遵循:`.6aspec/rules/common/code-reviewer-agent.md`