@rpamis/comet 0.3.6 → 0.3.8

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 (95) hide show
  1. package/README.md +575 -443
  2. package/assets/manifest.json +41 -24
  3. package/assets/skills/comet/SKILL.md +282 -301
  4. package/assets/skills/comet/reference/auto-transition.md +27 -0
  5. package/assets/skills/comet/reference/comet-yaml-fields.md +68 -0
  6. package/assets/skills/comet/reference/context-recovery.md +35 -0
  7. package/assets/skills/comet/reference/debug-gate.md +17 -0
  8. package/assets/skills/comet/reference/decision-point.md +20 -0
  9. package/assets/skills/comet/reference/dirty-worktree.md +1 -0
  10. package/assets/skills/comet/reference/file-structure.md +28 -0
  11. package/assets/skills/comet/reference/subagent-dispatch.md +113 -0
  12. package/assets/skills/comet/rules/comet-phase-guard.en.md +99 -0
  13. package/assets/skills/comet/rules/comet-phase-guard.md +99 -0
  14. package/assets/skills/comet/scripts/comet-archive.sh +71 -55
  15. package/assets/skills/comet/scripts/comet-guard.sh +174 -18
  16. package/assets/skills/comet/scripts/comet-handoff.sh +133 -6
  17. package/assets/skills/comet/scripts/comet-hook-guard.sh +260 -0
  18. package/assets/skills/comet/scripts/comet-state.sh +362 -25
  19. package/assets/skills/comet/scripts/comet-yaml-validate.sh +24 -1
  20. package/assets/skills/comet-archive/SKILL.md +100 -73
  21. package/assets/skills/comet-build/SKILL.md +304 -221
  22. package/assets/skills/comet-design/SKILL.md +263 -166
  23. package/assets/skills/comet-hotfix/SKILL.md +204 -169
  24. package/assets/skills/comet-open/SKILL.md +203 -113
  25. package/assets/skills/comet-tweak/SKILL.md +180 -154
  26. package/assets/skills/comet-verify/SKILL.md +234 -201
  27. package/assets/skills-zh/comet/SKILL.md +269 -301
  28. package/assets/skills-zh/comet/reference/auto-transition.md +27 -0
  29. package/assets/skills-zh/comet/reference/comet-yaml-fields.md +68 -0
  30. package/assets/skills-zh/comet/reference/context-recovery.md +35 -0
  31. package/assets/skills-zh/comet/reference/debug-gate.md +17 -0
  32. package/assets/skills-zh/comet/reference/decision-point.md +20 -0
  33. package/assets/skills-zh/comet/reference/dirty-worktree.md +2 -1
  34. package/assets/skills-zh/comet/reference/file-structure.md +28 -0
  35. package/assets/skills-zh/comet/reference/subagent-dispatch.md +113 -0
  36. package/assets/skills-zh/comet-archive/SKILL.md +100 -73
  37. package/assets/skills-zh/comet-build/SKILL.md +304 -221
  38. package/assets/skills-zh/comet-design/SKILL.md +264 -166
  39. package/assets/skills-zh/comet-hotfix/SKILL.md +200 -169
  40. package/assets/skills-zh/comet-open/SKILL.md +203 -113
  41. package/assets/skills-zh/comet-tweak/SKILL.md +176 -154
  42. package/assets/skills-zh/comet-verify/SKILL.md +232 -201
  43. package/dist/cli/index.js +19 -0
  44. package/dist/cli/index.js.map +1 -1
  45. package/dist/commands/doctor.d.ts.map +1 -1
  46. package/dist/commands/doctor.js +22 -0
  47. package/dist/commands/doctor.js.map +1 -1
  48. package/dist/commands/init.d.ts +5 -1
  49. package/dist/commands/init.d.ts.map +1 -1
  50. package/dist/commands/init.js +64 -9
  51. package/dist/commands/init.js.map +1 -1
  52. package/dist/commands/uninstall.d.ts +9 -0
  53. package/dist/commands/uninstall.d.ts.map +1 -0
  54. package/dist/commands/uninstall.js +113 -0
  55. package/dist/commands/uninstall.js.map +1 -0
  56. package/dist/commands/update.d.ts +1 -1
  57. package/dist/commands/update.d.ts.map +1 -1
  58. package/dist/commands/update.js +120 -32
  59. package/dist/commands/update.js.map +1 -1
  60. package/dist/core/codegraph.d.ts +4 -0
  61. package/dist/core/codegraph.d.ts.map +1 -0
  62. package/dist/core/codegraph.js +63 -0
  63. package/dist/core/codegraph.js.map +1 -0
  64. package/dist/core/detect.d.ts +8 -1
  65. package/dist/core/detect.d.ts.map +1 -1
  66. package/dist/core/detect.js +41 -2
  67. package/dist/core/detect.js.map +1 -1
  68. package/dist/core/openspec.d.ts +1 -1
  69. package/dist/core/openspec.d.ts.map +1 -1
  70. package/dist/core/openspec.js +40 -17
  71. package/dist/core/openspec.js.map +1 -1
  72. package/dist/core/platforms.d.ts +10 -0
  73. package/dist/core/platforms.d.ts.map +1 -1
  74. package/dist/core/platforms.js +177 -16
  75. package/dist/core/platforms.js.map +1 -1
  76. package/dist/core/skills.d.ts +36 -1
  77. package/dist/core/skills.d.ts.map +1 -1
  78. package/dist/core/skills.js +451 -15
  79. package/dist/core/skills.js.map +1 -1
  80. package/dist/core/superpowers.d.ts.map +1 -1
  81. package/dist/core/superpowers.js +1 -0
  82. package/dist/core/superpowers.js.map +1 -1
  83. package/dist/core/uninstall.d.ts +28 -0
  84. package/dist/core/uninstall.d.ts.map +1 -0
  85. package/dist/core/uninstall.js +421 -0
  86. package/dist/core/uninstall.js.map +1 -0
  87. package/dist/core/version.d.ts +31 -0
  88. package/dist/core/version.d.ts.map +1 -0
  89. package/dist/core/version.js +111 -0
  90. package/dist/core/version.js.map +1 -0
  91. package/dist/utils/file-system.d.ts +23 -0
  92. package/dist/utils/file-system.d.ts.map +1 -1
  93. package/dist/utils/file-system.js +100 -5
  94. package/dist/utils/file-system.js.map +1 -1
  95. package/package.json +69 -62
