@rpamis/comet 0.3.0 → 0.3.2

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.
Files changed (46) hide show
  1. package/LICENSE +21 -21
  2. package/assets/manifest.json +2 -1
  3. package/assets/skills/comet/SKILL.md +42 -30
  4. package/assets/skills/comet/scripts/comet-env.sh +55 -0
  5. package/assets/skills/comet/scripts/comet-state.sh +25 -9
  6. package/assets/skills/comet/scripts/comet-yaml-validate.sh +1 -1
  7. package/assets/skills/comet-archive/SKILL.md +8 -4
  8. package/assets/skills/comet-build/SKILL.md +36 -44
  9. package/assets/skills/comet-design/SKILL.md +93 -23
  10. package/assets/skills/comet-hotfix/SKILL.md +40 -25
  11. package/assets/skills/comet-open/SKILL.md +37 -30
  12. package/assets/skills/comet-tweak/SKILL.md +35 -22
  13. package/assets/skills/comet-verify/SKILL.md +70 -49
  14. package/assets/skills-zh/comet/SKILL.md +22 -14
  15. package/assets/skills-zh/comet-archive/SKILL.md +6 -2
  16. package/assets/skills-zh/comet-build/SKILL.md +35 -43
  17. package/assets/skills-zh/comet-design/SKILL.md +29 -9
  18. package/assets/skills-zh/comet-hotfix/SKILL.md +39 -24
  19. package/assets/skills-zh/comet-open/SKILL.md +9 -4
  20. package/assets/skills-zh/comet-tweak/SKILL.md +21 -8
  21. package/assets/skills-zh/comet-verify/SKILL.md +36 -15
  22. package/bin/comet.js +3 -3
  23. package/dist/commands/update.js +1 -1
  24. package/dist/commands/update.js.map +1 -1
  25. package/dist/core/command-error.d.ts +4 -0
  26. package/dist/core/command-error.d.ts.map +1 -0
  27. package/dist/core/command-error.js +53 -0
  28. package/dist/core/command-error.js.map +1 -0
  29. package/dist/core/detect.d.ts.map +1 -1
  30. package/dist/core/detect.js +33 -4
  31. package/dist/core/detect.js.map +1 -1
  32. package/dist/core/openspec.d.ts.map +1 -1
  33. package/dist/core/openspec.js +52 -1
  34. package/dist/core/openspec.js.map +1 -1
  35. package/dist/core/platforms.d.ts.map +1 -1
  36. package/dist/core/platforms.js +14 -2
  37. package/dist/core/platforms.js.map +1 -1
  38. package/dist/core/skills.d.ts.map +1 -1
  39. package/dist/core/skills.js +58 -0
  40. package/dist/core/skills.js.map +1 -1
  41. package/dist/core/superpowers.d.ts +3 -2
  42. package/dist/core/superpowers.d.ts.map +1 -1
  43. package/dist/core/superpowers.js +75 -9
  44. package/dist/core/superpowers.js.map +1 -1
  45. package/package.json +1 -1
  46. package/scripts/postinstall.js +44 -44
@@ -17,61 +17,131 @@ description: "Comet Phase 2: Deep Design. Invoke with /comet-design. Produce Des
17
17
  Execute entry verification:
18
18
 
19
19
  ```bash
20
- COMET_SEARCH_ROOTS=("." "$HOME/.claude/skills" "$HOME/.codex/skills" "$HOME/.cursor/skills")
21
- COMET_STATE="${COMET_STATE:-$(find "${COMET_SEARCH_ROOTS[@]}" -path '*/comet/scripts/comet-state.sh' -type f -print -quit 2>/dev/null)}"
22
- COMET_GUARD="${COMET_GUARD:-$(find "${COMET_SEARCH_ROOTS[@]}" -path '*/comet/scripts/comet-guard.sh' -type f -print -quit 2>/dev/null)}"
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> design
24
27
  ```
25
28
 
26
29
  Proceed to Step 1 after verification passes. The script outputs specific failure reasons when verification fails.
27
30
 
