SOPs define how the crew tackles different types of development tasks. This guide explains each SOP, when to use it, and how to customize it.
- Overview
- Feature Development SOP
- Bug Fix SOP
- Refactoring SOP
- Choosing the Right SOP
- Customizing SOPs
- Creating Custom SOPs
SOPs (Standard Operating Procedures) are predefined workflows that ensure consistent, high-quality results. Each SOP defines:
- Steps: Sequence of agent actions
- Agents: Which agents participate
- Dependencies: Which steps must complete before others
- Parallel execution: Which steps can run simultaneously
- Duration: Estimated time to complete
| SOP | Duration | Steps | Agents | Best For |
|---|---|---|---|---|
| feature | 60-90 min | 6 | PM, TA, Design, FE, QA | New features, enhancements |
| bugfix | 40-70 min | 5 | PM, TA, FE, QA | Bug fixes, corrections |
| refactor | 100-160 min | 6 | PM, TA, FE, QA | Code improvements, restructuring |
The feature SOP is designed for implementing new functionality from scratch. It includes research, design, implementation, and thorough testing.
Use for:
- ✅ New features
- ✅ Major enhancements
- ✅ New components or modules
- ✅ Complex integrations
Don't use for:
- ❌ Simple bug fixes
- ❌ Minor tweaks
- ❌ Quick patches
User Request
↓
[1] PM - Planning & Analysis (5-10 min)
↓
[2] TA - Research & Specs (15-20 min)
↓ (parallel with Design if enabled)
[3] Design - UX Review (10-15 min)
↓
[4] FE - Implementation (20-30 min)
↓
[5] QA - Testing (10-15 min)
↓
[6] PM - Final Review (5 min)
↓
Result
Step 1: PM Planning
- Analyzes user request
- Determines scope and complexity
- Creates high-level plan
- Assigns tasks to agents
Step 2: TA Research
- Researches best practices
- Reviews official documentation
- Analyzes existing codebase
- Provides technical specifications
- Identifies dependencies and risks
Step 3: Design Review (optional, parallel with TA)
- Reviews UX flows
- Recommends design patterns
- Ensures consistency with design system
- Identifies accessibility concerns
Step 4: FE Implementation
- Implements based on TA specs and Design guidelines
- Writes clean, maintainable code
- Follows project conventions
- Adds necessary documentation
Step 5: QA Testing
- Writes unit tests
- Writes integration tests
- Verifies functionality
- Checks edge cases
- Ensures code quality
Step 6: PM Final Review
- Reviews all outputs
- Ensures requirements met
- Generates summary
- Creates completion report
# Basic feature implementation
crew-opencode crew "Add user authentication with email/password"
# Explicit feature SOP
crew-opencode crew "Add dark mode toggle" --sop feature
# With project path
crew-opencode crew "Add API rate limiting" --sop feature --project /path/to/project{
"sop": {
"feature": {
"enabled": true,
"parallel": ["ta", "design"] // TA and Design run simultaneously
}
}
}Typical Duration: 60-90 minutes Typical Cost: $0.50 - $2.00
Factors affecting time:
- Complexity of feature
- Amount of research needed
- Number of files to modify
- Test coverage requirements
The bugfix SOP is optimized for identifying and fixing bugs quickly with minimal, targeted changes.
Use for:
- ✅ Fixing crashes or errors
- ✅ Correcting logic bugs
- ✅ Resolving UI issues
- ✅ Performance problems
Don't use for:
- ❌ Adding new features
- ❌ Major refactoring
- ❌ Architecture changes
Bug Report
↓
[1] PM - Triage & Prioritization (3-5 min)
↓
[2] TA - Root Cause Analysis (10-15 min)
↓
[3] FE - Minimal Fix (15-25 min)
↓
[4] QA - Regression Testing (10-15 min)
↓
[5] PM - Verification (5 min)
↓
Fixed
Step 1: PM Triage
- Assesses bug severity
- Determines priority
- Creates fix strategy
- Assigns resources
Step 2: TA Root Cause Analysis
- Investigates the issue
- Identifies root cause
- Analyzes impact
- Recommends minimal fix approach
Step 3: FE Implementation
- Implements targeted fix
- Avoids unnecessary changes
- Preserves existing functionality
- Documents the fix
Step 4: QA Regression Testing
- Verifies bug is fixed
- Tests related functionality
- Checks for new issues
- Validates edge cases
Step 5: PM Verification
- Confirms fix works
- Reviews for side effects
- Generates fix summary
# Basic bug fix
crew-opencode crew "Fix crash when clicking logout button" --sop bugfix
# With description
crew-opencode crew "Memory leak in dashboard component" --sop bugfix
# Specific project
crew-opencode crew "API returning 500 error" --sop bugfix --project ./backend{
"sop": {
"bugfix": {
"enabled": true,
"parallel": [] // No parallel execution (sequential for safety)
}
}
}Typical Duration: 40-70 minutes Typical Cost: $0.30 - $1.00
Factors affecting time:
- Bug complexity
- Time to reproduce
- Code coverage
- Dependency analysis
The refactor SOP is designed for improving code quality without changing functionality. It includes comprehensive testing to ensure nothing breaks.
Use for:
- ✅ Code restructuring
- ✅ Performance optimization
- ✅ Modernizing legacy code
- ✅ Improving maintainability
- ✅ Reducing technical debt
Don't use for:
- ❌ Bug fixes
- ❌ New features
- ❌ Quick improvements
Refactor Request
↓
[1] PM - Strategy & Planning (10-15 min)
↓
[2] TA - Dependency Analysis (20-30 min)
↓
[3] FE - Refactoring (40-60 min)
↓
[4] QA - Comprehensive Testing (20-30 min)
↓
[5] PM - Impact Review (10 min)
↓
Refactored
Step 1: PM Strategy
- Defines refactoring goals
- Identifies risks
- Creates rollback plan
- Sets success criteria
Step 2: TA Dependency Analysis
- Maps all dependencies
- Identifies breaking points
- Analyzes impact scope
- Recommends approach
- Plans incremental steps
Step 3: FE Refactoring
- Performs code changes
- Maintains functionality
- Improves code quality
- Updates documentation
- Follows best practices
Step 4: QA Comprehensive Testing
- Runs all existing tests
- Adds new tests if needed
- Verifies no regression
- Checks performance
- Validates edge cases
Step 5: PM Impact Review
- Reviews all changes
- Assesses improvement
- Documents benefits
- Creates migration notes
# Class to functional components
crew-opencode crew "Convert User component to use hooks" --sop refactor
# Performance optimization
crew-opencode crew "Optimize database queries in API" --sop refactor
# Modernization
crew-opencode crew "Migrate from JavaScript to TypeScript" --sop refactor{
"sop": {
"refactor": {
"enabled": true,
"parallel": ["ta"] // TA can run parallel analysis
}
}
}Typical Duration: 100-160 minutes Typical Cost: $1.00 - $3.00
Factors affecting time:
- Size of refactoring
- Complexity of dependencies
- Test coverage needs
- Number of files affected
Is it a bug?
├─ Yes → Use BUGFIX
└─ No ↓
Are you changing functionality?
├─ No → Use REFACTOR
└─ Yes ↓
Is it a new feature?
├─ Yes → Use FEATURE
└─ Unclear → Use FEATURE (default)
Use FEATURE for:
- "Add user authentication"
- "Create admin dashboard"
- "Implement payment integration"
- "Add email notifications"
- "Build API endpoints"
Use BUGFIX for:
- "Fix crash on logout"
- "Resolve memory leak"
- "Correct validation logic"
- "Fix broken link"
- "Resolve API 500 error"
Use REFACTOR for:
- "Convert to TypeScript"
- "Optimize performance"
- "Modernize code"
- "Improve error handling"
- "Restructure components"
"Update homepage design"
- Use FEATURE if adding new elements
- Use REFACTOR if just improving existing
"Improve API performance"
- Use REFACTOR if changing implementation
- Use BUGFIX if fixing specific slow query
"Add error handling"
- Use FEATURE if adding comprehensive system
- Use BUGFIX if fixing specific missing error
If you don't need a particular SOP:
{
"sop": {
"refactor": {
"enabled": false // Disable refactor SOP
}
}
}Control which agents run in parallel:
{
"sop": {
"feature": {
"parallel": ["ta", "design", "qa"] // Multiple agents parallel
},
"bugfix": {
"parallel": [] // All sequential (safer for bugs)
}
}
}Parallel execution benefits:
- ⚡ Faster total time
- 💰 Same cost (just faster)
- 🎯 Good for independent tasks
Sequential execution benefits:
- 🔒 Safer (less chance of conflicts)
- 📊 Easier to debug
- 🎯 Good for dependent tasks
In v1.1, you'll be able to create custom SOPs:
{
"sop": {
"api-development": {
"enabled": true,
"description": "Develop backend API endpoints",
"steps": [
{
"agent": "pm",
"action": "Plan API structure",
"order": 1
},
{
"agent": "ta",
"action": "Design data models",
"order": 2
},
{
"agent": "fe",
"action": "Implement endpoints",
"order": 3
},
{
"agent": "qa",
"action": "Test API",
"order": 4
}
],
"parallel": ["ta"]
}
}
}Future versions will support:
- SOP templates marketplace
- Community-contributed SOPs
- Industry-specific workflows
- Team custom SOPs
Don't try to force a bug fix through the feature SOP. Use the appropriate workflow for better results.
When in doubt, use the feature SOP. It's comprehensive and catches most cases.
Use sequential execution (no parallel) for:
- Security-sensitive features
- Database migrations
- Complex refactoring
Use parallel execution for:
- Research + Design phases
- Independent components
- Documentation tasks
Track how long workflows take:
# Check workflow duration
crew-opencode reports --stats
# View specific workflow
crew-opencode status <workflow-id>Different projects may need different SOP configurations:
# Project A (backend-heavy)
cd project-a
cat .opencode/crew-opencode/config.json
# → design disabled, parallel TA
# Project B (frontend-heavy)
cd project-b
cat .opencode/crew-opencode/config.json
# → all agents enabled, parallel designSolution 1: Use a simpler SOP
# Use bugfix instead of feature for small changes
crew-opencode crew "Fix typo" --sop bugfixSolution 2: Enable parallel execution
{
"sop": {
"feature": {
"parallel": ["ta", "design"]
}
}
}Solution 3: Disable optional agents
{
"crew": {
"design": { "enabled": false }
}
}Solution: Explicitly specify the SOP
# Don't rely on auto-detection
crew-opencode crew "Your task" --sop featureCheck: SOP is enabled
crew-opencode config sop.feature.enabledSolution: Enable the SOP
{
"sop": {
"feature": {
"enabled": true
}
}
}Feature SOP (60-90 min):
- PM (Opus): $0.15
- TA (Sonnet): $0.024
- Design (GPT): $0.018
- FE (Gemini): $0.024
- QA (Haiku): $0.0045
- Total: ~$0.22
Bugfix SOP (40-70 min):
- PM (Opus): $0.10
- TA (Sonnet): $0.016
- FE (Gemini): $0.016
- QA (Haiku): $0.003
- Total: ~$0.14
Refactor SOP (100-160 min):
- PM (Opus): $0.20
- TA (Sonnet): $0.032
- FE (Gemini): $0.048
- QA (Haiku): $0.006
- Total: ~$0.29
Next: Learn about Configuration or return to Getting Started.