@@ -123,12 +123,29 @@ validate_enum() {
123
123
  fail "$field='$value' is not valid. Expected: $valid_values"
124
124
  }
125
125
 
126
+ validate_required_enum() {
127
+ local field="$1" value="$2"
128
+ shift 2
129
+ local valid_values="$*"
130
+
131
+ if [ -z "$value" ] || [ "$value" = "null" ]; then
132
+ fail "$field='${value:-}' is not valid. Expected: $valid_values"
133
+ return 0
134
+ fi
135
+
136
+ validate_enum "$field" "$value" "$@"
137
+ }
138
+
126
139
  workflow=$(field_value "workflow")
127
140
  phase=$(field_value "phase")
141
+ context_compression=$(field_value "context_compression")
128
142
  build_mode=$(field_value "build_mode")
129
143
  build_pause=$(field_value "build_pause")
144
+ subagent_dispatch=$(field_value "subagent_dispatch")
145
+ tdd_mode=$(field_value "tdd_mode")
130
146
  isolation=$(field_value "isolation")
131
147
  verify_mode=$(field_value "verify_mode")
148
+ auto_transition=$(field_value "auto_transition")
132
149
  verify_result=$(field_value "verify_result")
133
150
  branch_status=$(field_value "branch_status")
134
151
  archived=$(field_value "archived")
@@ -140,10 +157,16 @@ handoff_hash=$(field_value "handoff_hash")
140
157
 
141
158
  validate_enum "workflow" "$workflow" "full hotfix tweak"
142
159
  validate_enum "phase" "$phase" "open design build verify archive"
160
+ validate_enum "context_compression" "$context_compression" "off beta"
143
161
  validate_enum "build_mode" "$build_mode" "subagent-driven-development executing-plans direct"
144
162
  validate_enum "build_pause" "$build_pause" "null plan-ready"
163
+ validate_enum "subagent_dispatch" "$subagent_dispatch" "null confirmed"
164
+ validate_enum "tdd_mode" "$tdd_mode" "tdd direct null"
145
165
  validate_enum "isolation" "$isolation" "branch worktree"
146
166
  validate_enum "verify_mode" "$verify_mode" "light full"
167
+ if grep -q "^auto_transition:" "$YAML" 2>/dev/null; then
168
+ validate_required_enum "auto_transition" "$auto_transition" "true false"
169
+ fi
147
170
  validate_enum "verify_result" "$verify_result" "pending pass fail"
148
171
  validate_enum "branch_status" "$branch_status" "pending handled"
149
172
  validate_enum "archived" "$archived" "true false"
@@ -176,7 +199,7 @@ if [ -n "$handoff_hash" ] && [ "$handoff_hash" != "null" ]; then
176
199
  fi
177
200
 