28
- ### 1a. Read Existing Context
31
+ ### 1a. Generate OpenSpec → Superpowers Handoff Package
29
32
 
30
- Read `proposal.md` and `design.md` under the active change, organize core content into summaries:
31
- - **Proposal summary**: goals, motivation, scope
32
- - **Design summary**: architectural decisions, high-level design
33
+ **Must be generated by script. Agent writing summaries on the fly is not allowed.**
33
34
 
34
- ### 1b. Execute Brainstorming (With Context)
35
+ ```bash
36
+ bash "$COMET_HANDOFF" <change-name> design --write
37
+ ```
38
+
39
+ The script generates and records:
40
+
41
+ ```
42
+ openspec/changes/<name>/.comet/handoff/design-context.json
43
+ openspec/changes/<name>/.comet/handoff/design-context.md
44
+ ```
45
+
46
+ And writes to `.comet.yaml`:
35
47
 
36
- **Immediately execute:** Use the Skill tool to load the `superpowers:brainstorming` skill, ARGUMENTS contains:
48
+ ```yaml
49
+ handoff_context: openspec/changes/<name>/.comet/handoff/design-context.json
50
+ handoff_hash: <sha256>
51
+ ```
52
+
53
+ The default handoff package is a **compact traceable excerpt**, not an agent summary:
54
+ - `design-context.json`: machine index containing change, phase, canonical spec, source paths, hash
55
+ - `design-context.md`: context for Superpowers to read, containing script markers, source path, line range, sha256, deterministic excerpts
56
+ - When exceeding excerpt budget, marks `[TRUNCATED]` and retains Full source path
57
+
58
+ If full context is genuinely needed, explicitly run:
59
+
60
+ ```bash
61
+ bash "$COMET_HANDOFF" <change-name> design --write --full
62
+ ```
63
+
64
+ Handoff package sources come from OpenSpec open phase artifacts:
65
+ - `proposal.md`: goals, motivation, scope, non-goals
66
+ - `design.md`: high-level architecture decisions, approach constraints
67
+ - `tasks.md`: initial task boundaries
68
+ - `specs/*/spec.md`: delta capability specs
69
+
70
+ ### 1b. Execute Brainstorming (with Context)
71
+
72
+ **Immediately execute:** Use the Skill tool to load the `superpowers:brainstorming` skill, ARGUMENTS containing:
37
73
 
38
74
  ```
39
75
  Change: <change-name>
40
- Proposal summary: <proposal core content>
41
- Design summary: <design.md architectural decisions>
42
- Skip context exploration, proceed directly to design questioning.
76
+ OpenSpec Context Pack: openspec/changes/<name>/.comet/handoff/design-context.md
77
+ Machine handoff: openspec/changes/<name>/.comet/handoff/design-context.json
78
+
79
+ OpenSpec artifacts are the upstream source of truth. Do not redefine requirements, do not rewrite proposal/spec.
80
+ Your task is to perform deep technical design based on the handoff package: implementation approach, technical risks, testing strategy, boundary conditions.
81
+ If you find OpenSpec delta spec missing acceptance scenarios, you may only propose Spec Patches and write them back to OpenSpec delta spec; do not create a second requirements spec in the Design Doc.
82
+
83
+ Design Doc frontmatter must be minimal, containing only:
84
+ ---
85
+ comet_change: <change-name>
86
+ role: technical-design
87
+ canonical_spec: openspec
88
+ ---
89
+
90
+ Skip redundant context exploration, proceed directly to design questions.
43
91
  ```
44
92
 
45
- Skipping this step is prohibited, and continuing without loading this skill is prohibited.
93
+ Skipping this step is prohibited. Proceeding without loading this skill is prohibited.
46
94
 
47
95
  If `superpowers:brainstorming` is unavailable, stop the process and prompt to install or enable Superpowers skills. Do not substitute this step with normal conversation.
48
96
 
