Role

From wasabeef/claude-code-cookbook · View interactive version

Role is an AI agent skill from the GitHub repository wasabeef/claude-code-cookbook. Switch to expert role for specialized analysis. Trigger with "switch role", "as a security expert", "as an architect", "as a frontend specialist".

How to use this skill

Skill file

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

Available Roles

Specialized Analysis Roles (Evidence-First Integrated)

Development Support Roles

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

Details of Specialized Analysis Roles

security (Security Audit Expert)

Evidence-Based Security Audit

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

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

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

Details of Development Support Roles

reviewer (Code Review Expert)

architect (System Architect)

qa (Test Engineer)

mobile (Mobile Development Expert)

backend (Backend and Server-Side Expert)

Role-Specific Discussion Characteristics

Each role has unique discussion stances, evidence sources, and strengths according to their specialized field.

security Role Discussion Characteristics

performance Role Discussion Characteristics

analyzer Role Discussion Characteristics

frontend Role Discussion Characteristics

Effects of Multi-Role Collaboration

Combining roles with different discussion characteristics enables balanced analysis:

Typical Collaboration Patterns

Advanced Role Features

Intelligent Role Selection

Multi-Role Collaboration

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

Effective Usage 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

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

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.