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
Install
$ npx -y skills add wasabeef/claude-code-cookbook --skill role --agent claude-code

How it fires

How this skill gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.
  • Slash command/role

Context preview

The summary Claude sees to decide when to auto-load this skill.

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

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
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.

Get the whole plugin

Other skills on claude-code-cookbook.