49
- After the skill loads, follow its guidance to produce:
50
- - `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md` design document (technical RFC)
51
- - `openspec/changes/<name>/specs/<capability>/spec.md` — capability specification (delta)
97
+ After the skill loads, follow its guidance to produce design proposals (presented as conversation):
98
+ - Technical approach: architecture, data flow, key technology choices and risks
99
+ - Testing strategy
100
+ - If acceptance scenarios need supplementing, indicate delta spec changes to be written back
101
+
102
+ The brainstorming phase does not write to the Design Doc file; it only produces design proposals for Step 1c user confirmation. Only after confirmation should `docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md` be created and delta spec written back.
103
+
104
+ ### 1c. User Confirms Design Proposal (Blocking Point)
105
+
106
+ After brainstorming produces a design proposal, **must pause and wait for the user to explicitly confirm the design proposal**. Must not create the final Design Doc, write `design_doc`, run design guard, or enter `/comet-build` before user confirmation.
107
+
108
+ When pausing, only present essential summary:
109
+ - Technical approach adopted
110
+ - Key trade-offs and risks
111
+ - Testing strategy
112
+ - If there are Spec Patches, list the delta spec changes to be written back
113
+
114
+ Only after the user explicitly confirms, proceed to Step 2. If the user requests adjustments, continue brainstorming iteration until the user confirms.
52
115
 
53
116
  ### 2. Update Comet State
54
117
 
55
- Record design_doc path, then run guard to auto-transition:
118
+ First record the design_doc path. If Step 1c wrote back delta spec (added or modified `specs/*/spec.md`), must regenerate handoff to update hash:
56
119
 
57
120
  ```bash
58
121
  # Record design_doc path
59
122
  bash "$COMET_STATE" set <name> design_doc docs/superpowers/specs/YYYY-MM-DD-topic-design.md
60
123
 
124
+ # If delta spec changes exist, regenerate handoff (update hash)
125
+ bash "$COMET_HANDOFF" <change-name> design --write
126
+
61
127
  # Auto-transition to next phase
62
128
  bash "$COMET_GUARD" <change-name> design --apply
63
129
  ```
64
130
 
65
- State file is updated automatically. No manual editing of other fields required.
131
+ If there are no delta spec changes, skip the handoff regeneration step. The state file updates automatically; no manual editing of other fields needed.
66
132
 
67
133
  ## Exit Conditions
68
134
 
69
- - Design Doc has been created and saved
70
- - Delta spec has been created if there are new capabilities
135
+ - Design Doc created and saved
136
+ - Design Doc frontmatter contains `comet_change`, `role: technical-design`, `canonical_spec: openspec`
137
+ - `handoff_context` and `handoff_hash` written to `.comet.yaml` (enforced by guard)
138
+ - `handoff_hash` matches current OpenSpec open phase artifacts (enforced by guard)
139
+ - `design-context.md` must be script-generated and contain source path, mode, sha256 traceability markers (enforced by guard)
140
+ - If new capabilities or supplementary acceptance scenarios exist, OpenSpec delta spec has been created/updated
71
141
  - `design_doc` written to `.comet.yaml`
72
- - **Phase guard**: Run `bash "$COMET_GUARD" <change-name> design --apply`; after all PASS, state advances to `phase: build`
142
+ - **Phase guard**: Run `bash "$COMET_GUARD" <change-name> design --apply`; after all PASS, auto-transitions to `phase: build`
73
143
 
74
- You must use `--apply` before exiting:
144
+ Must use `--apply` before exit:
75
145
 
76
146
  ```bash
77
147
  bash "$COMET_GUARD" <change-name> design --apply
@@ -81,4 +151,4 @@ bash "$COMET_GUARD" <change-name> design --apply
81
151
 
82
152
  After exit conditions are met, **proceed immediately to the next phase without waiting for user input**:
83
153
 
84
- > **REQUIRED NEXT SKILL:** Invoke `comet-build` skill to enter the planning and build phase.
154
+ > **REQUIRED NEXT SKILL:** Invoke `comet-build` skill to enter the plan and build phase.
@@ -16,17 +16,19 @@ Quick bug fix workflow: open → build → verify → archive. Skip brainstormin
16
16
 
17
17
  ---
18
18
 
19
- ## Process (preset workflow, 4 phases)
19
+ ## Process (preset workflow, 5 steps)
20
20
 
21
- Execution chain: open → build → verify → archive. Hotfix provides default decisions for each phase: streamlined open, direct build, scale-based verification, archive after verification passes.
21
+ Execution chain: open → build → root cause check → verify → archive. Hotfix provides default decisions for each phase: streamlined open, direct build, root cause confirmation, scale-based verification, archive after verification passes.
22
22
 
23
23
  Locate Comet scripts before starting:
24
24
 
25
25
  ```bash
