@rpamis/comet 0.1.4 → 0.1.5
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/README.md +5 -4
- package/assets/manifest.json +19 -15
- package/assets/skills/comet/SKILL.md +204 -204
- package/assets/skills/comet-archive/SKILL.md +151 -151
- package/assets/skills/comet-build/SKILL.md +161 -161
- package/assets/skills/comet-design/SKILL.md +108 -108
- package/assets/skills/comet-hotfix/SKILL.md +165 -165
- package/assets/skills/comet-open/SKILL.md +123 -123
- package/assets/skills/comet-tweak/SKILL.md +152 -152
- package/assets/skills/comet-verify/SKILL.md +164 -164
- package/assets/skills-zh/comet/SKILL.md +204 -0
- package/assets/skills-zh/comet-archive/SKILL.md +151 -0
- package/assets/skills-zh/comet-build/SKILL.md +161 -0
- package/assets/skills-zh/comet-design/SKILL.md +108 -0
- package/assets/skills-zh/comet-hotfix/SKILL.md +165 -0
- package/assets/skills-zh/comet-open/SKILL.md +123 -0
- package/assets/skills-zh/comet-tweak/SKILL.md +152 -0
- package/assets/skills-zh/comet-verify/SKILL.md +164 -0
- package/dist/core/init.d.ts.map +1 -1
- package/dist/core/init.js +32 -3
- package/dist/core/init.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,164 +1,164 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: comet-verify
|
|
3
|
-
description: "Comet
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Comet
|
|
7
|
-
|
|
8
|
-
##
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
- tasks.md
|
|
12
|
-
|
|
13
|
-
##
|
|
14
|
-
|
|
15
|
-
### 0.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
1. `openspec/changes/<name>/.comet.yaml`
|
|
21
|
-
2. `phase`
|
|
22
|
-
3. `verify_result`
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- `cat openspec/changes/<name>/.comet.yaml`
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
```
|
|
30
|
-
[HARD STOP] Entry check failed for comet-verify
|
|
31
|
-
Expected: phase=verify, verify_result=pending|null
|
|
32
|
-
Actual: phase
|
|
33
|
-
Suggestion: Run comet-build first, or this change was already verified.
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
### 1.
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
|
43
|
-
|
|
44
|
-
| tasks.md
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- `light`
|
|
54
|
-
- `full`
|
|
55
|
-
|
|
56
|
-
Few-shot
|
|
57
|
-
|
|
58
|
-
```yaml
|
|
59
|
-
#
|
|
60
|
-
phase: verify
|
|
61
|
-
verify_mode: light
|
|
62
|
-
verify_result: pending
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
```yaml
|
|
66
|
-
#
|
|
67
|
-
phase: verify
|
|
68
|
-
verify_mode: full
|
|
69
|
-
verify_result: pending
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
cat openspec/changes/<name>/.comet.yaml
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
### 2a.
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
1. tasks.md
|
|
82
|
-
2.
|
|
83
|
-
3.
|
|
84
|
-
4.
|
|
85
|
-
5.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
- spec scenario
|
|
93
|
-
- design doc
|
|
94
|
-
- code pattern consistency
|
|
95
|
-
- delta spec
|
|
96
|
-
|
|
97
|
-
### 2b.
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
1. tasks.md
|
|
105
|
-
2.
|
|
106
|
-
3.
|
|
107
|
-
4.
|
|
108
|
-
5. proposal.md
|
|
109
|
-
6. delta spec
|
|
110
|
-
7. `docs/superpowers/specs/`
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
**Spec
|
|
115
|
-
-
|
|
116
|
-
-
|
|
117
|
-
-
|
|
118
|
-
-
|
|
119
|
-
|
|
120
|
-
### 3.
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
1.
|
|
128
|
-
2.
|
|
129
|
-
3.
|
|
130
|
-
4.
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
- Maven
|
|
134
|
-
-
|
|
135
|
-
-
|
|
136
|
-
-
|
|
137
|
-
|
|
138
|
-
##
|
|
139
|
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
- `.comet.yaml`
|
|
143
|
-
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
```yaml
|
|
148
|
-
phase: archive
|
|
149
|
-
verify_result: pass
|
|
150
|
-
verified_at: YYYY-MM-DD
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
cat openspec/changes/<name>/.comet.yaml
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
##
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
> **REQUIRED NEXT SKILL:**
|
|
1
|
+
---
|
|
2
|
+
name: comet-verify
|
|
3
|
+
description: "Comet Phase 4: Verify and Complete. Invoke with /comet-verify. Verify implementation matches design, handle development branch."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Comet Phase 4: Verify and Complete (Verify)
|
|
7
|
+
|
|
8
|
+
## Prerequisites
|
|
9
|
+
|
|
10
|
+
- Code has been committed (Phase 3 complete)
|
|
11
|
+
- All tasks in tasks.md are complete
|
|
12
|
+
|
|
13
|
+
## Steps
|
|
14
|
+
|
|
15
|
+
### 0. Entry State Verification (Entry Check)
|
|
16
|
+
|
|
17
|
+
Before performing any operations, read and verify the current state:
|
|
18
|
+
|
|
19
|
+
**Checklist:**
|
|
20
|
+
1. `openspec/changes/<name>/.comet.yaml` exists
|
|
21
|
+
2. `phase` field value is `"verify"`
|
|
22
|
+
3. `verify_result` field is `"pending"` or null (not yet verified)
|
|
23
|
+
|
|
24
|
+
**Verification method:**
|
|
25
|
+
- `cat openspec/changes/<name>/.comet.yaml` to read all fields
|
|
26
|
+
- If `verify_result` is already `"pass"`, this change has already been verified
|
|
27
|
+
|
|
28
|
+
**Failure output:**
|
|
29
|
+
```
|
|
30
|
+
[HARD STOP] Entry check failed for comet-verify
|
|
31
|
+
Expected: phase=verify, verify_result=pending|null
|
|
32
|
+
Actual: phase=<actual-value>, verify_result=<actual-value>
|
|
33
|
+
Suggestion: Run comet-build first, or this change was already verified.
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Proceed to Step 1 only after verification passes.
|
|
37
|
+
|
|
38
|
+
### 1. Change Scale Assessment
|
|
39
|
+
|
|
40
|
+
Determine change scale based on the following metrics:
|
|
41
|
+
|
|
42
|
+
| Metric | Small (lightweight verification) | Large (full verification) |
|
|
43
|
+
|------|-------------------------------|--------------------------|
|
|
44
|
+
| tasks.md task count | ≤ 3 | > 3 |
|
|
45
|
+
| Changed file count (git diff --stat) | ≤ 5 | > 5 |
|
|
46
|
+
| Has delta spec | No | Yes |
|
|
47
|
+
| New capability added | No | Yes |
|
|
48
|
+
|
|
49
|
+
**Decision rule**: Any metric hitting "large" → full verification. All hitting "small" → lightweight verification.
|
|
50
|
+
|
|
51
|
+
After determination, record actual verification mode in `openspec/changes/<name>/.comet.yaml`. `verify_mode` only allows one of the following values:
|
|
52
|
+
|
|
53
|
+
- `light`
|
|
54
|
+
- `full`
|
|
55
|
+
|
|
56
|
+
Few-shot examples:
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
# All metrics hit "small"
|
|
60
|
+
phase: verify
|
|
61
|
+
verify_mode: light
|
|
62
|
+
verify_result: pending
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
```yaml
|
|
66
|
+
# Any metric hits "large"
|
|
67
|
+
phase: verify
|
|
68
|
+
verify_mode: full
|
|
69
|
+
verify_result: pending
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
【Write verification】After update completion, must verify:
|
|
73
|
+
cat openspec/changes/<name>/.comet.yaml
|
|
74
|
+
Confirm verify_mode line value is "<light or full>"
|
|
75
|
+
If not matching, retry write then verify again. Maximum 2 retries, report error and terminate if still fails.
|
|
76
|
+
|
|
77
|
+
### 2a. Lightweight Verification (Small Changes)
|
|
78
|
+
|
|
79
|
+
When scale assessment result is "small", skip `openspec-verify-change`, directly execute the following checks:
|
|
80
|
+
|
|
81
|
+
1. All tasks in tasks.md completed `[x]`
|
|
82
|
+
2. Changed files consistent with tasks.md description (`git diff --stat`对照 tasks content)
|
|
83
|
+
3. Build passes (for Maven projects, first execute `mvn spotless:apply`, then execute `mvn compile` or equivalent command)
|
|
84
|
+
4. Related tests pass
|
|
85
|
+
5. No obvious security issues (no hardcoded secrets, no new unsafe operations)
|
|
86
|
+
|
|
87
|
+
**Pass standard**: All 5 items OK, no CRITICAL issues.
|
|
88
|
+
|
|
89
|
+
**Report format**: Brief table listing 5 check results + PASS/FAIL.
|
|
90
|
+
|
|
91
|
+
**Skipped items** (not checked in lightweight verification):
|
|
92
|
+
- spec scenario coverage
|
|
93
|
+
- design doc consistency deep comparison
|
|
94
|
+
- code pattern consistency recommendations
|
|
95
|
+
- delta spec and design doc drift detection
|
|
96
|
+
|
|
97
|
+
### 2b. Full Verification (Large Changes)
|
|
98
|
+
|
|
99
|
+
When scale assessment result is "large":
|
|
100
|
+
|
|
101
|
+
**Immediately execute:** Use the Skill tool to load the `openspec-verify-change` skill. Skipping this step is prohibited.
|
|
102
|
+
|
|
103
|
+
After the skill loads, follow its guidance to verify. Check items:
|
|
104
|
+
1. All tasks in tasks.md completed (`[x]`)
|
|
105
|
+
2. Implementation matches design.md design decisions
|
|
106
|
+
3. Implementation matches brainstorming design document
|
|
107
|
+
4. All capability specification scenarios pass
|
|
108
|
+
5. proposal.md goals satisfied
|
|
109
|
+
6. No contradiction between delta spec and design doc (if Build phase had incremental spec modifications, check if design doc has corresponding records)
|
|
110
|
+
7. `docs/superpowers/specs/` associated design document can be located (file exists and relates to current change)
|
|
111
|
+
|
|
112
|
+
When verification fails: report missing items, return to Phase 3 to supplement (invoke `/comet-build`).
|
|
113
|
+
|
|
114
|
+
**Spec drift handling**:
|
|
115
|
+
- If check item 6 finds contradiction (delta spec has content but design doc doesn't reflect it), prompt user:
|
|
116
|
+
- Option A: Append "Implementation Divergence" section to design doc recording deviation reason
|
|
117
|
+
- Option B: Roll back to Build phase, supplement brainstorming to update design doc
|
|
118
|
+
- Option C: Confirm deviation acceptable, continue verification (design doc will be marked as `superseded-by-main-spec` during archiving)
|
|
119
|
+
|
|
120
|
+
### 3. Completion (Superpowers)
|
|
121
|
+
|
|
122
|
+
**Immediately execute:** Use the Skill tool to load the `superpowers:finishing-a-development-branch` skill. Skipping this step is prohibited.
|
|
123
|
+
|
|
124
|
+
If `superpowers:finishing-a-development-branch` is unavailable, stop the process and prompt to install or enable Superpowers skills. Do not substitute this step with normal conversation.
|
|
125
|
+
|
|
126
|
+
After the skill loads, follow its guidance to complete. Branch handling options:
|
|
127
|
+
1. Local merge to main branch
|
|
128
|
+
2. Push and create PR
|
|
129
|
+
3. Keep branch (handle later)
|
|
130
|
+
4. Discard work
|
|
131
|
+
|
|
132
|
+
**Confirmation items**:
|
|
133
|
+
- Maven test or build commands have executed `mvn spotless:apply`
|
|
134
|
+
- All tests pass
|
|
135
|
+
- No remaining spotless formatting issues
|
|
136
|
+
- No hardcoded secrets or security issues
|
|
137
|
+
|
|
138
|
+
## Exit Conditions
|
|
139
|
+
|
|
140
|
+
- Verification report passed
|
|
141
|
+
- Branch handled
|
|
142
|
+
- `.comet.yaml` `verify_result` recorded as `pass`
|
|
143
|
+
- **Phase guard**: Run `bash $COMET_GUARD <change-name> verify`, allow transition only after all PASS
|
|
144
|
+
|
|
145
|
+
Before exit, merge and update the following fields in `.comet.yaml` (keep other fields unchanged):
|
|
146
|
+
|
|
147
|
+
```yaml
|
|
148
|
+
phase: archive
|
|
149
|
+
verify_result: pass
|
|
150
|
+
verified_at: YYYY-MM-DD
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
【Write verification】After update completion, must verify:
|
|
154
|
+
cat openspec/changes/<name>/.comet.yaml
|
|
155
|
+
Confirm phase line value is "archive"
|
|
156
|
+
Confirm verify_result line value is "pass"
|
|
157
|
+
Confirm verified_at line value is non-empty (format YYYY-MM-DD)
|
|
158
|
+
If any field does not match, retry write then verify again. Maximum 2 retries, report error and terminate if still fails.
|
|
159
|
+
|
|
160
|
+
## Automatic Transition
|
|
161
|
+
|
|
162
|
+
After exit conditions are met, **proceed immediately to the next phase without waiting for user input**:
|
|
163
|
+
|
|
164
|
+
> **REQUIRED NEXT SKILL:** Invoke `comet-archive` skill to enter the archiving phase.
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: comet
|
|
3
|
+
description: "Comet — OpenSpec + Superpowers 双星开发流程。用 /comet 启动,自动检测阶段并分发到子命令。五阶段:开启 → 深度设计 → 计划与构建 → 验证与收尾 → 归档。"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Comet — OpenSpec + Superpowers 双星开发流程
|
|
7
|
+
|
|
8
|
+
OpenSpec 与 Superpowers 如双星系统围绕同一目标运转。OpenSpec 负责 WHAT,Superpowers 负责 HOW。
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
OpenSpec 负责 WHAT — 大纲、提案、spec 生命周期、归档
|
|
12
|
+
Superpowers 负责 HOW — 技术设计、计划、执行、收尾
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**核心原则:brainstorming 必不可跳过。每次变更都必须经过深度设计(hotfix 和 tweak preset 除外)。**
|
|
16
|
+
|
|
17
|
+
<IMPORTANT>
|
|
18
|
+
## 阶段衔接
|
|
19
|
+
|
|
20
|
+
单次 `/comet` 调用会从检测到的阶段开始执行,并在每个阶段退出条件满足后提示或进入下一阶段。
|
|
21
|
+
|
|
22
|
+
流转链:open → design → build → verify → archive
|
|
23
|
+
|
|
24
|
+
需要用户参与的节点:
|
|
25
|
+
1. brainstorming 过程中确认设计方案
|
|
26
|
+
2. build 阶段选择执行方式
|
|
27
|
+
3. verify 不通过时决定修复或接受偏差
|
|
28
|
+
4. finishing-branch 选择分支处理方式
|
|
29
|
+
5. 遇到升级条件(hotfix/tweak → 完整流程)
|
|
30
|
+
|
|
31
|
+
agent 不应跳过这些决策点;其他明确无歧义的阶段衔接可以继续推进。
|
|
32
|
+
</IMPORTANT>
|
|
33
|
+
|
|
34
|
+
## 阶段自动检测
|
|
35
|
+
|
|
36
|
+
### Step 0: 活跃 Change 发现
|
|
37
|
+
|
|
38
|
+
**立即执行:**
|
|
39
|
+
|
|
40
|
+
1. 运行 `openspec list --json` 获取所有活跃 change
|
|
41
|
+
2. 对每个 change,检查 `docs/superpowers/specs/` 和 `docs/superpowers/plans/` 匹配关联文件,判断阶段和进度
|
|
42
|
+
|
|
43
|
+
**分支逻辑:**
|
|
44
|
+
|
|
45
|
+
| 情况 | 行为 |
|
|
46
|
+
|------|------|
|
|
47
|
+
| 无活跃 change | → 调用 `/comet-open` |
|
|
48
|
+
| 恰好 1 个活跃 change | → 自动选中,进入阶段判定(Step 1) |
|
|
49
|
+
| 多个活跃 change | → 列出清单让用户选择 |
|
|
50
|
+
|
|
51
|
+
**多 change 选择**:使用 AskUserQuestion 展示,格式示例:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
| # | Change 名称 | 当前阶段 | 任务进度 |
|
|
55
|
+
|---|------------|---------|---------|
|
|
56
|
+
| 1 | xxx-feature | Build | 3/5 tasks |
|
|
57
|
+
| 2 | yyy-fix | Design | No design doc |
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
用户选择后,对选中的 change 进入阶段判定。
|
|
61
|
+
|
|
62
|
+
**Preset 检测**:
|
|
63
|
+
- 如用户明确描述为 bug fix / 热修复,且满足 hotfix 适用条件,直接调用 `/comet-hotfix`(跳过选择)。
|
|
64
|
+
- 如用户明确描述为文案、配置、文档、prompt 或小范围非 bug 调整,且满足 tweak 适用条件,直接调用 `/comet-tweak`(跳过选择)。
|
|
65
|
+
|
|
66
|
+
### Step 1: Comet 状态元数据读取
|
|
67
|
+
|
|
68
|
+
优先读取 `openspec/changes/<name>/.comet.yaml`。若该文件不存在,再回退到 `openspec status --change "<name>" --json`、`tasks.md` 和 `docs/superpowers/` 文件检查。
|
|
69
|
+
|
|
70
|
+
推荐元数据结构:
|
|
71
|
+
|
|
72
|
+
```yaml
|
|
73
|
+
workflow: full
|
|
74
|
+
phase: build
|
|
75
|
+
design_doc: docs/superpowers/specs/YYYY-MM-DD-topic-design.md
|
|
76
|
+
plan: docs/superpowers/plans/YYYY-MM-DD-feature.md
|
|
77
|
+
build_mode: subagent-driven-development
|
|
78
|
+
verify_mode: light
|
|
79
|
+
verify_result: pending
|
|
80
|
+
verified_at: null
|
|
81
|
+
archived: false
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
字段含义:
|
|
85
|
+
|
|
86
|
+
| 字段 | 含义 |
|
|
87
|
+
|------|------|
|
|
88
|
+
| `workflow` | `full`、`hotfix` 或 `tweak` |
|
|
89
|
+
| `phase` | 当前阶段:`open`、`design`、`build`、`verify`、`archive` |
|
|
90
|
+
| `design_doc` | 关联的 Superpowers Design Doc 路径,可为空 |
|
|
91
|
+
| `plan` | 关联的 Superpowers Plan 路径,可为空 |
|
|
92
|
+
| `build_mode` | 已选择的执行方式,可为空 |
|
|
93
|
+
| `verify_mode` | `light` 或 `full`,可为空 |
|
|
94
|
+
| `verify_result` | `pending`、`pass` 或 `fail` |
|
|
95
|
+
| `verified_at` | 验证通过时间,可为空 |
|
|
96
|
+
| `archived` | change 是否已归档 |
|
|
97
|
+
|
|
98
|
+
### Step 2: 阶段判定
|
|
99
|
+
|
|
100
|
+
对选中的 change,按以下顺序判断当前状态:
|
|
101
|
+
|
|
102
|
+
1. **`archived: true` 或 change 已移入 archive** → 流程已完成
|
|
103
|
+
2. **`verify_result: pass` 且 `archived` 不是 `true`** → 调用 `/comet-archive`
|
|
104
|
+
3. **`phase: verify` 或 tasks.md 全部勾选** → 调用 `/comet-verify`
|
|
105
|
+
4. **`phase: build` 或已有 Design Doc 但计划/执行未完成** → 调用 `/comet-build`
|
|
106
|
+
5. **`phase: design` 或有 change 但无 Design Doc** → 调用 `/comet-design`
|
|
107
|
+
6. **无活跃 change 或状态无法判定** → 调用 `/comet-open`
|
|
108
|
+
|
|
109
|
+
如果元数据与文件状态冲突,以可验证的文件状态为准,并在继续阶段前修正 `.comet.yaml`。
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## 子命令
|
|
114
|
+
|
|
115
|
+
| 命令 | 阶段 | 归属 | 产物 |
|
|
116
|
+
|------|------|------|------|
|
|
117
|
+
| `/comet-open` | 1. 开启 | OpenSpec | proposal.md、design.md、tasks.md |
|
|
118
|
+
| `/comet-design` | 2. 深度设计 | Superpowers | Design Doc、delta spec |
|
|
119
|
+
| `/comet-build` | 3. 计划与构建 | Superpowers | 实施计划、代码提交 |
|
|
120
|
+
| `/comet-verify` | 4. 验证与收尾 | Both | 验证报告、分支处理 |
|
|
121
|
+
| `/comet-archive` | 5. 归档 | OpenSpec | delta→main spec 同步、design doc 标注、归档 |
|
|
122
|
+
| `/comet-hotfix` | 预设路径 | Both | 快速修复(跳过 brainstorming) |
|
|
123
|
+
| `/comet-tweak` | 预设路径 | Both | 小改动(跳过 brainstorming 和完整 plan) |
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## 流程图
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
/comet
|
|
131
|
+
↓ 自动检测
|
|
132
|
+
/comet-open ──→ /comet-design ──→ /comet-build ──→ /comet-verify ──→ /comet-archive
|
|
133
|
+
(OpenSpec) (Superpowers) (Superpowers) (Both) (OpenSpec)
|
|
134
|
+
|
|
135
|
+
/comet-hotfix(预设路径,跳过 brainstorming)
|
|
136
|
+
open ──→ build ──→ verify ──→ archive
|
|
137
|
+
↑ 如触发升级条件 → 补充 Design Doc → 回到完整流程
|
|
138
|
+
|
|
139
|
+
/comet-tweak(预设路径,跳过 brainstorming 和完整 plan)
|
|
140
|
+
open ──→ lightweight build ──→ light verify ──→ archive
|
|
141
|
+
↑ 如触发升级条件 → 补充 Design Doc → 回到完整流程
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## 错误处理
|
|
147
|
+
|
|
148
|
+
| 场景 | 处理方式 |
|
|
149
|
+
|------|---------|
|
|
150
|
+
| `openspec list --json` 失败 | 检查 openspec 是否已安装,提示用户运行 `openspec init` |
|
|
151
|
+
| 子 skill 不可用(如 `superpowers:brainstorming`) | 停止流程,提示安装或启用对应 skill |
|
|
152
|
+
| `.comet.yaml` 格式异常或缺失 | 以文件状态为准(tasks.md、docs/superpowers/),修正元数据后继续 |
|
|
153
|
+
| Maven 编译/测试失败 | 返回 build 阶段修复,不进入 verify |
|
|
154
|
+
| change 目录结构不完整 | 按 `comet-open` 的产物要求补齐缺失文件 |
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## 快速参考
|
|
159
|
+
|
|
160
|
+
### 脚本定位
|
|
161
|
+
|
|
162
|
+
Comet 阶段守卫脚本 `comet-guard.sh` 随 skill 包分发,位于 `comet/scripts/` 目录。
|
|
163
|
+
**不硬编码平台路径**,运行时通过以下命令自定位:
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
COMET_GUARD=$(find . -path '*/comet/scripts/comet-guard.sh' -type f -print -quit)
|
|
167
|
+
bash "$COMET_GUARD" <change-name> <phase>
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
后续文档中 `bash $COMET_GUARD <change> <phase>` 均指此命令。加载 comet 后,agent 应在 shell 环境中缓存 `COMET_GUARD` 路径,避免重复 `find`。
|
|
171
|
+
|
|
172
|
+
### 文件结构
|
|
173
|
+
|
|
174
|
+
```
|
|
175
|
+
openspec/ # OpenSpec — WHAT
|
|
176
|
+
├── config.yaml
|
|
177
|
+
├── changes/
|
|
178
|
+
│ ├── <name>/ # 活跃 change
|
|
179
|
+
│ │ ├── .openspec.yaml
|
|
180
|
+
│ │ ├── .comet.yaml
|
|
181
|
+
│ │ ├── proposal.md # Why + What
|
|
182
|
+
│ │ ├── design.md # 高层架构决策
|
|
183
|
+
│ │ ├── specs/<capability>/spec.md # Delta 能力规格
|
|
184
|
+
│ │ └── tasks.md # 任务清单
|
|
185
|
+
│ └── archive/YYYY-MM-DD-<name>/ # 已归档
|
|
186
|
+
└── specs/<capability>/spec.md # 主 specs(归档时从 delta 同步)
|
|
187
|
+
|
|
188
|
+
docs/superpowers/ # Superpowers — HOW
|
|
189
|
+
├── specs/YYYY-MM-DD-<topic>-design.md # 设计文档(技术 RFC,归档时标注状态)
|
|
190
|
+
└── plans/YYYY-MM-DD-<feature>.md # 实施计划(文件头含 change 关联元数据)
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### 最佳实践
|
|
194
|
+
|
|
195
|
+
1. **brainstorming 不可跳过** — 每次变更必须经过深度设计(hotfix 和 tweak 除外)
|
|
196
|
+
2. **delta spec 是活文档** — 阶段 3 期间可自由修改,归档时同步
|
|
197
|
+
3. **保持 tasks.md 同步** — 完成一个勾一个
|
|
198
|
+
4. **频繁提交** — 每个任务一次提交,message 体现设计意图
|
|
199
|
+
5. **先验证再归档** — `/comet-verify` 通过后才执行 `/comet-archive`
|
|
200
|
+
6. **增量更新分级** — 小编辑、中重 brainstorming、大新 change
|
|
201
|
+
7. **Plan 必须关联 change** — 文件头包含 `change:` 和 `design-doc:` 元数据
|
|
202
|
+
8. **归档闭环** — design doc 和 plan 必须标注 `archived-with` 状态
|
|
203
|
+
9. **增量修改已有功能** — 基于 main spec 创建 delta spec 基线,不从零编写
|
|
204
|
+
10. **Preset 有上限** — hotfix/tweak 满足升级条件时及时切换到完整流程
|