@rpamis/comet 0.1.5 → 0.1.6

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.
@@ -75,6 +75,7 @@ phase: build
75
75
  design_doc: docs/superpowers/specs/YYYY-MM-DD-topic-design.md
76
76
  plan: docs/superpowers/plans/YYYY-MM-DD-feature.md
77
77
  build_mode: subagent-driven-development
78
+ isolation: branch
78
79
  verify_mode: light
79
80
  verify_result: pending
80
81
  verified_at: null
@@ -90,6 +91,7 @@ Field meanings:
90
91
  | `design_doc` | Associated Superpowers Design Doc path, can be empty |
91
92
  | `plan` | Associated Superpowers Plan path, can be empty |
92
93
  | `build_mode` | Selected execution mode, can be empty |
94
+ | `isolation` | `branch` or `worktree`, workspace isolation method, defaults to `branch` |
93
95
  | `verify_mode` | `light` or `full`, can be empty |
94
96
  | `verify_result` | `pending`, `pass`, or `fail` |
95
97
  | `verified_at` | Verification pass time, can be empty |
@@ -49,7 +49,7 @@ warn_msg() { warn " WARN: $1"; WARNINGS=$((WARNINGS + 1)); }
49
49
  echo "[VALIDATE] $YAML" >&2
50
50
 
51
51
  # --- Required fields ---
52
- REQUIRED_FIELDS="workflow phase design_doc plan build_mode verify_mode verify_result verified_at archived"
52
+ REQUIRED_FIELDS="workflow phase design_doc plan build_mode isolation verify_mode verify_result verified_at archived"
53
53
  for field in $REQUIRED_FIELDS; do
54
54
  if ! grep -q "^${field}:" "$YAML" 2>/dev/null; then
55
55
  fail "missing required field '$field'"