26
- COMET_SEARCH_ROOTS=("." "$HOME/.claude/skills" "$HOME/.codex/skills" "$HOME/.cursor/skills")
27
- COMET_STATE="${COMET_STATE:-$(find "${COMET_SEARCH_ROOTS[@]}" -path '*/comet/scripts/comet-state.sh' -type f -print -quit 2>/dev/null)}"
28
- COMET_GUARD="${COMET_GUARD:-$(find "${COMET_SEARCH_ROOTS[@]}" -path '*/comet/scripts/comet-guard.sh' -type f -print -quit 2>/dev/null)}"
29
- COMET_ARCHIVE="${COMET_ARCHIVE:-$(find "${COMET_SEARCH_ROOTS[@]}" -path '*/comet/scripts/comet-archive.sh' -type f -print -quit 2>/dev/null)}"
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)
@@ -75,33 +77,34 @@ Before continuing or starting changes, handle uncommitted changes through `comet
75
77
  - Check corresponding `- [ ]` to `- [x]` in tasks.md
76
78
  - Commit code, commit message format: `fix: <brief fix description>`
77
79
  3. After all tasks complete, explicitly run relevant project tests and build commands
78
- 4. Run phase guard to transition build → verify:
79
-
80
- ```bash
81
- bash "$COMET_GUARD" <change-name> build --apply
82
- ```
83
-
84
- State automatically updates to `phase: verify`, `verify_result: pending`, then enter verification.
85
80
 
86
81
  **If fix affects existing spec acceptance scenarios**:
87
82
  - Create delta spec in `openspec/changes/<name>/specs/<capability>/spec.md`
88
83
  - Only include `## MODIFIED Requirements` section
89
84
 
90
- ### 3a. Hotfix-Exclusive Check: Root Cause Elimination
85
+ ### 3. Root Cause Elimination Check
91
86
 
92
- **Execute before loading comet-verify**, ensuring the fix actually eliminates the root cause:
87
+ **Execute before running build guard**, ensuring the fix actually eliminates the root cause:
93
88
 
94
89
  1. Read bug description and root cause in proposal.md
95
90
  2. Search and verify problem code no longer exists
96
- 3. If root cause not eliminated, return to Step 2 to continue fix
91
+ 3. If root cause not eliminated, return to Step 2 to continue fix (still in build phase, no state transition needed)
97
92
 
98
93
  **Upgrade conditions**:
99
- - Root cause check reveals deep architecture issues → Stop hotfix, upgrade to `/comet`
100
- - Fix requires additional interface changes → Stop hotfix, upgrade to `/comet`
94
+ - Root cause check reveals deep architecture issues → Stop hotfix, handle per "Upgrade Conditions" section
95
+ - Fix requires additional interface changes → Stop hotfix, handle per "Upgrade Conditions" section
101
96
 
102
- ### 3b. Verification (preset verify)
97
+ After root cause is confirmed eliminated, run phase guard to transition build → verify:
103
98
 
104
- After root cause elimination check passes, reuse `/comet-verify`, with comet-verify's scale assessment deciding lightweight or full verification.
99
+ ```bash
100
+ bash "$COMET_GUARD" <change-name> build --apply
101
+ ```
102
+
103
+ State automatically updates to `phase: verify`, `verify_result: pending`, then enter verification.
104
+
105
+ ### 4. Verification (preset verify)
106
+
107
+ Reuse `/comet-verify`, with comet-verify's scale assessment deciding lightweight or full verification.
105
108
 
