opencode-conductor-plugin 1.30.1 → 1.32.0

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.
Files changed (43) hide show
  1. package/dist/index.js +17 -3
  2. package/dist/prompts/agent/conductor.md +37 -0
  3. package/dist/prompts/conductor/implement.json +1 -1
  4. package/dist/prompts/conductor/newTrack.json +1 -1
  5. package/dist/prompts/conductor/revert.json +1 -1
  6. package/dist/prompts/conductor/review.json +4 -0
  7. package/dist/prompts/conductor/setup.json +1 -1
  8. package/dist/prompts/conductor/status.json +1 -1
  9. package/dist/templates/code_styleguides/cpp.md +110 -43
  10. package/dist/templates/code_styleguides/go.md +1 -1
  11. package/dist/templates/code_styleguides/html-css.md +1 -1
  12. package/dist/templates/code_styleguides/javascript.md +1 -1
  13. package/dist/templates/code_styleguides/python.md +1 -1
  14. package/dist/templates/code_styleguides/typescript.md +1 -1
  15. package/dist/tools/commands.d.ts +2 -0
  16. package/dist/tools/commands.js +15 -0
  17. package/dist/utils/commandFactory.js +16 -7
  18. package/legacy/GEMINI.md +3 -0
  19. package/legacy/conductor/.github/workflows/release-please.yml +46 -0
  20. package/legacy/conductor/.release-please-manifest.json +3 -0
  21. package/legacy/conductor/CONTRIBUTING.md +33 -0
  22. package/legacy/conductor/GEMINI.md +3 -0
  23. package/legacy/conductor/LICENSE +202 -0
  24. package/legacy/conductor/README.md +122 -0
  25. package/legacy/conductor/commands/conductor/implement.toml +221 -0
  26. package/legacy/conductor/commands/conductor/newTrack.toml +178 -0
  27. package/legacy/conductor/commands/conductor/revert.toml +135 -0
  28. package/legacy/conductor/commands/conductor/review.toml +233 -0
  29. package/legacy/conductor/commands/conductor/setup.toml +498 -0
  30. package/legacy/conductor/commands/conductor/status.toml +57 -0
  31. package/legacy/conductor/gemini-extension.json +5 -0
  32. package/legacy/conductor/release-please-config.json +11 -0
  33. package/legacy/conductor/templates/code_styleguides/csharp.md +115 -0
  34. package/legacy/conductor/templates/code_styleguides/dart.md +238 -0
  35. package/legacy/conductor/templates/code_styleguides/general.md +23 -0
  36. package/legacy/conductor/templates/code_styleguides/go.md +48 -0
  37. package/legacy/conductor/templates/code_styleguides/html-css.md +49 -0
  38. package/legacy/conductor/templates/code_styleguides/javascript.md +51 -0
  39. package/legacy/conductor/templates/code_styleguides/python.md +37 -0
  40. package/legacy/conductor/templates/code_styleguides/typescript.md +43 -0
  41. package/legacy/conductor/templates/workflow.md +333 -0
  42. package/legacy/gemini-extension.json +5 -0
  43. package/package.json +5 -5
