diff --git a/README.md b/README.md
index 93485498ed..2b1b894d51 100644
--- a/README.md
+++ b/README.md
@@ -22,6 +22,8 @@ Learn all about Gemini CLI in our [documentation](https://geminicli.com/docs/).
context window.
- **đź”§ Built-in tools**: Google Search grounding, file operations, shell
commands, web fetching.
+- **đź“‹ Context-Driven Development**: Built-in [Conductor] extension for
+ spec-driven project management.
- **🔌 Extensible**: MCP (Model Context Protocol) support for custom
integrations.
- **đź’» Terminal-first**: Designed for developers who live in the command line.
@@ -388,6 +390,8 @@ instructions.
---
+[Conductor]: ./docs/cli/conductor.md
+
Built with ❤️ by Google and the open source community
diff --git a/docs/cli/conductor.md b/docs/cli/conductor.md
new file mode 100644
index 0000000000..0336dc4032
--- /dev/null
+++ b/docs/cli/conductor.md
@@ -0,0 +1,144 @@
+# Conductor
+
+**Measure twice, code once.**
+
+Conductor is a built-in methodology for Gemini CLI 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.
+
+Instead of just writing code, Conductor ensures a consistent, high-quality
+lifecycle for every task: **Context -> Spec & Plan -> Implement**.
+
+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.
+
+## Features
+
+- **Plan before you build**: Create specs and plans that guide the agent for new
+ and existing codebases.
+- **Maintain context**: Ensure AI follows style guides, tech stack choices, and
+ product goals.
+- **Iterate safely**: Review plans before code is written, keeping you firmly in
+ the loop.
+- **Work as a team**: Set project-level context for your product, tech stack,
+ and workflow preferences that become a shared foundation for your team.
+- **Build on existing projects**: Intelligent initialization for both new
+ (Greenfield) and existing (Brownfield) projects.
+- **Smart revert**: A git-aware revert command that understands logical units of
+ work (tracks, phases, tasks) rather than just commit hashes.
+
+## Usage
+
+Conductor is designed to manage the entire lifecycle of your development tasks.
+It is one of the [planning workflows](./plan-mode.md#planning-workflows)
+supported by Gemini CLI.
+
+**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`.
+
+### 1. Set Up the Project (Run Once)
+
+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.
+
+- **Product**: Define project context (e.g. users, product goals, high-level
+ features).
+- **Product guidelines**: Define standards (e.g. prose style, brand messaging,
+ visual identity).
+- **Tech stack**: Configure technical preferences (e.g. language, database,
+ frameworks).
+- **Workflow**: Set team preferences (e.g. TDD, commit strategy).
+
+**Generated Artifacts:**
+
+- `conductor/product.md`
+- `conductor/product-guidelines.md`
+- `conductor/tech-stack.md`
+- `conductor/workflow.md`
+- `conductor/code_styleguides/`
+- `conductor/tracks.md`
+
+```bash
+/conductor:setup
+```
+
+### 2. Start a New Track (Feature or Bug)
+
+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:
+
+- **Specs**: The detailed requirements for the specific job. What are we
+ building and why?
+- **Plan**: An actionable to-do list containing phases, tasks, and sub-tasks.
+
+**Generated Artifacts:**
+
+- `conductor/tracks//spec.md`
+- `conductor/tracks//plan.md`
+- `conductor/tracks//metadata.json`
+
+```bash
+/conductor:newTrack
+# OR with a description
+/conductor:newTrack "Add a dark mode toggle to the settings page"
+```
+
+### 3. Implement the Track
+
+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.
+
+**Updated Artifacts:**
+
+- `conductor/tracks.md` (Status updates)
+- `conductor/tracks//plan.md` (Status updates)
+- Project context files (Synchronized on completion)
+
+```bash
+/conductor:implement
+```
+
+Conductor will:
+
+1. Select the next pending task.
+2. Follow the defined workflow (e.g., TDD: Write Test -> Fail -> Implement ->
+ Pass).
+3. Update the status in the plan as it progresses.
+4. **Verify Progress**: Guide you through a manual verification step at the end
+ of each phase to ensure everything works as expected.
+
+During implementation, you can also:
+
+- **Check status**: Get a high-level overview of your project's progress.
+ ```bash
+ /conductor:status
+ ```
+- **Revert work**: Undo a feature or a specific task if needed.
+
+ ```bash
+ /conductor:revert
+ ```
+
+- **Review work**: Review completed work against guidelines and the plan.
+ ```bash
+ /conductor:review
+ ```
+
+## Commands Reference
+
+| Command | Description | Artifacts |
+| :--------------------- | :-------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------- |
+| `/conductor:setup` | Scaffolds the project and sets up the Conductor environment. Run this once per project. | `conductor/product.md` `conductor/product-guidelines.md` `conductor/tech-stack.md` `conductor/workflow.md` `conductor/tracks.md` |
+| `/conductor:newTrack` | Starts a new feature or bug track. Generates `spec.md` and `plan.md`. | `conductor/tracks//spec.md` `conductor/tracks//plan.md` `conductor/tracks.md` |
+| `/conductor:implement` | Executes the tasks defined in the current track's plan. | `conductor/tracks.md` `conductor/tracks//plan.md` |
+| `/conductor:status` | Displays the current progress of the tracks file and active tracks. | Reads `conductor/tracks.md` |
+| `/conductor:revert` | Reverts a track, phase, or task by analyzing git history. | Reverts git history |
+| `/conductor:review` | Reviews completed work against guidelines and the plan. | Reads `plan.md`, `product-guidelines.md` |
diff --git a/docs/cli/plan-mode.md b/docs/cli/plan-mode.md
index c7a2f4bd4e..103edefd5b 100644
--- a/docs/cli/plan-mode.md
+++ b/docs/cli/plan-mode.md
@@ -272,27 +272,24 @@ argsPattern = "\"file_path\":\"[^\"]+[\\\\/]+\\.gemini[\\\\/]+plans[\\\\/]+[\\w-
## Planning workflows
-Plan Mode provides building blocks for structured research and design. These are
-implemented as [extensions](../extensions/index.md) using core planning tools
-like [`enter_plan_mode`](../tools/planning.md#1-enter_plan_mode-enterplanmode),
-[`exit_plan_mode`](../tools/planning.md#2-exit_plan_mode-exitplanmode), and
-[`ask_user`](../tools/ask-user.md).
+Plan Mode provides building blocks for structured research and design. Gemini
+CLI includes two built-in planning workflows to suit different project needs.
-### Built-in planning workflow
+### Standard
-The built-in planner uses an adaptive workflow to analyze your project, consult
+The standard planner uses an adaptive workflow to analyze your project, consult
you on trade-offs via [`ask_user`](../tools/ask-user.md), and draft a plan for
-your approval.
+your approval. It is ideal for quick exploration and ad-hoc tasks.
-### Custom planning workflows
+### Conductor
-You can install or create specialized planners to suit your workflow.
+[Conductor] is a built-in methodology for spec-driven development, designed for
+managing large features and complex tasks through persistent artifacts. It
+organizes work into tracks and stores them in your project's `conductor/`
+directory.
-#### Conductor
-
-[Conductor] is designed for spec-driven development. It organizes work into
-"tracks" and stores persistent artifacts in your project's `conductor/`
-directory:
+Conductor leverages Plan Mode internally to ensure architectural safety during
+the design phase. To get started with Conductor, run `/conductor:setup`.
- **Automate transitions:** Switches to read-only mode via
[`enter_plan_mode`](../tools/planning.md#1-enter_plan_mode-enterplanmode).
@@ -303,10 +300,19 @@ directory:
- **Handoff execution:** Transitions to implementation via
[`exit_plan_mode`](../tools/planning.md#2-exit_plan_mode-exitplanmode).
-#### Build your own
+### Comparison of planning workflows
+
+| Feature | Standard | Conductor |
+| :-------------- | :--------------------------------- | :------------------------------------------------ |
+| **Persistence** | Ephemeral, session-based | Persistent, stored in your repository |
+| **Workflow** | Lightweight research & design | Structured Spec -> Plan -> Implement lifecycle |
+| **Artifacts** | `.md` files in a temp directory | `spec.md`, `plan.md`, `tracks.md` in `conductor/` |
+| **Best For** | Quick exploration and ad-hoc tasks | Major features, bug fixes, and long-running tasks |
+
+### Build your own
Since Plan Mode is built on modular building blocks, you can develop your own
-custom planning workflow as an [extensions](../extensions/index.md). By
+custom planning workflow as an [extension](../extensions/index.md). By
leveraging core tools and [custom policies](#custom-policies), you can define
how Gemini CLI researches and stores plans for your specific domain.
@@ -376,5 +382,5 @@ those files are not automatically deleted and must be managed manually.
[`plan.toml`]:
https://github.com/google-gemini/gemini-cli/blob/main/packages/core/src/policy/policies/plan.toml
-[Conductor]: https://github.com/gemini-cli-extensions/conductor
+[Conductor]: ./conductor.md
[open an issue]: https://github.com/google-gemini/gemini-cli/issues
diff --git a/packages/cli/src/config/extension-manager.ts b/packages/cli/src/config/extension-manager.ts
index 5da4f1ed44..fb34c463e6 100644
--- a/packages/cli/src/config/extension-manager.ts
+++ b/packages/cli/src/config/extension-manager.ts
@@ -7,6 +7,7 @@
import * as fs from 'node:fs';
import * as path from 'node:path';
import { stat } from 'node:fs/promises';
+import { fileURLToPath } from 'node:url';
import chalk from 'chalk';
import { ExtensionEnablementManager } from './extensions/extensionEnablement.js';
import { type MergedSettings, SettingScope } from './settings.js';
@@ -433,8 +434,8 @@ Would you like to attempt to install via "git clone" instead?`,
newExtensionConfig.name,
hashValue(newExtensionConfig.name),
getExtensionId(newExtensionConfig, installMetadata),
- newExtensionConfig.version,
- previousExtensionConfig.version,
+ newExtensionConfig.version ?? 'unknown',
+ previousExtensionConfig.version ?? 'unknown',
installMetadata.type,
CoreToolCallStatus.Success,
),
@@ -458,7 +459,7 @@ Would you like to attempt to install via "git clone" instead?`,
newExtensionConfig.name,
hashValue(newExtensionConfig.name),
getExtensionId(newExtensionConfig, installMetadata),
- newExtensionConfig.version,
+ newExtensionConfig.version ?? 'unknown',
installMetadata.type,
CoreToolCallStatus.Success,
),
@@ -495,8 +496,8 @@ Would you like to attempt to install via "git clone" instead?`,
config?.name ?? '',
hashValue(config?.name ?? ''),
extensionId ?? '',
- newExtensionConfig?.version ?? '',
- previousExtensionConfig.version,
+ newExtensionConfig?.version ?? 'unknown',
+ previousExtensionConfig.version ?? 'unknown',
installMetadata.type,
CoreToolCallStatus.Error,
),
@@ -508,7 +509,7 @@ Would you like to attempt to install via "git clone" instead?`,
newExtensionConfig?.name ?? '',
hashValue(newExtensionConfig?.name ?? ''),
extensionId ?? '',
- newExtensionConfig?.version ?? '',
+ newExtensionConfig?.version ?? 'unknown',
installMetadata.type,
CoreToolCallStatus.Error,
),
@@ -611,6 +612,68 @@ Would you like to attempt to install via "git clone" instead?`,
(ext): ext is GeminiCLIExtension => ext !== null,
);
+ let builtinExtensionsDir = path.join(
+ path.dirname(fileURLToPath(import.meta.url)),
+ 'extensions',
+ 'builtin',
+ );
+ if (!fs.existsSync(builtinExtensionsDir)) {
+ builtinExtensionsDir = path.join(
+ path.dirname(fileURLToPath(import.meta.url)),
+ '..',
+ '..',
+ '..',
+ '..',
+ 'core',
+ 'src',
+ 'extensions',
+ 'builtin',
+ );
+ }
+
+ if (!process.env['VITEST'] && fs.existsSync(builtinExtensionsDir)) {
+ const builtinSubdirs =
+ await fs.promises.readdir(builtinExtensionsDir);
+ const builtinPromises = builtinSubdirs.map((subdir) => {
+ const extensionDir = path.join(builtinExtensionsDir, subdir);
+ return this._buildExtension(extensionDir, true);
+ });
+ const builtinResolved = await Promise.all(builtinPromises);
+
+ for (const builtinExt of builtinResolved) {
+ if (builtinExt) {
+ const existingIdx = builtExtensions.findIndex(
+ (e) => e.name === builtinExt.name,
+ );
+ if (existingIdx !== -1) {
+ // If the user has a manually installed version of the builtin extension, we migrate them.
+ const manualExt = builtExtensions[existingIdx];
+ const storage = new ExtensionStorage(
+ manualExt.installMetadata?.type === 'link'
+ ? manualExt.name
+ : path.basename(manualExt.path),
+ );
+ try {
+ await fs.promises.rm(storage.getExtensionDir(), {
+ recursive: true,
+ force: true,
+ });
+ debugLogger.debug(
+ `Migrated to built-in extension: ${builtinExt.name}. Removed manual installation.`,
+ );
+ } catch (e) {
+ debugLogger.warn(
+ `Failed to clean up manual installation of ${builtinExt.name}: ${getErrorMessage(e)}`,
+ );
+ }
+ builtExtensions[existingIdx] = builtinExt;
+ } else {
+ builtExtensions.push(builtinExt);
+ }
+ }
+ }
+ }
+
const seenNames = new Set();
for (const ext of builtExtensions) {
if (seenNames.has(ext.name)) {
@@ -673,6 +736,7 @@ Would you like to attempt to install via "git clone" instead?`,
*/
private async _buildExtension(
extensionDir: string,
+ isBuiltin = false,
): Promise {
try {
const stats = await fs.promises.stat(extensionDir);
@@ -928,7 +992,9 @@ Would you like to attempt to install via "git clone" instead?`,
return {
name: config.name,
- version: config.version,
+ version:
+ config.version ??
+ (isBuiltin ? this.telemetryConfig.getClientVersion() : 'unknown'),
path: effectiveExtensionPath,
contextFiles,
installMetadata,
@@ -990,9 +1056,9 @@ Would you like to attempt to install via "git clone" instead?`,
const configContent = await fs.promises.readFile(configFilePath, 'utf-8');
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
const rawConfig = JSON.parse(configContent) as ExtensionConfig;
- if (!rawConfig.name || !rawConfig.version) {
+ if (!rawConfig.name) {
throw new Error(
- `Invalid configuration in ${configFilePath}: missing ${!rawConfig.name ? '"name"' : '"version"'}`,
+ `Invalid configuration in ${configFilePath}: missing "name"`,
);
}
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
diff --git a/packages/cli/src/config/extension.ts b/packages/cli/src/config/extension.ts
index 564c4fbb6f..a29479b4d8 100644
--- a/packages/cli/src/config/extension.ts
+++ b/packages/cli/src/config/extension.ts
@@ -23,7 +23,7 @@ import type { ExtensionSetting } from './extensions/extensionSettings.js';
*/
export interface ExtensionConfig {
name: string;
- version: string;
+ version?: string;
mcpServers?: Record;
contextFileName?: string | string[];
excludeTools?: string[];
diff --git a/packages/core/src/config/config.ts b/packages/core/src/config/config.ts
index 752ad25c4f..7617f11733 100644
--- a/packages/core/src/config/config.ts
+++ b/packages/core/src/config/config.ts
@@ -1416,6 +1416,10 @@ export class Config implements McpContext, AgentLoopContext {
return this.discoveryMaxDirs;
}
+ getClientVersion(): string {
+ return this.clientVersion;
+ }
+
getContentGeneratorConfig(): ContentGeneratorConfig {
return this.contentGeneratorConfig;
}
diff --git a/packages/core/src/extensions/builtin/conductor/commands/conductor/implement.toml b/packages/core/src/extensions/builtin/conductor/commands/conductor/implement.toml
new file mode 100644
index 0000000000..acf789b572
--- /dev/null
+++ b/packages/core/src/extensions/builtin/conductor/commands/conductor/implement.toml
@@ -0,0 +1,218 @@
+description = "Executes the tasks defined in the specified track's plan"
+prompt = """
+## 1.0 SYSTEM DIRECTIVE
+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.
+
+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.
+
+---
+
+## 1.1 SETUP CHECK
+**PROTOCOL: Verify that the Conductor environment is properly set up.**
+
+1. **Verify Core Context:** Using the **Universal File Resolution Protocol**, resolve and verify the existence of:
+ - **Product Definition**
+ - **Tech Stack**
+ - **Workflow**
+
+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.
+
+
+---
+
+## 2.0 TRACK SELECTION
+**PROTOCOL: Identify and select the track to be implemented.**
+
+1. **Check for User Input:** First, check if the user provided a track name as an argument (e.g., `/conductor:implement `).
+
+2. **Locate and Parse Tracks Registry:**
+ - Resolve the **Tracks Registry**.
+ - 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.
+ - **CRITICAL:** If no track sections are found after parsing, announce: "The tracks file is empty or malformed. No tracks to implement." and halt.
+
+3. **Continue:** Immediately proceed to the next step to select a track.
+
+4. **Select Track:**
+ - **If a track name was provided:**
+ 1. Perform an exact, case-insensitive match for the provided name against the track descriptions you parsed.
+ 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):
+ - **questions:**
+ - **header:** "Confirm"
+ - **question:** "I found track ''. Is this correct?"
+ - **type:** "yesno"
+ 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):
+ - **questions:**
+ - **header:** "Clarify"
+ - **question:** "I couldn't find a unique track matching the name you provided. Did you mean ''? Or please type the exact track name."
+ - **type:** "text"
+ - **If no track name was provided (or if the previous step failed):**
+ 1. **Identify Next Track:** Find the first track in the parsed tracks file that is NOT marked as `[x] Completed`.
+ 2. **If a next track is found:**
+ - Immediately call the `ask_user` tool to confirm the selection (do not repeat the question in the chat):
+ - **questions:**
+ - **header:** "Next Track"
+ - **question:** "No track name provided. Would you like to proceed with the next incomplete track: ''?"
+ - **type:** "yesno"
+ - 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):
+ - **questions:**
+ - **header:** "Clarify"
+ - **question:** "Please type the exact name of the track you would like to implement."
+ - **type:** "text"
+ 3. **If no incomplete tracks are found:**
+ - Announce: "No incomplete tracks found in the tracks file. All tasks are completed!"
+ - Halt the process and await further user instructions.
+
+5. **Handle No Selection:** If no track is selected, inform the user and await further instructions.
+
+---
+
+## 3.0 TRACK IMPLEMENTATION
+**PROTOCOL: Execute the selected track.**
+
+1. **Announce Action:** Announce which track you are beginning to implement.
+
+2. **Update Status to 'In Progress':**
+ - Before beginning any work, you MUST update the status of the selected track in the **Tracks Registry** file.
+ - This requires finding the specific heading for the track (e.g., `## [ ] Track: `) and replacing it with the updated status (e.g., `## [~] Track: `) in the **Tracks Registry** file you identified earlier.
+
+3. **Load Track Context:**
+ a. **Identify Track Folder:** From the tracks file, identify the track's folder link to get the ``.
+ b. **Read Files:**
+ - **Track Context:** Using the **Universal File Resolution Protocol**, resolve and read the **Specification** and **Implementation Plan** for the selected track.
+ - **Workflow:** Resolve **Workflow** (via the **Universal File Resolution Protocol** using the project's index file).
+ c. **Error Handling:** If you fail to read any of these files, you MUST stop and inform the user of the error.
+
+4. **Execute Tasks and Update Track Plan:**
+ a. **Announce:** State that you will now execute the tasks from the track's **Implementation Plan** by following the procedures in the **Workflow**.
+ b. **Iterate Through Tasks:** You MUST now loop through each task in the track's **Implementation Plan** one by one.
+ c. **For Each Task, You MUST:**
+ 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.
+ - **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.
+
+5. **Finalize Track:**
+ - After all tasks in the track's local **Implementation Plan** are completed, you MUST update the track's status in the **Tracks Registry**.
+ - This requires finding the specific heading for the track (e.g., `## [~] Track: `) and replacing it with the completed status (e.g., `## [x] Track: `).
+ - **Commit Changes:** Stage the **Tracks Registry** file and commit with the message `chore(conductor): Mark track '' as complete`.
+ - Announce that the track is fully complete and the tracks file has been updated.
+
+---
+
+## 4.0 SYNCHRONIZE PROJECT DOCUMENTATION
+**PROTOCOL: Update project-level documentation based on the completed track.**
+
+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.
+
+2. **Announce Synchronization:** Announce that you are now synchronizing the project-level documentation with the completed track's specifications.
+
+3. **Load Track Specification:** Read the track's **Specification**.
+
+4. **Load Project Documents:**
+ - Resolve and read:
+ - **Product Definition**
+ - **Tech Stack**
+ - **Product Guidelines**
+
+5. **Analyze and Update:**
+ a. **Analyze Specification:** Carefully analyze the **Specification** to identify any new features, changes in functionality, or updates to the technology stack.
+ b. **Update Product Definition:**
+ 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.
+ ii. **Propose and Confirm Changes:** If an update is needed:
+ - **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.
+ - **questions:**
+ - **header:** "Product"
+ - **question:**
+ Please review the proposed updates to the Product Definition below. Do you approve?
+
+ ---
+
+
+ - **type:** "yesno"
+ 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.
+ c. **Update Tech Stack:**
+ i. **Condition for Update:** Similarly, you MUST determine if significant changes in the technology stack are detected as a result of the completed track.
+ ii. **Propose and Confirm Changes:** If an update is needed:
+ - **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.
+ - **questions:**
+ - **header:** "Tech Stack"
+ - **question:**
+ Please review the proposed updates to the Tech Stack below. Do you approve?
+
+ ---
+
+
+ - **type:** "yesno"
+ 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.
+ d. **Update Product Guidelines (Strictly Controlled):**
+ 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.
+ 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.
+ iii. **Propose and Confirm Changes:** If the conditions are met:
+ - **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.
+ - **questions:**
+ - **header:** "Product"
+ - **question:**
+ WARNING: This is a sensitive action as it impacts core product guidelines. Please review the proposed changes below. Do you approve these critical changes?
+
+ ---
+
+
+ - **type:** "yesno"
+ iv. **Action:** Only after receiving explicit user confirmation, perform the file edits. Keep a record of whether this file was changed.
+
+6. **Final Report:** Announce the completion of the synchronization process and provide a summary of the actions taken.
+ - **Construct the Message:** Based on the records of which files were changed, construct a summary message.
+ - **Commit Changes:**
+ - If any files were changed (**Product Definition**, **Tech Stack**, or **Product Guidelines**), you MUST stage them and commit them.
+ - **Commit Message:** `docs(conductor): Synchronize docs for track ''`
+ - **Example (if Product Definition was changed, but others were not):**
+ > "Documentation synchronization is complete.
+ > - **Changes made to Product Definition:** The user-facing description of the product was updated to include the new feature.
+ > - **No changes needed for Tech Stack:** The technology stack was not affected.
+ > - **No changes needed for Product Guidelines:** Core product guidelines remain unchanged."
+ - **Example (if no files were changed):**
+ > "Documentation synchronization is complete. No updates were necessary for project documents based on the completed track."
+
+---
+
+## 5.0 TRACK CLEANUP
+**PROTOCOL: Offer to archive or delete the completed track.**
+
+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.
+
+2. **Ask for User Choice:** Immediately call the `ask_user` tool to prompt the user (do not repeat the question in the chat):
+ - **questions:**
+ - **header:** "Track Cleanup"
+ - **question:** "Track '' is now complete. What would you like to do?"
+ - **type:** "choice"
+ - **multiSelect:** false
+ - **options:**
+ - Label: "Review", Description: "Run the review command to verify changes before finalizing."
+ - Label: "Archive", Description: "Move the track's folder to `conductor/archive/` and remove it from the tracks file."
+ - Label: "Delete", Description: "Permanently delete the track's folder and remove it from the tracks file."
+ - Label: "Skip", Description: "Do nothing and leave it in the tracks file."
+
+3. **Handle User Response:**
+ * **If user chooses "Review":**
+ * Announce: "Please run `/conductor:review` to verify your changes. You will be able to archive or delete the track after the review."
+ * **If user chooses "Archive":**
+ i. **Create Archive Directory:** Check for the existence of `conductor/archive/`. If it does not exist, create it.
+ ii. **Archive Track Folder:** Move the track's folder from its current location (resolved via the **Tracks Directory**) to `conductor/archive/`.
+ 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.
+ iv. **Commit Changes:** Stage the **Tracks Registry** file and `conductor/archive/`. Commit with the message `chore(conductor): Archive track ''`.
+ v. **Announce Success:** Announce: "Track '' has been successfully archived."
+ * **If user chooses "Delete":**
+ i. **CRITICAL WARNING:** Before proceeding, immediately call the `ask_user` tool to ask for final confirmation (do not repeat the warning in the chat):
+ - **questions:**
+ - **header:** "Confirm"
+ - **question:** "WARNING: This will permanently delete the track folder and all its contents. This action cannot be undone. Are you sure?"
+ - **type:** "yesno"
+ ii. **Handle Confirmation:**
+ - **If 'yes'**:
+ a. **Delete Track Folder:** Resolve the **Tracks Directory** and permanently delete the track's folder from `/`.
+ 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.
+ c. **Commit Changes:** Stage the **Tracks Registry** file and the deletion of the track directory. Commit with the message `chore(conductor): Delete track ''`.
+ d. **Announce Success:** Announce: "Track '' has been permanently deleted."
+ - **If 'no'**:
+ a. **Announce Cancellation:** Announce: "Deletion cancelled. The track has not been changed."
+ * **If user chooses "Skip":**
+ * Announce: "Okay, the completed track will remain in your tracks file for now."
+"""
\ No newline at end of file
diff --git a/packages/core/src/extensions/builtin/conductor/commands/conductor/newTrack.toml b/packages/core/src/extensions/builtin/conductor/commands/conductor/newTrack.toml
new file mode 100644
index 0000000000..178253ff03
--- /dev/null
+++ b/packages/core/src/extensions/builtin/conductor/commands/conductor/newTrack.toml
@@ -0,0 +1,184 @@
+description = "Plans a track, generates track-specific spec documents and updates the tracks file"
+prompt = """
+## 1.0 SYSTEM DIRECTIVE
+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.
+
+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.
+
+PLAN MODE PROTOCOL: Parts of this process run within Plan Mode. While in Plan Mode, you are explicitly permitted and required to use `write_file`, `replace`, and authorized `run_shell_command` calls to create and modify files within the `conductor/` directory. **CRITICAL: You MUST use relative paths starting with `conductor/` (e.g., `conductor/product.md`) for all file operations. Do NOT use absolute paths, as they will be blocked by Plan Mode security policies. REDIRECTION (e.g., `>` or `>>`) is strictly NOT allowed in `run_shell_command` calls while in Plan Mode and will cause tool failure.**
+
+---
+
+## 1.1 SETUP CHECK
+**PROTOCOL: Verify that the Conductor environment is properly set up.**
+
+1. **Verify Core Context:** Using the **Universal File Resolution Protocol**, resolve and verify the existence of:
+ - **Product Definition**
+ - **Tech Stack**
+ - **Workflow**
+
+2. **Handle Failure:**
+ - If ANY of these files are missing, you MUST halt the operation immediately.
+ - Announce: "Conductor is not set up. Please run `/conductor:setup` to set up the environment."
+ - Do NOT proceed to New Track Initialization.
+
+---
+
+## 2.0 NEW TRACK INITIALIZATION
+**PROTOCOL: Follow this sequence precisely.**
+
+### 2.1 Get Track Description and Determine Type
+
+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**.
+2. **Get Track Description & Enter Plan Mode:**
+ * **If `{{args}}` is empty:**
+ 1. Call the `enter_plan_mode` tool with the reason: "Defining new track".
+ 2. Ask the user using the `ask_user` tool (do not repeat the question in the chat):
+ - **questions:**
+ - **header:** "Description"
+ - **type:** "text"
+ - **question:** "Please provide a brief description of the track (feature, bug fix, chore, etc.) you wish to start."
+ - **placeholder:** "e.g., Implement user authentication"
+ Await the user's response and use it as the track description.
+ * **If `{{args}}` contains a description:**
+ 1. Use the content of `{{args}}` as the track description.
+ 2. Call the `enter_plan_mode` tool with the reason: "Defining new track".
+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.
+
+### 2.2 Interactive Specification Generation (`spec.md`)
+
+1. **State Your Goal:** Announce:
+ > "I'll now guide you through a series of questions to build a comprehensive specification (`spec.md`) for this track."
+
+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).
+ * **CRITICAL:** Wait for the user's response after each `ask_user` tool call.
+ * **General Guidelines:**
+ * Refer to information in **Product Definition**, **Tech Stack**, etc., to ask context-aware questions.
+ * Provide a brief explanation and clear examples for each question.
+ * **Strongly Recommendation:** Whenever possible, present 2-3 plausible options for the user to choose from.
+
+ * **1. Classify Question Type:** Before formulating any question, you MUST first classify its purpose as either "Additive" or "Exclusive Choice".
+ * Use **Additive** for brainstorming and defining scope (e.g., users, goals, features, project guidelines). These questions allow for multiple answers.
+ * Use **Exclusive Choice** for foundational, singular commitments (e.g., selecting a primary technology, a specific workflow rule). These questions require a single answer.
+
+ * **2. Formulate the Question:** Use the `ask_user` tool: Adhere to the following for each question in the `questions` array:
+ - **header:** Very short label (max 16 chars).
+ - **type:** "choice", "text", or "yesno".
+ - **multiSelect:** (Required for type: "choice") Set to `true` for multi-select (additive) or `false` for single-choice (exclusive).
+ - **options:** (Required for type: "choice") Provide 2-4 options, each with a `label` and `description`. Note that "Other" is automatically added.
+ - **placeholder:** (For type: "text") Provide a hint.
+
+ * **3. Interaction Flow:**
+ * Wait for the user's response after each `ask_user` tool call.
+ * If the user selects "Other", use a subsequent `ask_user` tool call with `type: "text"` to get their input if necessary.
+ * Confirm your understanding by summarizing before moving on to drafting.
+
+ * **If FEATURE:**
+ * **Ask 3-4 relevant questions** to clarify the feature request using the `ask_user` tool.
+ * Examples include clarifying questions about the feature, how it should be implemented, interactions, inputs/outputs, etc.
+ * 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).
+
+ * **If SOMETHING ELSE (Bug, Chore, etc.):**
+ * **Ask 2-3 relevant questions** to obtain necessary details using the `ask_user` tool.
+ * Examples include reproduction steps for bugs, specific scope for chores, or success criteria.
+ * Tailor the questions to the specific request.
+
+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.
+
+4. **User Confirmation:**
+ - **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.
+ - **questions:**
+ - **header:** "Confirm Spec"
+ - **question:**
+ Please review the drafted Specification below. Does this accurately capture the requirements?
+
+ ---
+
+
+ - **type:** "choice"
+ - **multiSelect:** false
+ - **options:**
+ - Label: "Approve", Description: "The specification looks correct, proceed to planning."
+ - Label: "Revise", Description: "I want to make changes to the requirements."
+ Await user feedback and revise the `spec.md` content until confirmed.
+
+### 2.3 Interactive Plan Generation (`plan.md`)
+
+1. **State Your Goal:** Once `spec.md` is approved, announce:
+ > "Now I will create an implementation plan (plan.md) based on the specification."
+
+2. **Generate Plan:**
+ * Read the confirmed `spec.md` content for this track.
+ * Resolve and read the **Workflow** file (via the **Universal File Resolution Protocol** using the project's index file).
+ * Generate a `plan.md` with a hierarchical list of Phases, Tasks, and Sub-tasks.
+ * **CRITICAL:** The plan structure MUST adhere to the methodology in the **Workflow** file (e.g., TDD tasks for "Write Tests" and "Implement").
+ * Include status markers `[ ]` for **EVERY** task and sub-task. The format must be:
+ - Parent Task: `- [ ] Task: ...`
+ - Sub-task: ` - [ ] ...`
+ * **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 '' (Protocol in workflow.md)`.
+
+3. **User Confirmation:**
+ - **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.
+ - **questions:**
+ - **header:** "Confirm Plan"
+ - **question:**
+ Please review the drafted Implementation Plan below. Does this look correct and cover all the necessary steps?
+
+ ---
+
+
+ - **type:** "choice"
+ - **multiSelect:** false
+ - **options:**
+ - Label: "Approve", Description: "The plan looks solid, proceed to implementation."
+ - Label: "Revise", Description: "I want to modify the implementation steps."
+ Await user feedback and revise the `plan.md` content until confirmed.
+
+### 2.4 Create Track Artifacts and Update Main Plan
+
+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.
+2. **Generate Track ID:** Create a unique Track ID (e.g., ``shortname_YYYYMMDD``).
+3. **Create Directory:** Create a new directory for the tracks: `//`.
+4. **Create `metadata.json`:** Create a metadata file at `//metadata.json` with content like:
+ ```json
+ {
+ "track_id": "",
+ "type": "feature", // or "bug", "chore", etc.
+ "status": "new", // or in_progress, completed, cancelled
+ "created_at": "YYYY-MM-DDTHH:MM:SSZ",
+ "updated_at": "YYYY-MM-DDTHH:MM:SSZ",
+ "description": ""
+ }
+ ```
+ * Populate fields with actual values. Use the current timestamp.
+5. **Write Files:**
+ * Write the confirmed specification content to `//spec.md`.
+ * Write the confirmed plan content to `//plan.md`.
+ * Write the index file to `//index.md` with content:
+ ```markdown
+ # Track Context
+
+ - [Specification](./spec.md)
+ - [Implementation Plan](./plan.md)
+ - [Metadata](./metadata.json)
+ ```
+6. **Exit Plan Mode:** Call the `exit_plan_mode` tool with the path: `//index.md`.
+
+7. **Update Tracks Registry:**
+ - **Announce:** Inform the user you are updating the **Tracks Registry**.
+ - **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:
+ ```markdown
+
+ ---
+
+ - [ ] **Track: