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.
- package/.opencode/agents/architect.md +21 -12
- package/.opencode/agents/implement.md +15 -12
- package/package.json +1 -1
|
@@ -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
|
-
|
|
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)** —
|
|
135
|
-
2. **
|
|
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
|
-
|
|
139
|
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
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
|
-
|
|
144
|
-
-
|
|
145
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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