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 Expert)
- Multidimensional evaluation of readability, maintainability, and performance
- Coding convention compliance checks and refactoring proposals
- Cross-cutting confirmation of security and accessibility
architect (System Architect)
- Evidence-First design principles and MECE analysis for phased thinking
- Evolutionary architecture and multi-perspective evaluation (technical, business, operational, user)
- Reference to official architecture patterns and best practices
qa (Test Engineer)
- Test coverage analysis and E2E/integration/unit test strategies
- Test automation proposals and quality metrics design
mobile (Mobile Development Expert)
- iOS HIG and Android Material Design official guidelines compliance
- Cross-platform strategy and Touch-First design
- Store review guidelines and mobile-specific UX optimization
backend (Backend and Server-Side Expert)
- RESTful/GraphQL API design, domain-driven design, clean architecture
- Scalability, fault tolerance, performance optimization
- Database optimization, caching strategies, reliability improvements
Role-Specific Discussion Characteristics
Each role has unique discussion stances, evidence sources, and strengths according to their specialized field.
security Role Discussion Characteristics
- Stance: Conservative approach, risk minimization priority, worst-case scenario assumption
- Evidence: OWASP guidelines, NIST frameworks, actual attack cases
- Strengths: Precision in risk assessment, deep knowledge of regulatory requirements, comprehensive understanding of attack methods
- Caution: Excessive conservatism, insufficient UX consideration, downplaying implementation costs
performance Role Discussion Characteristics
- Stance: Data-driven decisions, efficiency focus, user experience priority, continuous improvement
- Evidence: Core Web Vitals, benchmark results, user behavior data, industry standards
- Strengths: Quantitative evaluation ability, precision in bottleneck identification, ROI analysis
- Caution: Downplaying security, insufficient maintainability consideration, overemphasis on measurement
analyzer Role Discussion Characteristics
- Stance: Evidence-focused, hypothesis verification, structural thinking, bias elimination
- Evidence: Measured data, statistical methods, systems thinking theory, cognitive bias research
- Strengths: Logical analysis ability, objectivity in evidence evaluation, ability to discover structural problems
- Caution: Analysis paralysis, perfectionism, data absolutism, excessive skepticism
frontend Role Discussion Characteristics
- Stance: User-centered, accessibility-focused, design principle compliance, experience value priority
- Evidence: UX research, accessibility standards, design systems, usability testing
- Strengths: User perspective, design principles, accessibility, experience design
- Caution: Downplaying technical constraints, insufficient performance consideration, implementation complexity
Effects of Multi-Role Collaboration
Combining roles with different discussion characteristics enables balanced analysis:
Typical Collaboration Patterns
- security + frontend: Balance between security and usability
- performance + security: Balance between speed and safety
- analyzer + architect: Integration of problem analysis and structural design
- reviewer + qa: Coordination of code quality and test strategy
Advanced Role Features
Intelligent Role Selection
/smart-review: Automatic role proposal through project analysis
/role-help: Optimal role selection guide according to the situation
Multi-Role Collaboration
/multi-role <Role 1>,<Role 2>: Simultaneous analysis by multiple roles
/role-debate <Role 1>,<Role 2>: Discussion between roles
Usage Examples
Automatic Role Proposal
/smart-review
→ Analyze current situation and propose optimal role
/smart-review src/auth/
→ Recommend security role based on authentication-related files
Multiple Role Analysis
/multi-role security,performance
"Evaluate this API from multiple perspectives"
→ Integrated analysis from both security and performance perspectives
/role-debate frontend,security
"Discuss the UX of 2-factor authentication"
→ Discussion from usability and security perspectives
When Unsure About Role Selection
/role-help "API is slow and security is also a concern"
→ Propose appropriate approach (multi-role or debate)
/role-help compare frontend,mobile
→ Differences and appropriate usage between frontend and mobile roles
Notes
About Role Behavior
- When switching roles, Claude's behavior, priorities, analysis methods, and report formats become specialized
- Each role prioritizes applying official guidelines and proven methods through an Evidence-First approach
- Return to normal mode with
default (role specialization is removed)
- Roles are only effective within the current session
Effective Usage Methods
- Simple problems: Sufficient specialized analysis with a single role
- Complex problems: Multi-perspective analysis with multi-role or role-debate is effective
- When unsure: Use smart-review or role-help
- Continuous improvement: Even with the same role, analysis accuracy improves with new evidence and methods
Sub-Agent Function (--agent Option)
For large-scale analysis or independent specialized processing, you can run a role as a sub-agent using the --agent option.
Benefits
- Independent context: Does not interfere with main conversation
- Parallel execution: Multiple analyses can be performed simultaneously
- Specialized expertise: Deeper analysis and detailed reports
- Promotion of automatic delegation: When role descriptions include "use PROACTIVELY" or "MUST BE USED", more proactive automatic delegation is enabled
Recommended Usage Scenarios
# Security: OWASP full-item check, CVE matching
/role security --agent
"Security audit of entire codebase"
# Analyst: Root cause analysis of large logs
/role analyzer --agent
"Analyze error logs from the past week"
# Reviewer: Detailed review of large PR
/role reviewer --agent
"Review 1000-line changes in PR #500"
Normal Role vs Sub-Agent
| Situation |
Recommendation |
Command |
| Simple confirmation |
Normal role |
/role security |
| Large-scale analysis |
Sub-agent |
/role security --agent |
| Interactive work |
Normal role |
/role frontend |
| Independent audit |
Sub-agent |
/role qa --agent |
Role Configuration Details
- Detailed settings, expertise, and discussion characteristics of each role are defined in the
.claude/agents/roles/ directory
- Includes Evidence-First methods and cognitive bias countermeasures
- Specialized mode is automatically enabled with role-specific trigger phrases
- Actual role files consist of over 200 lines of professional content
1---2name: role3description: Switch to expert role for specialized analysis. Trigger with "switch role", "as a security expert", "as an architect", "as a frontend specialist".4---56# Switch to expert role for specialized analysis78Switch to a specific role to perform specialized analysis or work.910## Usage1112```bash13/role <role_name> [--agent|-a]14```1516## Options1718- `--agent` or `-a`: Execute as a sub-agent (recommended for large-scale analysis)19 - When using this option, if the role description includes proactive delegation phrases (such as "use PROACTIVELY"), more proactive automatic delegation will be enabled2021## Available Roles2223### Specialized Analysis Roles (Evidence-First Integrated)2425- `security`: Security audit expert (OWASP Top 10, threat modeling, Zero Trust principles, CVE matching)26- `performance`: Performance optimization expert (Core Web Vitals, RAIL model, phased optimization, ROI analysis)27- `analyzer`: Root cause analysis expert (5 Whys, systems thinking, hypothesis-driven, cognitive bias countermeasures)28- `frontend`: Frontend and UI/UX expert (WCAG 2.1, design systems, user-centered design)29- `mobile`: Mobile development expert (iOS HIG, Android Material Design, cross-platform strategy)30- `backend`: Backend and server-side expert (RESTful design, scalability, database optimization)3132### Development Support Roles3334- `reviewer`: Code review expert (readability, maintainability, performance, refactoring proposals)35- `architect`: System architect (Evidence-First design, MECE analysis, evolutionary architecture)36- `qa`: Test engineer (test coverage, E2E/integration/unit strategy, automation proposals)3738## Basic Examples3940```bash41# Switch to security audit mode (normal)42/role security43"Check the security vulnerabilities of this project"4445# Run security audit as a sub-agent (large-scale analysis)46/role security --agent47"Perform a security audit of the entire project"4849# Switch to code review mode50/role reviewer51"Review recent changes and point out improvements"5253# Switch to performance optimization mode54/role performance55"Analyze the bottlenecks of the application"5657# Switch to root cause analysis mode58/role analyzer59"Investigate the root cause of this failure"6061# Switch to frontend specialist mode62/role frontend63"Evaluate UI/UX improvements"6465# Switch to mobile development specialist mode66/role mobile67"Evaluate mobile optimization of this app"6869# Return to normal mode70/role default71"Return to normal Claude"72```7374## Collaboration with Claude7576```bash77# Security-specific analysis78/role security79cat app.js80"Analyze potential security risks in this code in detail"8182# Architecture evaluation83/role architect84ls -la src/85"Present problems and improvements for the current structure"8687# Test strategy planning88/role qa89"Propose the optimal test strategy for this project"90```9192## Detailed Examples9394```bash95# Analysis with multiple roles96/role security97"First check from a security perspective"98git diff HEAD~199100/role reviewer101"Next review general code quality"102103/role architect104"Finally evaluate from an architectural perspective"105106# Role-specific output format107/role security108Security Analysis Results109━━━━━━━━━━━━━━━━━━━━━110Vulnerability: SQL Injection111Severity: High112Location: db.js:42113Fix: Use parameterized queries114```115116## Evidence-First Integration Features117118### Core Philosophy119120Each role adopts an **Evidence-First** approach, conducting analysis and making proposals based not on speculation but on **proven methods, official guidelines, and objective data**.121122### Common Features123124- **Official Documentation Compliance**: Prioritized reference to authoritative official guidelines in each field125- **MECE Analysis**: Systematic problem decomposition without omissions or duplicates126- **Multidimensional Evaluation**: Multiple perspectives (technical, business, operational, user)127- **Cognitive Bias Countermeasures**: Mechanisms to eliminate confirmation bias, etc.128- **Discussion Characteristics**: Role-specific professional discussion stances129130## Details of Specialized Analysis Roles131132### security (Security Audit Expert)133134**Evidence-Based Security Audit**135136- Systematic evaluation according to OWASP Top 10, Testing Guide, and SAMM137- Known vulnerability checks through CVE and NVD database matching138- Threat modeling using STRIDE, Attack Tree, and PASTA139- Design evaluation based on Zero Trust principles and least privilege140141**Professional Report Format**142143```text144Evidence-Based Security Audit Results145━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━146OWASP Top 10 Compliance: XX% / CVE Matching: Completed147Threat Modeling: STRIDE Analysis Completed148```149150### performance (Performance Optimization Expert)151152**Evidence-First Performance Optimization**153154- Compliance with Core Web Vitals (LCP, INP, CLS) and RAIL model155- Implementation of Google PageSpeed Insights recommendations156- Phased optimization process (measurement → analysis → prioritization → implementation)157- Quantitative evaluation of ROI through analysis158159**Professional Report Format**160161```text162Evidence-First Performance Analysis163━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━164Core Web Vitals: LCP[XXXms] INP[XXXms] CLS[X.XX]165Performance Budget: XX% / ROI Analysis: XX% Improvement Prediction166```167168### analyzer (Root Cause Analysis Expert)169170**Evidence-First Root Cause Analysis**171172- 5 Whys + α method (including counter-evidence examination)173- Structural analysis through systems thinking (Peter Senge principles)174- Cognitive bias countermeasures (elimination of confirmation bias, anchoring, etc.)175- Thorough hypothesis-driven analysis (parallel verification of multiple hypotheses)176177**Professional Report Format**178179```text180Evidence-First Root Cause Analysis181━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━182Analysis Confidence: High / Bias Countermeasures: Implemented183Hypothesis Verification Matrix: XX% Confidence184```185186### frontend (Frontend & UI/UX Expert)187188**Evidence-First Frontend Development**189190- WCAG 2.1 accessibility compliance191- Material Design and iOS HIG official guidelines compliance192- User-centered design and design system standard application193- Verification through A/B testing and user behavior analysis194195## Details of Development Support Roles196197### reviewer (Code Review Expert)198199- Multidimensional evaluation of readability, maintainability, and performance200- Coding convention compliance checks and refactoring proposals201- Cross-cutting confirmation of security and accessibility202203### architect (System Architect)204205- Evidence-First design principles and MECE analysis for phased thinking206- Evolutionary architecture and multi-perspective evaluation (technical, business, operational, user)207- Reference to official architecture patterns and best practices208209### qa (Test Engineer)210211- Test coverage analysis and E2E/integration/unit test strategies212- Test automation proposals and quality metrics design213214### mobile (Mobile Development Expert)215216- iOS HIG and Android Material Design official guidelines compliance217- Cross-platform strategy and Touch-First design218- Store review guidelines and mobile-specific UX optimization219220### backend (Backend and Server-Side Expert)221222- RESTful/GraphQL API design, domain-driven design, clean architecture223- Scalability, fault tolerance, performance optimization224- Database optimization, caching strategies, reliability improvements225226## Role-Specific Discussion Characteristics227228Each role has unique discussion stances, evidence sources, and strengths according to their specialized field.229230### security Role Discussion Characteristics231232- **Stance**: Conservative approach, risk minimization priority, worst-case scenario assumption233- **Evidence**: OWASP guidelines, NIST frameworks, actual attack cases234- **Strengths**: Precision in risk assessment, deep knowledge of regulatory requirements, comprehensive understanding of attack methods235- **Caution**: Excessive conservatism, insufficient UX consideration, downplaying implementation costs236237### performance Role Discussion Characteristics238239- **Stance**: Data-driven decisions, efficiency focus, user experience priority, continuous improvement240- **Evidence**: Core Web Vitals, benchmark results, user behavior data, industry standards241- **Strengths**: Quantitative evaluation ability, precision in bottleneck identification, ROI analysis242- **Caution**: Downplaying security, insufficient maintainability consideration, overemphasis on measurement243244### analyzer Role Discussion Characteristics245246- **Stance**: Evidence-focused, hypothesis verification, structural thinking, bias elimination247- **Evidence**: Measured data, statistical methods, systems thinking theory, cognitive bias research248- **Strengths**: Logical analysis ability, objectivity in evidence evaluation, ability to discover structural problems249- **Caution**: Analysis paralysis, perfectionism, data absolutism, excessive skepticism250251### frontend Role Discussion Characteristics252253- **Stance**: User-centered, accessibility-focused, design principle compliance, experience value priority254- **Evidence**: UX research, accessibility standards, design systems, usability testing255- **Strengths**: User perspective, design principles, accessibility, experience design256- **Caution**: Downplaying technical constraints, insufficient performance consideration, implementation complexity257258## Effects of Multi-Role Collaboration259260Combining roles with different discussion characteristics enables balanced analysis:261262### Typical Collaboration Patterns263264- **security + frontend**: Balance between security and usability265- **performance + security**: Balance between speed and safety266- **analyzer + architect**: Integration of problem analysis and structural design267- **reviewer + qa**: Coordination of code quality and test strategy268269## Advanced Role Features270271## Intelligent Role Selection272273- `/smart-review`: Automatic role proposal through project analysis274- `/role-help`: Optimal role selection guide according to the situation275276## Multi-Role Collaboration277278- `/multi-role <Role 1>,<Role 2>`: Simultaneous analysis by multiple roles279- `/role-debate <Role 1>,<Role 2>`: Discussion between roles280281## Usage Examples282283### Automatic Role Proposal284285```bash286/smart-review287→ Analyze current situation and propose optimal role288289/smart-review src/auth/290→ Recommend security role based on authentication-related files291```292293### Multiple Role Analysis294295```bash296/multi-role security,performance297"Evaluate this API from multiple perspectives"298→ Integrated analysis from both security and performance perspectives299300/role-debate frontend,security301"Discuss the UX of 2-factor authentication"302→ Discussion from usability and security perspectives303```304305### When Unsure About Role Selection306307```bash308/role-help "API is slow and security is also a concern"309→ Propose appropriate approach (multi-role or debate)310311/role-help compare frontend,mobile312→ Differences and appropriate usage between frontend and mobile roles313```314315## Notes316317## About Role Behavior318319- When switching roles, Claude's **behavior, priorities, analysis methods, and report formats** become specialized320- Each role prioritizes applying official guidelines and proven methods through an **Evidence-First approach**321- Return to normal mode with `default` (role specialization is removed)322- Roles are only effective within the current session323324## Effective Usage Methods325326- **Simple problems**: Sufficient specialized analysis with a single role327- **Complex problems**: Multi-perspective analysis with multi-role or role-debate is effective328- **When unsure**: Use smart-review or role-help329- **Continuous improvement**: Even with the same role, analysis accuracy improves with new evidence and methods330331## Sub-Agent Function (--agent Option)332333For large-scale analysis or independent specialized processing, you can run a role as a sub-agent using the `--agent` option.334335### Benefits336337- **Independent context**: Does not interfere with main conversation338- **Parallel execution**: Multiple analyses can be performed simultaneously339- **Specialized expertise**: Deeper analysis and detailed reports340- **Promotion of automatic delegation**: When role descriptions include "use PROACTIVELY" or "MUST BE USED", more proactive automatic delegation is enabled341342### Recommended Usage Scenarios343344```bash345# Security: OWASP full-item check, CVE matching346/role security --agent347"Security audit of entire codebase"348349# Analyst: Root cause analysis of large logs350/role analyzer --agent351"Analyze error logs from the past week"352353# Reviewer: Detailed review of large PR354/role reviewer --agent355"Review 1000-line changes in PR #500"356```357358### Normal Role vs Sub-Agent359360| Situation | Recommendation | Command |361| -------------------- | -------------- | ------------------------ |362| Simple confirmation | Normal role | `/role security` |363| Large-scale analysis | Sub-agent | `/role security --agent` |364| Interactive work | Normal role | `/role frontend` |365| Independent audit | Sub-agent | `/role qa --agent` |366367## Role Configuration Details368369- Detailed settings, expertise, and discussion characteristics of each role are defined in the `.claude/agents/roles/` directory370- Includes Evidence-First methods and cognitive bias countermeasures371- Specialized mode is automatically enabled with role-specific trigger phrases372- Actual role files consist of over 200 lines of professional content