178
201
  # --- Unknown keys check ---
179
- KNOWN_KEYS="workflow phase design_doc plan build_mode build_pause isolation verify_mode verify_result verification_report branch_status verified_at created_at archived direct_override build_command verify_command handoff_context handoff_hash base_ref"
202
+ KNOWN_KEYS="workflow phase context_compression design_doc plan build_mode build_pause subagent_dispatch tdd_mode isolation verify_mode auto_transition verify_result verification_report branch_status verified_at created_at archived direct_override build_command verify_command handoff_context handoff_hash base_ref"
180
203
  while IFS=: read -r key _; do
181
204
  key="${key// /}"
182
205
  [ -z "$key" ] && continue
@@ -1,73 +1,100 @@
1
- ---
2
- name: comet-archive
3
- description: "Comet Phase 5: Archive. Invoke with /comet-archive. Sync delta spec to main spec, archive change."
4
- ---
5
-
6
- # Comet Phase 5: Archive (Archive)
7
-
8
- ## Prerequisites
9
-
10
- - Verification passed (Phase 4 complete)
11
- - Branch handled
12
- - `verify_result: pass` in `openspec/changes/<name>/.comet.yaml`
13
-
14
- ## Steps
15
-
16
- ### 0. Entry State Verification (Entry Check)
17
-
18
- Execute entry verification:
19
-
20
- ```bash
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"
27
- "$COMET_BASH" "$COMET_STATE" check <name> archive
28
- ```
29
-
30
- Proceed to Step 1 after verification passes. The script outputs specific failure reasons when verification fails.
31
-
32
- ### 1. Execute Archive
33
-
34
- Run the archive script to automatically complete all steps:
35
-
36
- ```bash
37
- "$COMET_BASH" "$COMET_ARCHIVE" "<change-name>"
38
- ```
39
-
40
- The script automatically executes:
41
- 1. Entry state validation (phase=archive, verify_result=pass, archived=false)
42
- 2. Delta spec sync to main spec (overwrite)
43
- 3. Design doc frontmatter annotation (archived-with, status)
44
- 4. Plan frontmatter annotation (archived-with)
45
- 5. Move change to archive directory
46
- 6. Update `archived: true` through `comet-state transition <archive-name> archived`
47
-
48
- If script returns non-zero exit code, report error and stop.
49
- If script returns zero exit code, archive is complete.
50
- The summary `X/Y steps succeeded` counts real executed steps and does not double-count delta spec sync or document annotation.
51
-
52
- When a delta spec differs from an existing main spec, the script prints a unified diff preview before overwrite to help confirm archive sync content.
53
-
54
- Use `--dry-run` flag to preview without executing.
55
-
56
- ### 2. Lifecycle Closed Loop
57
-
58
- Spec lifecycle completes here:
59
- ```
60
- brainstorming → delta spec → implementation → verification → main spec overwrite → design doc annotation → archive
61
- ```
62
-
63
- ## Exit Conditions
64
-
65
- - Archive script executed successfully (exit code 0)
66
- - Archive directory `openspec/changes/archive/YYYY-MM-DD-<change-name>/` exists
67
- - Archived `.comet.yaml` contains `archived: true`
68
-
69
- The archive script moves `openspec/changes/<name>/` to `openspec/changes/archive/YYYY-MM-DD-<name>/`. After successful archive, **do not run** `"$COMET_BASH" "$COMET_GUARD" <change-name> archive` against the old active change name; the active directory no longer exists. Archive completeness is determined by script exit code and archived directory state.
70
-
71
- ## Complete
72
-
73
- Comet workflow complete. To start new work, invoke `/comet` or `/comet-open`.
1
+ ---
2
+ name: comet-archive
3
+ description: "Comet Phase 5: Archive. Invoke with /comet-archive. Merge delta specs into main specs with OpenSpec semantics, archive change."
4
+ ---
5
+
6
+ # Comet Phase 5: Archive (Archive)
7
+
8
+ ## Prerequisites
9
+
10
+ - Verification passed (Phase 4 complete)
11
+ - Branch handled
12
+ - `verify_result: pass` in `openspec/changes/<name>/.comet.yaml`
13
+
14
+ ## Steps
15
+
16
+ ### 0. Output Language Constraint
17
+
18
+ Archive summaries and lifecycle closure notes must use the language of the user request that triggered this workflow.
19
+
20
+ ### 0. Entry State Verification (Entry Check)
21
+
22
+ Execute entry verification:
23
+
24
+ ```bash
25
+ COMET_ENV="${COMET_ENV:-$(find . "$HOME"/.*/skills "$HOME/.config" "$HOME/.gemini" -path '*/comet/scripts/comet-env.sh' -type f -print -quit 2>/dev/null)}"
26
+ if [ -z "$COMET_ENV" ]; then
27
+ echo "ERROR: comet-env.sh not found. Ensure the comet skill is installed." >&2
28
+ return 1
29
+ fi
30
+ . "$COMET_ENV"
31
+ "$COMET_BASH" "$COMET_STATE" check <name> archive
32
+ ```
33
+
34
+ Proceed to Step 1 after verification passes. The script outputs specific failure reasons when verification fails.
35
+
36
+ ### 1. Final Archive Confirmation (Blocking Point)
37
+
38
+ After entry verification passes, **must follow the `comet/reference/decision-point.md` protocol to pause and wait for the user to confirm whether to archive immediately**. Must not run `"$COMET_BASH" "$COMET_ARCHIVE" "<change-name>"` before user confirmation.
39
+
40
+ Before confirmation, show the user a brief summary:
41
+ - Change name
42
+ - Verification report path and result
43
+ - Branch handling status
44
+ - Irreversible actions this archive will perform: merge main specs with OpenSpec delta semantics, annotate design doc / plan, and move the change to the archive directory
45
+
46
+ The user confirmation question must be presented as a single-select question with these options:
47
+ - "Confirm archive" — immediately run the archive script to complete spec merge and change movement
48
+ - "Needs adjustment or re-verification" do not archive; run `"$COMET_BASH" "$COMET_STATE" transition <change-name> archive-reopen` to return to `phase: verify`, then invoke `/comet-verify`. If verification confirms fixes are needed, follow `/comet-verify`'s verification-failure decision flow back to `/comet-build`
49
+ - "Do not archive yet" do not archive; keep the current `phase: archive` state and wait for the user to invoke `/comet-archive` again later
50
+
51
+ Only after the user selects "Confirm archive" may Step 2 continue. After the user selects "Needs adjustment or re-verification", must first run the `archive-reopen` state transition; do not edit `.comet.yaml` manually.
52
+
53
+ ### 2. Execute Archive
54
+
55
+ Run the archive script to automatically complete all steps:
56
+
57
+ ```bash
58
+ "$COMET_BASH" "$COMET_ARCHIVE" "<change-name>"
59
+ ```
60
+
61
+ The script automatically executes:
62
+ 1. Entry state validation (phase=archive, verify_result=pass, archived=false)
63
+ 2. Design doc frontmatter annotation (archived-with, status)
64
+ 3. Plan frontmatter annotation (archived-with)
65
+ 4. OpenSpec archive for delta-merge semantics and moving the change to the archive directory
66
+ 5. Main spec guard against leaked delta-only section headings
67
+ 6. Update `archived: true` through `comet-state transition <archive-name> archived`
68
+
69
+ If script returns non-zero exit code, report error and stop.
70
+ If script returns zero exit code, archive is complete.
71
+ The summary `X/Y steps succeeded` counts real executed steps and does not double-count delta spec sync or document annotation.
72
+
73
+ The script calls OpenSpec archive to merge `ADDED/MODIFIED/REMOVED/RENAMED` delta semantics into main specs, then verifies main specs do not contain delta-only section headings.
74
+
75
+ Use `--dry-run` flag to preview without executing.
76
+
77
+ ### 3. Lifecycle Closed Loop
78
+
79
+ Spec lifecycle completes here:
80
+ ```
81
+ brainstorming → delta spec → implementation → verification → main spec merge → design doc annotation → archive
82
+ ```
83
+
84
+ ## Exit Conditions
85
+
86
+ - Archive script executed successfully (exit code 0)
87
+ - Archive directory `openspec/changes/archive/YYYY-MM-DD-<change-name>/` exists
88
+ - Archived `.comet.yaml` contains `archived: true`
89
+
90
+ The archive script moves `openspec/changes/<name>/` to `openspec/changes/archive/YYYY-MM-DD-<name>/`.
91
+
92
+ > **WARNING**: After successful archive, **do not run** `"$COMET_BASH" "$COMET_GUARD" <change-name> archive` against the old active change name; the active directory no longer exists. Doing so will cause the guard to error with "change directory not found". Archive completeness is determined by script exit code and archived directory state.
93
+
94
+ ## Complete
95
+
96
+ Comet workflow complete. To start new work, invoke `/comet` or `/comet-open`.
97
+
98
+ ## Context Compression Recovery
99
+
100
+ Follow `comet/reference/context-recovery.md` with phase set to `archive`. If `archived: true` and archive directory exists, archival is complete — do not re-execute archive operations.