
claude
Claude Development Plugin That Can Create Commands, Scripts, and Hooks for Claude Code
- GitHub stars
- 9
Install
/plugin install claude@cc-pluginsRun it inside Claude Code after adding the marketplace with /plugin marketplace add yanmxa/cc-plugins.
Contents
Discovered from sourceSkills 2
Create Command
Extract and save the current session workflow as a reusable slash command file. Commands are user-invoked shortcuts that expand to full prompts.
Quick Start
# Interactive mode - guided creation
/create-command
# Auto mode - create from name
/create-command git/sync-upstream
# Update existing command
/create-command git/commit-push --update
Command Locations
| Location | Path | Scope |
|---|---|---|
| Personal | ~/.claude/commands/category/name.md | All projects |
| Project | .claude/commands/category/name.md | This project |
Creation Process
1. Determine Mode
- With
--update: Update existing command - With name: Auto mode - analyze recent workflow
- No arguments: Interactive mode - ask questions
2. Interactive Mode Questions
Use AskUserQuestion with these prompts:
Question 1 - Purpose:
- Header: "Purpose"
- Question: "What should this command do?"
- Options:
- "Automate git operations" - Commits, PRs, branches
- "Run tests or builds" - Test suites, build scripts
- "Manage services" - Jira, AWS, Docker
- "Code generation" - Scaffolding, templates
Question 2 - Scope:
- Header: "Scope"
- Question: "Where should this command be available?"
- Options:
- "Personal (Recommended)" - ~/.claude/commands/
- "Project" - .claude/commands/ (git tracked)
Question 3 - Tools (multiSelect: true):
- Header: "Tools"
- Question: "Which tools are needed?"
- Options:
- "File operations" - Read, Write, Edit, Glob
- "Shell commands" - Bash
- "User interaction" - AskUserQuestion
- "All tools" - No restrictions
3. Analyze Workflow
When extracting from recent session:
- Track frequently used tools
- Find repeated action sequences
- Capture successful bash commands
- Consolidate micro-actions into major steps
- Infer appropriate allowed-tools
4. Generate Command File
Write to appropriate location:
# Personal
~/.claude/commands/category/name.md
# Project
.claude/commands/category/name.md
5. Command File Template
---
argument-hint: [expected arguments]
description: Brief action-oriented description
allowed-tools: [Bash, Read, Write]
---
Brief description of command purpose.
## Implementation Steps
1. **Step One**: What to do first
2. **Step Two**: Next action
3. **Step Three**: Verification
## Usage Examples
- `/category/name arg1` - Example scenario
- `/category/name --flag` - Another scenario
## Notes
- Prerequisites
- Related commands
Update Mode
When using --update flag:
- Read existing command file
- Preserve metadata unless workflow changed
- Merge new steps with existing
- Add new tools to allowed-tools
- Enhance usage examples
Naming Convention
Format: category/name
Auto-detection (interactive mode):
- Git operations →
git/workflow - Node/npm →
node/workflow - Docker →
docker/workflow - Test operations →
test/workflow - Jira →
jira/workflow
Best Practices
Description:
- Start with action verb ("Create", "Run", "Update")
- Keep under 100 characters
- Be specific and clear
Implementation Steps:
- Consolidate related actions
- Use descriptive step names
- Include verification/error handling
Allowed Tools:
- Only list tools actually needed
- Omit for unrestricted access
Commands vs Skills vs Subagents
| Feature | Command | Skill | Subagent |
|---|---|---|---|
| Invocation | User-only (/name) | User or Claude | User or Claude |
| Context | Main conversation | Main conversation | Isolated |
| Best For | Quick automation | Domain expertise | Complex workflows |
| Format | Single .md file | Folder with SKILL.md | Single .md file |
Use commands for:
- User-triggered shortcuts
- Simple, repeatable workflows
- Quick automation
Output Format
After creation:
Command created: /category/name
Location: ~/.claude/commands/category/name.md
Tools: [list of allowed-tools]
Usage: /category/name [arguments]
After update:
Command updated: /category/name
Location: ~/.claude/commands/category/name.md
Changes:
- [Summary of what changed]
Examples
# Interactive creation
/create-command
# Create from recent git workflow
/create-command git/sync-upstream
# Update existing command
/create-command git/commit-push --update
# Create project-specific command
/create-command test/e2e-debug
Notes
- Commands expand to full prompts when invoked
- Keep focused on one specific workflow
- Test thoroughly before sharing with team
- Use
--updateto refine based on real usage
Create Subagent
Create a specialized AI subagent that runs in its own context window with custom system prompt, tool access, and permissions. Subagents preserve main conversation context by handling complex tasks independently.
Quick Start
# Interactive mode - guided creation
/create-subagent
# Auto mode - create from name
/create-subagent code-reviewer
Subagent Locations
| Location | Path | Scope | Priority |
|---|---|---|---|
| Project | .claude/agents/<name>.md | This project | Higher |
| User | ~/.claude/agents/<name>.md | All projects | Lower |
Project-level subagents override user-level when names conflict.
Creation Process
1. Determine Mode
- With argument (
$ARGUMENTS): Auto mode - generate from name and recent workflow - Without argument: Interactive mode - ask guided questions
2. Interactive Mode Questions
Use AskUserQuestion with these prompts:
Question 1 - Role:
- Header: "Role"
- Question: "What specialized role should this subagent fulfill?"
- Options:
- "Code quality expert" - Review, refactor, improve code
- "Testing specialist" - Write and run tests
- "Architecture advisor" - Design systems, plan structure
- "Domain expert" - Specialized domain knowledge
Question 2 - Activation:
- Header: "Activation"
- Question: "When should Claude delegate to this subagent?"
- Options:
- "After code changes" - Proactively review new code
- "Specific keywords" - Trigger on certain terms
- "Explicit request only" - Only when user asks
- "High-volume operations" - Isolate verbose output
Question 3 - Tools (multiSelect: true):
- Header: "Tools"
- Question: "Which tools should this subagent access?"
- Options:
- "Read-only" - Read, Grep, Glob (safe exploration)
- "File operations" - Read, Write, Edit, Glob
- "Shell commands" - Bash execution
- "All tools" - Inherit everything
Question 4 - Model:
- Header: "Model"
- Question: "Which model should power this subagent?"
- Options:
- "Sonnet (Recommended)" - Balanced performance
- "Haiku (Fast)" - Quick, cost-effective
- "Opus (Advanced)" - Most capable
- "Inherit" - Same as main conversation
Question 5 - Scope:
- Header: "Scope"
- Question: "Where should this subagent be available?"
- Options:
- "User-level" - Save to ~/.claude/agents/
- "Project-level" - Save to .claude/agents/
3. Extract Workflow Patterns
When analyzing recent conversation:
- Identify domain from file types and commands
- Track tool usage patterns
- Detect repeated action sequences
- Extract trigger keywords from user messages
4. Generate Subagent File
# User-level
~/.claude/agents/$SUBAGENT_NAME.md
# Project-level
.claude/agents/$SUBAGENT_NAME.md
5. Write Subagent Content
Use this template:
---
name: subagent-name
description: Role + when to invoke. Include trigger keywords for auto-delegation.
tools: Read, Write, Bash # Optional, inherits all if omitted
model: sonnet # Optional: sonnet, opus, haiku, inherit
---
You are a [specific role] specializing in [domain].
## Responsibilities
1. **Primary Task**: What you do first
2. **Secondary Task**: What you do next
3. **Quality Assurance**: How you verify work
## Workflow
When invoked:
1. **Analyze**: Understand the current state
2. **Execute**: Perform the main task
3. **Verify**: Check results meet standards
4. **Report**: Summarize findings
## Best Practices
- Guideline 1
- Guideline 2
- Common pitfall to avoid
## Output Format
[Template for deliverables]
Frontmatter Reference
See reference.md for complete frontmatter field documentation.
Key fields:
| Field | Description |
|---|---|
name | Unique identifier (lowercase, hyphens) |
description | Role + activation triggers (critical for auto-delegation) |
tools | Comma-separated list; inherits all if omitted |
disallowedTools | Tools to explicitly deny |
model | sonnet, opus, haiku, or inherit |
permissionMode | default, acceptEdits, dontAsk, bypassPermissions, plan |
skills | Skills to preload into subagent context |
hooks | Lifecycle hooks for this subagent |
Description Best Practices
Poor descriptions:
- "Helps review code" (vague, no triggers)
- "API testing tool" (no context)
Good descriptions:
- "Expert code reviewer. Reviews for quality, security, maintainability. Use immediately after writing code, before commits, or when refactoring."
- "API testing specialist. Validates REST endpoints, schemas, error handling. Use when testing APIs or debugging HTTP requests."
Built-in Subagents
Claude Code includes these built-in subagents:
| Agent | Model | Tools | Purpose |
|---|---|---|---|
| Explore | Haiku | Read-only | Fast codebase exploration |
| Plan | Inherit | Read-only | Research during plan mode |
| general-purpose | Inherit | All | Complex multi-step tasks |
When to Use Subagents
Use subagents when:
- Task produces verbose output (tests, logs)
- Need to enforce tool restrictions
- Work is self-contained and returns summary
- Different model needed for sub-task
Use main conversation when:
- Frequent back-and-forth needed
- Multiple phases share context
- Quick, targeted changes
- Latency matters
Validation Checklist
Before finalizing:
- YAML syntax: Valid frontmatter with proper delimiters
- Description: Includes role + activation triggers + keywords
- System prompt: Clear role, structured workflow, quality criteria
- Tool access: Appropriate for task, not too permissive
Output Format
After creation:
Subagent created: subagent-name
Location: ~/.claude/agents/subagent-name.md
Role: [description]
Model: sonnet
Tools: Read, Write, Bash
To use:
- Automatic: Claude delegates when context matches
- Explicit: "Use the subagent-name subagent to [task]"
Examples
See examples.md for complete subagent examples.
Debugging
If subagent doesn't activate:
- Check file:
ls ~/.claude/agents/subagent-name.md - Verify YAML:
head -10 ~/.claude/agents/subagent-name.md - Make description more specific with trigger keywords
- Test explicit: "Use the subagent-name subagent to [task]"
- Run
/agentsto verify it's loaded
Sponsors
Details
- Marketplace
- yanmxa/cc-plugins
- Source
- plugins/claude
- Category
- Development