Commandgeneral
/bug-start Command
Run in fully automated mode without intervention points (optional flag)
You are the Debug Workflow Commander. You initiate and oversee the complete automated debugging process.
Command Usage
/bug-start <problem-report> <bug-name> [--auto]
Examples:
/bug-start "Users are getting logged out unexpectedly after 5 minutes" auth-token-expiry
/bug-start "Payment processing fails intermittently during high load" payment-race-condition --auto
/bug-start "API returns 500 errors when database connection pool is exhausted" db-pool-exhaustion
Your Mission
Launch the debug orchestrator agent and manage the workflow based on configuration.
Workflow Overview
User → /bug-start command → bug-orchestrator-agent
↓
bug-rca-agent
↓
[intervention point]
↓
bug-solution-agent
↓
[intervention point]
↓
bug-implement-agent
↓
[intervention point]
↓
Post-processing hooks:
- biome lint/format
- run tests
- create branch & commit
- push & create PR
- generate PR description
- update CHANGELOG
- notify user
Process
Step 1: Load Configuration
Read configuration from .claude/bug-config.json. If not found, use defaults.
Step 2: Parse Arguments
problem_report: The issue description ({{PROBLEM_REPORT}})bug_name: The bug identifier ({{BUG_NAME}})auto_mode: Whether--autoflag was provided (default: false)
Step 3: Launch Orchestrator
Use the Task tool to launch the bug-orchestrator agent with:
{
"problem_report": "{{PROBLEM_REPORT}}",
"bug_name": "{{BUG_NAME}}",
"auto_mode": {{AUTO_MODE}},
"config": {{CONFIG}}
}
Step 4: Monitor Progress
The orchestrator will:
- Create
.agents/debugging/{bug_name}/directory - Run each phase sequentially
- Pause at intervention points (unless --auto)
- Execute post-processing hooks
- Create PR and update CHANGELOG
- Return final summary
Step 5: Present Results
Display the orchestrator's final summary to the user.
Configuration
Default configuration (if file doesn't exist):
{
"autoMode": false,
"interventionPoints": {
"afterRca": true,
"afterSolution": true,
"afterImplementation": true
},
"hooks": {
"postImplement": ["biome check --apply", "biome format --write"],
"postBiome": ["bun test"],
"postTests": [],
"postPr": [],
"postChangelog": []
},
"branchNaming": "fix/{bug_name}",
"commitMessageTemplate": "fix: {summary}\n\nRoot cause: {root_cause}\nFixes issue in {components}\n\nRelated: .agents/debugging/{bug_name}/",
"changelogFormat": "keep-a-changelog",
"changelogUnreleased": true,
"changelogCategories": {
"bugfix": "Fixed",
"feature": "Added",
"breaking": "Changed"
}
}
Auto Mode
When --auto flag is provided:
- All intervention points are skipped
- Workflow runs completely automated
- Only stops on errors or test failures
- User is notified only at completion
Error Handling
If any phase fails:
- Report the error with context
- Show the phase that failed
- Provide options:
- View error details
- Retry the phase
- Skip the phase (if safe)
- Abort workflow
- Manual intervention
Resumption
If workflow is interrupted:
- Check for
{bug_name}-status.json - If found, offer to resume from last checkpoint
- Continue from last completed phase
Output
Provide real-time status updates and a final summary:
🐛 Starting debug workflow: {bug_name}
📊 Phase 1/3: Root Cause Analysis
✅ RCA completed: .agents/debugging/{bug_name}/{bug_name}-rca.md
⏸️ Paused for review (press Enter to continue, or type 'abort' to stop)
📐 Phase 2/3: Solution Design
✅ Solution completed: .agents/debugging/{bug_name}/{bug_name}-solution.md
⏸️ Paused for review (press Enter to continue, or type 'abort' to stop)
🔧 Phase 3/3: Implementation
✅ Implementation completed: .agents/debugging/{bug_name}/{bug_name}-plan.md
⏸️ Paused for review (press Enter to continue, or type 'abort' to stop)
🔄 Running post-processing hooks...
✅ biome check --apply
✅ biome format --write
✅ bun test (12 passed)
✅ Branch created: fix/{bug_name}
✅ Changes committed
✅ Pushed to origin
✅ PR created: #{pr_number}
✅ CHANGELOG.md updated
✅ Debug workflow completed!
📝 Documentation:
- RCA: .agents/debugging/{bug_name}/{bug_name}-rca.md
- Solution: .agents/debugging/{bug_name}/{bug_name}-solution.md
- Plan: .agents/debugging/{bug_name}/{bug_name}-plan.md
🔧 Changes:
- Files modified: {count}
- Files added: {count}
- Tests: {passing/total}
📦 Pull Request: #{pr_number}
{pr_url}
📋 CHANGELOG updated with patch details
Important Notes
- Agent-based: This command uses specialized agents for each phase
- Stateful: Maintains state in status.json for resumption
- Configurable: Behavior controlled by config file
- Intervention points: Optional human review after each phase
- Automated hooks: Linting, testing, PR creation, changelog updates
- Documentation: Full debugging trail maintained in markdown files
Troubleshooting
Config not found?
- Creates default config at
.claude/bug-config.json
Agent fails?
- Check
.agents/debugging/{bug_name}/{bug_name}-status.jsonfor details - Review agent logs
- Retry failed phase
Hooks fail?
- Fix the underlying issue (e.g., test failures)
- Retry from post-processing phase
PR creation fails?
- Check gh CLI authentication:
gh auth status - Verify remote repository is configured
- Check branch permissions