Skip to content
Development
Skill

/role

Switch to expert role for specialized analysis. Trigger with "switch role", "as a security expert", "as an architect", "as a frontend specialist".

From plugin
claude-code-cookbook
1.1k39 skills9 agents39 commands8 MCP

Claude Code

$ npx -y skills add wasabeef/claude-code-cookbook --skill role --agent claude-code

SKILL.md

role.SKILL.md
description: 'Switch to expert role for specialized analysis. Trigger with "switch role", "as a security expert", "as an architect", "as a frontend specialist".'
allowed-tools:
  - Read
  - Grep
  - Glob

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 gui
Read more
@wasabeef
Ships withclaude-code-cookbook

A collection of commands, roles, and automation scripts for Claude Code. Automate your workflow without unnecessary confirmations, allowing you to focus on what matters.

1.1k39 skills9 agents8 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
1.1k
Star history of wasabeef/claude-code-cookbook on GitHub, a chart by star-history.com

Other skills on claude-code-cookbook.

check-fact

check-fact

Verify information accuracy against codebase and documentation. Trigger with "is this correct?", "fact check", "verify this", "is…

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills2w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react5d252k
@facebook@facebookInstall Skill

Questions about role.

Which coding agents can use role?
role installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.