Claude Development Plugin That Can Create Commands, Scripts, and Hooks for Claude Code

GitHub stars
9

Install

/plugin install claude@cc-plugins

Run it inside Claude Code after adding the marketplace with /plugin marketplace add yanmxa/cc-plugins.

Contents

Discovered from source

Skills 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

LocationPathScope
Personal~/.claude/commands/category/name.mdAll projects
Project.claude/commands/category/name.mdThis 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:

  1. Track frequently used tools
  2. Find repeated action sequences
  3. Capture successful bash commands
  4. Consolidate micro-actions into major steps
  5. 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:

  1. Read existing command file
  2. Preserve metadata unless workflow changed
  3. Merge new steps with existing
  4. Add new tools to allowed-tools
  5. 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

FeatureCommandSkillSubagent
InvocationUser-only (/name)User or ClaudeUser or Claude
ContextMain conversationMain conversationIsolated
Best ForQuick automationDomain expertiseComplex workflows
FormatSingle .md fileFolder with SKILL.mdSingle .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 --update to 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

LocationPathScopePriority
Project.claude/agents/<name>.mdThis projectHigher
User~/.claude/agents/<name>.mdAll projectsLower

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:

  1. Identify domain from file types and commands
  2. Track tool usage patterns
  3. Detect repeated action sequences
  4. 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:

FieldDescription
nameUnique identifier (lowercase, hyphens)
descriptionRole + activation triggers (critical for auto-delegation)
toolsComma-separated list; inherits all if omitted
disallowedToolsTools to explicitly deny
modelsonnet, opus, haiku, or inherit
permissionModedefault, acceptEdits, dontAsk, bypassPermissions, plan
skillsSkills to preload into subagent context
hooksLifecycle 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:

AgentModelToolsPurpose
ExploreHaikuRead-onlyFast codebase exploration
PlanInheritRead-onlyResearch during plan mode
general-purposeInheritAllComplex 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:

  1. YAML syntax: Valid frontmatter with proper delimiters
  2. Description: Includes role + activation triggers + keywords
  3. System prompt: Clear role, structured workflow, quality criteria
  4. 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:

  1. Check file: ls ~/.claude/agents/subagent-name.md
  2. Verify YAML: head -10 ~/.claude/agents/subagent-name.md
  3. Make description more specific with trigger keywords
  4. Test explicit: "Use the subagent-name subagent to [task]"
  5. Run /agents to verify it's loaded

Sponsors

Details

Marketplace
yanmxa/cc-plugins
Source
plugins/claude
Category
Development

More from yanmxa/cc-plugins

All 10