@rpamis/comet 0.3.1 → 0.3.3
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/assets/manifest.json +2 -1
- package/assets/skills/comet/SKILL.md +6 -5
- package/assets/skills/comet/scripts/comet-env.sh +55 -0
- package/assets/skills/comet/scripts/comet-state.sh +2 -2
- package/assets/skills/comet-archive/SKILL.md +6 -2
- package/assets/skills/comet-build/SKILL.md +7 -4
- package/assets/skills/comet-design/SKILL.md +6 -4
- package/assets/skills/comet-hotfix/SKILL.md +11 -9
- package/assets/skills/comet-open/SKILL.md +6 -3
- package/assets/skills/comet-tweak/SKILL.md +10 -8
- package/assets/skills/comet-verify/SKILL.md +6 -3
- package/assets/skills-zh/comet/SKILL.md +7 -6
- package/assets/skills-zh/comet-archive/SKILL.md +6 -2
- package/assets/skills-zh/comet-build/SKILL.md +6 -3
- package/assets/skills-zh/comet-design/SKILL.md +6 -4
- package/assets/skills-zh/comet-hotfix/SKILL.md +9 -7
- package/assets/skills-zh/comet-open/SKILL.md +6 -3
- package/assets/skills-zh/comet-tweak/SKILL.md +6 -4
- package/assets/skills-zh/comet-verify/SKILL.md +6 -3
- package/dist/core/command-error.d.ts +4 -0
- package/dist/core/command-error.d.ts.map +1 -0
- package/dist/core/command-error.js +53 -0
- package/dist/core/command-error.js.map +1 -0
- package/dist/core/detect.d.ts.map +1 -1
- package/dist/core/detect.js +33 -4
- package/dist/core/detect.js.map +1 -1
- package/dist/core/openspec.d.ts.map +1 -1
- package/dist/core/openspec.js +120 -1
- package/dist/core/openspec.js.map +1 -1
- package/dist/core/platforms.d.ts.map +1 -1
- package/dist/core/platforms.js +14 -2
- package/dist/core/platforms.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +58 -0
- package/dist/core/skills.js.map +1 -1
- package/dist/core/superpowers.d.ts +3 -2
- package/dist/core/superpowers.d.ts.map +1 -1
- package/dist/core/superpowers.js +75 -25
- package/dist/core/superpowers.js.map +1 -1
- package/package.json +1 -1
package/assets/manifest.json
CHANGED
|
@@ -206,11 +206,12 @@ State-machine hard constraints:
|
|
|
206
206
|
Comet scripts are distributed in `comet/scripts/`. **Do not hardcode paths** — locate once, cache in env vars:
|
|
207
207
|
|
|
208
208
|
```bash
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
209
|
+
COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
|
|
210
|
+
if [ -z "$COMET_ENV" ]; then
|
|
211
|
+
echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
|
|
212
|
+
return 1
|
|
213
|
+
fi
|
|
214
|
+
. "$COMET_ENV"
|
|
214
215
|
|
|
215
216
|
# Stop workflow when script location fails
|
|
216
217
|
if [ -z "$COMET_GUARD" ] || [ -z "$COMET_STATE" ] || [ -z "$COMET_HANDOFF" ] || [ -z "$COMET_ARCHIVE" ]; then
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Comet script locator — source this file to export paths to bundled scripts.
|
|
3
|
+
#
|
|
4
|
+
# Usage:
|
|
5
|
+
# . /path/to/comet/scripts/comet-env.sh
|
|
6
|
+
#
|
|
7
|
+
# This file is sourced by workflow snippets. Do not set global shell options here.
|
|
8
|
+
|
|
9
|
+
_comet_env_source="${BASH_SOURCE[0]:-$0}"
|
|
10
|
+
_comet_script_dir="$(cd "$(dirname "$_comet_env_source")" && pwd -P)"
|
|
11
|
+
_comet_env_sourced=0
|
|
12
|
+
(return 0 2>/dev/null) && _comet_env_sourced=1
|
|
13
|
+
|
|
14
|
+
export COMET_GUARD="${COMET_GUARD:-${_comet_script_dir}/comet-guard.sh}"
|
|
15
|
+
export COMET_STATE="${COMET_STATE:-${_comet_script_dir}/comet-state.sh}"
|
|
16
|
+
export COMET_HANDOFF="${COMET_HANDOFF:-${_comet_script_dir}/comet-handoff.sh}"
|
|
17
|
+
export COMET_ARCHIVE="${COMET_ARCHIVE:-${_comet_script_dir}/comet-archive.sh}"
|
|
18
|
+
export COMET_YAML_VALIDATE="${COMET_YAML_VALIDATE:-${_comet_script_dir}/comet-yaml-validate.sh}"
|
|
19
|
+
|
|
20
|
+
_comet_env_fail() {
|
|
21
|
+
echo "ERROR: Comet scripts not found. Ensure the comet skill is installed completely." >&2
|
|
22
|
+
echo "Expected path pattern: */comet/scripts/comet-*.sh under project or platform skill directories" >&2
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
_comet_env_abort() {
|
|
26
|
+
local _comet_env_was_sourced="$_comet_env_sourced"
|
|
27
|
+
unset _comet_env_source _comet_script_dir _comet_script _comet_env_missing _comet_env_sourced
|
|
28
|
+
unset -f _comet_env_fail
|
|
29
|
+
if [ "$_comet_env_was_sourced" -eq 1 ]; then
|
|
30
|
+
unset -f _comet_env_abort
|
|
31
|
+
return 1
|
|
32
|
+
fi
|
|
33
|
+
exit 1
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
_comet_env_missing=0
|
|
37
|
+
for _comet_script in \
|
|
38
|
+
"$COMET_GUARD" \
|
|
39
|
+
"$COMET_STATE" \
|
|
40
|
+
"$COMET_HANDOFF" \
|
|
41
|
+
"$COMET_ARCHIVE" \
|
|
42
|
+
"$COMET_YAML_VALIDATE"; do
|
|
43
|
+
if [ ! -f "$_comet_script" ]; then
|
|
44
|
+
_comet_env_fail
|
|
45
|
+
_comet_env_missing=1
|
|
46
|
+
break
|
|
47
|
+
fi
|
|
48
|
+
done
|
|
49
|
+
|
|
50
|
+
if [ "$_comet_env_missing" -ne 0 ]; then
|
|
51
|
+
_comet_env_abort
|
|
52
|
+
else
|
|
53
|
+
unset _comet_env_source _comet_script_dir _comet_script _comet_env_missing _comet_env_sourced
|
|
54
|
+
unset -f _comet_env_fail _comet_env_abort
|
|
55
|
+
fi
|
|
@@ -271,8 +271,8 @@ cmd_set() {
|
|
|
271
271
|
red "Valid fields:" >&2
|
|
272
272
|
red " workflow, phase, design_doc, plan, build_mode, isolation," >&2
|
|
273
273
|
red " verify_mode, verify_result, verification_report, branch_status," >&2
|
|
274
|
-
red " verified_at, archived,
|
|
275
|
-
red " verify_command, handoff_context, handoff_hash" >&2
|
|
274
|
+
red " verified_at, created_at, archived, base_ref, direct_override," >&2
|
|
275
|
+
red " build_command, verify_command, handoff_context, handoff_hash" >&2
|
|
276
276
|
exit 1
|
|
277
277
|
;;
|
|
278
278
|
esac
|
|
@@ -18,8 +18,12 @@ description: "Comet Phase 5: Archive. Invoke with /comet-archive. Sync delta spe
|
|
|
18
18
|
Execute entry verification:
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
|
|
22
|
+
if [ -z "$COMET_ENV" ]; then
|
|
23
|
+
echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
|
|
24
|
+
return 1
|
|
25
|
+
fi
|
|
26
|
+
. "$COMET_ENV"
|
|
23
27
|
bash "$COMET_STATE" check <name> archive
|
|
24
28
|
```
|
|
25
29
|
|
|
@@ -17,9 +17,12 @@ description: "Comet Phase 3: Plan and Build. Invoke with /comet-build. Create pl
|
|
|
17
17
|
Execute entry verification:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
|
|
21
|
+
if [ -z "$COMET_ENV" ]; then
|
|
22
|
+
echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
|
|
23
|
+
return 1
|
|
24
|
+
fi
|
|
25
|
+
. "$COMET_ENV"
|
|
23
26
|
bash "$COMET_STATE" check <name> build
|
|
24
27
|
```
|
|
25
28
|
|
|
@@ -85,7 +88,7 @@ Plan has been written to the current branch. Before starting execution, **ask th
|
|
|
85
88
|
- Task count ≤ 2 and no cross-module dependencies → Recommend B
|
|
86
89
|
- From hotfix path → Recommend B
|
|
87
90
|
|
|
88
|
-
This is a user decision point. Must pause and wait for the user to explicitly choose both isolation method and execution method. **
|
|
91
|
+
This is a user decision point. Must pause and wait for the user to explicitly choose both isolation method and execution method. You **must not choose `branch` or `worktree` based on recommendation rules**, and **must not choose the execution method based on recommendation rules**. Recommendation rules are for suggestion only, not a substitute for user confirmation.
|
|
89
92
|
|
|
90
93
|
After user selection, update `isolation` and `build_mode` fields:
|
|
91
94
|
|
|
@@ -17,10 +17,12 @@ description: "Comet Phase 2: Deep Design. Invoke with /comet-design. Produce Des
|
|
|
17
17
|
Execute entry verification:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
|
|
21
|
+
if [ -z "$COMET_ENV" ]; then
|
|
22
|
+
echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
|
|
23
|
+
return 1
|
|
24
|
+
fi
|
|
25
|
+
. "$COMET_ENV"
|
|
24
26
|
bash "$COMET_STATE" check <name> design
|
|
25
27
|
```
|
|
26
28
|
|
|
@@ -23,10 +23,12 @@ Execution chain: open → build → root cause check → verify → archive. Hot
|
|
|
23
23
|
Locate Comet scripts before starting:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
|
|
27
|
+
if [ -z "$COMET_ENV" ]; then
|
|
28
|
+
echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
|
|
29
|
+
return 1
|
|
30
|
+
fi
|
|
31
|
+
. "$COMET_ENV"
|
|
30
32
|
```
|
|
31
33
|
|
|
32
34
|
### 1. Quick Open (preset open)
|
|
@@ -124,9 +126,9 @@ If there is delta spec, sync to main spec according to comet-archive rules, and
|
|
|
124
126
|
<IMPORTANT>
|
|
125
127
|
Hotfix workflow is **one-time continuous execution**. After invoking `/comet-hotfix`, agent must automatically advance through hotfix steps, without pausing to wait for user input mid-way. But the following situations must pause and wait for user confirmation:
|
|
126
128
|
|
|
127
|
-
1. Encountering upgrade conditions (see "Upgrade Conditions" section)
|
|
128
|
-
2.
|
|
129
|
-
3.
|
|
129
|
+
1. Encountering upgrade conditions (see "Upgrade Conditions" section). Handle through the upgrade-condition blocking confirmation
|
|
130
|
+
2. workspace isolation and execution-method selection when tasks exceed 3 and transfer to `/comet-build`
|
|
131
|
+
3. verify phase (comet-verify) verification-failure and branch-handling decisions
|
|
130
132
|
|
|
131
133
|
Execution order: quick open → direct build → root cause check → verification → archive → complete
|
|
132
134
|
|
|
@@ -147,7 +149,7 @@ Upgrade to full `/comet` when **any** of the following conditions are met:
|
|
|
147
149
|
| Introduces new public API | Fix creates new external interface |
|
|
148
150
|
| Fix scope exceeds single function/module | Requires coordinated changes |
|
|
149
151
|
|
|
150
|
-
When upgrade conditions are met, must pause and wait for user to explicitly confirm
|
|
152
|
+
When upgrade conditions are met, must pause and wait for the user to explicitly confirm upgrading to the full `/comet` workflow. Do not directly enter `/comet-design`, and do not automatically supplement Design Doc.
|
|
151
153
|
|
|
152
154
|
After user confirms upgrade, **must first update the workflow field** before entering full flow:
|
|
153
155
|
|
|
@@ -155,7 +157,7 @@ After user confirms upgrade, **must first update the workflow field** before ent
|
|
|
155
157
|
bash "$COMET_STATE" set <name> workflow full
|
|
156
158
|
```
|
|
157
159
|
|
|
158
|
-
Then on current change basis, supplement Design Doc: **
|
|
160
|
+
Then on current change basis, supplement Design Doc: **Immediately use the Skill tool to load the `comet-design` skill**, proceed normally with full workflow. If user does not confirm upgrade, stop hotfix and report that current change has exceeded hotfix scope.
|
|
159
161
|
|
|
160
162
|
---
|
|
161
163
|
|
|
@@ -35,9 +35,12 @@ openspec/changes/<name>/
|
|
|
35
35
|
Create `.comet.yaml` state file:
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
|
|
39
|
+
if [ -z "$COMET_ENV" ]; then
|
|
40
|
+
echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
|
|
41
|
+
return 1
|
|
42
|
+
fi
|
|
43
|
+
. "$COMET_ENV"
|
|
41
44
|
|
|
42
45
|
if [ -z "$COMET_STATE" ] || [ -z "$COMET_GUARD" ]; then
|
|
43
46
|
echo "ERROR: Comet scripts not found. Ensure the comet skill is installed." >&2
|
|
@@ -26,10 +26,12 @@ Execution chain: open → lightweight build → light verify → archive. Tweak
|
|
|
26
26
|
Locate Comet scripts before starting:
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
|
|
30
|
+
if [ -z "$COMET_ENV" ]; then
|
|
31
|
+
echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
|
|
32
|
+
return 1
|
|
33
|
+
fi
|
|
34
|
+
. "$COMET_ENV"
|
|
33
35
|
```
|
|
34
36
|
|
|
35
37
|
### 1. Quick Open (preset open)
|
|
@@ -109,8 +111,8 @@ Reuse `/comet-archive`. Must satisfy `verify_result: pass` in `.comet.yaml` befo
|
|
|
109
111
|
<IMPORTANT>
|
|
110
112
|
Tweak workflow is **one-time continuous execution**. After invoking `/comet-tweak`, agent must automatically advance through tweak steps, without pausing to wait for user input mid-way. But the following situations must pause and wait for user confirmation:
|
|
111
113
|
|
|
112
|
-
1. Encountering upgrade conditions (see "Upgrade Conditions" section)
|
|
113
|
-
2.
|
|
114
|
+
1. Encountering upgrade conditions (see "Upgrade Conditions" section). Handle through the upgrade-condition blocking confirmation
|
|
115
|
+
2. verify phase (comet-verify) verification-failure and branch-handling decisions
|
|
114
116
|
|
|
115
117
|
Execution order: quick open → lightweight build → lightweight verification → archive → complete
|
|
116
118
|
|
|
@@ -132,7 +134,7 @@ Upgrade to full `/comet` when **any** of the following conditions are met:
|
|
|
132
134
|
| New capability needed | Exceeds local optimization |
|
|
133
135
|
| Delta spec needed | Affects existing specs |
|
|
134
136
|
|
|
135
|
-
When upgrade conditions are met, must pause and wait for user to explicitly confirm
|
|
137
|
+
When upgrade conditions are met, must pause and wait for the user to explicitly confirm upgrading to the full `/comet` workflow. Do not directly enter `/comet-design`, and do not automatically supplement Design Doc.
|
|
136
138
|
|
|
137
139
|
After user confirms upgrade, **must first update the workflow field** before entering full flow:
|
|
138
140
|
|
|
@@ -140,7 +142,7 @@ After user confirms upgrade, **must first update the workflow field** before ent
|
|
|
140
142
|
bash "$COMET_STATE" set <name> workflow full
|
|
141
143
|
```
|
|
142
144
|
|
|
143
|
-
Then on current change basis, supplement Design Doc: **
|
|
145
|
+
Then on current change basis, supplement Design Doc: **Immediately use the Skill tool to load the `comet-design` skill**, proceed normally with full workflow. If user does not confirm upgrade, stop tweak and report that current change has exceeded tweak scope.
|
|
144
146
|
|
|
145
147
|
---
|
|
146
148
|
|
|
@@ -17,9 +17,12 @@ description: "Comet Phase 4: Verify and Close. Invoke with /comet-verify. Verify
|
|
|
17
17
|
Execute entry verification:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
|
|
21
|
+
if [ -z "$COMET_ENV" ]; then
|
|
22
|
+
echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
|
|
23
|
+
return 1
|
|
24
|
+
fi
|
|
25
|
+
. "$COMET_ENV"
|
|
23
26
|
bash "$COMET_STATE" check <change-name> verify
|
|
24
27
|
```
|
|
25
28
|
|
|
@@ -110,7 +110,7 @@ agent 做决策只需读本节,参考附录按需查阅。
|
|
|
110
110
|
需要用户参与的节点(仅在这些节点暂停):
|
|
111
111
|
1. brainstorming 确认设计方案
|
|
112
112
|
2. build 阶段选择工作方式(隔离方式 + 执行方式,一次交互完成)
|
|
113
|
-
|
|
113
|
+
3. verify 不通过时决定修复或接受偏差(含 Spec 漂移处理方式选择)
|
|
114
114
|
4. finishing-branch 选择分支处理方式
|
|
115
115
|
5. 遇到升级条件(hotfix/tweak → 完整流程)
|
|
116
116
|
6. build 阶段范围扩张需重新设计或拆分新 change
|
|
@@ -206,11 +206,12 @@ archived: false
|
|
|
206
206
|
Comet 脚本随 skill 包分发在 `comet/scripts/` 下。**不硬编码路径** — 定位一次,缓存到环境变量:
|
|
207
207
|
|
|
208
208
|
```bash
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
209
|
+
COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
|
|
210
|
+
if [ -z "$COMET_ENV" ]; then
|
|
211
|
+
echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
|
|
212
|
+
return 1
|
|
213
|
+
fi
|
|
214
|
+
. "$COMET_ENV"
|
|
214
215
|
|
|
215
216
|
# 脚本定位失败时停止流程
|
|
216
217
|
if [ -z "$COMET_GUARD" ] || [ -z "$COMET_STATE" ] || [ -z "$COMET_HANDOFF" ] || [ -z "$COMET_ARCHIVE" ]; then
|
|
@@ -18,8 +18,12 @@ description: "Comet 阶段 5:归档。用 /comet-archive 调用。同步 delta
|
|
|
18
18
|
执行入口验证:
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
|
|
22
|
+
if [ -z "$COMET_ENV" ]; then
|
|
23
|
+
echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
|
|
24
|
+
return 1
|
|
25
|
+
fi
|
|
26
|
+
. "$COMET_ENV"
|
|
23
27
|
bash "$COMET_STATE" check <name> archive
|
|
24
28
|
```
|
|
25
29
|
|
|
@@ -17,9 +17,12 @@ description: "Comet 阶段 3:计划与构建。用 /comet-build 调用。制
|
|
|
17
17
|
执行入口验证:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
|
|
21
|
+
if [ -z "$COMET_ENV" ]; then
|
|
22
|
+
echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
|
|
23
|
+
return 1
|
|
24
|
+
fi
|
|
25
|
+
. "$COMET_ENV"
|
|
23
26
|
bash "$COMET_STATE" check <name> build
|
|
24
27
|
```
|
|
25
28
|
|
|
@@ -17,10 +17,12 @@ description: "Comet 阶段 2:深度设计。用 /comet-design 调用。通过
|
|
|
17
17
|
执行入口验证:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
|
|
21
|
+
if [ -z "$COMET_ENV" ]; then
|
|
22
|
+
echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
|
|
23
|
+
return 1
|
|
24
|
+
fi
|
|
25
|
+
. "$COMET_ENV"
|
|
24
26
|
bash "$COMET_STATE" check <name> design
|
|
25
27
|
```
|
|
26
28
|
|
|
@@ -16,17 +16,19 @@ description: "Comet 预设路径:Bug fix / 热修复。跳过 brainstorming,
|
|
|
16
16
|
|
|
17
17
|
---
|
|
18
18
|
|
|
19
|
-
## 流程(preset workflow,
|
|
19
|
+
## 流程(preset workflow,5 阶段)
|
|
20
20
|
|
|
21
21
|
执行链路:open → build → verify → archive。Hotfix 为每个阶段提供默认决策:精简开启、直接构建、按规模验证、验证通过后归档。
|
|
22
22
|
|
|
23
23
|
开始前先定位 Comet 脚本:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
|
|
27
|
+
if [ -z "$COMET_ENV" ]; then
|
|
28
|
+
echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
|
|
29
|
+
return 1
|
|
30
|
+
fi
|
|
31
|
+
. "$COMET_ENV"
|
|
30
32
|
```
|
|
31
33
|
|
|
32
34
|
### 1. 快速开启(preset open)
|
|
@@ -110,7 +112,7 @@ bash "$COMET_GUARD" <change-name> build --apply
|
|
|
110
112
|
|
|
111
113
|
验证通过后,按 `/comet-verify` 的规则将 `.comet.yaml` 的 `verify_result` 记录为 `pass`,归档前不得跳过该状态。
|
|
112
114
|
|
|
113
|
-
###
|
|
115
|
+
### 5. 归档(preset archive)
|
|
114
116
|
|
|
115
117
|
复用 `/comet-archive`。归档前必须满足 `.comet.yaml` 中 `verify_result: pass`。
|
|
116
118
|
|
|
@@ -128,7 +130,7 @@ Hotfix 流程为 **一次性连续执行**。调用 `/comet-hotfix` 后,agent
|
|
|
128
130
|
2. 任务超过 3 个转入 `/comet-build` 时的工作区隔离和执行方式选择
|
|
129
131
|
3. 验证阶段(comet-verify)的验证失败决策和分支处理决策
|
|
130
132
|
|
|
131
|
-
执行顺序:快速开启 → 直接构建 → 验证 → 归档 → 完成
|
|
133
|
+
执行顺序:快速开启 → 直接构建 → 根因消除检查 → 验证 → 归档 → 完成
|
|
132
134
|
|
|
133
135
|
每个阶段完成后立即进入下一阶段。阶段内部仍必须按上文要求调用对应 Comet/OpenSpec/Superpowers skill,被调用的 skill 如有自己的用户决策点,按该 skill 规则执行。
|
|
134
136
|
</IMPORTANT>
|
|
@@ -35,9 +35,12 @@ openspec/changes/<name>/
|
|
|
35
35
|
创建 `.comet.yaml` 状态文件:
|
|
36
36
|
|
|
37
37
|
```bash
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
|
|
39
|
+
if [ -z "$COMET_ENV" ]; then
|
|
40
|
+
echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
|
|
41
|
+
return 1
|
|
42
|
+
fi
|
|
43
|
+
. "$COMET_ENV"
|
|
41
44
|
|
|
42
45
|
if [ -z "$COMET_STATE" ] || [ -z "$COMET_GUARD" ]; then
|
|
43
46
|
echo "ERROR: Comet scripts not found. Ensure the comet skill is installed." >&2
|
|
@@ -26,10 +26,12 @@ Tweak 是 Comet 五阶段能力的预设工作流,不是独立的平行流程
|
|
|
26
26
|
开始前先定位 Comet 脚本:
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
|
|
30
|
+
if [ -z "$COMET_ENV" ]; then
|
|
31
|
+
echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
|
|
32
|
+
return 1
|
|
33
|
+
fi
|
|
34
|
+
. "$COMET_ENV"
|
|
33
35
|
```
|
|
34
36
|
|
|
35
37
|
### 1. 快速开启(preset open)
|
|
@@ -17,9 +17,12 @@ description: "Comet 阶段 4:验证与收尾。用 /comet-verify 调用。验
|
|
|
17
17
|
执行入口验证:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
|
|
21
|
+
if [ -z "$COMET_ENV" ]; then
|
|
22
|
+
echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
|
|
23
|
+
return 1
|
|
24
|
+
fi
|
|
25
|
+
. "$COMET_ENV"
|
|
23
26
|
bash "$COMET_STATE" check <change-name> verify
|
|
24
27
|
```
|
|
25
28
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-error.d.ts","sourceRoot":"","sources":["../../src/core/command-error.ts"],"names":[],"mappings":"AA2BA,iBAAS,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,EAAE,CA+B3D;AAED,iBAAS,wBAAwB,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,IAAI,CAIvE;AAED,OAAO,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const ESC = String.fromCharCode(27);
|
|
2
|
+
const ANSI_ESCAPE_PATTERN = new RegExp(`${ESC}\\[[0-9;?]*[a-zA-Z]`, 'g');
|
|
3
|
+
const LOOSE_ESCAPE_PATTERN = new RegExp(`${ESC}\\[[^a-zA-Z\\r\\n]*`, 'g');
|
|
4
|
+
function streamToText(stream) {
|
|
5
|
+
if (!stream)
|
|
6
|
+
return '';
|
|
7
|
+
return Buffer.isBuffer(stream) ? stream.toString() : stream;
|
|
8
|
+
}
|
|
9
|
+
function cleanCommandOutput(output) {
|
|
10
|
+
return output
|
|
11
|
+
.replace(ANSI_ESCAPE_PATTERN, '')
|
|
12
|
+
.replace(LOOSE_ESCAPE_PATTERN, '')
|
|
13
|
+
.split('\n')
|
|
14
|
+
.map((line) => line.trimEnd())
|
|
15
|
+
.filter((line) => line.trim() && !/^(│|├|╮|╯|●|◇|◒|◐|◓|◑|■)/.test(line.trim()))
|
|
16
|
+
.join('\n')
|
|
17
|
+
.trim();
|
|
18
|
+
}
|
|
19
|
+
function formatCommandErrorDetails(error) {
|
|
20
|
+
const details = [];
|
|
21
|
+
if (!error || typeof error !== 'object') {
|
|
22
|
+
details.push('Unknown error occurred');
|
|
23
|
+
return details;
|
|
24
|
+
}
|
|
25
|
+
const commandError = error;
|
|
26
|
+
for (const [label, stream] of [
|
|
27
|
+
['stderr', commandError.stderr],
|
|
28
|
+
['stdout', commandError.stdout],
|
|
29
|
+
]) {
|
|
30
|
+
const cleaned = cleanCommandOutput(streamToText(stream));
|
|
31
|
+
if (cleaned) {
|
|
32
|
+
details.push(`${label}:\n${cleaned}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (details.length === 0) {
|
|
36
|
+
const reason = commandError.killed
|
|
37
|
+
? 'Process was killed (likely timed out)'
|
|
38
|
+
: commandError.code === 'ETIMEDOUT'
|
|
39
|
+
? 'Process timed out'
|
|
40
|
+
: commandError.code === 'ENOENT'
|
|
41
|
+
? 'Command not found — check that the required CLI is installed and on PATH'
|
|
42
|
+
: 'No error output captured';
|
|
43
|
+
details.push(reason);
|
|
44
|
+
}
|
|
45
|
+
return details;
|
|
46
|
+
}
|
|
47
|
+
function printCommandErrorDetails(error, indent = ' ') {
|
|
48
|
+
for (const detail of formatCommandErrorDetails(error)) {
|
|
49
|
+
console.error(`${indent}${detail.split('\n').join(`\n${indent}`)}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
export { printCommandErrorDetails, formatCommandErrorDetails };
|
|
53
|
+
//# sourceMappingURL=command-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"command-error.js","sourceRoot":"","sources":["../../src/core/command-error.ts"],"names":[],"mappings":"AAAA,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;AACpC,MAAM,mBAAmB,GAAG,IAAI,MAAM,CAAC,GAAG,GAAG,qBAAqB,EAAE,GAAG,CAAC,CAAC;AACzE,MAAM,oBAAoB,GAAG,IAAI,MAAM,CAAC,GAAG,GAAG,qBAAqB,EAAE,GAAG,CAAC,CAAC;AAS1E,SAAS,YAAY,CAAC,MAAmC;IACvD,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IACvB,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;AAC9D,CAAC;AAED,SAAS,kBAAkB,CAAC,MAAc;IACxC,OAAO,MAAM;SACV,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC;SAChC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC;SACjC,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;SAC7B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;SAC9E,IAAI,CAAC,IAAI,CAAC;SACV,IAAI,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,yBAAyB,CAAC,KAAc;IAC/C,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACxC,OAAO,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;QACvC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,YAAY,GAAG,KAAqB,CAAC;IAE3C,KAAK,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI;QAC5B,CAAC,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC;QAC/B,CAAC,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC;KACvB,EAAE,CAAC;QACX,MAAM,OAAO,GAAG,kBAAkB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;QACzD,IAAI,OAAO,EAAE,CAAC;YACZ,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,MAAM,OAAO,EAAE,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,MAAM,GAAG,YAAY,CAAC,MAAM;YAChC,CAAC,CAAC,uCAAuC;YACzC,CAAC,CAAC,YAAY,CAAC,IAAI,KAAK,WAAW;gBACjC,CAAC,CAAC,mBAAmB;gBACrB,CAAC,CAAC,YAAY,CAAC,IAAI,KAAK,QAAQ;oBAC9B,CAAC,CAAC,0EAA0E;oBAC5E,CAAC,CAAC,0BAA0B,CAAC;QACnC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,wBAAwB,CAAC,KAAc,EAAE,MAAM,GAAG,MAAM;IAC/D,KAAK,MAAM,MAAM,IAAI,yBAAyB,CAAC,KAAK,CAAC,EAAE,CAAC;QACtD,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;IACtE,CAAC;AACH,CAAC;AAED,OAAO,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../src/core/detect.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoC,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAU/C,iBAAS,UAAU,CAAC,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED;;;GAGG;AACH,iBAAe,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC,CAmBtD;
|
|
1
|
+
{"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../src/core/detect.ts"],"names":[],"mappings":"AAIA,OAAO,EAAoC,KAAK,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAU/C,iBAAS,UAAU,CAAC,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAEpE;AAED;;;GAGG;AACH,iBAAe,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC,CAmBtD;AAWD,iBAAe,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAuBxE;AAED,iBAAe,SAAS,CACtB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,UAAU,GAAG,aAAa,GAAG,OAAO,EAC/C,kBAAkB,GAAE,QAAQ,EAAO,EACnC,KAAK,GAAE,YAAwB,GAC9B,OAAO,CAAC,OAAO,CAAC,CAqElB;AAED,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,oBAAoB,EAAE,UAAU,EAAE,CAAC;AACxE,YAAY,EAAE,YAAY,EAAE,CAAC"}
|