conductor-init 1.3.2 → 1.3.3

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.
@@ -37,42 +37,35 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
37
37
 
38
38
  * **PATH A: Direct Confirmation**
39
39
  1. Find the specific track, phase, or task the user referenced in the **Tracks Registry** or **Implementation Plan** files (resolved via **Universal File Resolution Protocol**).
40
- 2. Ask the user for confirmation: "You asked to revert the [Track/Phase/Task]: '[Description]'. Is this correct?".
41
- - **Structure:**
42
- A) Yes
43
- B) No
44
- 3. If "yes", establish this as the `target_intent` and proceed to Phase 2. If "no", ask clarifying questions to find the correct item to revert.
40
+ 2. Immediately call the `ask_user` tool to confirm the selection (do not repeat the question in the chat):
41
+ - **questions:**
42
+ - **header:** "Confirm"
43
+ - **question:** "You asked to revert the [Track/Phase/Task]: '[Description]'. Is this correct?"
44
+ - **type:** "yesno"
45
+ 3. If "yes", establish this as the `target_intent` and proceed to Phase 2. If "no", immediately call the `ask_user` tool to ask clarifying questions (do not repeat the question in the chat):
46
+ - **questions:**
47
+ - **header:** "Clarify"
48
+ - **question:** "I'm sorry, I misunderstood. Please describe the Track, Phase, or Task you would like to revert."
49
+ - **type:** "text"
45
50
 
46
51
  * **PATH B: Guided Selection Menu**
47
52
  1. **Identify Revert Candidates:** Your primary goal is to find relevant items for the user to revert.
48
53
  * **Scan All Plans:** You MUST read the **Tracks Registry** and every track's **Implementation Plan** (resolved via **Universal File Resolution Protocol** using the track's index file).
49
- * **Prioritize In-Progress:** First, find **all** Tracks, Phases, and Tasks marked as "in-progress" (`[~]`).
50
- * **Fallback to Completed:** If and only if NO in-progress items are found, find the **5 most recently completed** Tasks and Phases (`[x]`).
51
- 2. **Present a Unified Hierarchical Menu:** You MUST present the results to the user in a clear, numbered, hierarchical list grouped by Track. The introductory text MUST change based on the context.
52
- * **Example when in-progress items are found:**
53
- > "I found multiple in-progress items. Please choose which one to revert:
54
- >
55
- > Track: track_20251208_user_profile
56
- > 1) [Phase] Implement Backend API
57
- > 2) [Task] Update user model
58
- >
59
- > 3) A different Track, Task, or Phase."
60
- * **Example when showing recently completed items:**
61
- > "No items are in progress. Please choose a recently completed item to revert:
62
- >
63
- > Track: track_20251208_user_profile
64
- > 1) [Phase] Foundational Setup
65
- > 2) [Task] Initialize React application
66
- >
67
- > Track: track_20251208_auth_ui
68
- > 3) [Task] Create login form
69
- >
70
- > 4) A different Track, Task, or Phase."
54
+ * **Prioritize In-Progress:** First, find the **top 3** most relevant Tracks, Phases, or Tasks marked as "in-progress" (`[~]`).
55
+ * **Fallback to Completed:** If and only if NO in-progress items are found, find the **3 most recently completed** Tasks and Phases (`[x]`).
56
+ 2. **Present a Unified Hierarchical Menu:** Immediately call the `ask_user` tool to present the results (do not list them in the chat first):
57
+ - **questions:**
58
+ - **header:** "Select Item"
59
+ - **question:** "I found multiple in-progress items (or recently completed items). Please choose which one to revert:"
60
+ - **type:** "choice"
61
+ - **multiSelect:** false
62
+ - **options:** Provide the identified items as options. Group them by Track in the description if possible. **CRITICAL:** You MUST limit this array to a maximum of 4 items.
63
+ - **Example Option Label:** "[Task] Update user model", **Description:** "Track: track_20251208_user_profile"
64
+ - **Example Option Label:** "[Phase] Implement Backend", **Description:** "Track: track_20251208_user_profile"
65
+ - **Note:** The "Other" option is automatically added by the tool.
71
66
  3. **Process User's Choice:**
