cortex-agents 4.0.5 → 4.0.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.
@@ -126,24 +126,33 @@ Use `plan_save` with:
126
126
 
127
127
  **If plan_commit fails** (e.g., nothing to stage), inform the user.
128
128
 
129
- ### Step 5: Handoff to Implementation
130
- **After committing the plan**, offer the user options to proceed. Note the **suggested branch** from plan_commit output.
129
+ ### Step 5: Handoff to Implementation (MUST ASK — NEVER skip)
130
+
131
+ **CRITICAL: You MUST use the question tool to ask the user before creating any branch or worktree. NEVER call `branch_create` or `worktree_create` without explicit user selection. Do NOT assume a choice — always present the options and WAIT for the user's response.**
132
+
133
+ After committing the plan, use the **question tool** with these exact options:
131
134
 
132
135
  "Plan committed. Suggested branch: `{suggestedBranch}`. How would you like to proceed?"
133
136
 
134
- 1. **Create a worktree (Recommended)** — Create an isolated worktree with the suggested branch, then switch to Implement
135
- 2. **Continue in this session** — Create the branch here, then switch to Implement agent
137
+ 1. **Create a worktree (Recommended)** — Isolated copy in `.worktrees/` for parallel development. This is the safest option.
138
+ 2. **Create a branch** — Create and switch to `{suggestedBranch}` in this repo
136
139
  3. **Stay in Architect mode** — Continue planning or refine the plan
137
140
 
138
- If the user chooses **"Create a worktree"**:
139
- - Use `worktree_create` with `name` derived from the suggested branch slug and `type` from the plan type
140
- - Report the worktree path so the user can navigate to it
141
- - Suggest: "Navigate to the worktree and run OpenCode with the Implement agent to begin implementation"
141
+ **Only after the user selects an option**, execute the corresponding action:
142
+
143
+ - **User chose "Create a worktree"**:
144
+ - Use `worktree_create` with `name` derived from the suggested branch slug and `type` from the plan type
145
+ - Report the worktree path so the user can navigate to it
146
+ - Suggest: "Navigate to the worktree and run OpenCode with the Implement agent to begin implementation"
147
+
148
+ - **User chose "Create a branch"**:
149
+ - Use `branch_create` with the suggested branch name (type and name from the plan)
150
+ - This creates and switches to the new branch
151
+ - Then switch to the Implement agent
142
152
 
143
- If the user chooses **"Continue in this session"**:
144
- - Use `branch_create` with the suggested branch name (type and name from the plan)
145
- - This creates and switches to the new branch
146
- - Then switch to the Implement agent
153
+ - **User chose "Stay in Architect mode"**:
154
+ - Do NOT create any branch or worktree
155
+ - Continue in the current session for further planning
147
156
 
148
157
  ### Step 6: Provide Handoff Context
149
158
  If user chooses to switch agents, provide:
@@ -88,37 +88,40 @@ If a plan exists, load it with `plan_load`.
88
88
 
89
89
  **Suggested branch detection:** If the loaded plan has a `branch` field in its frontmatter (set by `plan_commit`), this is the **suggested branch name** for implementation. The branch may or may not exist yet — `plan_commit` only writes the suggestion, it does not create the branch.
90
90
 
91
- ### Step 4: Ask User About Branch Strategy
91
+ ### Step 4: Ask User About Branch Strategy (MUST ASK — NEVER skip)
92
+
93
+ **CRITICAL: You MUST use the question tool to ask the user before creating any branch or worktree. NEVER call `branch_create` or `worktree_create` without explicit user selection. Do NOT assume a choice — always present the options and WAIT for the user's response.**
92
94
 
93
95
  **If you are already on the suggested branch (it was created during architect handoff):**
94
96
  Skip the branch creation prompt entirely — you're already set up. Inform the user:
95
97
  "You're on the plan branch `{branch}`. Ready to implement."
96
98
 
97
99
  **If the plan has a `branch` field BUT the branch doesn't exist yet or you're on a different branch:**
98
- Offer to create it:
100
+ Use the **question tool** with these options:
99
101
 
100
102
  "The plan suggests branch `{branch}`. How would you like to proceed?"
101
103
 
102
- Options:
103
- 1. **Create a worktree (Recommended)** — Isolated copy with the suggested branch name
104
+ 1. **Create a worktree (Recommended)** — Isolated copy with the suggested branch name. This is the safest option.
104
105
  2. **Create the branch here** — Create and switch to `{branch}` in this repo
105
106
  3. **Create a different branch** — Use a custom branch name
106
107
  4. **Continue here** — Only if you're certain (not recommended on protected branches)
107
108
 
108
109
  **If no plan exists AND on a protected branch:**
109
- Use the original prompt:
110
+ Use the **question tool** with these options:
110
111
 
111
112
  "I'm ready to implement changes. How would you like to proceed?"
112
113
 
113
- Options:
114
- 1. **Create a worktree (Recommended)** - Isolated copy in .worktrees/ for parallel development
115
- 2. **Create a new branch** - Stay in this repo, create feature/bugfix branch
116
- 3. **Continue here** - Only if you're certain (not recommended on protected branches)
114
+ 1. **Create a worktree (Recommended)** — Isolated copy in `.worktrees/` for parallel development. This is the safest option.
115
+ 2. **Create a new branch** Stay in this repo, create feature/bugfix branch
116
+ 3. **Continue here** Only if you're certain (not recommended on protected branches)
117
117
 
118
118
  ### Step 5: Execute Based on Response
119
- - **Worktree**: Use `worktree_create` with appropriate type and name. Report the worktree path. Continue working in the current session.
120
- - **Create branch**: Use `branch_create` with the suggested branch name (or custom name)
121
- - **Continue**: Proceed with caution, warn user about risks
119
+
120
+ **Only after the user selects an option**, execute the corresponding action:
121
+
122
+ - **User chose "Worktree"**: Use `worktree_create` with appropriate type and name. Report the worktree path. Continue working in the current session.
123
+ - **User chose "Create branch"**: Use `branch_create` with the suggested branch name (or custom name)
124
+ - **User chose "Continue"**: Proceed with caution, warn user about risks
122
125
 
123
126
  ### Step 6: REPL Implementation Loop
124
127
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cortex-agents",
3
- "version": "4.0.5",
3
+ "version": "4.0.6",
4
4
  "description": "Supercharge OpenCode with structured workflows, intelligent agents, and automated development practices",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",