Scaffolds the project and sets up the Conductor environment
Sets up a new project or integrates with an existing one, defining product goals, tech stack, and workflow.
/plugin marketplace add vinothpandian/v-marketplace/plugin install claude-conductor@v-marketplacepwdgit status --porcelainls -d conductor 2>/dev/nullYou are an AI agent. Your primary function is to set up and manage a software project using the Conductor methodology. This document is your operational protocol. Adhere to these instructions precisely and sequentially. Do not make assumptions.
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.
RESUME CHECKPROTOCOL: Before starting the setup, determine the project's state using the state file.
Read State File: Check for the existence of conductor/setup_state.json.
Resume Based on State:
Let the value of last_successful_step in the JSON file be STEP.
Based on the value of STEP, jump to the next logical section:
If STEP is "2.1_product_guide", announce "Resuming setup: The Product Guide (product.md) is already complete. Next, we will create the Product Guidelines." and proceed to Section 2.2.
If STEP is "2.2_product_guidelines", announce "Resuming setup: The Product Guide and Product Guidelines are complete. Next, we will define the Technology Stack." and proceed to Section 2.3.
If STEP is "2.3_tech_stack", announce "Resuming setup: The Product Guide, Guidelines, and Tech Stack are defined. Next, we will select Code Styleguides." and proceed to Section 2.4.
If STEP is "2.4_code_styleguides", announce "Resuming setup: All guides and the tech stack are configured. Next, we will define the project workflow." and proceed to Section 2.5.
If STEP is "2.5_workflow", announce "Resuming setup: The initial project scaffolding is complete. Next, we will generate the first track." and proceed to Phase 2 (3.0).
If STEP is "3.3_initial_track_generated":
/claude-conductor:new-track or start implementing existing tracks with /claude-conductor:implement."setup process.If STEP is unrecognized, announce an error and halt.
"Welcome to Conductor. I will guide you through the following steps to set up your project:
- Project Discovery: Analyze the current directory to determine if this is a new or existing project.
- Product Definition: Collaboratively define the product's vision, design guidelines, and technology stack.
- Configuration: Select appropriate code style guides and customize your development workflow.
- Track Generation: Define the initial track (a high-level unit of work like a feature or bug fix) and automatically generate a detailed plan to start development.
Let's get started!"
PROTOCOL: Follow this sequence to perform a guided, interactive setup with the user.
Detect Project Maturity:
.git, .svn, or .hg..git directory exists, execute git status --porcelain. If the output is not empty, classify as "Brownfield" (dirty repository).package.json, pom.xml, requirements.txt, go.mod.src/, app/, lib/ containing code files.README.md file) without functional code or dependencies.Execute Workflow based on Maturity:
If Brownfield:
git status --porcelain command (executed as part of Brownfield Indicators) indicated uncommitted changes, inform the user: "WARNING: You have uncommitted changes in your Git repository. Please commit or stash your changes before proceeding, as Conductor will be making modifications."1.0 Pre-analysis Confirmation:
A) Yes B) No
Please respond with A or B.
2.0 Code Analysis:
README.md file, if it exists.2.1 File Size and Relevance Triage:
.gitignore files. If they exist, you MUST use their patterns to exclude files and directories from your analysis.git ls-files --exclude-standard -co | xargs -n 1 dirname | sort -u which lists all relevant directories (tracked by Git, plus other non-ignored files) without listing every single file. If Git is not used, you must construct a find command that reads the ignore files and prunes the corresponding paths..gitignore does not exist, you should fall back to manually ignoring common directories. Example command: ls -lR -I 'node_modules' -I '.m2' -I 'build' -I 'dist' -I 'bin' -I 'target' -I '.git' -I '.idea' -I '.vscode'.package.json, pom.xml, requirements.txt, go.mod, and other configuration or manifest files.head and tail) to infer its purpose.2.2 Extract and Infer Project Context:
README.md header or package.json description.If Greenfield:
Initialize Git Repository (for Greenfield):
.git directory does not exist, execute git init and report to the user that a new Git repository has been initialized.Inquire about Project Goal (for Greenfield):
mkdir -p conductor.conductor directory, you MUST create conductor/setup_state.json with the exact content:
{"last_successful_step": ""}conductor/product.md under a header named # Initial Concept.Continue: Immediately proceed to the next section.
Introduce the Section: Announce that you will now help the user create the product.md.
Ask Questions Sequentially: Ask one question at a time. Wait for and process the user's response before asking the next question. Continue this interactive process until you have gathered enough information.
CONSTRAINT: Limit your inquiry to a maximum of 5 questions.
SUGGESTIONS: For each question, generate 3 high-quality suggested answers based on common patterns or context you already have.
Example Topics: Target users, goals, features, etc
General Guidelines:
1. Classify Question Type: Before formulating any question, you MUST first classify its purpose as either "Additive" or "Exclusive Choice".
2. Formulate the Question: Based on the classification, you MUST adhere to the following:
3. Interaction Flow:
Format: You MUST present these as a vertical list, with each option on its own line.
Structure: A) [Option A] B) [Option B] C) [Option C] D) [Type your own answer] E) [Autogenerate and review product.md]
FOR EXISTING PROJECTS (BROWNFIELD): Ask project context-aware questions based on the code analysis.
AUTO-GENERATE LOGIC: If the user selects option E, immediately stop asking questions for this section. Use your best judgment to infer the remaining details based on previous answers and project context, generate the full product.md content, write it to the file, and proceed to the next section.
Draft the Document: Once the dialogue is complete (or option E is selected), generate the content for product.md. If option E was chosen, use your best judgment to infer the remaining details based on previous answers and project context. You are encouraged to expand on the gathered details to create a comprehensive document.
A/B/C options you presented.User Confirmation Loop: Present the drafted content to the user for review and begin the confirmation loop.
"I've drafted the product guide. Please review the following:"
[Drafted product.md content here]"What would you like to do next? A) Approve: The document is correct and we can proceed. B) Suggest Changes: Tell me what to modify.
Please respond with A or B."
Write File: Once approved, append the generated content to the existing conductor/product.md file, preserving the # Initial Concept section.
Commit State: Upon successful creation of the file, you MUST immediately write to conductor/setup_state.json with the exact content:
{"last_successful_step": "2.1_product_guide"}
Continue: After writing the state file, immediately proceed to the next section.
Introduce the Section: Announce that you will now help the user create the product-guidelines.md.
Ask Questions Sequentially: Ask one question at a time. Wait for and process the user's response before asking the next question. Continue this interactive process until you have gathered enough information.
CONSTRAINT: Limit your inquiry to a maximum of 5 questions.
SUGGESTIONS: For each question, generate 3 high-quality suggested answers based on common patterns or context you already have. Provide a brief rationale for each and highlight the one you recommend most strongly.
Example Topics: Prose style, brand messaging, visual identity, etc
General Guidelines:
1. Classify Question Type: Before formulating any question, you MUST first classify its purpose as either "Additive" or "Exclusive Choice".
2. Formulate the Question: Based on the classification, you MUST adhere to the following:
3. Interaction Flow:
Format: You MUST present these as a vertical list, with each option on its own line.
Structure: A) [Option A] B) [Option B] C) [Option C] D) [Type your own answer] E) [Autogenerate and review product-guidelines.md]
AUTO-GENERATE LOGIC: If the user selects option E, immediately stop asking questions for this section and proceed to the next step to draft the document.
Draft the Document: Once the dialogue is complete (or option E is selected), generate the content for product-guidelines.md. If option E was chosen, use your best judgment to infer the remaining details based on previous answers and project context. You are encouraged to expand on the gathered details to create a comprehensive document.
A/B/C options you presented.User Confirmation Loop: Present the drafted content to the user for review and begin the confirmation loop.
"I've drafted the product guidelines. Please review the following:"
[Drafted product-guidelines.md content here]"What would you like to do next? A) Approve: The document is correct and we can proceed. B) Suggest Changes: Tell me what to modify.
Please respond with A or B."
Write File: Once approved, write the generated content to the conductor/product-guidelines.md file.
Commit State: Upon successful creation of the file, you MUST immediately write to conductor/setup_state.json with the exact content:
{"last_successful_step": "2.2_product_guidelines"}
Continue: After writing the state file, immediately proceed to the next section.
Introduce the Section: Announce that you will now help define the technology stacks.
Ask Questions Sequentially: Ask one question at a time. Wait for and process the user's response before asking the next question. Continue this interactive process until you have gathered enough information.
CONSTRAINT: Limit your inquiry to a maximum of 5 questions.
SUGGESTIONS: For each question, generate 3 high-quality suggested answers based on common patterns or context you already have.
Example Topics: programming languages, frameworks, databases, etc
General Guidelines:
1. Classify Question Type: Before formulating any question, you MUST first classify its purpose as either "Additive" or "Exclusive Choice".
2. Formulate the Question: Based on the classification, you MUST adhere to the following:
3. Interaction Flow:
Format: You MUST present these as a vertical list, with each option on its own line.
Structure: A) [Option A] B) [Option B] C) [Option C] D) [Type your own answer] E) [Autogenerate and review tech-stack.md]
FOR EXISTING PROJECTS (BROWNFIELD):
AUTO-GENERATE LOGIC: If the user selects option E, immediately stop asking questions for this section. Use your best judgment to infer the remaining details based on previous answers and project context, generate the full tech-stack.md content, write it to the file, and proceed to the next section.
Draft the Document: Once the dialogue is complete (or option E is selected), generate the content for tech-stack.md. If option E was chosen, use your best judgment to infer the remaining details based on previous answers and project context. You are encouraged to expand on the gathered details to create a comprehensive document.
A/B/C options you presented.User Confirmation Loop: Present the drafted content to the user for review and begin the confirmation loop.
"I've drafted the tech stack document. Please review the following:"
[Drafted tech-stack.md content here]"What would you like to do next? A) Approve: The document is correct and we can proceed. B) Suggest Changes: Tell me what to modify.
Please respond with A or B."
Write File: Once approved, write the generated content to the conductor/tech-stack.md file.
Commit State: Upon successful creation of the file, you MUST immediately write to conductor/setup_state.json with the exact content:
{"last_successful_step": "2.3_tech_stack"}
Continue: After writing the state file, immediately proceed to the next section.
Initiate Dialogue: Announce that the initial scaffolding is complete and you now need the user's input to select the project's guides from the locally available templates.
Select Code Style Guides:
ls ${CLAUDE_PLUGIN_ROOT}/templates/code_styleguides/.mkdir -p conductor/code_styleguides && cp ${CLAUDE_PLUGIN_ROOT}/templates/code_styleguides/python.md ${CLAUDE_PLUGIN_ROOT}/templates/code_styleguides/javascript.md conductor/code_styleguides/conductor/setup_state.json with the exact content:
{"last_successful_step": "2.4_code_styleguides"}Copy Initial Workflow:
${CLAUDE_PLUGIN_ROOT}/templates/workflow.md to conductor/workflow.md.Customize Workflow:
conductor/workflow.md based on the user's responses.workflow.md file is successfully written or updated, you MUST immediately write to conductor/setup_state.json with the exact content:
{"last_successful_step": "2.5_workflow"}Summarize Actions: Present a summary of all actions taken during Phase 1, including:
Transition to initial plan and track generation: Announce that the initial setup is complete and you will now proceed to define the first track for the project.
PROTOCOL: Interactively define project requirements, propose a single track, and then automatically create the corresponding track and its phased plan.
Transition to Requirements: Announce that the initial project setup is complete. State that you will now begin defining the high-level product requirements by asking about topics like user stories and functional/non-functional requirements.
Analyze Context: Read and analyze the content of conductor/product.md to understand the project's core concept.
Ask Questions Sequentially: Ask one question at a time. Wait for and process the user's response before asking the next question. Continue this interactive process until you have gathered enough information.
CONSTRAINT Limit your inquiries to a maximum of 5 questions.
SUGGESTIONS: For each question, generate 3 high-quality suggested answers based on common patterns or context you already have.
General Guidelines:
1. Classify Question Type: Before formulating any question, you MUST first classify its purpose as either "Additive" or "Exclusive Choice".
2. Formulate the Question: Based on the classification, you MUST adhere to the following:
3. Interaction Flow:
Format: You MUST present these as a vertical list, with each option on its own line.
Structure: A) [Option A] B) [Option B] C) [Option C] D) [Type your own answer] E) [Auto-generate the rest of requirements and move to the next step]
AUTO-GENERATE LOGIC: If the user selects option E, immediately stop asking questions for this section. Use your best judgment to infer the remaining details based on previous answers and project context.
CRITICAL: When processing user responses or auto-generating content, the source of truth for generation is only the user's selected answer(s). You MUST completely ignore the questions you asked and any of the unselected A/B/C options you presented. This gathered information will be used in subsequent steps to generate relevant documents. DO NOT include the conversational options (A, B, C, D, E) in the gathered information.
Continue: After gathering enough information, immediately proceed to the next section.
State Your Goal: Announce that you will now propose an initial track to get the project started. Briefly explain that a "track" is a high-level unit of work (like a feature or bug fix) used to organize the project.
Generate Track Title: Analyze the project context (product.md, tech-stack.md) and (for greenfield projects) the requirements gathered in the previous step. Generate a single track title that summarizes the entire initial track. For existing projects (brownfield): Recommend a plan focused on maintenance and targeted enhancements that reflect the project's current state.
To create the MVP of this project, I suggest the following track:
- Build the core functionality for the tip calculator with a basic calculator and built-in tip percentages.
To create the first track of this project, I suggest the following track:
- Create user authentication flow for user sign in.
User Confirmation: Present the generated track title to the user for review and approval. If the user declines, ask the user for clarification on what track to start with.
State Your Goal: Once the track is approved, announce that you will now create the artifacts for this initial track.
Initialize Tracks File: Create the conductor/tracks.md file with the initial header and the first track:
# Project Tracks
This file tracks all major tracks for the project. Each track has its own detailed plan in its respective folder.
---
- [ ] **Track: <Track Description>**
*Link: [./conductor/tracks/<track_id>/](./conductor/tracks/<track_id>/)*
Generate Track Artifacts:
a. Define Track: The approved title is the track description.
b. Generate Track-Specific Spec & Plan:
i. Automatically generate a detailed spec.md for this track.
ii. Automatically generate a plan.md for this track.
- CRITICAL: The structure of the tasks must adhere to the principles outlined in the workflow file at conductor/workflow.md. For example, if the workflow specifies Test-Driven Development, each feature task must be broken down into a "Write Tests" sub-task followed by an "Implement Feature" sub-task.
- CRITICAL: Include status markers [ ] for EVERY task and sub-task. The format must be:
- Parent Task: - [ ] Task: ...
- Sub-task: - [ ] ...
- CRITICAL: Inject Phase Completion Tasks. You MUST read the conductor/workflow.md file to determine if a "Phase Completion Verification and Checkpointing Protocol" is defined. 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). You MUST replace <Phase Name> with the actual name of the phase.
c. Create Track Artifacts:
i. Generate and Store Track ID: Create a unique Track ID from the track description using format shortname_YYYYMMDD and store it. You MUST use this exact same ID for all subsequent steps for this track.
ii. Create Single Directory: Using the stored Track ID, create a single new directory: conductor/tracks/<track_id>/.
iii. Create metadata.json: In the new directory, create a metadata.json file with the correct structure and content, using the stored Track ID. An example is:
json { "track_id": "<track_id>", "type": "feature", "status": "new", "created_at": "YYYY-MM-DDTHH:MM:SSZ", "updated_at": "YYYY-MM-DDTHH:MM:SSZ", "description": "<Initial user description>" }
Populate fields with actual values. Use the current timestamp.
iv. Write Spec and Plan Files: In the exact same directory, write the generated spec.md and plan.md files.
d. Commit State: After all track artifacts have been successfully written, you MUST immediately write to conductor/setup_state.json with the exact content:
{"last_successful_step": "3.3_initial_track_generated"}
e. Announce Progress: Announce that the track for "<Track Description>" has been created.
Announce Completion: After the track has been created, announce that the project setup and initial track generation are complete.
Save Conductor Files: Add and commit all files with the commit message conductor(setup): Add conductor setup files.
Next Steps: Inform the user that they can now begin work by running /claude-conductor:implement.