72
- * If the user's response is **A** or **B**, set this as the `target_intent` and proceed directly to Phase 2.
73
- * If the user's response is **C** or another value that does not match A or B, you must engage in a dialogue to find the correct target. Ask clarifying questions like:
74
- * "What is the name or ID of the track you are looking for?"
75
- * "Can you describe the task you want to revert?"
67
+ * If the user selects a specific item from the list, set this as the `target_intent` and proceed directly to Phase 2.
68
+ * If the user selects "Other" (automatically added for "choice") or the explicit "Other" option provided, you must engage in a dialogue to find the correct target using `ask_user` tool with a single question of `type: "text"` in the `questions` array.
76
69
  * Once a target is identified, loop back to Path A for final confirmation.
77
70
 
78
71
  4. **Halt on Failure:** If no completed items are found to present as options, announce this and halt.
@@ -112,11 +105,23 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
112
105
  > ` - <sha_plan_commit> ('conductor(plan): Mark task complete')`
113
106
  > * **Action:** I will run `git revert` on these commits in reverse order.
114
107
 
115
- 2. **Final Go/No-Go:** Ask for final confirmation: "**Do you want to proceed? (yes/no)**".
116
- - **Structure:**
117
- A) Yes
118
- B) No
119
- 3. If "yes", proceed to Phase 4. If "no", ask clarifying questions to get the correct plan for revert.
108
+ 2. **Final Go/No-Go:** Immediately call the `ask_user` tool to ask for final confirmation (do not repeat the question in the chat):
109
+ - **questions:**
110
+ - **header:** "Confirm Plan"
111
+ - **question:** "Do you want to proceed with the drafted plan?"
112
+ - **type:** "choice"
113
+ - **multiSelect:** false
114
+ - **options:**
115
+ - Label: "Approve", Description: "Proceed with the revert actions."
116
+ - Label: "Revise", Description: "I want to change the revert plan."
117
+
118
+ 3. **Process User Choice:**
119
+ - If "Approve", proceed to Phase 4.
120
+ - If "Revise", immediately call the `ask_user` tool to get the correct plan (do not repeat the question in the chat):
121
+ - **questions:**
122
+ - **header:** "Revise"
123
+ - **question:** "Please describe the changes needed for the revert plan."
124
+ - **type:** "text"
120
125
 
121
126
  ---
122
127
 
@@ -41,9 +41,22 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
41
41
  2. **Auto-Detect Scope:**
42
42
  - If no input, read the **Tracks Registry**.
43
43
  - Look for a track marked as `[~] In Progress`.
44
- - If one exists, ask the user: "Do you want to review the in-progress track '<track_name>'? (yes/no)"
45
- - If no track is in progress, or user says "no", ask: "What would you like to review? (Enter a track name, or typing 'current' for uncommitted changes)"
46
- 3. **Confirm Scope:** Ensure you and the user agree on what is being reviewed.
44
+ - If one exists, immediately call the `ask_user` tool to confirm (do not repeat the question in the chat):
45
+ - **questions:**
46
+ - **header:** "Review Track"
47
+ - **question:** "Do you want to review the in-progress track '<track_name>'?"
48
+ - **type:** "yesno"
49
+ - If no track is in progress, or user says "no", immediately call the `ask_user` tool to ask for the scope (do not repeat the question in the chat):
50
+ - **questions:**
51
+ - **header:** "Select Scope"
52
+ - **question:** "What would you like to review?"
53
+ - **type:** "text"
54
+ - **placeholder:** "Enter track name, or 'current' for uncommitted changes"
55
+ 3. **Confirm Scope:** Ensure you and the user agree on what is being reviewed by immediately calling the `ask_user` tool (do not repeat the question in the chat):
56
+ - **questions:**
57
+ - **header:** "Confirm Scope"
58
+ - **question:** "I will review: '<identified_scope>'. Is this correct?"
59
+ - **type:** "yesno"
47
60
 
48
61
  ### 2.2 Retrieve Context
49
62
  1. **Load Project Context:**
@@ -61,7 +74,11 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
61
74
  - Run `git diff <revision_range>` to get the full context in one go.
62
75
  - Proceed to "Analyze and Verify".
63
76
  - **Large Changes (> 300 lines):**
64
- - **Announce:** "Use 'Iterative Review Mode' due to change size."
77
+ - **Confirm:** Immediately call the `ask_user` tool to confirm before proceeding with a large review (do not repeat the question in the chat):
78
+ - **questions:**
79
+ - **header:** "Large Review"
80
+ - **question:** "This review involves >300 lines of changes. I will use 'Iterative Review Mode' which may take longer. Proceed?"
81
+ - **type:** "yesno"
65
82
  - **List Files:** Run `git diff --name-only <revision_range>`.
66
83
  - **Iterate:** For each source file (ignore locks/assets):
67
84
  1. Run `git diff <revision_range> -- <file_path>`.
