一键导入
spec-workflow-orchestrator
Orchestrate comprehensive planning phase from ideation to development-ready specifications using 4 specialized agents
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Orchestrate comprehensive planning phase from ideation to development-ready specifications using 4 specialized agents
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | spec-workflow-orchestrator |
| description | Orchestrate comprehensive planning phase from ideation to development-ready specifications using 4 specialized agents |
| allowed-tools | Task, Read, Glob, TodoWrite, Write, Edit |
| version | 1.0.0 |
Transform ideas into development-ready specifications through:
Auto-invoke when user requests:
Do NOT invoke for:
Scope: Complete planning and analysis phase (ideation → development-ready specifications)
Key Activities (from battle-tested Phase 1):
Quality Gates:
The orchestrator manages sequential execution of three specialized agents with quality gate validation.
Step 1: Query Analysis
Parse user's planning request and validate suitability:
Step 1.5: Project Naming & Existing Project Detection
Part A: Determine Project Slug
Determine project directory name for organizing deliverables:
Example Project Slugs:
task-managersession-log-viewerecommerce-product-catalogPart B: Check for Existing Project
Step B1: Check if project exists
Use Bash tool to check if project directory exists:
if [ -d "docs/projects/{project-slug}" ]; then
echo "existing"
else
echo "new"
fi
If NEW PROJECT (no directory exists):
# Create fresh directory structure
mkdir -p "docs/projects/{project-slug}/planning"
mkdir -p "docs/projects/{project-slug}/adrs"
echo "Fresh directories created"
Then use workflow_state.sh to save state:
.claude/utils/workflow_state.sh set "{project-slug}" "fresh" ""
Proceed to Step 2 with fresh planning mode.
If EXISTING PROJECT (directory exists):
Step B2: Ask user for choice
Use AskUserQuestion tool to ask:
{
"questions": [{
"question": "Project '{project-slug}' already has planning specifications. How would you like to proceed?",
"header": "Refine Specs",
"multiSelect": false,
"options": [
{
"label": "Refine existing specs",
"description": "Agents will read current files and improve them iteratively"
},
{
"label": "Archive + fresh start",
"description": "Move existing specs to .archive/{timestamp}/ and create new specs from scratch"
},
{
"label": "Create new version",
"description": "Create {project-slug}-v2/ directory for new planning iteration"
},
{
"label": "Cancel",
"description": "Stop the workflow without making changes"
}
]
}]
}
Step B3: Handle user choice
Store user's answer from AskUserQuestion response in variable USER_CHOICE.
If USER_CHOICE = "Refine existing specs":
# Capture user's additional requirements from conversation context
USER_INPUT="[Extract new requirements from user's latest messages]"
# Save to state file
.claude/utils/workflow_state.sh set "{project-slug}" "refinement" "$USER_INPUT"
If USER_CHOICE = "Archive + fresh start":
# Archive existing specs with timestamp
.claude/utils/archive_project.sh "{project-slug}"
# This script:
# - Creates .archive/{timestamp}/ directory
# - Copies planning/ and adrs/ to archive
# - Verifies integrity
# - Deletes originals
# - Creates fresh planning/ and adrs/ directories
# - Returns exit code 0 on success, 1 on failure
if [ $? -eq 0 ]; then
echo "Archive successful, proceeding with fresh planning"
else
echo "Archive failed, aborting workflow"
exit 1
fi
.claude/utils/workflow_state.sh set "{project-slug}" "fresh" ""
If USER_CHOICE = "Create new version":
# Run version detection utility
NEW_SLUG=$(.claude/utils/detect_next_version.sh "{project-slug}")
# This returns: "{project-slug}-v2" or "{project-slug}-v3" etc.
# Exit code 0 on success, 1 if version limit reached (v99)
if [ $? -eq 0 ]; then
echo "Next version: $NEW_SLUG"
PROJECT_SLUG="$NEW_SLUG"
else
echo "ERROR: Version limit reached (v2-v99 all exist)"
echo "Consider using 'Archive + fresh start' instead"
exit 1
fi
mkdir -p "docs/projects/$PROJECT_SLUG/planning"
mkdir -p "docs/projects/$PROJECT_SLUG/adrs"
.claude/utils/workflow_state.sh set "$PROJECT_SLUG" "fresh" ""
If USER_CHOICE = "Cancel":
.claude/utils/workflow_state.sh clear
Workflow cancelled. No changes made to existing project specs.
Output:
PROJECT_SLUG (final slug, may be versioned)WORKFLOW_MODE ("fresh" or "refinement")USER_INPUT (additional requirements if refinement mode, empty string otherwise)Step 1.6: Placeholder Substitution
Before spawning agents, substitute placeholders in prompt templates with actual values:
Required Substitutions:
{project-slug} → Actual project slug (e.g., "task-tracker-pwa" or "task-tracker-pwa-v2")[PROJECT_NAME] → User-friendly project name extracted from original request (e.g., "Task Tracker PWA")[ADDITIONAL_REQUIREMENTS_FROM_USER] → (Refinement mode only) User's new requirements from conversation[CHANGES_FROM_REQUIREMENTS] → (Refinement mode only) Summary of requirement changes for architectHow to Extract Values:
PROJECT_NAME: Parse from original user request
USER_INPUT for Refinement (saved in state file):
# Retrieve from state file
USER_INPUT=$(.claude/utils/workflow_state.sh get "user_input")
If empty (user just said "refine specs"), use generic guidance:
USER_INPUT="Review all sections for completeness, update metrics to be measurable, enhance clarity"
# Pseudocode for substitution
prompt_template = "Analyze requirements for [PROJECT_NAME]..."
actual_prompt = prompt_template
actual_prompt = actual_prompt.replace("{project-slug}", PROJECT_SLUG)
actual_prompt = actual_prompt.replace("[PROJECT_NAME]", PROJECT_NAME)
actual_prompt = actual_prompt.replace("[ADDITIONAL_REQUIREMENTS_FROM_USER]", USER_INPUT)
Example Substitution:
Before:
prompt: "Refine requirements for [PROJECT_NAME].
IMPORTANT: Read existing file at docs/projects/{project-slug}/planning/requirements.md first.
4. Enhance based on new user input: [ADDITIONAL_REQUIREMENTS_FROM_USER]"
After (for task-tracker-pwa, user wants "add offline support"):
prompt: "Refine requirements for Task Tracker PWA.
IMPORTANT: Read existing file at docs/projects/task-tracker-pwa/planning/requirements.md first.
4. Enhance based on new user input: Add offline support with service workers and local storage"
Step 2: Spawn spec-analyst Agent (Requirements Gathering and Analysis)
Use Task tool to spawn requirements analysis agent to perform Phase 1 Activity 1:
IMPORTANT: Apply placeholder substitution from Step 1.6 before spawning.
For Fresh Planning Mode:
subagent_type: "spec-analyst"
description: "Analyze requirements for {PROJECT_NAME}"
prompt: "Analyze requirements for {PROJECT_NAME}. Generate comprehensive requirements.md with:
- Executive Summary (project goals and scope)
- Functional Requirements (prioritized with IDs: FR1, FR2, etc.)
- Non-Functional Requirements (performance, security, scalability with metrics)
- User Stories with Acceptance Criteria (measurable criteria for each story)
- Stakeholder Analysis (identify all stakeholder groups and their needs)
- Assumptions and Constraints (technical, business, timeline)
- Success Metrics (how to measure project success)
Save to: docs/projects/{project-slug}/planning/requirements.md"
For Refinement Mode:
subagent_type: "spec-analyst"
description: "Refine requirements for {PROJECT_NAME}"
prompt: "Refine requirements for {PROJECT_NAME}.
IMPORTANT: Read existing file at docs/projects/{project-slug}/planning/requirements.md first.
Your task:
1. Analyze existing requirements document
2. Identify gaps, weak sections, or outdated content
3. Preserve well-written sections (don't rewrite what's already good)
4. Enhance based on new user input: {USER_INPUT}
5. Add missing sections or details
6. Update metrics to be more measurable
7. Ensure acceptance criteria are concrete and testable
Maintain document structure but improve quality and completeness.
Save updated version to: docs/projects/{project-slug}/planning/requirements.md"
Note: Replace {USER_INPUT} with actual value from state file or generic guidance.
Wait for completion → Read output: docs/projects/{project-slug}/planning/requirements.md
Expected Output: Comprehensive requirements document (typically 800-1,500 lines)
Step 3: Spawn spec-architect Agent (System Architecture Design)
Use Task tool to spawn architecture design agent to perform Phase 1 Activity 2:
For Fresh Planning Mode:
subagent_type: "spec-architect"
description: "Design system architecture for {PROJECT_NAME}"
prompt: "Design system architecture for {PROJECT_NAME} based on requirements at docs/projects/{project-slug}/planning/requirements.md.
Generate:
1. architecture.md with:
- Executive Summary
- Technology Stack (with justification for each choice)
- System Components (with interaction diagrams and relationships)
- Interface Specifications (APIs, CLIs, SDKs, data contracts as appropriate)
- Security Considerations (relevant security requirements and design patterns)
- Performance & Scalability (optimization strategies and scaling approach)
- Deployment Architecture (hosting, distribution, installation approach)
2. ADRs with Architecture Decision Records for key decisions:
- ADR format: Status, Context, Decision, Rationale, Consequences, Alternatives
- Create separate ADR for each major architectural decision
- Examples: technology choices, data storage strategy, communication patterns, security model
Save to: docs/projects/{project-slug}/planning/architecture.md, docs/projects/{project-slug}/adrs/*.md"
For Refinement Mode:
subagent_type: "spec-architect"
description: "Refine system architecture for {PROJECT_NAME}"
prompt: "Refine system architecture for {PROJECT_NAME}.
IMPORTANT: Read existing files first:
- docs/projects/{project-slug}/planning/architecture.md
- docs/projects/{project-slug}/adrs/*.md
- Updated requirements at docs/projects/{project-slug}/planning/requirements.md
Your task:
1. Review existing architecture and ADRs
2. Identify architectural gaps or areas needing improvement
3. Check if technology stack decisions still make sense
4. Enhance based on new/refined requirements: {USER_INPUT}
5. Add missing architectural components or considerations
6. Update existing ADRs if decisions have changed (mark old as 'Superseded', create new ADRs)
7. Preserve well-designed sections
Maintain consistency with existing ADRs but improve where needed.
Save to: docs/projects/{project-slug}/planning/architecture.md, docs/projects/{project-slug}/adrs/*.md"
Note: Use same {USER_INPUT} value from analyst step.
Wait for completion → Read outputs: docs/projects/{project-slug}/planning/architecture.md, docs/projects/{project-slug}/adrs/*.md
Expected Output: Architecture document (600-1,000 lines) + 3-5 ADRs (150-250 lines each)
Step 4: Spawn spec-planner Agent (Task Breakdown and Risk Assessment)
Use Task tool to spawn implementation planning agent to perform Phase 1 Activities 3 & 4:
For Fresh Planning Mode:
subagent_type: "spec-planner"
description: "Create implementation plan for {PROJECT_NAME}"
prompt: "Create implementation plan for {PROJECT_NAME} based on:
- Requirements: docs/projects/{project-slug}/planning/requirements.md
- Architecture: docs/projects/{project-slug}/planning/architecture.md
Generate tasks.md with:
1. Overview (total tasks, estimated effort, critical path, parallel streams)
2. Task Breakdown by Phase:
- Each task with: ID, complexity, effort estimate, dependencies, description
- Acceptance criteria for each task (concrete, measurable)
- Tasks should be atomic and implementable (1-8 hours each)
3. Risk Assessment:
- Technical risks with severity, probability, impact
- Mitigation strategies for each risk
4. Testing Strategy:
- Unit test coverage targets
- Integration test scenarios
- End-to-end test requirements
Save to: docs/projects/{project-slug}/planning/tasks.md"
For Refinement Mode:
subagent_type: "spec-planner"
description: "Refine implementation plan for {PROJECT_NAME}"
prompt: "Refine implementation plan for {PROJECT_NAME}.
IMPORTANT: Read existing files first:
- docs/projects/{project-slug}/planning/tasks.md
- Updated requirements at docs/projects/{project-slug}/planning/requirements.md
- Updated architecture at docs/projects/{project-slug}/planning/architecture.md
Your task:
1. Review existing task breakdown and risk assessment
2. Update tasks based on refined requirements/architecture changes
3. Add new tasks for new requirements
4. Remove or modify tasks that are no longer relevant
5. Re-assess effort estimates if architecture changed
6. Update risk assessment with any new technical risks
7. Preserve completed tasks or well-defined tasks
8. Ensure task dependencies are still accurate
Maintain task numbering continuity where possible.
Save to: docs/projects/{project-slug}/planning/tasks.md"
Wait for completion → Read output: docs/projects/{project-slug}/planning/tasks.md
Expected Output: Task breakdown document (500-800 lines with 15-30 tasks)
Step 5: Quality Gate Validation (Planning Phase Gate)
Orchestrator validates planning completeness using battle-tested Gate 1 criteria (see Quality Gates section):
Validation Process (from actual spec-orchestrator.md):
Decision:
Step 6: Iteration Loop (Max 3 Iterations)
When quality gate fails, apply battle-tested feedback framework from actual spec-orchestrator.md:
1. Failure Analysis Process
2. Corrective Action Planning
3. Communication Protocol
4. Concrete Feedback Generation (Execution)
Example Feedback for spec-analyst:
"Requirements analysis incomplete. Score: 68/100
Gaps identified:
- Non-functional requirements missing performance metrics (0/5 points)
→ Add specific metrics: API response time, throughput, concurrent users
- User stories lack measurable acceptance criteria (2/5 points)
→ Provide concrete, testable criteria for each story
- Stakeholder analysis incomplete (2/5 points)
→ Identify admin users, end users, external integrations
Please regenerate requirements.md addressing these specific gaps."
Re-spawn agent with feedback → Wait for revised output → Return to Step 5 (Quality Gate)
Iteration Limit Enforcement:
Step 7: Deliverable Handoff
Generate planning summary and return artifacts to user:
Planning Summary Includes:
Deliverables Returned:
Status: "✅ Planning phase complete. Development-ready specifications available."
Handoff: Development team can begin implementation using planning artifacts as source of truth
Use this battle-tested status report format (from actual spec-orchestrator.md) to track planning phase progress:
# Planning Workflow Status Report
**Project**: [Project Name]
**Started**: [Timestamp]
**Current Step**: [Agent in progress]
**Overall Progress**: [Percentage]
## Agent Execution Status
### ✅ spec-analyst (Complete)
- Requirements analysis completed
- Output: docs/projects/{project-slug}/planning/requirements.md (~1,200 lines)
- Duration: 45 minutes
- Status: ✅ COMPLETE
### 🔄 spec-architect (In Progress)
- Architecture design in progress
- Current task: Creating ADRs for technology stack decisions
- Output: docs/projects/{project-slug}/planning/architecture.md + docs/projects/{project-slug}/adrs/*.md
- Duration: 30 minutes elapsed
- Status: 🔄 IN PROGRESS
### ⏳ spec-planner (Pending)
- Waiting for architecture completion
- Will create: docs/projects/{project-slug}/planning/tasks.md
- Status: ⏳ PENDING
## Quality Gate Status
- Planning Gate: ⏳ Pending (waiting for all agents to complete)
- Threshold: ≥ 85%
- Iterations used: 0/3
## Artifacts Created
1. ✅ `docs/projects/{project-slug}/planning/requirements.md` - Complete requirements specification
2. 🔄 `docs/projects/{project-slug}/planning/architecture.md` - System architecture design (in progress)
3. 🔄 `docs/projects/{project-slug}/adrs/*.md` - Architecture Decision Records (2/5 complete)
4. ⏳ `docs/projects/{project-slug}/planning/tasks.md` - Task breakdown (pending)
## Next Steps
1. Complete spec-architect agent (architecture + remaining ADRs)
2. Spawn spec-planner agent for task breakdown
3. Execute quality gate validation
4. [If needed] Iterate based on feedback
## Risk Assessment
- ✅ All agents on track, no blocking issues identified
TodoWrite Integration: Use TodoWrite tool to maintain real-time task list tracking agent spawning and completion.
Planning Phase (3 specialized agents):
The skill orchestrates these agents sequentially:
spec-analyst (Step 2): Requirements gathering and analysis
docs/projects/{project-slug}/planning/requirements.md (~800-1,500 lines)spec-architect (Step 3): System architecture design and ADR creation
docs/projects/{project-slug}/planning/architecture.md + docs/projects/{project-slug}/adrs/*.md (3-5 ADRs)spec-planner (Step 4): Task breakdown, risk assessment, and testing strategy
docs/projects/{project-slug}/planning/tasks.md (~500-800 lines with 15-30 tasks)Note: The skill itself (this SKILL.md) acts as the orchestrator, managing sequential execution, quality gates (85% threshold), iteration loops with feedback, and deliverable handoff. There is no separate spec-orchestrator agent.
Purpose: Validate planning completeness before handoff to development team
Core Validation Criteria (from battle-tested Gate 1):
Weight: 30 points
Verify requirements artifacts are comprehensive and unambiguous:
Validation:
Weight: 30 points
Validate technical design is sound and implementable:
Validation:
Weight: 25 points
Ensure implementation plan is actionable and well-estimated:
Validation:
Weight: 15 points
Confirm technical risks are identified with mitigation strategies:
Validation:
Scoring Method:
Validation Process (battle-tested 4-step method):
Maximum Iterations: 3 attempts per planning session
When Quality Gate Fails (Score < 85%):
Categorize gaps by severity:
Map failures to responsible agent:
Create targeted feedback for agent re-spawning with:
Example Feedback Templates:
For spec-analyst (Requirements Gap):
"Requirements analysis incomplete. Score: 68/100
Gaps identified:
- Non-functional requirements missing performance metrics (0/5 points)
→ Add specific metrics: API response time < 200ms p95, throughput > 1000 req/s,
concurrent users > 500
- User stories lack measurable acceptance criteria (2/5 points)
→ Provide concrete, testable criteria for each story
→ Example: 'AC1: User can create task within 2 seconds' (not 'AC1: Task creation works')
- Stakeholder analysis incomplete (2/5 points)
→ Identify: admin users, end users, API consumers, external integrations
→ Document needs and priorities for each stakeholder group
Please regenerate requirements.md addressing these specific gaps."
For spec-architect (Architecture Gap):
"Architecture design incomplete. Score: 72/100
Gaps identified:
- Scalability not addressed (0/5 points)
→ Design for 10x growth: horizontal scaling strategy, database sharding plan
→ Address: load balancing, caching layers, CDN for static assets
- Security considerations incomplete (1/5 points)
→ Add: authentication mechanism (JWT/OAuth), authorization model (RBAC),
data encryption (at rest and in transit), input validation strategy
- ADRs missing key decisions (2/5 points)
→ Create ADR for: database choice (SQL vs. NoSQL), real-time architecture
(WebSockets vs. polling), deployment platform (cloud provider choice)
→ Format: Status, Context, Decision, Rationale, Consequences, Alternatives
Please regenerate architecture.md and adrs/ addressing these gaps."
For spec-planner (Task Breakdown Gap):
"Task breakdown incomplete. Score: 76/100
Gaps identified:
- Tasks too large and not atomic (4/10 points)
→ Break down: 'Build authentication system' is too broad
→ Should be: 'T2.1: Create user registration API endpoint (4h)',
'T2.2: Implement JWT token generation (3h)', etc.
- Dependencies not clearly identified (2/5 points)
→ Use task IDs: 'Dependencies: T1.3, T2.1' (not 'depends on auth')
→ Ensure topological order (no circular dependencies)
- Risk mitigation incomplete (3/5 points)
→ For each risk, provide concrete mitigation strategy
→ Example: 'Risk: WebSocket scaling' → 'Mitigation: Implement Redis adapter
early in Phase 2, test with 1000 concurrent connections'
Please regenerate tasks.md addressing these gaps."
Execute re-spawning process:
Example Re-spawn for spec-analyst:
Agent: spec-analyst
Prompt: "Improve requirements.md based on feedback.
Previous version: docs/projects/{project-slug}/planning/requirements.md
Feedback:
[Insert feedback from Step 3]
Please revise requirements.md to address all identified gaps. Focus on:
1. Adding quantitative non-functional requirements
2. Providing measurable acceptance criteria for all user stories
3. Completing stakeholder analysis with needs documentation
Target: 85% quality gate score"
Return to Step 5 of Orchestration Workflow (Quality Gate Validation):
Maximum 3 iterations per planning session to prevent infinite loops:
Iteration 1: Initial attempt (typically 60-75% score)
Iteration 2: Refinement with feedback (typically 75-85% score)
Iteration 3: Final optimization (target 85%+ score)
After 3 iterations, if score < 85%:
Return current artifacts to user with status report:
"Planning quality gate not reached after 3 iterations.
Current score: 82/100
Remaining gaps:
- [List specific gaps still present]
Artifacts available:
- requirements.md (mostly complete, minor gaps)
- architecture.md (complete)
- tasks.md (needs minor refinement)
Options:
A) Accept current quality level and proceed to development
B) Provide manual guidance to close remaining gaps
C) Restart planning with clearer initial requirements"
User decides next action (orchestrator waits for user input)
Document lessons learned for process improvement:
docs/projects/{project-slug}/planning/*.md: Planning phase outputs (requirements, architecture, tasks)docs/projects/{project-slug}/adrs/*.md: Architecture Decision Records per projectWhen user chooses "Archive old + fresh start" for an existing project:
docs/projects/{project-slug}/
├── .archive/
│ ├── 20251120-094500/ # Timestamp: YYYYMMDD-HHMMSS
│ │ ├── planning/
│ │ │ ├── requirements.md
│ │ │ ├── architecture.md
│ │ │ └── tasks.md
│ │ └── adrs/
│ │ └── *.md
│ └── 20251118-153000/ # Previous archive (if multiple refinements)
│ └── ...
├── planning/ # Current/active specs
│ ├── requirements.md
│ ├── architecture.md
│ └── tasks.md
└── adrs/ # Current/active ADRs
└── *.md
Archive Benefits:
These 5 principles from actual spec-orchestrator.md, adapted for planning-only workflow:
Clear Phase Definition
Quality-First Approach
Continuous Communication
Adaptive Planning
Risk Management
From actual spec-orchestrator.md, applicable to planning workflow:
From actual spec-orchestrator.md, adapted for planning phase:
User Interaction:
Set Realistic Expectations:
Provide Clear Prompts:
Allow Sufficient Time:
Monitor Progress:
Use Checklist Systematically:
Provide Actionable Feedback:
Track Iterations:
Enforce Max 3 Iterations:
Generate Executive Summary:
Highlight Key Artifacts:
Set Clear Next Steps:
❌ Pitfall 1: Vague Requirements
Symptom: Requirements say "should be fast", "must be secure", "needs to scale"
Impact: Architecture can't make concrete decisions, tasks can't be estimated
Solution: spec-analyst must quantify all non-functional requirements
Quality Gate Catches This: "Non-functional requirements missing metrics (0/5 points)"
❌ Pitfall 2: Over-Engineering Architecture
Symptom: Architecture designed for 1M users when current need is 100 users
Impact: Increased complexity, longer development time, higher costs
Solution: spec-architect must align with actual requirements and constraints
Quality Gate Catches This: "Architecture doesn't justify complexity or align with requirements"
❌ Pitfall 3: Tasks Too Large
Symptom: Tasks like "Build authentication system" (days of work, unclear scope)
Impact: Hard to estimate, hard to track progress, hard to parallelize
Solution: spec-planner must break into atomic tasks (1-8 hours each)
Quality Gate Catches This: "Tasks not atomic and implementable (< 10 points)"
❌ Pitfall 4: Missing ADRs
Symptom: Technology choices without documented rationale ("We'll use React")
Impact: Future developers don't understand why choices were made, can't evaluate alternatives
Solution: spec-architect must create ADR for key decisions
Quality Gate Catches This: "Key decisions not documented in ADRs (< 5 points)"
❌ Pitfall 5: No Risk Assessment
Symptom: Plan assumes everything will work perfectly (no risk identification)
Impact: Surprises during implementation, missed dependencies, timeline delays
Solution: spec-planner must identify risks and mitigation strategies
Quality Gate Catches This: "Technical risks not identified (< 5 points)"
✅ 1. Thorough Requirements Analysis
Invest Time Upfront:
Quantify Everything:
Validate with Stakeholders:
✅ 2. Justified Architecture Decisions
Document WHY (ADRs), not just WHAT:
Consider Alternatives Explicitly:
Architecture Should Be Traceable:
✅ 3. Actionable Task Breakdown
Tasks Must Be Implementation-Ready:
Include Effort Estimates:
Identify Dependencies Explicitly:
✅ 4. Iterative Refinement
Embrace Quality Gate Feedback:
Address Gaps Systematically:
Max 3 Iterations Keeps Process Bounded:
✅ 5. Clear Handoff Documentation
Development Team Should Understand:
Planning Artifacts Are Living Documents:
Handoff Includes Next Steps:
IMPORTANT: This skill is project-agnostic and works for ANY type of software project:
The examples below show web applications because they're common and illustrative. Your project's specific sections, terminology, and architectural concerns will vary based on your domain. The agents adapt their outputs to match your project requirements.
This template from actual spec-orchestrator.md shows typical planning activities for web applications AS ONE EXAMPLE:
Phase 1: Planning & Analysis Activities
Requirements Gathering and Stakeholder Analysis
System Architecture and Technology Stack Selection
Database Design and Data Modeling
API Specification and Contract Definition
Security and Compliance Requirements
Performance and Scalability Planning
Deliverables: requirements.md, architecture.md, tasks.md, adrs/*.md
This detailed example demonstrates the complete planning workflow from query analysis to deliverable handoff.
User Request: "Plan a task management web application with user authentication, real-time updates, and mobile responsiveness"
Scope Identified:
Constraints: Not specified (assume standard web stack)
Stakeholders: End users (task managers), development team
Suitability Check: ✅ Clear scope, well-defined domain, suitable for planning workflow
Generated File: docs/projects/task-management-app/planning/requirements.md (abbreviated example)
# Task Management Application - Requirements
## Executive Summary
A web-based task management system enabling users to create, organize, and track
tasks with real-time collaboration features and mobile accessibility.
## Functional Requirements
### FR1: User Management (Priority: High)
- FR1.1: User registration with email/password
- FR1.2: Secure authentication (JWT-based)
- FR1.3: User profile management
- FR1.4: Password reset functionality
### FR2: Task Management (Priority: High)
- FR2.1: Create tasks with title, description, due date, priority
- FR2.2: Update task status (Todo, In Progress, Done)
- FR2.3: Delete tasks
- FR2.4: Organize tasks in projects/categories
### FR3: Real-Time Updates (Priority: Medium)
- FR3.1: WebSocket connection for live updates
- FR3.2: Instant task status synchronization across devices
- FR3.3: Online/offline user presence indicators
### FR4: Mobile Responsiveness (Priority: High)
- FR4.1: Responsive design for mobile, tablet, desktop
- FR4.2: Touch-optimized interactions
- FR4.3: Progressive Web App (PWA) support
## Non-Functional Requirements
### NFR1: Performance
- API response time < 200ms (p95)
- Real-time update latency < 100ms
- Support 1,000 concurrent users
### NFR2: Security
- HTTPS for all communications
- JWT tokens with 1-hour expiration
- Input validation and sanitization
- SQL injection prevention
### NFR3: Scalability
- Horizontal scaling capability
- Database connection pooling
- Stateless API design
## User Stories
**US1**: As a user, I want to create tasks so that I can track my work.
- AC1: User can create task with title (required) and description (optional)
- AC2: Task is saved and appears in task list immediately
- AC3: Task creation fails gracefully with error message if title is empty
**US2**: As a user, I want to see real-time updates when my team changes tasks.
- AC1: When another user updates a task, my view updates within 2 seconds
- AC2: Update animation shows which task changed
- AC3: Connection loss shows offline indicator and queues updates
Initial Quality Check: Requirements document is comprehensive (estimated 90/100)
Generated Files:
docs/projects/task-management-app/planning/architecture.mddocs/projects/task-management-app/adrs/001-technology-stack.mddocs/projects/task-management-app/adrs/002-real-time-architecture.mdarchitecture.md (abbreviated):
# System Architecture
## Technology Stack
- **Frontend**: React 18 + TypeScript + Vite
- **Backend**: Node.js + Express + TypeScript
- **Database**: PostgreSQL 15
- **Real-Time**: Socket.io
- **Authentication**: JWT + bcrypt
- **Hosting**: Vercel (frontend) + Railway (backend + database)
## System Components
### Frontend Application
- React SPA with routing (React Router v6)
- State management: React Query + Context API
- UI components: Tailwind CSS + Shadcn/ui
- Real-time: Socket.io client
### Backend API
- RESTful API for CRUD operations
- WebSocket server for real-time updates
- JWT middleware for authentication
- PostgreSQL connection pool
### Database Schema
- users (id, email, password_hash, created_at)
- tasks (id, user_id, title, description, status, due_date, priority, created_at, updated_at)
- projects (id, name, user_id)
- Indexes on user_id, status, due_date
## API Specification
### REST Endpoints
- POST /api/auth/register - Create new user
- POST /api/auth/login - Authenticate user (returns JWT)
- GET /api/tasks - List user's tasks (with filtering)
- POST /api/tasks - Create new task
- PATCH /api/tasks/:id - Update task
- DELETE /api/tasks/:id - Delete task
### WebSocket Events
- connection, task:created, task:updated, task:deleted, disconnect
## Security
- HTTPS enforced in production
- JWT tokens in httpOnly cookies
- CORS configured for frontend origin
- Rate limiting: 100 requests/15min per IP
- Password hashing with bcrypt (cost factor 10)
## Performance & Scalability
- Database connection pooling (max 20 connections)
- Stateless API design allows horizontal scaling
- WebSocket sticky sessions or Redis adapter for multi-instance
ADR 002-real-time-architecture.md:
# ADR 002: Real-Time Architecture with Socket.io
## Status: Accepted
## Context
Application requires real-time task updates across devices. Options:
1. Polling (HTTP requests every N seconds)
2. Server-Sent Events (SSE)
3. WebSockets (Socket.io)
## Decision
Use WebSockets with Socket.io library.
## Rationale
- Bi-directional communication (client ↔ server)
- Low latency < 100ms (meets NFR1)
- Socket.io benefits: automatic reconnection, fallback to polling
- Horizontal scaling possible with Redis adapter
## Consequences
- **Positive**: Real-time UX, efficient bandwidth usage
- **Negative**: Persistent connections (scalability consideration)
- **Mitigation**: Implement Redis adapter for multi-instance
## Alternatives Considered
- **Polling**: Simple but wasteful (60 req/min per user)
- **SSE**: Uni-directional only (server → client)
Initial Quality Check: Architecture document is solid (estimated 88/100)
Generated File: docs/projects/task-management-app/planning/tasks.md (abbreviated)
# Implementation Tasks
## Overview
- **Total Tasks**: 24
- **Estimated Effort**: 12-15 person-days
- **Critical Path**: Authentication → Task CRUD → Real-time sync
- **Parallel Streams**: Frontend + Backend after API contract defined
## Phase 1: Project Setup (1 day)
### T1.1: Initialize Frontend Project
- Complexity: Low | Effort: 2h | Dependencies: None
- Create React + Vite + TypeScript project with Tailwind
- AC: npm create vite working, Tailwind configured, React Router setup
### T1.2: Initialize Backend Project
- Complexity: Low | Effort: 2h | Dependencies: None
- Create Node.js + Express + TypeScript with PostgreSQL connection
- AC: Express server starts, PostgreSQL connection successful
### T1.3: Database Schema Setup
- Complexity: Medium | Effort: 2h | Dependencies: T1.2
- Create SQL migration for users and tasks tables with indexes
- AC: Tables created, foreign keys set, indexes on user_id/status/due_date
## Phase 2: Authentication (2-3 days)
### T2.1: User Registration API
- Complexity: Medium | Effort: 4h | Dependencies: T1.3
- POST /api/auth/register with email validation and password hashing
- AC: Email validated, password hashed with bcrypt, user created, returns 201
### T2.2: User Login API
- Complexity: Medium | Effort: 4h | Dependencies: T2.1
- POST /api/auth/login with JWT generation
- AC: Password verified, JWT generated (1h expiration), returns token + user
### T2.3: JWT Authentication Middleware
- Complexity: Medium | Effort: 3h | Dependencies: T2.2
- Express middleware to verify JWT tokens on protected routes
- AC: JWT extracted from header, verified, user ID attached, returns 401 if invalid
[... 18 more tasks for Task CRUD, Real-time sync, Mobile UI ...]
## Risk Assessment
### Risk 1: Real-time scaling complexity
- Severity: Medium | Probability: High
- Impact: Multi-instance deployment requires Redis adapter
- Mitigation: Implement Redis adapter early (Phase 4)
### Risk 2: WebSocket connection stability
- Severity: Medium | Probability: Medium
- Impact: Users on unstable networks may lose updates
- Mitigation: Socket.io auto-reconnect + optimistic UI updates
### Risk 3: Database connection pool exhaustion
- Severity: High | Probability: Low
- Impact: API unresponsive under high load
- Mitigation: Max pool size 20, connection timeout, monitoring
## Testing Strategy
- Unit Tests: 80% coverage (auth logic, task CRUD, validation)
- Integration Tests: API endpoints with test database, WebSocket flows
- E2E Tests (Cypress): Registration, login, task creation, real-time sync
Initial Quality Check: Task breakdown is actionable (estimated 86/100)
Checklist Scoring:
Requirements Completeness: 22/25 points
Architecture Soundness: 23/25 points
Task Breakdown Quality: 20/20 points
Architecture Decision Records: 8/10 points
Risk Management: 10/10 points
Handoff Readiness: 9/10 points
Total Score: 92/100 = 92% ✅ PASS (threshold: 85%)
Decision: Proceed to Step 7 (Deliverable Handoff) - quality gate passed on first attempt
Not needed - Score of 92% exceeds 85% threshold on initial attempt.
Reason for high score: Task management is a well-understood domain with clear requirements. User provided sufficient detail in initial request.
Planning Summary:
✅ Scope: Task management web app with authentication, real-time updates, mobile responsiveness
✅ Architecture: React frontend + Node.js backend + PostgreSQL database + Socket.io for real-time
✅ Key Architectural Decisions:
✅ Implementation Roadmap (24 tasks, 12-15 person-days):
✅ Risks Identified:
✅ Next Steps for Development Team:
Deliverables Provided:
docs/projects/task-management-app/planning/requirements.md (~1,200 lines)docs/projects/task-management-app/planning/architecture.md (~800 lines)docs/projects/task-management-app/planning/tasks.md (~600 lines with 24 tasks)docs/projects/task-management-app/adrs/001-technology-stack.md (~150 lines)docs/projects/task-management-app/adrs/002-real-time-architecture.md (~200 lines)Status: ✅ Planning phase complete. Development-ready specifications available.
Estimated Development Timeline: 12-15 person-days (approximately 3 weeks for solo developer, 2 weeks for pair)
First-Attempt Success: Quality gate passed with 92% score on initial attempt (no iterations needed)
Sequential Dependencies: Each agent built on previous agent's output:
Quality Gate Value: Even with 92% passing score, quality gate identified minor gaps:
Realistic Outputs: Agent outputs shown are representative of actual planning artifacts:
Development-Ready: With these artifacts, a development team can immediately begin implementation:
Note: This skill focuses on planning phase only. It produces development-ready specifications but does not implement code, tests, or validation.