Build - Workflow Orchestrator
You are a workflow orchestrator that chains existing skills for feature development. You coordinate the execution of multiple skills in sequence, passing handoffs between them and pausing for human checkpoints at phase boundaries.
Invocation
Question Flow (No Arguments)
If the user types just /build with no or partial arguments, guide them through this question flow to infer the right configuration. Use AskUserQuestion for each phase.
Phase 0: Workflow Selection
Mapping:
- "Help me choose" → Continue to Phase 1-4 questions
- "Greenfield" → Set mode=greenfield, skip to Phase 5 (description)
- "Brownfield" → Set mode=brownfield, skip to Phase 5 (description)
- "TDD" → Set mode=tdd, skip to Phase 5 (description)
- "Refactor" → Set mode=refactor, skip to Phase 5 (description)
If Answer is Unclear (via "Other"):
Phase 1: Project Context
Mapping:
- "New feature from scratch" → greenfield mode
- "Adding to existing codebase" → brownfield mode
- "Refactoring existing code" → refactor mode
If Answer is Unclear (via "Other"):
Phase 2: Requirements Clarity
Mapping:
- "Clear spec" → --skip-discovery
- "Rough idea" → run discovery-interview first
- "Exploring" → run discovery-interview with broader scope
If Answer is Unclear (via "Other"):
Phase 3: Development Approach
Mapping:
- "Just implement" → standard chain
- "Tests first" → tdd mode (overrides previous if not refactor)
- "Validate plan" → keep validate-agent in chain
If Answer is Unclear (via "Other"):
Phase 4: Post-Implementation
Mapping:
- No "Auto-commit" selected → --skip-commit
- No "Create PR" selected → --skip-pr
If Answer is Unclear (via "Other"):
Phase 5: Description
Finally, ask for the feature description:
Summary Before Execution
Before starting, show what will run:
This ensures the user knows exactly what will happen before any agents spawn.
Modes
Options
Handoff Directory
All handoffs go to: thoughts/shared/handoffs/<session>/
Session name derived from:
- Existing continuity ledger name, OR
- Generated from feature description:
build-<date>-<kebab-description>
Orchestration Process
Step 0: Parse Arguments
Parse the mode and options from user input:
Build the skill chain based on mode:
Apply options to modify chain:
--skip-discovery: Remove "discovery-interview" from chain--skip-validate: Remove "validate-agent" from chain--skip-commit: Remove "commit" from chain--skip-pr: Remove "describe_pr" from chain
Step 1: Setup
-
Create handoff directory:
-
Create orchestration state file:
Step 2: Execute Chain
For each skill in the chain:
Phase Execution Pattern
Skill Execution Details
discovery-interview:
Output: Spec file at thoughts/shared/specs/<name>-spec.md
onboard:
Output: TLDR caches, continuity ledger
research-codebase:
Output: Research document at thoughts/shared/research/<date>-<topic>.md
tldr-impact (for refactor mode):
Output: Impact and architecture analysis files
plan-agent:
Output: Plan at thoughts/shared/plans/PLAN-<name>.md, handoff at <session>/plan-<name>.md
CHECKPOINT: After plan-agent
validate-agent:
Output: Validation handoff at <session>/validation-<name>.md
CHECKPOINT: After validate-agent (if issues found)
test-driven-development (for tdd/refactor modes):
This is interactive - guide user through TDD cycles.
implement_plan:
Output: Task handoffs at <session>/task-NN-<description>.md
CHECKPOINT: After each implementation phase
commit:
describe_pr:
Step 3: Handle Errors
If any phase fails or returns blocked status:
Present to user:
Step 4: Completion
When all phases complete:
Human Checkpoints
Checkpoints pause for human verification at critical decision points:
To skip checkpoints: Run with --no-checkpoint (advanced users only)
Resume Support
If workflow is interrupted, resume from last checkpoint:
This reads orchestration.yaml and continues from the last incomplete phase.
Example Sessions
Greenfield Feature
TDD Mode
Running test... FAILED (as expected - RateLimiter doesn't exist)
GREEN - Implement minimal code: [Guides through implementation]
Running test... PASSED
REFACTOR - Any cleanup needed?
Next test: "Rate limiter resets after window expires" ...
Phase 3/3: Implementation [Integrates rate limiter into endpoints]
Build complete!
User: /build refactor Extract auth logic into separate module
Claude: Starting refactor workflow for "Extract auth logic into separate module"
Phase 1/4: Impact Analysis Running: tldr impact auth src/ --depth 3
Impact analysis complete:
- 12 files directly call auth functions
- 3 entry points affected
- No circular dependencies detected
Architecture analysis:
- auth is currently in: src/api/middleware/
- Callers in: src/api/routes/, src/api/handlers/
--- CHECKPOINT --- Review impact before planning? [Y/n]
User: Y
[Shows detailed impact report]
Phase 2/4: Planning [Creates refactor plan based on impact analysis]
...
Phase 3 (validate-agent) failed:
Error: WebSearch unavailable
Options:
- Retry phase (recommended)
- Skip validation (--skip-validate)
- Abort workflow
Choice:
Task 3/5 blocked:
Blocker: Database schema doesn't match expected structure Found: users.email (VARCHAR) Expected: users.email (UNIQUE VARCHAR)
Options:
- Create migration to fix schema
- Adjust plan to work with current schema
- Abort and investigate
Choice:
/build brownfield --parallel Add dashboard feature
Phase 1: Onboard (started) Phase 2: Research-codebase (started in parallel)
[Both complete]
Phase 3: Plan-agent (uses results from both) ...
Troubleshooting
Related Skills
/discovery-interview- Deep interview for requirements/plan-agent- Create implementation plans/validate-agent- Validate tech choices/implement_plan- Execute implementation plans/implement_task- Single task implementation/test-driven-development- TDD workflow/commit- Create commits/describe_pr- Generate PR descriptions/onboard- Codebase analysis/research-codebase- Research existing code/tldr-code- Code analysis CLI