@@ -114,48 +131,103 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
114
131
  ---
115
132
 
116
133
  ## 3.0 COMPLETION PHASE
117
- 1. **Review Decision:**
118
- - **Determine Recommendation and announce it to the user:**
119
- - If **Critical** or **High** issues found:
120
- > "I recommend we fix the important issues I found before moving forward."
121
- - If only **Medium/Low** issues found:
122
- > "The changes look good overall, but I have a few suggestions to improve them."
123
- - If no issues found:
124
- > "Everything looks great! I don't see any issues."
125
- - **Action:**
126
- - **If issues found:** Ask:
127
- > "Do you want me to apply the suggested fixes, fix them manually yourself, or proceed to complete the track?
128
- > A. **Apply Fixes:** Automatically apply the suggested code changes.
129
- > B. **Manual Fix:** Stop so you can fix issues yourself.
130
- > C. **Complete Track:** Ignore warnings and proceed to cleanup.
131
- > Please enter your choice (A, B, or C)."
132
- - **If "A" (Apply Fixes):** Apply the code modifications suggested in the findings using file editing tools. Then Proceed to next step.
133
- - **If "B" (Manual Fix):** Terminate operation to allow user to edit code.
134
- - **If "C" (Complete Track):** Proceed to the next step.
135
- - **If no issues found:** Proceed to the next step.
136
-
137
- 2. **Track Cleanup:**
138
- **PROTOCOL: Offer to archive or delete the reviewed track.**
139
-
140
- a. **Context Check:** If you are NOT reviewing a specific track (e.g., just reviewing current changes without a track context), SKIP this entire section.
141
-
142
- b. **Ask for User Choice:**
143
- > "Review complete. What would you like to do with track '<track_name>'?
144
- > A. **Archive:** Move to `conductor/archive/` and update registry.
145
- > B. **Delete:** Permanently remove from system.
146
- > C. **Skip:** Leave as is.
147
- > Please enter your choice (A, B, or C)."
148
-
149
- c. **Handle User Response:**
150
- * **If "A" (Archive):**
151
- i. **Setup:** Ensure `conductor/archive/` exists.
152
- ii. **Move:** Move track folder to `conductor/archive/<track_id>`.
153
- iii. **Update Registry:** Remove track section from **Tracks Registry**.
154
- iv. **Commit:** Stage registry and archive. Commit: `chore(conductor): Archive track '<track_name>'`.
155
- v. **Announce:** "Track '<track_name>' archived."
156
- * **If "B" (Delete):**
157
- i. **Confirm:** "WARNING: Irreversible deletion. Proceed? (yes/no)"
158
- ii. **If yes:** Delete track folder, remove from **Tracks Registry**, commit (`chore(conductor): Delete track '<track_name>'`), announce success.
159
- iii. **If no:** Cancel.
160
- * **If "C" (Skip):** Leave track as is.
134
+
135
+ ### 3.1 Review Decision
136
+ 1. **Determine Recommendation and announce it to the user:**
137
+ - If **Critical** or **High** issues found:
138
+ - Announce: "I recommend we fix the important issues I found before moving forward."
139
+ - If only **Medium/Low** issues found:
140
+ - Announce: "The changes look good overall, but I have a few suggestions to improve them."
141
+ - If no issues found:
142
+ - Announce: "Everything looks great! I don't see any issues."
143
+ 2. **Action:**
144
+ - **If issues found:** Immediately call the `ask_user` tool (do not repeat the question in the chat):
145
+ - **questions:**
146
+ - **header:** "Decision"
147
+ - **question:** "How would you like to proceed with the findings?"
148
+ - **type:** "choice"
149
+ - **multiSelect:** false
150
+ - **options:**
151
+ - Label: "Apply Fixes", Description: "Automatically apply the suggested code changes."
152
+ - Label: "Manual Fix", Description: "Stop so you can fix issues yourself."
153
+ - Label: "Complete Track", Description: "Ignore warnings and proceed to cleanup."
154
+ - **If "Apply Fixes":** Apply the code modifications suggested in the findings using file editing tools. Then Proceed to next step.
155
+ - **If "Manual Fix":** Terminate operation to allow user to edit code.
156
+ - **If "Complete Track":** Proceed to the next step.
157
+ - **If no issues found:** Proceed to the next step.
158
+
159
+ ### 3.2 Commit Review Changes
160
+ **PROTOCOL: Ensure all review-related changes are committed and tracked in the plan.**
161
+
162
+ 1. **Check for Changes:** Use `git status --porcelain` to check for any uncommitted changes (staged or unstaged) in the repository.
163
+ 2. **Condition for Action:**
164
+ - If NO changes are detected, proceed to '3.3 Track Cleanup'.
165
+ - If changes are detected:
166
+ a. **Check for Track Context:**
167
+ - If you are NOT reviewing a specific track (i.e., you don't have a `plan.md` in context), immediately call the `ask_user` tool (do not repeat the question in the chat):
168
+ - **questions:**
169
+ - **header:** "Commit Changes"
170
+ - **question:** "I've detected uncommitted changes. Should I commit them?"
171
+ - **type:** "yesno"
172
+ - If 'yes', stage all changes and commit with `fix(conductor): Apply review suggestions <brief description of changes>`.
173
+ - Proceed to '3.3 Track Cleanup'.
174
+ b. **Handle Track-Specific Changes:**
175
+ i. **Confirm with User:** Immediately call the `ask_user` tool (do not repeat the question in the chat):
176
+ - **questions:**
177
+ - **header:** "Commit & Track"
178
+ - **question:** "I've detected uncommitted changes from the review process. Should I commit these and update the track's plan?"
179
+ - **type:** "yesno"
180
+ ii. **If Yes:**
181
+ - **Update Plan (Add Review Task):**
182
+ - Read the track's `plan.md`.
183
+ - Append a new phase (if it doesn't exist) and task to the end of the file.
184
+ - **Format:**
185
+ ```markdown
186
+ ## Phase: Review Fixes
187
+ - [~] Task: Apply review suggestions
188
+ ```
189
+ - **Commit Code:**
190
+ - Stage all code changes related to the track (excluding `plan.md`).
191
+ - Commit with message: `fix(conductor): Apply review suggestions for track '<track_name>'`.
192
+ - **Record SHA:**
193
+ - Get the short SHA (first 7 characters) of the commit.
194
+ - Update the task in `plan.md` to: `- [x] Task: Apply review suggestions <sha>`.
195
+ - **Commit Plan Update:**
196
+ - Stage `plan.md`.
197
+ - Commit with message: `conductor(plan): Mark task 'Apply review suggestions' as complete`.
198
+ - **Announce Success:** "Review changes committed and tracked in the plan."
199
+ iii. **If No:** Skip the commit and plan update. Proceed to '3.3 Track Cleanup'.
200
+
201
+ ### 3.3 Track Cleanup
202
+ **PROTOCOL: Offer to archive or delete the reviewed track.**
203
+
204
+ 1. **Context Check:** If you are NOT reviewing a specific track (e.g., just reviewing current changes without a track context), SKIP this entire section.
205
+
206
+ 2. **Ask for User Choice:** Immediately call the `ask_user` tool to prompt the user (do not repeat the question in the chat):
207
+ - **questions:**
208
+ - **header:** "Track Cleanup"
209
+ - **question:** "Review complete. What would you like to do with track '<track_name>'?"
210
+ - **type:** "choice"
211
+ - **multiSelect:** false
212
+ - **options:**
213
+ - Label: "Archive", Description: "Move the track's folder to `conductor/archive/` and remove it from the tracks file."
214
+ - Label: "Delete", Description: "Permanently delete the track's folder and remove it from the tracks file."
215
+ - Label: "Skip", Description: "Do nothing and leave it in the tracks file."
216
+
217
+ 3. **Handle User Response:**
218
+ * **If "Archive":**
219
+ i. **Setup:** Ensure `conductor/archive/` exists.
220
+ ii. **Move:** Move track folder to `conductor/archive/<track_id>`.
221
+ iii. **Update Registry:** Remove track section from **Tracks Registry**.
222
+ iv. **Commit:** Stage registry and archive. Commit: `chore(conductor): Archive track '<track_name>'`.
223
+ v. **Announce:** "Track '<track_name>' archived."
224
+ * **If "Delete":**
225
+ i. **Confirm:** Immediately call the `ask_user` tool to ask for final confirmation (do not repeat the warning in the chat):
226
+ - **questions:**
227
+ - **header:** "Confirm"
228
+ - **question:** "WARNING: This is an irreversible deletion. Do you want to proceed?"
229
+ - **type:** "yesno"
230
+ ii. **If yes:** Delete track folder, remove from **Tracks Registry**, commit (`chore(conductor): Delete track '<track_name>'`), announce success.
231
+ iii. **If no:** Cancel.
232
+ * **If "Skip":** Leave track as is.
161
233
  """