@@ -78,6 +78,7 @@ validate_enum() {
78
78
  workflow=$(field_value "workflow")
79
79
  phase=$(field_value "phase")
80
80
  build_mode=$(field_value "build_mode")
81
+ isolation=$(field_value "isolation")
81
82
  verify_mode=$(field_value "verify_mode")
82
83
  verify_result=$(field_value "verify_result")
83
84
  archived=$(field_value "archived")
@@ -87,6 +88,7 @@ plan=$(field_value "plan")
87
88
  validate_enum "workflow" "$workflow" "full hotfix tweak"
88
89
  validate_enum "phase" "$phase" "design build verify archive"
89
90
  validate_enum "build_mode" "$build_mode" "subagent-driven-development executing-plans direct"
91
+ validate_enum "isolation" "$isolation" "branch worktree"
90
92
  validate_enum "verify_mode" "$verify_mode" "light full"
91
93
  validate_enum "verify_result" "$verify_result" "pending pass fail"
92
94
  validate_enum "archived" "$archived" "true false"
@@ -106,7 +108,7 @@ if [ -n "$plan" ] && [ "$plan" != "null" ]; then
106
108
  fi
107
109
 
108
110
  # --- Unknown keys check ---
109
- KNOWN_KEYS="workflow phase design_doc plan build_mode verify_mode verify_result verified_at archived"
111
+ KNOWN_KEYS="workflow phase design_doc plan build_mode isolation verify_mode verify_result verified_at archived"
110
112
  while IFS=: read -r key _; do
111
113
  key="${key// /}"
112
114
  [ -z "$key" ] && continue
@@ -68,7 +68,49 @@ plan: docs/superpowers/plans/YYYY-MM-DD-feature.md
68
68
  Confirm plan line value is "docs/superpowers/plans/YYYY-MM-DD-feature.md"
69
69
  If not matching, retry write then verify again. Maximum 2 retries, report error and terminate if still fails.
70
70
 
71
- ### 3. Select Execution Method
71
+ ### 3. Workspace Isolation
72
+
73
+ Plan has been written to the current branch. Before starting execution, choose workspace isolation method:
74
+
75
+ | Option | Method | Description |
76
+ |--------|--------|-------------|
77
+ | A | Create branch | Create a new branch in the current repo, simple and fast |
78
+ | B | Create Worktree | Isolated workspace, fully independent, suitable for parallel development |
79
+
80
+ **Recommendation rules**:
81
+ - Change involves ≤ 3 files → Recommend A
82
+ - Need parallel development, current branch has uncommitted work → Recommend B
83
+
84
+ After user selection, merge and update `isolation` in `openspec/changes/<name>/.comet.yaml` (keep other fields unchanged). `isolation` only allows one of the following values:
85
+
86
+ - `branch`
87
+ - `worktree`
88
+
89
+ Few-shot examples:
90
+
91
+ ```yaml
92
+ # User selects create branch / A
93
+ isolation: branch
94
+ ```
95
+
96
+ ```yaml
97
+ # User selects create worktree / B
98
+ isolation: worktree
99
+ ```
100
+
101
+ 【Write verification】After update completion, must verify:
102
+ cat openspec/changes/<name>/.comet.yaml
103
+ Confirm isolation line value is "<branch or worktree>"
104
+ If not matching, retry write then verify again. Maximum 2 retries, report error and terminate if still fails.
105
+
106
+ **Execute isolation**:
107
+
108
+ - **branch**: Run `git checkout -b <change-name>`, subsequent work on the new branch
109
+ - **worktree**: Invoke `superpowers:using-git-worktrees` skill or use native `EnterWorktree` tool to create isolated workspace
110
+
111
+ After creating isolation, confirm plan file is accessible (naturally accessible with branch method; for worktree method, confirm plan has been committed).
112
+
113
+ ### 4. Select Execution Method
72
114
 
73
115
  Present plan summary to user (task count, involved modules), then ask for execution method:
74
116
 
@@ -114,7 +156,7 @@ After the skill loads, follow its guidance to execute:
114
156
  - Complete tasks.md check (`- [ ]` → `- [x]`)
115
157
  - Commit code after each task completion
116
158
 
117
- ### 4. Spec Incremental Updates
159
+ ### 5. Spec Incremental Updates
118
160
 
119
161
  When the initial spec is found incomplete during implementation, handle by scale:
120
162
 
@@ -64,6 +64,7 @@ phase: build
64
64
  design_doc: null
65
65
  plan: null
66
66
  build_mode: direct
67
+ isolation: branch
67
68
  verify_mode: light
68
69
  verify_result: pending
69
70
  verified_at: null
@@ -77,6 +78,7 @@ archived: false
77
78
  Confirm design_doc line value is "null"
78
79
  Confirm plan line value is "null"
79
80
  Confirm build_mode line value is "direct"
81
+ Confirm isolation line value is "branch"
80
82
  Confirm verify_mode line value is "light"
81
83
  Confirm verify_result line value is "pending"
82
84
  Confirm verified_at line value is "null"
@@ -65,6 +65,7 @@ phase: build
65
65
  design_doc: null
66
66
  plan: null
67
67
  build_mode: direct
68
+ isolation: branch
68
69
  verify_mode: light
69
70
  verify_result: pending
70
71
  verified_at: null
@@ -78,6 +79,7 @@ archived: false
78
79
  Confirm design_doc line value is "null"
79
80
  Confirm plan line value is "null"
80
81
  Confirm build_mode line value is "direct"
82
+ Confirm isolation line value is "branch"
81
83
  Confirm verify_mode line value is "light"
82
84
  Confirm verify_result line value is "pending"
83
85
  Confirm verified_at line value is "null"
@@ -75,6 +75,7 @@ phase: build
75
75
  design_doc: docs/superpowers/specs/YYYY-MM-DD-topic-design.md
76
76
  plan: docs/superpowers/plans/YYYY-MM-DD-feature.md
77
77
  build_mode: subagent-driven-development
78
+ isolation: branch
78
79
  verify_mode: light
79
80
  verify_result: pending
80
81
  verified_at: null
@@ -90,6 +91,7 @@ archived: false
90
91
  | `design_doc` | 关联的 Superpowers Design Doc 路径,可为空 |
91
92
  | `plan` | 关联的 Superpowers Plan 路径,可为空 |
92
93
  | `build_mode` | 已选择的执行方式,可为空 |
94
+ | `isolation` | `branch` 或 `worktree`,工作区隔离方式,默认 `branch` |
93
95
  | `verify_mode` | `light` 或 `full`,可为空 |
94
96
  | `verify_result` | `pending`、`pass` 或 `fail` |
95
97
  | `verified_at` | 验证通过时间,可为空 |
@@ -68,7 +68,49 @@ plan: docs/superpowers/plans/YYYY-MM-DD-feature.md
68
68
  确认 plan 行的值为 "docs/superpowers/plans/YYYY-MM-DD-feature.md"
69
69
  如不匹配,重试写入后再次验证。最多重试 2 次,仍失败则报告错误并终止。
70
70
 
71
- ### 3. 选择执行方式
71
+ ### 3. 工作区隔离
72
+
73
+ 计划已写入当前分支。在开始执行前,选择工作区隔离方式:
74
+
75
+ | 选项 | 方式 | 说明 |
76
+ |------|------|------|
77
+ | A | 创建分支 | 在当前仓库创建新分支,简单快速 |
78
+ | B | 创建 Worktree | 隔离工作区,完全独立,适合并行开发 |
79
+
80
+ **推荐规则**:
81
+ - 变更涉及 ≤ 3 个文件 → 推荐 A
82
+ - 需要并行开发、当前分支有未提交工作 → 推荐 B
83
+
84
+ 用户选择后,在 `openspec/changes/<name>/.comet.yaml` 中合并更新 `isolation`(保留其他字段不变)。`isolation` 只允许以下值之一:
85
+
86
+ - `branch`
87
+ - `worktree`
88
+
89
+ Few-shot 示例:
90
+
91
+ ```yaml
92
+ # 用户选择创建分支 / A
93
+ isolation: branch
94
+ ```
95
+
96
+ ```yaml
97
+ # 用户选择创建 worktree / B
98
+ isolation: worktree
99
+ ```
100
+
101
+ 【写入验证】更新完成后必须验证:
102
+ cat openspec/changes/<name>/.comet.yaml
103
+ 确认 isolation 行的值为 "<branch 或 worktree>"
104
+ 如不匹配,重试写入后再次验证。最多重试 2 次,仍失败则报告错误并终止。
105
+
106
+ **执行隔离**:
107
+
108
+ - **branch**:执行 `git checkout -b <change-name>`,后续工作在新分支上进行
109
+ - **worktree**:调用 `superpowers:using-git-worktrees` 技能或使用原生 `EnterWorktree` 工具创建隔离工作区
110
+
111
+ 创建隔离后,确认计划文件可访问(分支方式天然可访问;worktree 方式需确认计划已提交)。
112
+
113
+ ### 4. 选择执行方式
72
114
 
73
115
  向用户展示计划摘要(任务数、涉及模块),然后询问执行方式:
74
116
 
@@ -114,7 +156,7 @@ build_mode: executing-plans
114
156
  - 完成 tasks.md 勾选(`- [ ]` → `- [x]`)
115
157
  - 每个任务完成后提交代码
116
158
 
117
- ### 4. Spec 增量更新
159
+ ### 5. Spec 增量更新
118
160
 
119
161
  实施过程中发现初版 spec 不完整时,按变更规模分级处理:
120
162
 
@@ -64,6 +64,7 @@ phase: build
64
64
  design_doc: null
65
65
  plan: null
66
66
  build_mode: direct
67
+ isolation: branch
67
68
  verify_mode: light
68
69
  verify_result: pending
69
70
  verified_at: null
@@ -77,6 +78,7 @@ archived: false
77
78
  确认 design_doc 行的值为 "null"
78
79
  确认 plan 行的值为 "null"
79
80
  确认 build_mode 行的值为 "direct"
81
+ 确认 isolation 行的值为 "branch"
80
82
  确认 verify_mode 行的值为 "light"
81
83
  确认 verify_result 行的值为 "pending"
82
84
  确认 verified_at 行的值为 "null"
@@ -65,6 +65,7 @@ phase: build
65
65
  design_doc: null
66
66
  plan: null
67
67
  build_mode: direct
68
+ isolation: branch
68
69
  verify_mode: light
69
70
  verify_result: pending
70
71
  verified_at: null
@@ -78,6 +79,7 @@ archived: false
78
79
  确认 design_doc 行的值为 "null"
79
80
  确认 plan 行的值为 "null"
80
81
  确认 build_mode 行的值为 "direct"
82
+ 确认 isolation 行的值为 "branch"
81
83
  确认 verify_mode 行的值为 "light"
82
84
  确认 verify_result 行的值为 "pending"
83
85
  确认 verified_at 行的值为 "null"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpamis/comet",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "OpenSpec + Superpowers dual-star development workflow",
5
5
  "keywords": [
6
6
  "comet",