106
109
  **Immediately execute:** Use the Skill tool to load the `comet-verify` skill. Skipping this step is prohibited.
107
110
 
@@ -109,7 +112,7 @@ Small-scale hotfixes without delta spec usually meet lightweight verification co
109
112
 
110
113
  After verification passes, record `.comet.yaml` `verify_result` as `pass` according to `/comet-verify` rules, must not skip this status before archiving.
111
114
 
112
- ### 4. Archive (preset archive)
115
+ ### 5. Archive (preset archive)
113
116
 
114
117
  Reuse `/comet-archive`. Must satisfy `verify_result: pass` in `.comet.yaml` before archiving.
115
118
 
@@ -121,11 +124,15 @@ If there is delta spec, sync to main spec according to comet-archive rules, and
121
124
  ## Continuous Execution Mode
122
125
 
123
126
  <IMPORTANT>
124
- Hotfix workflow is **one-time continuous execution**. After invoking `/comet-hotfix`, agent must automatically complete all 4 phases, without pausing to wait for user input mid-way (unless encountering upgrade conditions requiring user confirmation).
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:
125
128
 
126
- Execution order: quick open direct build verification archive complete
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
127
132
 
128
- After each phase completes, immediately enter next phase, no need for user input again. Within each phase, must still call corresponding Comet/OpenSpec/Superpowers skill according to above requirements.
133
+ Execution order: quick open direct build root cause check verification archive complete
134
+
135
+ After each step completes, immediately enter next step. Within each phase, must still call corresponding Comet/OpenSpec/Superpowers skill according to above requirements; if the called skill has its own user decision points, follow that skill's rules.
129
136
  </IMPORTANT>
130
137
 
131
138
  ---
@@ -142,7 +149,15 @@ Upgrade to full `/comet` when **any** of the following conditions are met:
142
149
  | Introduces new public API | Fix creates new external interface |
143
150
  | Fix scope exceeds single function/module | Requires coordinated changes |
144
151
 
145
- Upgrade method: On current change basis, supplement Design Doc (execute `/comet-design`), then proceed normally with full workflow.
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.
153
+
154
+ After user confirms upgrade, **must first update the workflow field** before entering full flow:
155
+
156
+ ```bash
157
+ bash "$COMET_STATE" set <name> workflow full
158
+ ```
159
+
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.
146
161
 
147
162
  ---
148
163
 
@@ -1,40 +1,25 @@
1
1
  ---
2
2
  name: comet-open
3
- description: "Comet Phase 1: Open. Invoke with /comet-open. Explore ideas through OpenSpec and create change structure (proposal + design + tasks)."
3
+ description: "Comet Phase 1: Open. Invoke with /comet-open. Explore ideas through OpenSpec, create change structure (proposal + design + tasks)."
4
4
  ---
5
5
 
6
6
  # Comet Phase 1: Open
7
7
 
8
8
  ## Prerequisites
9
9
 
10
- - No active change, or user wishes to create a new change
10
+ - No active change, or user wants to create a new change
11
11
 
12
12
  ## Steps
13
13
 
14
- ### 0. Locate Comet Scripts
15
-
16
- Locate scripts before creating state:
17
-
18
- ```bash
19
- COMET_SEARCH_ROOTS=("." "$HOME/.claude/skills" "$HOME/.codex/skills" "$HOME/.cursor/skills")
20
- COMET_STATE="${COMET_STATE:-$(find "${COMET_SEARCH_ROOTS[@]}" -path '*/comet/scripts/comet-state.sh' -type f -print -quit 2>/dev/null)}"
21
- COMET_GUARD="${COMET_GUARD:-$(find "${COMET_SEARCH_ROOTS[@]}" -path '*/comet/scripts/comet-guard.sh' -type f -print -quit 2>/dev/null)}"
22
-
23
- if [ -z "$COMET_STATE" ] || [ -z "$COMET_GUARD" ]; then
24
- echo "ERROR: Comet scripts not found. Ensure the comet skill is installed." >&2
25
- return 1
26
- fi
27
- ```
28
-
29
- ### 1. Explore Idea
14
+ ### 1. Explore Ideas
30
15
 
