conductor-setup
Initialize project with Conductor context-driven development. Sets up product.md, tech-stack.md, and workflow.md.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Initialize project with Conductor context-driven development. Sets up product.md, tech-stack.md, and workflow.md.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Execute tasks from a track's plan following the TDD workflow.
Create a new feature/bug track with spec and plan.
Git-aware revert of tracks, phases, or tasks.
Initialize project with Conductor context-driven development. Sets up product.md, tech-stack.md, and workflow.md.
Context-driven development methodology. Understands projects set up with Conductor (via Gemini CLI or Claude Code). Use when working with conductor/ directories, tracks, specs, plans, or when user mentions context-driven development.
Display project progress overview.
| name | conductor-setup |
| description | Initialize project with Conductor context-driven development. Sets up product.md, tech-stack.md, and workflow.md. |
| license | Apache-2.0 |
| compatibility | Works with Claude Code, Gemini CLI, and any Agent Skills compatible CLI |
You 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.
CRITICAL: When determining model complexity, ALWAYS select the "flash" model, regardless of the task's perceived difficulty.
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 Section 3.0.
If STEP is "3.3_initial_track_generated":
/conductor:newTrack or start implementing existing tracks with /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:
- Announce that an existing project has been detected.
- If the 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."
- Begin Brownfield Project Initialization Protocol:
- 1.0 Pre-analysis Confirmation:
1. Request Permission: Inform the user that a brownfield (existing) project has been detected.
2. Ask for Permission: Request permission for a read-only scan to analyze the project with the following options using the next structure:
> A) Yes
> B) No
>
> Please respond with A or B.
3. Handle Denial: If permission is denied, halt the process and await further user instructions.
4. Confirmation: Upon confirmation, proceed to the next step.
- **2.0 Code Analysis:**
1. **Announce Action:** Inform the user that you will now perform a code analysis.
2. **Prioritize README:** Begin by analyzing the `README.md` file, if it exists.
3. **Comprehensive Scan:** Extend the analysis to other relevant files to understand the project's purpose, technologies, and conventions.
- **2.1 File Size and Relevance Triage:**
1. **Respect Ignore Files:** Before scanning any files, you MUST check for the existence of `.geminiignore` and `.gitignore` files. If either or both exist, you MUST use their combined patterns to exclude files and directories from your analysis. The patterns in `.geminiignore` should take precedence over `.gitignore` if there are conflicts. This is the primary mechanism for avoiding token-heavy, irrelevant files like `node_modules`.
2. **Efficiently List Relevant Files:** To list the files for analysis, you MUST use a command that respects the ignore files. For example, you can use `git ls-files --exclude-standard -co` which lists all relevant files (tracked by Git, plus other non-ignored files). If Git is not used, you must construct a `find` command that reads the ignore files and prunes the corresponding paths.
3. **Fallback to Manual Ignores:** ONLY if neither `.geminiignore` nor `.gitignore` 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'`.
4. **Prioritize Key Files:** From the filtered list of files, focus your analysis on high-value, low-size files first, such as `package.json`, `pom.xml`, `requirements.txt`, `go.mod`, and other configuration or manifest files.
5. **Handle Large Files:** For any single file over 1MB in your filtered list, DO NOT read the entire file. Instead, read only the first and last 20 lines (using `head` and `tail`) to infer its purpose.
- **2.2 Extract and Infer Project Context:**
1. **Strict File Access:** DO NOT ask for more files. Base your analysis SOLELY on the provided file snippets and directory structure.
2. **Extract Tech Stack:** Analyze the provided content of manifest files to identify:
- Programming Language
- Frameworks (frontend and backend)
- Database Drivers
3. **Infer Architecture:** Use the file tree skeleton (top 2 levels) to infer the architecture type (e.g., Monorepo, Microservices, MVC).
4. **Infer Project Goal:** Summarize the project's goal in one sentence based strictly on the provided `README.md` header or `package.json` description.
- **Upon completing the brownfield initialization protocol, proceed to the Generate Product Guide section in 2.1.**
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". * 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:** Based on the classification, you MUST adhere to the following:
* **If Additive:** Formulate an open-ended question that encourages multiple points. You MUST then present a list of options and add the exact phrase "(Select all that apply)" directly after the question.
* **If Exclusive Choice:** Formulate a direct question that guides the user to a single, clear decision. You MUST NOT add "(Select all that apply)".
* **3. Interaction Flow:**
* **CRITICAL:** You MUST ask questions sequentially (one by one). Do not ask multiple questions in a single turn. Wait for the user's response after each question.
* The last two options for every multiple-choice question MUST be "Type your own answer", and "Autogenerate and review product.md".
* Confirm your understanding by summarizing before moving on.
- **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]
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.
You can always edit the generated file with the Gemini CLI built-in option "Modify with external editor" (if present), or with your favorite external editor after this step. 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.
product-guidelines.md.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: * CRITICAL: You MUST ask questions sequentially (one by one). Do not ask multiple questions in a single turn. Wait for the user's response after each question.
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.
CRITICAL: 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.
"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.
You can always edit the generated file with the Gemini CLI built-in option "Modify with external editor" (if present), or with your favorite external editor after this step. Please respond with A or B."
conductor/product-guidelines.md file.conductor/setup_state.json with the exact content:
{"last_successful_step": "2.2_product_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: * CRITICAL: You MUST ask questions sequentially (one by one). Do not ask multiple questions in a single turn. Wait for the user's response after each question.
tech-stack.md content, write it to the file, and proceed to the next section.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."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.
You can always edit the generated file with the Gemini CLI built-in option "Modify with external editor" (if present), or with your favorite external editor after this step. Please respond with A or B."
conductor/tech-stack.md file.conductor/setup_state.json with the exact content:
{"last_successful_step": "2.3_tech_stack"}ls ~/.gemini/extensions/conductor/templates/code_styleguides/.mkdir -p conductor/code_styleguides && cp ~/.gemini/extensions/conductor/templates/code_styleguides/python.md ~/.gemini/extensions/conductor/templates/code_styleguides/javascript.md conductor/code_styleguides/conductor/setup_state.json with the exact content:
{"last_successful_step": "2.4_code_styleguides"}~/.gemini/extensions/conductor/templates/workflow.md to conductor/workflow.md.conductor/workflow.md based on the user's responses.workflow.md file is successfully copied or updated, you MUST immediately write to conductor/setup_state.json with the exact content:
{"last_successful_step": "2.5_workflow"}Generate Index File:
conductor/index.md with the following content:
# Project Context
## Definition
- [Product Definition](./product.md)
- [Product Guidelines](./product-guidelines.md)
- [Tech Stack](./tech-stack.md)
## Workflow
- [Workflow](./workflow.md)
- [Code Style Guides](./code_styleguides/)
## Management
- [Tracks Registry](./tracks.md)
- [Tracks Directory](./tracks/)
conductor/index.md to serve as the project context index."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.
conductor/product.md to understand the project's core concept.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: * CRITICAL: You MUST ask questions sequentially (one by one). Do not ask multiple questions in a single turn. Wait for the user's response after each question.
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.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.
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: [./<Tracks Directory Name>/<track_id>/](./<Tracks Directory Name>/<track_id>/)*
(Replace <Tracks Directory Name> with the actual name of the tracks folder resolved via the protocol.)
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 specifying 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 - Automated 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: Resolve the Tracks Directory via the Universal File Resolution Protocol and create a single new directory: <Tracks Directory>/<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. Valid values for type: "feature" or "bug". Valid values for status: "new", "in_progress", "completed", or "cancelled".
iv. Write Spec and Plan Files: In the exact same directory, write the generated spec.md and plan.md files.
v. Write Index File: In the exact same directory, write index.md with content:
```markdown
# Track <track_id> Context
- [Specification](./spec.md)
- [Implementation Plan](./plan.md)
- [Metadata](./metadata.json)
```
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 "" has been created.
conductor(setup): Add conductor setup files./conductor:implement.