| name | ai-dev-workflow |
| description | Multi-agent development workflow system for structured task execution. Use when working with tasks in .tasks/ directory, when user invokes /task, /explore, /research, /spec, /build, /review, or /refactor commands, or when Claude needs to understand the task orchestration system. Provides workflow state management, sub-agent coordination, and session persistence. |
AI Development Workflow
A structured workflow system where Claude Code orchestrates sub-agents to execute development tasks with full state persistence across sessions.
Workflow Overview
User Input → /task → /explore → /research → /spec → /build → /review → /refactor → Done
Each stage persists state in .tasks/{task-name}/ enabling:
- Session continuity (resume work anytime)
- Sub-agent coordination (agents read each other's output)
- Clear progress tracking
Directory Structure
.tasks/
└── {task-name}/
├── status.md # Current phase, activity log
├── task.md # Requirements + clarifications Q&A
├── explore.md # Codebase analysis
├── research.md # Documentation, patterns, snippets
├── spec.md # Implementation plan with phases
├── review.md # Code review findings
└── refactor.md # Applied fixes
Workflow Stages
1. Task (/task)
- Collect requirements from user
- Ask clarifying questions (document Q&A in task.md)
- Generate task name (kebab-case)
- Create directory structure
2. Explore (/explore)
- Analyze codebase relevant to task
- Use builtin Explore agent
- Document: structure, stack, relevant files, patterns
3. Research (/research)
- Delegate to
researchsub-agent with GRANULAR queries - Spawn MULTIPLE research agents for specific topics (not one big request)
- Must match INSTALLED versions
- Output: code snippets, official docs, patterns
4. Spec (/spec)
- Delegate to
specsub-agent - Create phases: small, independent, executable in separate sessions
- Include code snippets as implementation guides
- Define clear "done" criteria per phase
5. Build (/build)
- Follow spec.md exactly
- Implement phase by phase
- Update status.md progress
- Use research.md snippets as reference
6. Review (/review)
- Delegate to
reviewsub-agent - Check: naming, duplication, security, organization, docs
- Categorize: ❌ HIGH, ⚠️ MEDIUM, 💡 LOW
- Compare implementation vs spec
7. Refactor (/refactor)
- Delegate to
refactorsub-agent - Fix issues from review.md by priority
- Surgical changes only (no scope creep)
- Document all changes
Sub-Agent Coordination
Claude Code acts as orchestrator. Sub-agents:
- Read previous stage outputs
- Write to their designated .md file
- Update status.md activity log
Research agent pattern: Call multiple times with specific queries:
Agent 1: "Better Auth session configuration"
Agent 2: "Drizzle auth schema pattern"
Agent 3: "Next.js 15 middleware auth"
Status Tracking
status.md format:
## Current Phase
- [x] Task Definition
- [x] Explore
- [ ] Research ← current
- [ ] Spec
- [ ] Build
- [ ] Review
- [ ] Refactor
## Activity Log
- [2025-01-15 10:30] Task initialized
- [2025-01-15 10:45] Explore complete
Session Continuity
When resuming work:
- Check
.tasks/for active tasks - Read
status.mdto find current phase - Read relevant .md files for context
- Continue from where left off
Rules
- ALWAYS use plan mode to interact with user at decision points
- ALWAYS update status.md after completing any stage
- Each phase in spec.md must be independently executable
- Research must be granular (multiple specific queries)
- Never deviate from spec during build without discussion
- Review must be thorough; refactor must be surgical
References
references/file-formats.md- Templates for each markdown filereferences/slash-commands.md- All slash commands for this workflowreferences/sub-agents.md- Descriptions for creating sub-agents via /agents