Skip to content

Commit 5eacb73

Browse files
committed
feat(conductor): migrate interactive prompts to AskUser tool
Refactors the interactive flows in `implement`, `newTrack`, `revert`, and `setup` commands to utilize the `AskUser` tool. This replaces free-text parsing with structured inputs (choice, yesno, text), improving the reliability and user experience of the CLI interactions. Updates: - `implement.toml`: specific prompts for track selection, document synchronization (with diff previews), and cleanup options using the `AskUser` tool. - `newTrack.toml`: structured questions for track specification and planning with the `AskUser` tool, including Markdown previews. Removed redundant option descriptions. - `revert.toml`: better selection menus for reverting tracks/tasks and plan confirmation using the `AskUser` tool. Removed redundant option descriptions. - `setup.toml`: enhanced project initialization and configuration questionnaires using the `AskUser` tool, including document previews. Removed redundant option descriptions. Explicitly mentions AskUser tool calls.
1 parent 2eedf9b commit 5eacb73

File tree

4 files changed

+271
-284
lines changed

4 files changed

+271
-284
lines changed

commands/conductor/implement.toml

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ 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?"
38+
2. If a unique match is found, confirm the selection with the user using the `AskUser` tool:
39+
- **header:** "Confirm"
40+
- **question:** "I found track '<track_description>'. Is this correct?"
41+
- **type:** "yesno"
3942
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.
4043
- **If no track name was provided (or if the previous step failed):**
4144
1. **Identify Next Track:** Find the first track in the parsed tracks file that is NOT marked as `[x] Completed`.
@@ -99,31 +102,25 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
99102
a. **Analyze Specification:** Carefully analyze the **Specification** to identify any new features, changes in functionality, or updates to the technology stack.
100103
b. **Update Product Definition:**
101104
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:
103-
> "Based on the completed track, I propose the following updates to the **Product Definition**:"
104-
> ```diff
105-
> [Proposed changes here, ideally in a diff format]
106-
> ```
107-
> "Do you approve these changes? (yes/no)"
105+
ii. **Propose and Confirm Changes:** If an update is needed, generate the proposed changes. Then, present them to the user for confirmation using the `AskUser` tool:
106+
- **header:** "Update Doc"
107+
- **question:** "Based on the completed track, I propose the following updates to the **Product Definition**:\n\n```diff\n[Proposed changes here]\n```\n\nDo you approve these changes?"
108+
- **type:** "yesno"
108109
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.
109110
c. **Update Tech Stack:**
110111
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:
112-
> "Based on the completed track, I propose the following updates to the **Tech Stack**:"
113-
> ```diff
114-
> [Proposed changes here, ideally in a diff format]
115-
> ```
116-
> "Do you approve these changes? (yes/no)"
112+
ii. **Propose and Confirm Changes:** If an update is needed, generate the proposed changes. Then, present them to the user for confirmation using the `AskUser` tool:
113+
- **header:** "Update Stack"
114+
- **question:** "Based on the completed track, I propose the following updates to the **Tech Stack**:\n\n```diff\n[Proposed changes here]\n```\n\nDo you approve these changes?"
115+
- **type:** "yesno"
117116
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.
118117
d. **Update Product Guidelines (Strictly Controlled):**
119118
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.
120119
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:
122-
> "WARNING: The completed track suggests a change to the core **Product Guidelines**. This is an unusual step. Please review carefully:"
123-
> ```diff
124-
> [Proposed changes here, ideally in a diff format]
125-
> ```
126-
> "Do you approve these critical changes to the **Product Guidelines**? (yes/no)"
120+
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 `AskUser` tool:
121+
- **header:** "Update Guide"
122+
- **question:** "WARNING: The completed track suggests a change to the core **Product Guidelines**. This is an unusual step. Please review carefully:\n\n```diff\n[Proposed changes here]\n```\n\nDo you approve these critical changes?"
123+
- **type:** "yesno"
127124
iv. **Action:** Only after receiving explicit user confirmation, perform the file edits. Keep a record of whether this file was changed.
128125
129126
6. **Final Report:** Announce the completion of the synchronization process and provide a summary of the actions taken.
@@ -146,31 +143,36 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
146143
147144
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.
148145
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. **Archive:** Move the track's folder to `conductor/archive/` and remove it from the tracks file.
152-
> B. **Delete:** Permanently delete the track's folder and remove it from the tracks file.
153-
> C. **Skip:** Do nothing and leave it in the tracks file.
154-
> Please enter the number of your choice (A, B, or C)."
146+
2. **Ask for User Choice:** You MUST prompt the user with the available options for the completed track using the `AskUser` tool.
147+
- **header:** "Cleanup"
148+
- **question:** "Track '<track_description>' is now complete. What would you like to do?"
149+
- **type:** "choice"
150+
- **multiSelect:** `false`
151+
- **options:**
152+
- Label: "Archive"
153+
- Label: "Delete"
154+
- Label: "Skip"
155155
156156
3. **Handle User Response:**
157-
* **If user chooses "A" (Archive):**
157+
* **If user chooses "Archive":**
158158
i. **Create Archive Directory:** Check for the existence of `conductor/archive/`. If it does not exist, create it.
159159
ii. **Archive Track Folder:** Move the track's folder from its current location (resolved via the **Tracks Directory**) to `conductor/archive/<track_id>`.
160160
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.
161161
iv. **Commit Changes:** Stage the **Tracks Registry** file and `conductor/archive/`. Commit with the message `chore(conductor): Archive track '<track_description>'`.
162162
v. **Announce Success:** Announce: "Track '<track_description>' has been successfully archived."
163-
* **If user chooses "B" (Delete):**
164-
i. **CRITICAL WARNING:** Before proceeding, you MUST ask for a final confirmation due to the irreversible nature of the action.
165-
> "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)"
163+
* **If user chooses "Delete":**
164+
i. **CRITICAL WARNING:** Before proceeding, you MUST ask for a final confirmation using the `AskUser` tool.
165+
- **header:** "Confirm"
166+
- **question:** "WARNING: This will permanently delete the track folder. This action cannot be undone. Are you sure?"
167+
- **type:** "yesno"
166168
ii. **Handle Confirmation:**
167169
- **If 'yes'**:
168170
a. **Delete Track Folder:** Resolve the **Tracks Directory** and permanently delete the track's folder from `<Tracks Directory>/<track_id>`.
169171
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.
170172
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>'`.
171173
d. **Announce Success:** Announce: "Track '<track_description>' has been permanently deleted."
172-
- **If 'no' (or anything else)**:
174+
- **If 'no'**:
173175
a. **Announce Cancellation:** Announce: "Deletion cancelled. The track has not been changed."
174-
* **If user chooses "C" (Skip) or provides any other input:**
176+
* **If user chooses "Skip":**
175177
* Announce: "Okay, the completed track will remain in your tracks file for now."
176178
"""

commands/conductor/newTrack.toml

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
3030
1. **Load Project Context:** Read and understand the content of the project documents (**Product Definition**, **Tech Stack**, etc.) resolved via the **Universal File Resolution Protocol**.
3131
2. **Get Track Description:**
3232
* **If `{{args}}` contains a description:** Use the content of `{{args}}`.
33-
* **If `{{args}}` is empty:** Ask the user:
34-
> "Please provide a brief description of the track (feature, bug fix, chore, etc.) you wish to start."
33+
* **If `{{args}}` is empty:** Ask the user using the `AskUser` tool:
34+
- **Header:** "Description"
35+
- **Type:** "text"
36+
- **Question:** "Please provide a brief description of the track (feature, bug fix, chore, etc.) you wish to start."
37+
- **Placeholder:** "e.g., Implement user authentication"
3538
Await the user's response and use it as the track description.
3639
3. **Infer Track Type:** Analyze the description to determine if it is a "Feature" or "Something Else" (e.g., Bug, Chore, Refactor). Do NOT ask the user to classify it.
3740
@@ -40,48 +43,45 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
4043
1. **State Your Goal:** Announce:
4144
> "I'll now guide you through a series of questions to build a comprehensive specification (`spec.md`) for this track."
4245
43-
2. **Questioning Phase:** Ask a series of questions to gather details for the `spec.md`. Tailor questions based on the track type (Feature or Other).
44-
* **CRITICAL:** You MUST ask these questions sequentially (one by one). Do not ask multiple questions in a single turn. Wait for the user's response after each question.
46+
2. **Questioning Phase:** Ask a series of questions to gather details for the `spec.md` using the `AskUser` tool. You can batch up to 4 related questions in a single tool call to streamline the process. Tailor questions based on the track type (Feature or Other).
47+
* **CRITICAL:** Wait for the user's response after each `AskUser` tool call.
4548
* **General Guidelines:**
4649
* Refer to information in **Product Definition**, **Tech Stack**, etc., to ask context-aware questions.
4750
* Provide a brief explanation and clear examples for each question.
4851
* **Strongly Recommendation:** Whenever possible, present 2-3 plausible options (A, B, C) for the user to choose from.
49-
* **Mandatory:** The last option for every multiple-choice question MUST be "Type your own answer".
5052
51-
* **1. Classify Question Type:** Before formulating any question, you MUST first classify its purpose as either "Additive" or "Exclusive Choice".
52-
* Use **Additive** for brainstorming and defining scope (e.g., users, goals, features, project guidelines). These questions allow for multiple answers.
53-
* Use **Exclusive Choice** for foundational, singular commitments (e.g., selecting a primary technology, a specific workflow rule). These questions require a single answer.
54-
55-
* **2. Formulate the Question:** Based on the classification, you MUST adhere to the following:
56-
* **Strongly Recommended:** Whenever possible, present 2-3 plausible options (A, B, C) for the user to choose from.
57-
* **If Additive:** Formulate an open-ended question that encourages multiple points. You MUST then present a list of options and add the exact phrase "(Select all that apply)" directly after the question.
58-
* **If Exclusive Choice:** Formulate a direct question that guides the user to a single, clear decision. You MUST NOT add "(Select all that apply)".
59-
60-
* **3. Interaction Flow:**
61-
* **CRITICAL:** You MUST ask questions sequentially (one by one). Do not ask multiple questions in a single turn. Wait for the user's response after each question.
62-
* The last option for every multiple-choice question MUST be "Type your own answer".
63-
* Confirm your understanding by summarizing before moving on to the next question or section..
53+
* **1. Formulate the `AskUser` tool call:** Adhere to the following for each question in the `questions` array:
54+
- **header:** Very short label (max 12 chars).
55+
- **type:** "choice", "text", or "yesno".
56+
- **multiSelect:** (Required for type: "choice") Set to `true` for multi-select (additive) or `false` for single-choice (exclusive).
57+
- **options:** (Required for type: "choice") Provide 2-4 options. Note that "Other" is automatically added.
58+
- **placeholder:** (For type: "text") Provide a hint.
59+
60+
* **2. Interaction Flow:**
61+
* Wait for the user's response after each `AskUser` tool call.
62+
* If the user selects "Other", use a subsequent `AskUser` tool call with `type: "text"` to get their input if necessary.
63+
* Confirm your understanding by summarizing before moving on to drafting.
6464
6565
* **If FEATURE:**
66-
* **Ask 3-5 relevant questions** to clarify the feature request.
66+
* Ask 3-5 relevant questions to clarify the feature request using the `AskUser` tool.
6767
* Examples include clarifying questions about the feature, how it should be implemented, interactions, inputs/outputs, etc.
6868
* Tailor the questions to the specific feature request (e.g., if the user didn't specify the UI, ask about it; if they didn't specify the logic, ask about it).
6969
7070
* **If SOMETHING ELSE (Bug, Chore, etc.):**
71-
* **Ask 2-3 relevant questions** to obtain necessary details.
71+
* Ask 2-3 relevant questions to obtain necessary details using the `AskUser` tool.
7272
* Examples include reproduction steps for bugs, specific scope for chores, or success criteria.
7373
* Tailor the questions to the specific request.
7474
7575
3. **Draft `spec.md`:** Once sufficient information is gathered, draft the content for the track's `spec.md` file, including sections like Overview, Functional Requirements, Non-Functional Requirements (if any), Acceptance Criteria, and Out of Scope.
7676
77-
4. **User Confirmation:** Present the drafted `spec.md` content to the user for review and approval.
78-
> "I've drafted the specification for this track. Please review the following:"
79-
>
80-
> ```markdown
81-
> [Drafted spec.md content here]
82-
> ```
83-
>
84-
> "Does this accurately capture the requirements? Please suggest any changes or confirm."
77+
4. **User Confirmation:** Present the drafted `spec.md` content and ask for approval using the `AskUser` tool.
78+
- **header:** "Confirm Spec"
79+
- **question:** "I've drafted the specification for this track. Please review the following:\n\n```markdown\n[Drafted spec.md content here]\n```\n\nDoes this accurately capture the requirements?"
80+
- **type:** "choice"
81+
- **multiSelect:** `false`
82+
- **options:**
83+
- Label: "Approve"
84+
- Label: "Revise"
8585
Await user feedback and revise the `spec.md` content until confirmed.
8686
8787
### 2.3 Interactive Plan Generation (`plan.md`)
@@ -99,14 +99,14 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
9999
- Sub-task: ` - [ ] ...`
100100
* **CRITICAL: Inject Phase Completion Tasks.** Determine if a "Phase Completion Verification and Checkpointing Protocol" is defined in the **Workflow**. If this protocol exists, then for each **Phase** that you generate in `plan.md`, you MUST append a final meta-task to that phase. The format for this meta-task is: `- [ ] Task: Conductor - User Manual Verification '<Phase Name>' (Protocol in workflow.md)`.
101101
102-
3. **User Confirmation:** Present the drafted `plan.md` to the user for review and approval.
103-
> "I've drafted the implementation plan. Please review the following:"
104-
>
105-
> ```markdown
106-
> [Drafted plan.md content here]
107-
> ```
108-
>
109-
> "Does this plan look correct and cover all the necessary steps based on the spec and our workflow? Please suggest any changes or confirm."
102+
3. **User Confirmation:** Present the drafted `plan.md` content and ask for approval using the `AskUser` tool.
103+
- **header:** "Confirm Plan"
104+
- **question:** "I've drafted the implementation plan. Please review the following:\n\n```markdown\n[Drafted plan.md content here]\n```\n\nDoes this look correct based on the spec and workflow?"
105+
- **type:** "choice"
106+
- **multiSelect:** `false`
107+
- **options:**
108+
- Label: "Approve"
109+
- Label: "Revise"
110110
Await user feedback and revise the `plan.md` content until confirmed.
111111
112112
### 2.4 Create Track Artifacts and Update Main Plan

0 commit comments

Comments
 (0)