Automate workflows with custom commands, agents, skills, and hooks
Claude Code’s plugin system enables powerful workflow automation through custom slash commands, specialized agents, skills, and event hooks. This guide shows you how to create and use these automation tools.
---description: Deploy application to productionallowed-tools: Bash(npm:*), Bash(git:*)---# Deployment Workflow1. Ensure we're on the main branch2. Run tests: !`npm test`3. Build production assets: !`npm run build`4. Deploy: !`npm run deploy`5. Create git tag with version from package.json6. Push tag to remoteIf any step fails, stop and report the error.
---# Requireddescription: Short description shown in command list# Optionalargument-hint: Expected argument formatallowed-tools: ["Bash(npm:*)", "Read", "Write"]---
Example with arguments:
---description: Create a new React componentargument-hint: ComponentName---Create a new React component named $ARGUMENTS:1. Create file: src/components/$ARGUMENTS.jsx2. Generate component boilerplate following our patterns3. Create test file: src/components/$ARGUMENTS.test.jsx4. Export from src/components/index.js
---description: Create model and migrationargument-hint: ModelName---Create a $ARGUMENTS[0] model with migration:1. Generate model: !`rails generate model $ARGUMENTS[0]`2. Edit migration to add fields3. Run migration: !`rails db:migrate`
---description: Run tests with coverageallowed-tools: Bash(npm test:*)---Run test suite with coverage:!`npm test -- --coverage`If tests fail, show failures and suggest fixes.
---description: Reset development databaseallowed-tools: Bash(npm:*), Bash(rm:*)---Reset the development database:1. Confirm with user first (this is destructive)2. Drop database: !`npm run db:drop`3. Create database: !`npm run db:create`4. Run migrations: !`npm run db:migrate`5. Seed data: !`npm run db:seed`Report success or any errors encountered.
---description: Audit code for security vulnerabilitiesmodel: claude-sonnet-4.6tools: ["Read", "Grep", "Bash"]background: false---# Security Audit AgentPerform a comprehensive security audit of: $ARGUMENTS## Check for:### 1. Injection Vulnerabilities- SQL injection (string interpolation in queries)- Command injection (unsanitized shell commands)- XSS (unescaped user input in HTML)### 2. Authentication Issues - Hardcoded credentials- Weak password policies- Missing authentication checks- Session management flaws### 3. Data Exposure- Sensitive data in logs- API keys in code- Unnecessary data in API responses### 4. Dependencies- Known vulnerable packages- Outdated dependencies## Output FormatFor each issue found:- **Severity**: Critical/High/Medium/Low- **Location**: file:line- **Description**: What the issue is- **Impact**: What could happen- **Fix**: How to resolve it- **Confidence**: 0-100%Only report issues with confidence ≥75%.
---# Requireddescription: Agent description# Model selectionmodel: claude-sonnet-4.6 # or claude-opus-4.6# Tool restrictionstools: ["Read", "Grep", "Glob", "Bash"]# Execution modebackground: true # Run as background taskisolation: worktree # Run in isolated git worktree# Memorymemory: project # user, project, or local# Agent teamscan-spawn: ["code-explorer", "code-reviewer"] # Which agents this can launch---
---description: Generate API documentation from codemodel: claude-sonnet-4.6tools: ["Read", "Grep", "Write"]---# Documentation GeneratorGenerate API documentation for: $ARGUMENTS1. Find all API route definitions2. Extract: - HTTP method and path - Request parameters - Request body schema - Response format - Error codes3. Generate Markdown documentation4. Write to docs/api.mdInclude code examples for each endpoint.
---description: Migrate code from old pattern to new patternmodel: claude-opus-4.6tools: ["Read", "Edit", "Grep"]isolation: worktree---# Migration AssistantMigrate from old pattern to new pattern:Old pattern: $ARGUMENTS[0]New pattern: $ARGUMENTS[1]1. Find all occurrences of old pattern2. Analyze context for each occurrence3. Generate migration for each file4. Show diff for user approval5. Apply changes if approvedRun in isolated worktree for safety.