31
16
  **Immediately execute:** Use the Skill tool to load the `openspec-explore` skill. Skipping this step is prohibited.
32
17
 
33
18
  After the skill loads, freely explore the problem space following its guidance.
34
19
 
35
- ### 2. Create Change Structure
20
+ ### 2. Create Change Structure + Initialize State
36
21
 
37
- **Immediately execute:** Use the Skill tool to load the `openspec-new-change` skill. If user intent is unclear and needs to form a proposal first, load `openspec-propose` instead. Skipping this step is prohibited.
22
+ **Immediately execute:** Use the Skill tool to load the `openspec-new-change` skill. If the user's intent is unclear and needs proposal formation first, load `openspec-propose` instead. Skipping this step is prohibited.
38
23
 
39
24
  Confirm the following artifacts have been created:
40
25
 
@@ -43,40 +28,62 @@ openspec/changes/<name>/
43
28
  ├── .openspec.yaml
44
29
  ├── .comet.yaml
45
30
  ├── proposal.md # Why + What: problem, goals, scope
46
- ├── design.md # How (high-level): architectural decisions, solution selection
31
+ ├── design.md # How (high-level): architecture decisions, approach selection
47
32
  └── tasks.md # Task checklist (checkboxes)
48
33
  ```
49
34
 
50
- ### 3. Initialize Comet State
51
-
52
- Initialize Comet state file:
35
+ Create `.comet.yaml` state file:
53
36
 
54
37
  ```bash
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"
44
+
45
+ if [ -z "$COMET_STATE" ] || [ -z "$COMET_GUARD" ]; then
46
+ echo "ERROR: Comet scripts not found. Ensure the comet skill is installed." >&2
47
+ return 1
48
+ fi
49
+
55
50
  bash "$COMET_STATE" init <name> full
56
51
  ```
57
52
 
53
+ ### 3. Entry State Verification
54
+
55
+ Verify state machine has been correctly initialized:
56
+
57
+ ```bash
58
+ bash "$COMET_STATE" check <name> open
59
+ ```
60
+
61
+ Proceed to Step 4 after verification passes. The script outputs specific failure reasons when verification fails.
62
+
58
63
  ### 4. Content Completeness Check
59
64
 
60
65
  Confirm the three documents have complete content:
61
66
  - **proposal.md**: problem background, goals, scope, non-goals
62
- - **design.md**: high-level architectural decisions, solution selection, data flow
67
+ - **design.md**: high-level architecture decisions, approach selection, data flow
63
68
  - **tasks.md**: task list, each task has a clear description
64
69
 
65
70
  ## Exit Conditions
66
71
 
67
- - proposal.md, design.md, and tasks.md are all created with complete content
68
- - **Phase guard**: Run `bash "$COMET_GUARD" <change-name> open --apply`; after all PASS, state automatically advances to the next phase
72
+ - proposal.md, design.md, tasks.md all created with complete content
73
+ - **Phase guard**: Run `bash "$COMET_GUARD" <change-name> open --apply`; after all PASS, auto-transitions to next phase
69
74
 
70
- You must use `--apply` before exiting. Otherwise `.comet.yaml` stays at `phase: open`, and the next phase entry check will fail.
75
+ Must use `--apply` before exit, otherwise `.comet.yaml` remains at `phase: open` and the next phase entry check will fail.
71
76
 
72
77
  ```bash
73
78
  bash "$COMET_GUARD" <change-name> open --apply