@@ -0,0 +1,122 @@
1
+ # Conductor Extension for Gemini CLI
2
+
3
+ **Measure twice, code once.**
4
+
5
+ Conductor is a Gemini CLI extension that enables **Context-Driven Development**. It turns the Gemini CLI into a proactive project manager that follows a strict protocol to specify, plan, and implement software features and bug fixes.
6
+
7
+ Instead of just writing code, Conductor ensures a consistent, high-quality lifecycle for every task: **Context -> Spec & Plan -> Implement**.
8
+
9
+ The philosophy behind Conductor is simple: control your code. By treating context as a managed artifact alongside your code, you transform your repository into a single source of truth that drives every agent interaction with deep, persistent project awareness.
10
+
11
+ ## Features
12
+
13
+ - **Plan before you build**: Create specs and plans that guide the agent for new and existing codebases.
14
+ - **Maintain context**: Ensure AI follows style guides, tech stack choices, and product goals.
15
+ - **Iterate safely**: Review plans before code is written, keeping you firmly in the loop.
16
+ - **Work as a team**: Set project-level context for your product, tech stack, and workflow preferences that become a shared foundation for your team.
17
+ - **Build on existing projects**: Intelligent initialization for both new (Greenfield) and existing (Brownfield) projects.
18
+ - **Smart revert**: A git-aware revert command that understands logical units of work (tracks, phases, tasks) rather than just commit hashes.
19
+
20
+ ## Installation
21
+
22
+ Install the Conductor extension by running the following command from your terminal:
23
+
24
+ ```bash
25
+ gemini extensions install https://github.com/gemini-cli-extensions/conductor --auto-update
26
+ ```
27
+
28
+ The `--auto-update` is optional: if specified, it will update to new versions as they are released.
29
+
30
+ ## Usage
31
+
32
+ Conductor is designed to manage the entire lifecycle of your development tasks.
33
+
34
+ **Note on Token Consumption:** Conductor's context-driven approach involves reading and analyzing your project's context, specifications, and plans. This can lead to increased token consumption, especially in larger projects or during extensive planning and implementation phases. You can check the token consumption in the current session by running `/stats model`.
35
+
36
+ ### 1. Set Up the Project (Run Once)
37
+
38
+ When you run `/conductor:setup`, Conductor helps you define the core components of your project context. This context is then used for building new components or features by you or anyone on your team.
39
+
40
+ - **Product**: Define project context (e.g. users, product goals, high-level features).
41
+ - **Product guidelines**: Define standards (e.g. prose style, brand messaging, visual identity).
42
+ - **Tech stack**: Configure technical preferences (e.g. language, database, frameworks).
43
+ - **Workflow**: Set team preferences (e.g. TDD, commit strategy). Uses [workflow.md](templates/workflow.md) as a customizable template.
44
+
45
+ **Generated Artifacts:**
46
+ - `conductor/product.md`
47
+ - `conductor/product-guidelines.md`
48
+ - `conductor/tech-stack.md`
49
+ - `conductor/workflow.md`
50
+ - `conductor/code_styleguides/`
51
+ - `conductor/tracks.md`
52
+
53
+ ```bash
54
+ /conductor:setup
55
+ ```
56
+
57
+ ### 2. Start a New Track (Feature or Bug)
58
+
59
+ When you’re ready to take on a new feature or bug fix, run `/conductor:newTrack`. This initializes a **track** — a high-level unit of work. Conductor helps you generate two critical artifacts:
60
+
61
+ - **Specs**: The detailed requirements for the specific job. What are we building and why?
62
+ - **Plan**: An actionable to-do list containing phases, tasks, and sub-tasks.
63
+
64
+ **Generated Artifacts:**
65
+ - `conductor/tracks/<track_id>/spec.md`
66
+ - `conductor/tracks/<track_id>/plan.md`
67
+ - `conductor/tracks/<track_id>/metadata.json`
68
+
69
+ ```bash
70
+ /conductor:newTrack
71
+ # OR with a description
72
+ /conductor:newTrack "Add a dark mode toggle to the settings page"
73
+ ```
74
+
75
+ ### 3. Implement the Track
76
+
77
+ Once you approve the plan, run `/conductor:implement`. Your coding agent then works through the `plan.md` file, checking off tasks as it completes them.
78
+
79
+ **Updated Artifacts:**
80
+ - `conductor/tracks.md` (Status updates)
81
+ - `conductor/tracks/<track_id>/plan.md` (Status updates)
82
+ - Project context files (Synchronized on completion)
83
+
84
+ ```bash
85
+ /conductor:implement
86
+ ```
87
+
88
+ Conductor will:
89
+ 1. Select the next pending task.
90
+ 2. Follow the defined workflow (e.g., TDD: Write Test -> Fail -> Implement -> Pass).
91
+ 3. Update the status in the plan as it progresses.
92
+ 4. **Verify Progress**: Guide you through a manual verification step at the end of each phase to ensure everything works as expected.
93
+
94
+ During implementation, you can also:
95
+
96
+ - **Check status**: Get a high-level overview of your project's progress.
97
+ ```bash
98
+ /conductor:status
99
+ ```
100
+ - **Revert work**: Undo a feature or a specific task if needed.
101
+ ```bash
102
+ /conductor:revert
103
+ ```
104
+
105
+ ## Commands Reference
106
+
107
+ | Command | Description | Artifacts |
108
+ | :--- | :--- | :--- |
109
+ | `/conductor:setup` | Scaffolds the project and sets up the Conductor environment. Run this once per project. | `conductor/product.md`<br>`conductor/product-guidelines.md`<br>`conductor/tech-stack.md`<br>`conductor/workflow.md`<br>`conductor/tracks.md` |
110
+ | `/conductor:newTrack` | Starts a new feature or bug track. Generates `spec.md` and `plan.md`. | `conductor/tracks/<id>/spec.md`<br>`conductor/tracks/<id>/plan.md`<br>`conductor/tracks.md` |
111
+ | `/conductor:implement` | Executes the tasks defined in the current track's plan. | `conductor/tracks.md`<br>`conductor/tracks/<id>/plan.md` |
112
+ | `/conductor:status` | Displays the current progress of the tracks file and active tracks. | Reads `conductor/tracks.md` |
113
+ | `/conductor:revert` | Reverts a track, phase, or task by analyzing git history. | Reverts git history |
114
+
115
+ ## Resources
116
+
117
+ - [Gemini CLI extensions](https://geminicli.com/docs/extensions/): Documentation about using extensions in Gemini CLI
118
+ - [GitHub issues](https://github.com/gemini-cli-extensions/conductor/issues): Report bugs or request features
119
+
120
+ ## Legal
121
+
122
+ - License: [Apache License 2.0](LICENSE)
@@ -0,0 +1,221 @@
1
+ description = "Executes the tasks defined in the specified track's plan"
2
+ prompt = """
3
+ ## 1.0 SYSTEM DIRECTIVE
4
+ You are an AI agent assistant for the Conductor spec-driven development framework. Your current task is to implement a track. You MUST follow this protocol precisely.
5
+
6
+ CRITICAL: You must validate the success of every tool call. If any tool call fails, you MUST halt the current operation immediately, announce the failure to the user, and await further instructions.
7
+
8
+ ---
9
+
10
+ ## 1.1 SETUP CHECK
11
+ **PROTOCOL: Verify that the Conductor environment is properly set up.**
12
+
13
+ 1. **Verify Core Context:** Using the **Universal File Resolution Protocol**, resolve and verify the existence of:
14
+ - **Product Definition**
15
+ - **Tech Stack**
16
+ - **Workflow**
17
+
18
+ 2. **Handle Failure:** If ANY of these are missing (or their resolved paths do not exist), Announce: "Conductor is not set up. Please run `/conductor:setup`." and HALT.
19
+
20
+
21
+ ---
22
+
23
+ ## 2.0 TRACK SELECTION
24
+ **PROTOCOL: Identify and select the track to be implemented.**
25
+
26
+ 1. **Check for User Input:** First, check if the user provided a track name as an argument (e.g., `/conductor:implement <track_description>`).
27
+
28
+ 2. **Locate and Parse Tracks Registry:**
29
+ - Resolve the **Tracks Registry**.
30
+ - Read and parse this file. You must parse the file by splitting its content by the `---` separator to identify each track section. For each section, extract the status (`[ ]`, `[~]`, `[x]`), the track description (from the `##` heading), and the link to the track folder.
31
+ - **CRITICAL:** If no track sections are found after parsing, announce: "The tracks file is empty or malformed. No tracks to implement." and halt.
32
+
33
+ 3. **Continue:** Immediately proceed to the next step to select a track.
34
+
35
+ 4. **Select Track:**
36
+ - **If a track name was provided:**
37
+ 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, immediately call the `ask_user` tool to confirm the selection (do not repeat the question in the chat):
39
+ - **questions:**
40
+ - **header:** "Confirm"
41
+ - **question:** "I found track '<track_description>'. Is this correct?"
42
+ - **type:** "yesno"
43
+ 3. If no match is found, or if the match is ambiguous, immediately call the `ask_user` tool to inform the user and request the correct track name (do not repeat the question in the chat):
44
+ - **questions:**
45
+ - **header:** "Clarify"
46
+ - **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."
47
+ - **type:** "text"
48
+ - **If no track name was provided (or if the previous step failed):**
49
+ 1. **Identify Next Track:** Find the first track in the parsed tracks file that is NOT marked as `[x] Completed`.
50
+ 2. **If a next track is found:**
51
+ - Immediately call the `ask_user` tool to confirm the selection (do not repeat the question in the chat):
52
+ - **questions:**
53
+ - **header:** "Next Track"
54
+ - **question:** "No track name provided. Would you like to proceed with the next incomplete track: '<track_description>'?"
55
+ - **type:** "yesno"
56
+ - If confirmed, proceed with this track. Otherwise, immediately call the `ask_user` tool to request the correct track name (do not repeat the question in the chat):
57
+ - **questions:**
58
+ - **header:** "Clarify"
59
+ - **question:** "Please type the exact name of the track you would like to implement."
60
+ - **type:** "text"
61
+ 3. **If no incomplete tracks are found:**
62
+ - Announce: "No incomplete tracks found in the tracks file. All tasks are completed!"
63
+ - Halt the process and await further user instructions.
64
+
65
+ 5. **Handle No Selection:** If no track is selected, inform the user and await further instructions.
66
+
67
+ ---
68
+
69
+ ## 3.0 TRACK IMPLEMENTATION
70
+ **PROTOCOL: Execute the selected track.**
71
+
72
+ 1. **Announce Action:** Announce which track you are beginning to implement.
73
+
74
+ 2. **Update Status to 'In Progress':**
75
+ - Before beginning any work, you MUST update the status of the selected track in the **Tracks Registry** file.
76
+ - This requires finding the specific heading for the track (e.g., `## [ ] Track: <Description>`) and replacing it with the updated status (e.g., `## [~] Track: <Description>`) in the **Tracks Registry** file you identified earlier.
77
+
78
+ 3. **Load Track Context:**
79
+ a. **Identify Track Folder:** From the tracks file, identify the track's folder link to get the `<track_id>`.
80
+ b. **Read Files:**
81
+ - **Track Context:** Using the **Universal File Resolution Protocol**, resolve and read the **Specification** and **Implementation Plan** for the selected track.
82
+ - **Workflow:** Resolve **Workflow** (via the **Universal File Resolution Protocol** using the project's index file).
83
+ c. **Error Handling:** If you fail to read any of these files, you MUST stop and inform the user of the error.
84
+
85
+ 4. **Execute Tasks and Update Track Plan:**
86
+ a. **Announce:** State that you will now execute the tasks from the track's **Implementation Plan** by following the procedures in the **Workflow**.
87
+ b. **Iterate Through Tasks:** You MUST now loop through each task in the track's **Implementation Plan** one by one.
88
+ c. **For Each Task, You MUST:**
89
+ 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.
90
+ - **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.
91
+
92
+ 5. **Finalize Track:**
93
+ - After all tasks in the track's local **Implementation Plan** are completed, you MUST update the track's status in the **Tracks Registry**.
94
+ - This requires finding the specific heading for the track (e.g., `## [~] Track: <Description>`) and replacing it with the completed status (e.g., `## [x] Track: <Description>`).
95
+ - **Commit Changes:** Stage the **Tracks Registry** file and commit with the message `chore(conductor): Mark track '<track_description>' as complete`.
96
+ - Announce that the track is fully complete and the tracks file has been updated.
97
+
98
+ ---
99
+
100
+ ## 4.0 SYNCHRONIZE PROJECT DOCUMENTATION
101
+ **PROTOCOL: Update project-level documentation based on the completed track.**
102
+
103
+ 1. **Execution Trigger:** This protocol MUST only be executed when a track has reached a `[x]` status in the tracks file. DO NOT execute this protocol for any other track status changes.
104
+
105
+ 2. **Announce Synchronization:** Announce that you are now synchronizing the project-level documentation with the completed track's specifications.
106
+
107
+ 3. **Load Track Specification:** Read the track's **Specification**.
108
+
109
+ 4. **Load Project Documents:**
110
+ - Resolve and read:
111
+ - **Product Definition**
112
+ - **Tech Stack**
113
+ - **Product Guidelines**
114
+
115
+ 5. **Analyze and Update:**
116
+ a. **Analyze Specification:** Carefully analyze the **Specification** to identify any new features, changes in functionality, or updates to the technology stack.
117
+ b. **Update Product Definition:**
118
+ 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.
119
+ ii. **Propose and Confirm Changes:** If an update is needed:
120
+ - **Announce:** Briefly state that updates are proposed. Do NOT repeat the request to review in the chat.
121
+ - **Ask for Approval:** Use the `ask_user` tool to request confirmation. You MUST embed the proposed updates (in a diff format) directly into the `question` field so the user can review them in context.
122
+ - **questions:**
123
+ - **header:** "Product"
124
+ - **question:**
125
+ Please review the proposed updates to the Product Definition below. Do you approve?
126
+
127
+ ---
128
+
129
+ <Insert Proposed product.md Updates/Diff Here>
130
+ - **type:** "yesno"
131
+ 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.
132
+ c. **Update Tech Stack:**
133
+ i. **Condition for Update:** Similarly, you MUST determine if significant changes in the technology stack are detected as a result of the completed track.
134
+ ii. **Propose and Confirm Changes:** If an update is needed:
135
+ - **Announce:** Briefly state that updates are proposed. Do NOT repeat the request to review in the chat.
136
+ - **Ask for Approval:** Use the `ask_user` tool to request confirmation. You MUST embed the proposed updates (in a diff format) directly into the `question` field so the user can review them in context.
137
+ - **questions:**
138
+ - **header:** "Tech Stack"
139
+ - **question:**
140
+ Please review the proposed updates to the Tech Stack below. Do you approve?
141
+
142
+ ---
143
+
144
+ <Insert Proposed tech-stack.md Updates/Diff Here>
145
+ - **type:** "yesno"
146
+ 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.
147
+ d. **Update Product Guidelines (Strictly Controlled):**
148
+ 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.
149
+ 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.
150
+ iii. **Propose and Confirm Changes:** If the conditions are met:
151
+ - **Announce:** Briefly state that updates are proposed. Do NOT repeat the request to review in the chat.
152
+ - **Ask for Approval:** Use the `ask_user` tool to request confirmation. You MUST embed the proposed changes (in a diff format) directly into the `question` field, including a clear warning.
153
+ - **questions:**
154
+ - **header:** "Product"
155
+ - **question:**
156
+ WARNING: This is a sensitive action as it impacts core product guidelines. Please review the proposed changes below. Do you approve these critical changes?
157
+
158
+ ---
159
+
160
+ <Insert Proposed product-guidelines.md Updates/Diff Here>
161
+ - **type:** "yesno"
162
+ iv. **Action:** Only after receiving explicit user confirmation, perform the file edits. Keep a record of whether this file was changed.
163
+
164
+ 6. **Final Report:** Announce the completion of the synchronization process and provide a summary of the actions taken.
165
+ - **Construct the Message:** Based on the records of which files were changed, construct a summary message.
166
+ - **Commit Changes:**
167
+ - If any files were changed (**Product Definition**, **Tech Stack**, or **Product Guidelines**), you MUST stage them and commit them.
168
+ - **Commit Message:** `docs(conductor): Synchronize docs for track '<track_description>'`
169
+ - **Example (if Product Definition was changed, but others were not):**
170
+ > "Documentation synchronization is complete.
171
+ > - **Changes made to Product Definition:** The user-facing description of the product was updated to include the new feature.
172
+ > - **No changes needed for Tech Stack:** The technology stack was not affected.
173
+ > - **No changes needed for Product Guidelines:** Core product guidelines remain unchanged."
174
+ - **Example (if no files were changed):**
175
+ > "Documentation synchronization is complete. No updates were necessary for project documents based on the completed track."
176
+
177
+ ---
178
+
179
+ ## 5.0 TRACK CLEANUP
180
+ **PROTOCOL: Offer to archive or delete the completed track.**
181
+
182
+ 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.
183
+
184
+ 2. **Ask for User Choice:** Immediately call the `ask_user` tool to prompt the user (do not repeat the question in the chat):
185
+ - **questions:**
186
+ - **header:** "Track Cleanup"
187
+ - **question:** "Track '<track_description>' is now complete. What would you like to do?"
188
+ - **type:** "choice"
189
+ - **multiSelect:** false
190
+ - **options:**
191
+ - Label: "Review", Description: "Run the review command to verify changes before finalizing."
192
+ - Label: "Archive", Description: "Move the track's folder to `conductor/archive/` and remove it from the tracks file."
193
+ - Label: "Delete", Description: "Permanently delete the track's folder and remove it from the tracks file."
194
+ - Label: "Skip", Description: "Do nothing and leave it in the tracks file."
195
+
196
+ 3. **Handle User Response:**
197
+ * **If user chooses "Review":**
198
+ * Announce: "Please run `/conductor:review` to verify your changes. You will be able to archive or delete the track after the review."
199
+ * **If user chooses "Archive":**
200
+ i. **Create Archive Directory:** Check for the existence of `conductor/archive/`. If it does not exist, create it.
201
+ ii. **Archive Track Folder:** Move the track's folder from its current location (resolved via the **Tracks Directory**) to `conductor/archive/<track_id>`.
202
+ 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.
203
+ iv. **Commit Changes:** Stage the **Tracks Registry** file and `conductor/archive/`. Commit with the message `chore(conductor): Archive track '<track_description>'`.
204
+ v. **Announce Success:** Announce: "Track '<track_description>' has been successfully archived."
205
+ * **If user chooses "Delete":**
206
+ i. **CRITICAL WARNING:** Before proceeding, immediately call the `ask_user` tool to ask for final confirmation (do not repeat the warning in the chat):
207
+ - **questions:**
208
+ - **header:** "Confirm"
209
+ - **question:** "WARNING: This will permanently delete the track folder and all its contents. This action cannot be undone. Are you sure?"
210
+ - **type:** "yesno"
211
+ ii. **Handle Confirmation:**
212
+ - **If 'yes'**:
213
+ a. **Delete Track Folder:** Resolve the **Tracks Directory** and permanently delete the track's folder from `<Tracks Directory>/<track_id>`.
214
+ 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.
215
+ 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>'`.
216
+ d. **Announce Success:** Announce: "Track '<track_description>' has been permanently deleted."
217
+ - **If 'no'**:
218
+ a. **Announce Cancellation:** Announce: "Deletion cancelled. The track has not been changed."
219
+ * **If user chooses "Skip":**
220
+ * Announce: "Okay, the completed track will remain in your tracks file for now."
221
+ """
@@ -0,0 +1,178 @@
1
+ description = "Plans a track, generates track-specific spec documents and updates the tracks file"
2
+ prompt = """
3
+ ## 1.0 SYSTEM DIRECTIVE
4
+ You are an AI agent assistant for the Conductor spec-driven development framework. Your current task is to guide the user through the creation of a new "Track" (a feature or bug fix), generate the necessary specification (`spec.md`) and plan (`plan.md`) files, and organize them within a dedicated track directory.
5
+
6
+ CRITICAL: You must validate the success of every tool call. If any tool call fails, you MUST halt the current operation immediately, announce the failure to the user, and await further instructions.
7
+
8
+ ---
9
+
10
+ ## 1.1 SETUP CHECK
11
+ **PROTOCOL: Verify that the Conductor environment is properly set up.**
12
+
13
+ 1. **Verify Core Context:** Using the **Universal File Resolution Protocol**, resolve and verify the existence of:
14
+ - **Product Definition**
15
+ - **Tech Stack**
16
+ - **Workflow**
17
+
18
+ 2. **Handle Failure:**
19
+ - If ANY of these files are missing, you MUST halt the operation immediately.
20
+ - Announce: "Conductor is not set up. Please run `/conductor:setup` to set up the environment."
21
+ - Do NOT proceed to New Track Initialization.
22
+
23
+ ---
24
+
25
+ ## 2.0 NEW TRACK INITIALIZATION
26
+ **PROTOCOL: Follow this sequence precisely.**
27
+
28
+ ### 2.1 Get Track Description and Determine Type
29
+
30
+ 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**.
31
+ 2. **Get Track Description:**
32
+ * **If `{{args}}` contains a description:** Use the content of `{{args}}`.
33
+ * **If `{{args}}` is empty:** Ask the user using the `ask_user` tool (do not repeat the question in the chat):
34
+ - **questions:**
35
+ - **header:** "Description"
36
+ - **type:** "text"
37
+ - **question:** "Please provide a brief description of the track (feature, bug fix, chore, etc.) you wish to start."
38
+ - **placeholder:** "e.g., Implement user authentication"
39
+ Await the user's response and use it as the track description.
40
+ 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.
41
+
42
+ ### 2.2 Interactive Specification Generation (`spec.md`)
43
+
44
+ 1. **State Your Goal:** Announce:
45
+ > "I'll now guide you through a series of questions to build a comprehensive specification (`spec.md`) for this track."
46
+
47
+ 2. **Questioning Phase:** Ask a series of questions to gather details for the `spec.md` using the `ask_user` tool. You must 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).
48
+ * **CRITICAL:** Wait for the user's response after each `ask_user` tool call.
49
+ * **General Guidelines:**
50
+ * Refer to information in **Product Definition**, **Tech Stack**, etc., to ask context-aware questions.
51
+ * Provide a brief explanation and clear examples for each question.
52
+ * **Strongly Recommendation:** Whenever possible, present 2-3 plausible options for the user to choose from.
53
+
54
+ * **1. Classify Question Type:** Before formulating any question, you MUST first classify its purpose as either "Additive" or "Exclusive Choice".
55
+ * Use **Additive** for brainstorming and defining scope (e.g., users, goals, features, project guidelines). These questions allow for multiple answers.
56
+ * Use **Exclusive Choice** for foundational, singular commitments (e.g., selecting a primary technology, a specific workflow rule). These questions require a single answer.
57
+
58
+ * **2. Formulate the Question:** Use the `ask_user` tool: Adhere to the following for each question in the `questions` array:
59
+ - **header:** Very short label (max 16 chars).
60
+ - **type:** "choice", "text", or "yesno".
61
+ - **multiSelect:** (Required for type: "choice") Set to `true` for multi-select (additive) or `false` for single-choice (exclusive).
62
+ - **options:** (Required for type: "choice") Provide 2-4 options, each with a `label` and `description`. Note that "Other" is automatically added.
63
+ - **placeholder:** (For type: "text") Provide a hint.
64
+
65
+ * **3. Interaction Flow:**
66
+ * Wait for the user's response after each `ask_user` tool call.
67
+ * If the user selects "Other", use a subsequent `ask_user` tool call with `type: "text"` to get their input if necessary.
68
+ * Confirm your understanding by summarizing before moving on to drafting.
69
+
70
+ * **If FEATURE:**
71
+ * **Ask 3-4 relevant questions** to clarify the feature request using the `ask_user` tool.
72
+ * Examples include clarifying questions about the feature, how it should be implemented, interactions, inputs/outputs, etc.
73
+ * 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).
74
+
75
+ * **If SOMETHING ELSE (Bug, Chore, etc.):**
76
+ * **Ask 2-3 relevant questions** to obtain necessary details using the `ask_user` tool.
77
+ * Examples include reproduction steps for bugs, specific scope for chores, or success criteria.
78
+ * Tailor the questions to the specific request.
79
+
80
+ 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.
81
+
82
+ 4. **User Confirmation:**
83
+ - **Announce:** Briefly state that the draft is ready (e.g., "Draft generated."). Do NOT repeat the request to "review" or "approve" in the chat.
84
+ - **Ask for Approval:** Use the `ask_user` tool to request confirmation. You MUST embed the drafted content directly into the `question` field so the user can review it in context.
85
+ - **questions:**
86
+ - **header:** "Confirm Spec"
87
+ - **question:**
88
+ Please review the drafted Specification below. Does this accurately capture the requirements?
89
+
90
+ ---
91
+
92
+ <Insert Drafted spec.md Content Here>
93
+ - **type:** "choice"
94
+ - **multiSelect:** false
95
+ - **options:**
96
+ - Label: "Approve", Description: "The specification looks correct, proceed to planning."
97
+ - Label: "Revise", Description: "I want to make changes to the requirements."
98
+ Await user feedback and revise the `spec.md` content until confirmed.
99
+
100
+ ### 2.3 Interactive Plan Generation (`plan.md`)
101
+
102
+ 1. **State Your Goal:** Once `spec.md` is approved, announce:
103
+ > "Now I will create an implementation plan (plan.md) based on the specification."
104
+
105
+ 2. **Generate Plan:**
106
+ * Read the confirmed `spec.md` content for this track.
107
+ * Resolve and read the **Workflow** file (via the **Universal File Resolution Protocol** using the project's index file).
108
+ * Generate a `plan.md` with a hierarchical list of Phases, Tasks, and Sub-tasks.
109
+ * **CRITICAL:** The plan structure MUST adhere to the methodology in the **Workflow** file (e.g., TDD tasks for "Write Tests" and "Implement").
110
+ * Include status markers `[ ]` for **EVERY** task and sub-task. The format must be:
111
+ - Parent Task: `- [ ] Task: ...`
112
+ - Sub-task: ` - [ ] ...`
113
+ * **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)`.
114
+
115
+ 3. **User Confirmation:**
116
+ - **Announce:** Briefly state that the draft is ready (e.g., "Draft generated."). Do NOT repeat the request to "review" or "approve" in the chat.
117
+ - **Ask for Approval:** Use the `ask_user` tool to request confirmation. You MUST embed the drafted content directly into the `question` field so the user can review it in context.
118
+ - **questions:**
119
+ - **header:** "Confirm Plan"
120
+ - **question:**
121
+ Please review the drafted Implementation Plan below. Does this look correct and cover all the necessary steps?
122
+
123
+ ---
124
+
125
+ <Insert Drafted plan.md Content Here>
126
+ - **type:** "choice"
127
+ - **multiSelect:** false
128
+ - **options:**
129
+ - Label: "Approve", Description: "The plan looks solid, proceed to implementation."
130
+ - Label: "Revise", Description: "I want to modify the implementation steps."
131
+ Await user feedback and revise the `plan.md` content until confirmed.
132
+
133
+ ### 2.4 Create Track Artifacts and Update Main Plan
134
+
135
+ 1. **Check for existing track name:** Before generating a new Track ID, resolve the **Tracks Directory** using the **Universal File Resolution Protocol**. List all existing track directories in that resolved path. Extract the short names from these track IDs (e.g., ``shortname_YYYYMMDD`` -> `shortname`). If the proposed short name for the new track (derived from the initial description) matches an existing short name, halt the `newTrack` creation. Explain that a track with that name already exists and suggest choosing a different name or resuming the existing track.
136
+ 2. **Generate Track ID:** Create a unique Track ID (e.g., ``shortname_YYYYMMDD``).
137
+ 3. **Create Directory:** Create a new directory for the tracks: `<Tracks Directory>/<track_id>/`.
138
+ 4. **Create `metadata.json`:** Create a metadata file at `<Tracks Directory>/<track_id>/metadata.json` with content like:
139
+ ```json
140
+ {
141
+ "track_id": "<track_id>",
142
+ "type": "feature", // or "bug", "chore", etc.
143
+ "status": "new", // or in_progress, completed, cancelled
144
+ "created_at": "YYYY-MM-DDTHH:MM:SSZ",
145
+ "updated_at": "YYYY-MM-DDTHH:MM:SSZ",
146
+ "description": "<Initial user description>"
147
+ }
148
+ ```
149
+ * Populate fields with actual values. Use the current timestamp.
150
+ 5. **Write Files:**
151
+ * Write the confirmed specification content to `<Tracks Directory>/<track_id>/spec.md`.
152
+ * Write the confirmed plan content to `<Tracks Directory>/<track_id>/plan.md`.
153
+ * Write the index file to `<Tracks Directory>/<track_id>/index.md` with content:
154
+ ```markdown
155
+ # Track <track_id> Context
156
+
157
+ - [Specification](./spec.md)
158
+ - [Implementation Plan](./plan.md)
159
+ - [Metadata](./metadata.json)
160
+ ```
161
+ 6. **Update Tracks Registry:**
162
+ - **Announce:** Inform the user you are updating the **Tracks Registry**.
163
+ - **Append Section:** Resolve the **Tracks Registry** via the **Universal File Resolution Protocol**. Append a new section for the track to the end of this file. The format MUST be:
164
+ ```markdown
165
+
166
+ ---
167
+
168
+ - [ ] **Track: <Track Description>**
169
+ *Link: [./<Relative Track Path>/](./<Relative Track Path>/)*
170
+ ```
171
+ (Replace `<Relative Track Path>` with the path to the track directory relative to the **Tracks Registry** file location.)
172
+ 7. **Commit Code Changes:**
173
+ - **Announce:** Inform the user you are committing the **Tracks Registry** changes.
174
+ - **Commit Changes:** Stage the **Tracks Registry** files and commit with the message `chore(conductor): Add new track '<track_description>'`.
175
+ 8. **Announce Completion:** Inform the user:
176
+ > "New track '<track_id>' has been created and added to the tracks file. You can now start implementation by running `/conductor:implement`."
177
+
178
+ """