|
| 1 | +# Role-Based Slash Commands for Claude Code |
| 2 | + |
| 3 | +This directory contains custom slash commands that transform Claude into specialized expert roles for multi-perspective software development analysis. |
| 4 | + |
| 5 | +## Quick Start |
| 6 | + |
| 7 | +### Analyze a Task |
| 8 | +```bash |
| 9 | +/project:workflows:analyze-task "Implement OAuth2 authentication with role-based permissions" |
| 10 | +``` |
| 11 | + |
| 12 | +### Single Role Analysis |
| 13 | +```bash |
| 14 | +/project:roles:senior-frontend-architect "Review the new dashboard component architecture" |
| 15 | +``` |
| 16 | + |
| 17 | +### Sequential Expert Chain |
| 18 | +```bash |
| 19 | +/project:chains:feature-development "Create a real-time notification system" |
| 20 | +``` |
| 21 | + |
| 22 | +### Parallel Expert Analysis |
| 23 | +```bash |
| 24 | +/project:parallel:code-review-team "PR #123 - Authentication refactor" |
| 25 | +``` |
| 26 | + |
| 27 | +## Command Categories |
| 28 | + |
| 29 | +### 🎭 Individual Roles (`/project:roles:`) |
| 30 | +Specialized expert perspectives for focused analysis: |
| 31 | +- `product-manager` - Business requirements and strategy |
| 32 | +- `senior-frontend-architect` - Technical architecture and design |
| 33 | +- `typescript-quality-engineer` - Code quality and type safety |
| 34 | +- `senior-sdet` - Testing strategy and quality assurance |
| 35 | +- `cybersecurity-engineer` - Security assessment and compliance |
| 36 | +- `devops-engineer` - Infrastructure and deployment |
| 37 | +- `ui-ux-design-engineer` - User experience and accessibility |
| 38 | +- `open-source-maintainer` - Community and sustainability |
| 39 | + |
| 40 | +### 🔗 Sequential Chains (`/project:chains:`) |
| 41 | +Multi-role workflows that build upon each phase: |
| 42 | +- `feature-development` - Complete feature development lifecycle |
| 43 | +- `bug-fix-optimization` - Comprehensive bug analysis and resolution |
| 44 | +- `security-review` - Multi-layered security assessment |
| 45 | + |
| 46 | +### ⚡ Parallel Analysis (`/project:parallel:`) |
| 47 | +Simultaneous expert perspectives with synthesis: |
| 48 | +- `code-review-team` - Multi-expert code review |
| 49 | +- `feature-planning-team` - Comprehensive feature planning |
| 50 | +- `performance-team` - Performance optimization analysis |
| 51 | + |
| 52 | +### 🛠️ Workflow Utilities (`/project:workflows:`) |
| 53 | +Supporting tools for complex workflows: |
| 54 | +- `analyze-task` - Determine optimal workflow strategy |
| 55 | +- `handoff-context` - Preserve context between roles |
| 56 | +- `synthesize-perspectives` - Unify multi-role insights |
| 57 | + |
| 58 | +### ⚡ Quick Actions (`/project:quick:`) |
| 59 | +Rapid, focused expert responses: |
| 60 | +- `review-pr` - Fast TypeScript-focused PR review |
| 61 | +- `fix-bug` - Quick bug analysis and resolution |
| 62 | +- `optimize-performance` - Immediate performance improvements |
| 63 | +- `security-check` - Rapid security assessment |
| 64 | + |
| 65 | +## Usage Patterns |
| 66 | + |
| 67 | +### Pattern 1: Task Complexity Analysis |
| 68 | +Start with complexity analysis to choose the right approach: |
| 69 | +```bash |
| 70 | +/project:workflows:analyze-task "Your complex development task" |
| 71 | +# Follow the recommended workflow from the analysis |
| 72 | +``` |
| 73 | + |
| 74 | +### Pattern 2: Single Expert Consultation |
| 75 | +For focused, domain-specific analysis: |
| 76 | +```bash |
| 77 | +/project:roles:cybersecurity-engineer "Review authentication implementation" |
| 78 | +``` |
| 79 | + |
| 80 | +### Pattern 3: Sequential Expert Chain |
| 81 | +For comprehensive feature development: |
| 82 | +```bash |
| 83 | +/project:chains:feature-development "Build user analytics dashboard" |
| 84 | +# Automatically progresses through Product → Architecture → Quality → Testing |
| 85 | +``` |
| 86 | + |
| 87 | +### Pattern 4: Parallel Expert Team |
| 88 | +For complex decisions requiring multiple perspectives: |
| 89 | +```bash |
| 90 | +/project:parallel:code-review-team "Major refactoring PR" |
| 91 | +# Gets simultaneous input from Architecture, Quality, and Security experts |
| 92 | +``` |
| 93 | + |
| 94 | +### Pattern 5: Context Handoff |
| 95 | +For manual role transitions: |
| 96 | +```bash |
| 97 | +/project:roles:product-manager "Define user requirements" |
| 98 | +# Then use the output as input to: |
| 99 | +/project:workflows:handoff-context "[Product Manager's analysis]" |
| 100 | +# Finally: |
| 101 | +/project:roles:senior-frontend-architect "[Handoff context + original task]" |
| 102 | +``` |
| 103 | + |
| 104 | +## Command Composition Examples |
| 105 | + |
| 106 | +### Example 1: Feature Development |
| 107 | +```bash |
| 108 | +# Step 1: Analyze complexity |
| 109 | +/project:workflows:analyze-task "Real-time collaboration features" |
| 110 | + |
| 111 | +# Step 2: Follow recommended approach (e.g., sequential chain) |
| 112 | +/project:chains:feature-development "Real-time collaboration features" |
| 113 | + |
| 114 | +# Step 3: If conflicts arise, synthesize |
| 115 | +/project:workflows:synthesize-perspectives "[Chain output]" |
| 116 | +``` |
| 117 | + |
| 118 | +### Example 2: Bug Investigation |
| 119 | +```bash |
| 120 | +# Quick assessment |
| 121 | +/project:quick:fix-bug "Memory leak in dashboard component" |
| 122 | + |
| 123 | +# If complex, escalate to full analysis |
| 124 | +/project:chains:bug-fix-optimization "Memory leak in dashboard component" |
| 125 | +``` |
| 126 | + |
| 127 | +### Example 3: Code Review |
| 128 | +```bash |
| 129 | +# Quick review |
| 130 | +/project:quick:review-pr "Authentication service changes" |
| 131 | + |
| 132 | +# For critical changes, get team perspective |
| 133 | +/project:parallel:code-review-team "Authentication service changes" |
| 134 | +``` |
| 135 | + |
| 136 | +## Best Practices |
| 137 | + |
| 138 | +1. **Start with Analysis**: Use `/project:workflows:analyze-task` for complex or unfamiliar tasks |
| 139 | +2. **Choose Appropriate Scope**: Single role for focused issues, chains for comprehensive development, parallel for critical decisions |
| 140 | +3. **Preserve Context**: Use handoff commands when manually transitioning between roles |
| 141 | +4. **Synthesize Conflicts**: Use synthesis commands when parallel analyses conflict |
| 142 | +5. **Document Decisions**: Keep role outputs for future reference and team alignment |
| 143 | + |
| 144 | +## Integration with Development Workflow |
| 145 | + |
| 146 | +### Git Integration |
| 147 | +```bash |
| 148 | +# Before starting work |
| 149 | +/project:workflows:analyze-task "$(git show --name-only HEAD)" |
| 150 | + |
| 151 | +# During development |
| 152 | +/project:quick:review-pr "$(git diff --name-only main...HEAD)" |
| 153 | + |
| 154 | +# Before merging |
| 155 | +/project:parallel:code-review-team "$(git log --oneline main...HEAD)" |
| 156 | +``` |
| 157 | + |
| 158 | +### CI/CD Integration |
| 159 | +Use commands in pull request templates or automated checks: |
| 160 | +```markdown |
| 161 | +## Pre-merge Checklist |
| 162 | +- [ ] `/project:quick:security-check` completed |
| 163 | +- [ ] `/project:quick:optimize-performance` reviewed |
| 164 | +- [ ] `/project:parallel:code-review-team` approved |
| 165 | +``` |
| 166 | + |
| 167 | +## Troubleshooting |
| 168 | + |
| 169 | +### Command Not Found |
| 170 | +- Verify `.claude/commands/` directory structure |
| 171 | +- Check file naming matches command structure |
| 172 | +- Ensure files are in the correct subdirectories |
| 173 | + |
| 174 | +### Poor Role Performance |
| 175 | +- Provide more specific context in arguments |
| 176 | +- Use handoff commands to preserve context between roles |
| 177 | +- Try analyze-task first for complex scenarios |
| 178 | + |
| 179 | +### Conflicting Recommendations |
| 180 | +- Use `/project:workflows:synthesize-perspectives` |
| 181 | +- Review individual role constraints and assumptions |
| 182 | +- Consider parallel analysis for critical decisions |
| 183 | + |
| 184 | +## Contributing |
| 185 | + |
| 186 | +To add new roles or workflows: |
| 187 | +1. Follow existing file naming patterns |
| 188 | +2. Include clear role definitions and responsibilities |
| 189 | +3. Use `$ARGUMENTS` for dynamic input |
| 190 | +4. Provide structured output templates |
| 191 | +5. Test with various input scenarios |
| 192 | + |
| 193 | +--- |
| 194 | + |
| 195 | +**Next Steps**: Run `/project:test-setup "Initial validation"` to verify your command setup. |
0 commit comments