74
79
  ```
75
80
 
76
- Full workflow advances to `phase: design`; hotfix/tweak presets advance to `phase: build`.
81
+ Full workflow auto-transitions to `phase: design`; hotfix/tweak presets auto-transition to `phase: build`.
77
82
 
78
83
  ## Automatic Transition
79
84
 
80
85
  After exit conditions are met, **proceed immediately to the next phase without waiting for user input**:
81
86
 
82
- > **REQUIRED NEXT SKILL:** Invoke `comet-design` skill to enter the deep design phase.
87
+ > **REQUIRED NEXT SKILL (full workflow):** Invoke `comet-design` skill to enter the deep design phase.
88
+ >
89
+ > Hotfix/tweak presets are controlled by their corresponding preset skill for subsequent transitions (phase goes directly to build), and do not go through this section.
@@ -5,17 +5,17 @@ description: "Comet preset path: Non-bug small changes (tweak). Skip brainstormi
5
5
 
6
6
  # Comet Preset Path: Tweak
7
7
 
8
- Tweak is a preset workflow of Comet's five-phase capabilities, not a separate parallel process. It reuses open, build, verify, archive capabilities, only skipping brainstorming and full plan.
8
+ Tweak is a preset workflow of Comet's five-phase capabilities, not an independent parallel process. It reuses open, build, verify, archive capabilities, only skipping brainstorming and full plan.
9
9
 
10
- Applicable for small-scale non-bug changes, such as copy adjustments, configuration adjustments, documentation or prompt local optimization.
10
+ Applicable for non-bug small scope changes, such as copy adjustment, configuration adjustment, documentation or prompt local optimization.
11
11
 
12
12
  **Applicable conditions** (all must be met):
13
13
  1. No new capability
14
14
  2. No architecture changes
15
- 3. No interface changes involved
16
- 4. Usually not exceeding 3 tasks, 4 files
15
+ 3. No interface changes
16
+ 4. Typically no more than 3 tasks, 4 files
17
17
 
18
- **Not applicable**: If change process discovers need for capability, architecture, or interface adjustments, should upgrade to full `/comet` workflow.
18
+ **Not applicable**: If change process discovers need for capability, architecture or interface adjustments, should upgrade to full `/comet` workflow.
19
19
 
20
20
  ---
21
21
 
@@ -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
- COMET_SEARCH_ROOTS=("." "$HOME/.claude/skills" "$HOME/.codex/skills" "$HOME/.cursor/skills")
30
- COMET_STATE="${COMET_STATE:-$(find "${COMET_SEARCH_ROOTS[@]}" -path '*/comet/scripts/comet-state.sh' -type f -print -quit 2>/dev/null)}"
31
- COMET_GUARD="${COMET_GUARD:-$(find "${COMET_SEARCH_ROOTS[@]}" -path '*/comet/scripts/comet-guard.sh' -type f -print -quit 2>/dev/null)}"
32
- COMET_ARCHIVE="${COMET_ARCHIVE:-$(find "${COMET_SEARCH_ROOTS[@]}" -path '*/comet/scripts/comet-archive.sh' -type f -print -quit 2>/dev/null)}"
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)
@@ -41,8 +43,8 @@ Reuse Comet open capability to create change, but use tweak defaults: do not exe
41
43
  After the skill loads, follow its guidance to create streamlined artifacts:
42
44
  - `proposal.md` — change motivation + goals + scope
43
45
  - `design.md` — brief implementation description (no solution comparison needed)
44
- - `tasks.md` — not exceeding 3 tasks
45
- - **No delta spec needed** (unless change changes existing spec acceptance scenarios; once delta spec needed, upgrade to full `/comet`)
46
+ - `tasks.md` — no more than 3 tasks
47
+ - **No delta spec needed** (unless change modifies existing spec acceptance scenarios; once delta spec is needed, upgrade to full `/comet`)
46
48
 
47
49
  Initialize Comet state file:
48
50
 
@@ -66,13 +68,13 @@ bash "$COMET_GUARD" <change-name> open --apply
66
68
 
67
69
  Use tweak defaults: `build_mode: direct`. Skip `superpowers:brainstorming` and `superpowers:writing-plans`.
68
70
 
69
- Before continuing or starting changes, handle uncommitted changes through `comet/reference/dirty-worktree.md`. If attribution shows the scope exceeds tweak, handle it through this file's "Upgrade Conditions".
71
+ Before continuing or starting changes, handle uncommitted changes through `comet/reference/dirty-worktree.md`. If attribution shows scope exceeds tweak, handle it through this file's "Upgrade Conditions".
70
72
 
71
73
  **Immediately execute:** Execute tasks one by one according to tasks.md:
72
74
 
73
75
  1. Read `openspec/changes/<name>/tasks.md`, get incomplete task list
74
76
  2. For each incomplete task:
75
- - Modify target file according to task description
77
+ - Modify target files according to task description
76
78
  - Run project formatter (e.g., `mvn spotless:apply`, `npm run format`)
77
79
  - Run related tests to confirm pass
78
80
  - Check corresponding `- [ ]` to `- [x]` in tasks.md
@@ -92,7 +94,7 @@ Reuse `/comet-verify`. Tweak must maintain lightweight verification conditions:
92
94
 
93
95
  **Immediately execute:** Use the Skill tool to load the `comet-verify` skill. Skipping this step is prohibited.
94
96
 
95
- If scale assessment enters full verification path, stop tweak, upgrade to full `/comet`.
97
+ If scale assessment enters full verification path, stop tweak, handle per upgrade conditions blocking confirmation.
96
98
 
97
99
  After verification passes, record `.comet.yaml` `verify_result` as `pass` according to `/comet-verify` rules, must not skip this status before archiving.
98
100
 
@@ -107,11 +109,14 @@ Reuse `/comet-archive`. Must satisfy `verify_result: pass` in `.comet.yaml` befo
107
109
  ## Continuous Execution Mode
108
110
 
109
111
  <IMPORTANT>
110
- Tweak workflow is **one-time continuous execution**. After invoking `/comet-tweak`, agent must automatically complete all 4 phases, without pausing to wait for user input mid-way (unless encountering upgrade conditions requiring user confirmation).
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:
113
+
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
111
116
 
112
117
  Execution order: quick open → lightweight build → lightweight verification → archive → complete
113
118
 
114
- After each phase completes, immediately enter next phase, no need for user input again. Within each phase, must still call corresponding Comet/OpenSpec/Superpowers skill according to above requirements.
119
+ After each phase completes, immediately enter next phase. Within each phase, must still call corresponding Comet/OpenSpec/Superpowers skill according to above requirements; if the called skill has its own user decision points, follow that skill's rules.
115
120
  </IMPORTANT>
116
121
 
117
122
  ---
@@ -123,13 +128,21 @@ Upgrade to full `/comet` when **any** of the following conditions are met:
123
128
  | Condition | Explanation |
124
129
  |-----------|-------------|
125
130
  | Change involves **5+ files** | Exceeds small change scope |
126
- | Cross-module coordination required | Needs coordination across components |
127
- | **5+** new test cases needed | Change complexity increasing |
128
- | Config item additions or deletions | Non-value config changes |
131
+ | Cross-module coordination required | Requires cross-component coordination |
132
+ | **5+** new test cases needed | Change complexity rising |
133
+ | Config item additions or deletions | Config changes beyond value modifications |
129
134
  | New capability needed | Exceeds local optimization |
130
- | Delta spec needed | Affects existing specifications |
135
+ | Delta spec needed | Affects existing specs |
136
+
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.
138
+
139
+ After user confirms upgrade, **must first update the workflow field** before entering full flow:
140
+
141
+ ```bash
142
+ bash "$COMET_STATE" set <name> workflow full
143
+ ```
131
144
 
132
- Upgrade method: On current change basis, supplement Design Doc (execute `/comet-design`), then proceed normally with full workflow.
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.
133
146
 
134
147
  ---
135
148
 
@@ -137,5 +150,5 @@ Upgrade method: On current change basis, supplement Design Doc (execute `/comet-
137
150
 
138
151
  - Small change completed, tests pass
139
152
  - Change archived
140
- - No new capability, architecture adjustments, or interface changes
153
+ - No new capability, architecture adjustments or interface changes
141
154
  - **Phase guard**: Before build → verify run `bash "$COMET_GUARD" <change-name> build --apply`; before verify → archive follow `/comet-verify` and run `bash "$COMET_GUARD" <change-name> verify --apply`