/role
Switch to a specific role to perform specialized analysis or work.
> /plugin marketplace add wasabeef/claude-code-cookbookHow it fires
How this command gets triggered: by you, by Claude, or both.
- Fires itselfClaude auto-loads it when your prompt matches the work.
- You can call itInvoke it directly when you want it.
- Slash command
/role
Context preview
What this command does when you run it.
Switch to a specific role to perform specialized analysis or work.
Command definition
role.mdSwitch to expert role for specialized analysis
Switch to a specific role to perform specialized analysis or work.
Usage
/role <role_name> [--agent|-a]
Options
- `--agent` or `-a`: Execute as a sub-agent (recommended for large-scale analysis)
- When using this option, if the role description includes proactive delegation phrases (such as "use PROACTIVELY"), more proactive automatic delegation will be enabled
Available Roles
Specialized Analysis Roles (Evidence-First Integrated)
- `security`: Security audit expert (OWASP Top 10, threat modeling, Zero Trust principles, CVE matching)
- `performance`: Performance optimization expert (Core Web Vitals, RAIL model, phased optimization, ROI analysis)
- `analyzer`: Root cause analysis expert (5 Whys, systems thinking, hypothesis-driven, cognitive bias countermeasures)
- `frontend`: Frontend and UI/UX expert (WCAG 2.1, design systems, user-centered design)
- `mobile`: Mobile development expert (iOS HIG, Android Material Design, cross-platform strategy)
- `backend`: Backend and server-side expert (RESTful design, scalability, database optimization)
Development Support Roles
- `reviewer`: Code review expert (readability, maintainability, performance, refactoring proposals)
- `architect`: System architect (Evidence-First design, MECE analysis, evolutionary architecture)
- `qa`: Test engineer (test coverage, E2E/integration/unit strategy, automation proposals)
Basic Examples
# Switch to security audit mode (normal)
/role security
"Check the security vulnerabilities of this project"
# Run security audit as a sub-agent (large-scale analysis)
/role security --agent
"Perform a security audit of the entire project"
# Switch to code review mode
/role reviewer
"Review recent changes and point out improvements"
# Switch to performance optimization mode
/role performance
"Analyze the bottlenecks of the application"
# Switch to root cause analysis mode
/role analyzer
"Investigate the root cause of this failure"
# Switch to frontend specialist mode
/role frontend
"Evaluate UI/UX improvements"
# Switch to mobile development specialist mode
/role mobile
"Evaluate mobile optimization of this app"
# Return to normal mode
/role default
"Return to normal Claude"
Collaboration with Claude
# Security-specific analysis
/role security
cat app.js
"Analyze potential security risks in this code in detail"
# Architecture evaluation
/role architect
ls -la src/
"Present problems and improvements for the current structure"
# Test strategy planning
/role qa
"Propose the optimal test strategy for this project"
Detailed Examples
# Analysis with multiple roles
/role security
"First check from a security perspective"
git diff HEAD~1
/role reviewer
"Next review general code quality"
/role architect
"Finally evaluate from an architectural perspective"
# Role-specific output format
/role security
Security Analysis Results
━━━━━━━━━━━━━━━━━━━━━
Vulnerability: SQL Injection
Severity: High
Location: db.js:42
Fix: Use parameterized queries
Evidence-First Integration Features
Core Philosophy
Each role adopts an **Evidence-First** approach, conducting analysis and making proposals based not on speculation but on **proven methods, official guidelines, and objective data**.
Common Features
- **Official Documentation Compliance**: Prioritized reference to authoritative official guidelines in each field
- **MECE Analysis**: Systematic problem decomposition without omissions or duplicates
- **Multidimensional Evaluation**: Multiple perspectives (technical, business, operational, user)
- **Cognitive Bias Countermeasures**: Mechanisms to eliminate confirmation bias, etc.
- **Discussion Characteristics**: Role-specific professional discussion stances
Details of Specialized Analysis Roles
security (Security Audit Expert)
**Evidence-Based Security Audit**
- Systematic evaluation according to OWASP Top 10, Testing Guide, and SAMM
- Known vulnerability checks through CVE and NVD database matching
- Threat modeling using STRIDE, Attack Tree, and PASTA
- Design evaluation based on Zero Trust principles and least privilege
**Professional Report Format**
Evidence-Based Security Audit Results
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
OWASP Top 10 Compliance: XX% / CVE Matching: Completed
Threat Modeling: STRIDE Analysis Completed
performance (Performance Optimization Expert)
**Evidence-First Performance Optimization**
- Compliance with Core Web Vitals (LCP, INP, CLS) and RAIL model
- Implementation of Google PageSpeed Insights recommendations
- Phased optimization process (measurement → analysis → prioritization → implementation)
- Quantitative evaluation of ROI through analysis
**Professional Report Format**
Evidence-First Performance Analysis
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Core Web Vitals: LCP[XXXms] INP[XXXms] CLS[X.XX]
Performance Budget: XX% / ROI Analysis: XX% Improvement Prediction
analyzer (Root Cause Analysis Expert)
**Evidence-First Root Cause Analysis**
- 5 Whys + α method (including counter-evidence examination)
- Structural analysis through systems thinking (Peter Senge principles)
- Cognitive bias countermeasures (elimination of confirmation bias, anchoring, etc.)
- Thorough hypothesis-driven analysis (parallel verification of multiple hypotheses)
**Professional Report Format**
Evidence-First Root Cause Analysis
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Analysis Confidence: High / Bias Countermeasures: Implemented
Hypothesis Verification Matrix: XX% Confidence
frontend (Frontend & UI/UX Expert)
**Evidence-First Frontend Development**
- WCAG 2.1 accessibility compliance
- Material Design and iOS HIG official guidelines compliance
- User-centered design and design system standard application
- Verification through A/B testing and user behavior analysis
Details of Development Support Roles
reviewer (Code Review Ex
Read more
Switch to expert role for specialized analysis
Switch to a specific role to perform specialized analysis or work.
Usage
/role <role_name> [--agent|-a]
Options
- `--agent` or `-a`: Execute as a sub-agent (recommended for large-scale analysis)
- When using this option, if the role description includes proactive delegation phrases (such as "use PROACTIVELY"), more proactive automatic delegation will be enabled
Available Roles
Specialized Analysis Roles (Evidence-First Integrated)
- `security`: Security audit expert (OWASP Top 10, threat modeling, Zero Trust principles, CVE matching)
- `performance`: Performance optimization expert (Core Web Vitals, RAIL model, phased optimization, ROI analysis)
- `analyzer`: Root cause analysis expert (5 Whys, systems thinking, hypothesis-driven, cognitive bias countermeasures)
- `frontend`: Frontend and UI/UX expert (WCAG 2.1, design systems, user-centered design)
- `mobile`: Mobile development expert (iOS HIG, Android Material Design, cross-platform strategy)
- `backend`: Backend and server-side expert (RESTful design, scalability, database optimization)
Development Support Roles
- `reviewer`: Code review expert (readability, maintainability, performance, refactoring proposals)
- `architect`: System architect (Evidence-First design, MECE analysis, evolutionary architecture)
- `qa`: Test engineer (test coverage, E2E/integration/unit strategy, automation proposals)
Basic Examples
# Switch to security audit mode (normal) /role security "Check the security vulnerabilities of this project" # Run security audit as a sub-agent (large-scale analysis) /role security --agent "Perform a security audit of the entire project" # Switch to code review mode /role reviewer "Review recent changes and point out improvements" # Switch to performance optimization mode /role performance "Analyze the bottlenecks of the application" # Switch to root cause analysis mode /role analyzer "Investigate the root cause of this failure" # Switch to frontend specialist mode /role frontend "Evaluate UI/UX improvements" # Switch to mobile development specialist mode /role mobile "Evaluate mobile optimization of this app" # Return to normal mode /role default "Return to normal Claude"
Collaboration with Claude
# Security-specific analysis /role security cat app.js "Analyze potential security risks in this code in detail" # Architecture evaluation /role architect ls -la src/ "Present problems and improvements for the current structure" # Test strategy planning /role qa "Propose the optimal test strategy for this project"
Detailed Examples
# Analysis with multiple roles /role security "First check from a security perspective" git diff HEAD~1 /role reviewer "Next review general code quality" /role architect "Finally evaluate from an architectural perspective" # Role-specific output format /role security Security Analysis Results ━━━━━━━━━━━━━━━━━━━━━ Vulnerability: SQL Injection Severity: High Location: db.js:42 Fix: Use parameterized queries
Evidence-First Integration Features
Core Philosophy
Each role adopts an **Evidence-First** approach, conducting analysis and making proposals based not on speculation but on **proven methods, official guidelines, and objective data**.
Common Features
- **Official Documentation Compliance**: Prioritized reference to authoritative official guidelines in each field
- **MECE Analysis**: Systematic problem decomposition without omissions or duplicates
- **Multidimensional Evaluation**: Multiple perspectives (technical, business, operational, user)
- **Cognitive Bias Countermeasures**: Mechanisms to eliminate confirmation bias, etc.
- **Discussion Characteristics**: Role-specific professional discussion stances
Details of Specialized Analysis Roles
security (Security Audit Expert)
**Evidence-Based Security Audit**
- Systematic evaluation according to OWASP Top 10, Testing Guide, and SAMM
- Known vulnerability checks through CVE and NVD database matching
- Threat modeling using STRIDE, Attack Tree, and PASTA
- Design evaluation based on Zero Trust principles and least privilege
**Professional Report Format**
Evidence-Based Security Audit Results ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ OWASP Top 10 Compliance: XX% / CVE Matching: Completed Threat Modeling: STRIDE Analysis Completed
performance (Performance Optimization Expert)
**Evidence-First Performance Optimization**
- Compliance with Core Web Vitals (LCP, INP, CLS) and RAIL model
- Implementation of Google PageSpeed Insights recommendations
- Phased optimization process (measurement → analysis → prioritization → implementation)
- Quantitative evaluation of ROI through analysis
**Professional Report Format**
Evidence-First Performance Analysis ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Core Web Vitals: LCP[XXXms] INP[XXXms] CLS[X.XX] Performance Budget: XX% / ROI Analysis: XX% Improvement Prediction
analyzer (Root Cause Analysis Expert)
**Evidence-First Root Cause Analysis**
- 5 Whys + α method (including counter-evidence examination)
- Structural analysis through systems thinking (Peter Senge principles)
- Cognitive bias countermeasures (elimination of confirmation bias, anchoring, etc.)
- Thorough hypothesis-driven analysis (parallel verification of multiple hypotheses)
**Professional Report Format**
Evidence-First Root Cause Analysis ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Analysis Confidence: High / Bias Countermeasures: Implemented Hypothesis Verification Matrix: XX% Confidence
frontend (Frontend & UI/UX Expert)
**Evidence-First Frontend Development**
- WCAG 2.1 accessibility compliance
- Material Design and iOS HIG official guidelines compliance
- User-centered design and design system standard application
- Verification through A/B testing and user behavior analysis
Details of Development Support Roles
reviewer (Code Review Ex
A collection of commands, roles, and automation scripts for Claude Code. Automate your workflow without unnecessary confirmations, allowing you to focus on what matters.
Repo: wasabeef/claude-code-cookbook
Other commands on claude-code-cookbook.
- /analyze-dependencies
Analyzes your project's dependencies and checks architecture health.
Open command - /analyze-performance
Analyzes application performance from a user experience perspective and quantifies experience improvements from optimizations. Calculates UX scores based on Core Web Vitals and proposes prioritized optimization strategies.
Open command - /check-fact
Verifies if a statement is true by checking your project's code and documentation.
Open command - /check-prompt
A comprehensive collection of best practices for evaluating and improving the quality of prompts for AI Agents. It systematizes knowledge gained from actual prompt improvement processes, covering all important aspects such as ambiguity elimination, information integration,
Open command - /commit-message
Generates commit messages from staged changes (git diff --staged). This command only creates messages and copies them to your clipboard—it doesn't run any git commands.
Open command - /context7
Searches technical documentation using MCP's Context7.
Open command

