Skip to content

Commit 57055df

Browse files
committed
feat(conductor): migrate interactive prompts to AskUser tool
1 parent 44446c6 commit 57055df

5 files changed

Lines changed: 398 additions & 331 deletions

File tree

commands/conductor/implement.toml

Lines changed: 52 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,25 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
3535
4. **Select Track:**
3636
- **If a track name was provided:**
3737
1. Perform an exact, case-insensitive match for the provided name against the track descriptions you parsed.
38-
2. If a unique match is found, confirm the selection with the user: "I found track '<track_description>'. Is this correct?"
39-
3. If no match is found, or if the match is ambiguous, inform the user and ask for clarification. Suggest the next available track as below.
38+
2. If a unique match is found, confirm the selection with the user using the `ask_user` tool:
39+
- **header:** "Confirm"
40+
- **question:** "I found track '<track_description>'. Is this correct?"
41+
- **type:** "yesno"
42+
3. If no match is found, or if the match is ambiguous, use the `ask_user` tool to inform the user and request the correct track name. You must suggest the next available track in the question text.
43+
- **header:** "Clarify"
44+
- **question:** "I couldn't find a unique track matching the name you provided. Did you mean '<next_available_track>'? Or please type the exact track name."
45+
- **type:** "text"
4046
- **If no track name was provided (or if the previous step failed):**
4147
1. **Identify Next Track:** Find the first track in the parsed tracks file that is NOT marked as `[x] Completed`.
4248
2. **If a next track is found:**
43-
- Announce: "No track name provided. Automatically selecting the next incomplete track: '<track_description>'."
44-
- Proceed with this track.
49+
- Confirm selection with the user using the `ask_user` tool:
50+
- **header:** "Next Track"
51+
- **question:** "No track name provided. Would you like to proceed with the next incomplete track: '<track_description>'?"
52+
- **type:** "yesno"
53+
- If confirmed, proceed with this track. Otherwise, use the `ask_user` tool to request the correct track name:
54+
- **header:** "Clarify"
55+
- **question:** "Please type the exact name of the track you would like to implement."
56+
- **type:** "text"
4557
3. **If no incomplete tracks are found:**
4658
- Announce: "No incomplete tracks found in the tracks file. All tasks are completed!"
4759
- Halt the process and await further user instructions.
@@ -71,6 +83,7 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
7183
b. **Iterate Through Tasks:** You MUST now loop through each task in the track's **Implementation Plan** one by one.
7284
c. **For Each Task, You MUST:**
7385
i. **Defer to Workflow:** The **Workflow** file is the **single source of truth** for the entire task lifecycle. You MUST now read and execute the procedures defined in the "Task Workflow" section of the **Workflow** file you have in your context. Follow its steps for implementation, testing, and committing precisely.
86+
- **CRITICAL:** Every human-in-the-loop interaction, confirmation, or request for feedback mentioned in the **Workflow** (e.g., manual verification plans or guidance on persistent failures) MUST be conducted using the `ask_user` tool.
7487
7588
5. **Finalize Track:**
7689
- After all tasks in the track's local **Implementation Plan** are completed, you MUST update the track's status in the **Tracks Registry**.
@@ -99,31 +112,40 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
99112
a. **Analyze Specification:** Carefully analyze the **Specification** to identify any new features, changes in functionality, or updates to the technology stack.
100113
b. **Update Product Definition:**
101114
i. **Condition for Update:** Based on your analysis, you MUST determine if the completed feature or bug fix significantly impacts the description of the product itself.
102-
ii. **Propose and Confirm Changes:** If an update is needed, generate the proposed changes. Then, present them to the user for confirmation:
115+
ii. **Propose and Confirm Changes:** If an update is needed, generate the proposed changes. Then, present them to the user for confirmation using the `ask_user` tool:
116+
- **header:** "Prod Definition"
117+
- **question:**
103118
> "Based on the completed track, I propose the following updates to the **Product Definition**:"
104119
> ```diff
105120
> [Proposed changes here, ideally in a diff format]
106121
> ```
107-
> "Do you approve these changes? (yes/no)"
122+
> "Do you approve these changes?"
123+
- **type:** "yesno"
108124
iii. **Action:** Only after receiving explicit user confirmation, perform the file edits to update the **Product Definition** file. Keep a record of whether this file was changed.
109125
c. **Update Tech Stack:**
110126
i. **Condition for Update:** Similarly, you MUST determine if significant changes in the technology stack are detected as a result of the completed track.
111-
ii. **Propose and Confirm Changes:** If an update is needed, generate the proposed changes. Then, present them to the user for confirmation:
127+
ii. **Propose and Confirm Changes:** If an update is needed, generate the proposed changes. Then, present them to the user for confirmation using the `ask_user` tool:
128+
- **header:** "Tech Stack"
129+
- **question:**
112130
> "Based on the completed track, I propose the following updates to the **Tech Stack**:"
113131
> ```diff
114132
> [Proposed changes here, ideally in a diff format]
115133
> ```
116-
> "Do you approve these changes? (yes/no)"
134+
> "Do you approve these changes?"
135+
- **type:** "yesno"
117136
iii. **Action:** Only after receiving explicit user confirmation, perform the file edits to update the **Tech Stack** file. Keep a record of whether this file was changed.
118137
d. **Update Product Guidelines (Strictly Controlled):**
119138
i. **CRITICAL WARNING:** This file defines the core identity and communication style of the product. It should be modified with extreme caution and ONLY in cases of significant strategic shifts, such as a product rebrand or a fundamental change in user engagement philosophy. Routine feature updates or bug fixes should NOT trigger changes to this file.
120139
ii. **Condition for Update:** You may ONLY propose an update to this file if the track's **Specification** explicitly describes a change that directly impacts branding, voice, tone, or other core product guidelines.
121-
iii. **Propose and Confirm Changes:** If the conditions are met, you MUST generate the proposed changes and present them to the user with a clear warning:
140+
iii. **Propose and Confirm Changes:** If the conditions are met, you MUST generate the proposed changes and present them to the user with a clear warning using the `ask_user` tool:
141+
- **header:** "Prod Guidelines"
142+
- **question:**
122143
> "WARNING: The completed track suggests a change to the core **Product Guidelines**. This is an unusual step. Please review carefully:"
123144
> ```diff
124145
> [Proposed changes here, ideally in a diff format]
125146
> ```
126-
> "Do you approve these critical changes to the **Product Guidelines**? (yes/no)"
147+
> "Do you approve these critical changes to the **Product Guidelines**?"
148+
- **type:** "yesno"
127149
iv. **Action:** Only after receiving explicit user confirmation, perform the file edits. Keep a record of whether this file was changed.
128150
129151
6. **Final Report:** Announce the completion of the synchronization process and provide a summary of the actions taken.
@@ -146,34 +168,39 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
146168
147169
1. **Execution Trigger:** This protocol MUST only be executed after the current track has been successfully implemented and the `SYNCHRONIZE PROJECT DOCUMENTATION` step is complete.
148170
149-
2. **Ask for User Choice:** You MUST prompt the user with the available options for the completed track.
150-
> "Track '<track_description>' is now complete. What would you like to do?
151-
> A. **Review (Recommended):** Run the review command to verify changes before finalizing.
152-
> B. **Archive:** Move the track's folder to `conductor/archive/` and remove it from the tracks file.
153-
> C. **Delete:** Permanently delete the track's folder and remove it from the tracks file.
154-
> D. **Skip:** Do nothing and leave it in the tracks file.
155-
> Please enter the option of your choice (A, B, C, or D)."
171+
2. **Ask for User Choice:** You MUST prompt the user with the available options for the completed track using the `ask_user` tool.
172+
- **header:** "Track Cleanup"
173+
- **question:** "Track '<track_description>' is now complete. What would you like to do?"
174+
- **type:** "choice"
175+
- **multiSelect:** `false`
176+
- **options:**
177+
- Label: "Review", Description: "Run the review command to verify changes before finalizing."
178+
- Label: "Archive", Description: "Move the track's folder to `conductor/archive/` and remove it from the tracks file."
179+
- Label: "Delete", Description: "Permanently delete the track's folder and remove it from the tracks file."
180+
- Label: "Skip", Description: "Do nothing and leave it in the tracks file."
156181
157182
3. **Handle User Response:**
158-
* **If user chooses "A" (Review):**
183+
* **If user chooses "Review":**
159184
* Announce: "Please run `/conductor:review` to verify your changes. You will be able to archive or delete the track after the review."
160-
* **If user chooses "B" (Archive):**
185+
* **If user chooses "Archive":**
161186
i. **Create Archive Directory:** Check for the existence of `conductor/archive/`. If it does not exist, create it.
162187
ii. **Archive Track Folder:** Move the track's folder from its current location (resolved via the **Tracks Directory**) to `conductor/archive/<track_id>`.
163188
iii. **Remove from Tracks File:** Read the content of the **Tracks Registry** file, remove the entire section for the completed track (the part that starts with `---` and contains the track description), and write the modified content back to the file.
164189
iv. **Commit Changes:** Stage the **Tracks Registry** file and `conductor/archive/`. Commit with the message `chore(conductor): Archive track '<track_description>'`.
165190
v. **Announce Success:** Announce: "Track '<track_description>' has been successfully archived."
166-
* **If user chooses "C" (Delete):**
167-
i. **CRITICAL WARNING:** Before proceeding, you MUST ask for a final confirmation due to the irreversible nature of the action.
168-
> "WARNING: This will permanently delete the track folder and all its contents. This action cannot be undone. Are you sure you want to proceed? (yes/no)"
191+
* **If user chooses "Delete":**
192+
i. **CRITICAL WARNING:** Before proceeding, you MUST ask for a final confirmation using the `ask_user` tool.
193+
- **header:** "Confirm"
194+
- **question:** "WARNING: This will permanently delete the track folder and all its contents. This action cannot be undone. Are you sure?"
195+
- **type:** "yesno"
169196
ii. **Handle Confirmation:**
170197
- **If 'yes'**:
171198
a. **Delete Track Folder:** Resolve the **Tracks Directory** and permanently delete the track's folder from `<Tracks Directory>/<track_id>`.
172199
b. **Remove from Tracks File:** Read the content of the **Tracks Registry** file, remove the entire section for the completed track, and write the modified content back to the file.
173200
c. **Commit Changes:** Stage the **Tracks Registry** file and the deletion of the track directory. Commit with the message `chore(conductor): Delete track '<track_description>'`.
174201
d. **Announce Success:** Announce: "Track '<track_description>' has been permanently deleted."
175-
- **If 'no' (or anything else)**:
202+
- **If 'no'**:
176203
a. **Announce Cancellation:** Announce: "Deletion cancelled. The track has not been changed."
177-
* **If user chooses "D" (Skip) or provides any other input:**
204+
* **If user chooses "Skip":**
178205
* Announce: "Okay, the completed track will remain in your tracks file for now."
179-
"""
206+
"""

0 commit comments

Comments
 (0)