From plugin-dev
Guides developers in creating, improving, and organizing SKILL.md files for Claude Code plugins, covering frontmatter, triggers, structure, progressive disclosure, hooks, budgets, and best practices.
npx claudepluginhub sjnims/plugin-dev --plugin plugin-devThis skill uses the workspace's default tool permissions.
This skill provides guidance for creating effective skills for Claude Code plugins.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
This skill provides guidance for creating effective skills for Claude Code plugins.
Skills are modular, self-contained packages that extend Claude's capabilities by providing specialized knowledge, workflows, and tools. Think of them as "onboarding guides" for specific domains or tasks—they transform Claude from a general-purpose agent into a specialized agent equipped with procedural knowledge that no model can fully possess.
When multiple skills share the same name, precedence determines which loads:
~/.claude/skills/).claude/skills/)Plugin developers should use distinctive, ideally namespaced names (the plugin system auto-namespaces as plugin-name:skill-name) to avoid collisions with user or project skills.
Skills and commands share the same underlying mechanism (Skill tool). The choice depends on complexity needs:
commands/foo.md): Simple prompts without bundled resourcesskills/foo/SKILL.md): Complex workflows needing scripts, references, or examplesBoth support $ARGUMENTS, [BANG] bash execution, and frontmatter fields. Skills add bundled resources and progressive disclosure.
Every skill consists of a required SKILL.md file and optional bundled resources:
skill-name/
├── SKILL.md (required)
│ ├── YAML frontmatter metadata (required)
│ │ ├── name: (required)
│ │ └── description: (required)
│ └── Markdown instructions (required)
└── Bundled Resources (optional)
├── scripts/ - Executable code (Python/Bash/etc.)
├── references/ - Documentation intended to be loaded into context as needed
└── assets/ - Files used in output (templates, icons, fonts, etc.)
Metadata Quality: The name and description in YAML frontmatter determine when Claude will use the skill. Be specific about what the skill does and when to use it. Use the third-person (e.g. "This skill should be used when..." instead of "Use this skill when...").
Optionally restrict which tools Claude can use when the skill is active:
---
name: code-reviewer
description: Review code for best practices...
allowed-tools: Read, Grep, Glob
---
Use allowed-tools for:
When specified, Claude can only use the listed tools without needing permission. If omitted, Claude follows the standard permission model.
Control how the skill's context is loaded:
---
name: analysis-skill
description: Perform deep code analysis...
context: fork
---
Values:
fork - Run skill in a subagent (separate context), preserving main agent's contextUse context: fork for:
Specify which agent type handles the skill when context: fork is set:
---
name: exploration-skill
description: Explore codebase patterns...
context: fork
agent: Explore
---
Values:
Explore - Fast agent for codebase explorationPlan - Architect agent for implementation planninggeneral - General-purpose agent (default if context: fork)Requires context: fork to be set.
Load other skills into the forked agent's context:
---
name: comprehensive-review
description: Full code review with testing...
context: fork
agent: general
skills:
- testing-patterns
- security-audit
---
Requires context: fork to be set. Only skills from the same plugin can be loaded.
Control whether the skill appears in the slash command menu:
---
name: internal-review-standards
description: Apply internal code review standards...
user-invocable: false
---
Default: true (skills are visible in the / menu)
Important: This field only controls slash menu visibility. It does NOT affect:
Use user-invocable: false for skills that Claude should use automatically but users shouldn't invoke directly.
Prevent Claude from programmatically invoking the skill via the Skill tool:
---
name: dangerous-operation
description: Perform dangerous operation...
disable-model-invocation: true
---
Default: false (programmatic invocation allowed)
Use for skills that should only be manually invoked by users, such as:
Visibility comparison:
| Setting | Slash Menu | Skill Tool | Auto-Discovery |
|---|---|---|---|
user-invocable: true (default) | Visible | Allowed | Yes |
user-invocable: false | Hidden | Allowed | Yes |
disable-model-invocation: true | Visible | Blocked | Yes |
Override which model handles the skill:
---
name: quick-lint
description: Fast code linting checks...
model: haiku
---
Values: sonnet, opus, haiku, inherit (default), or a full model ID (e.g., claude-sonnet-4-5-20250929)
Use haiku for fast/cheap skills, opus for complex reasoning requiring maximum capability. Default behavior (inherit) uses the conversation's current model.
See references/advanced-frontmatter.md for detailed guidance on model selection.
Define scoped hooks that activate only when this skill is in use:
---
name: secure-writer
description: Write files with validation...
hooks:
PreToolUse:
- matcher: Write
hooks:
- type: command
command: "${CLAUDE_PLUGIN_ROOT}/scripts/validate-write.sh"
---
Scoped hooks follow the same event/matcher/hook structure as hooks.json but are lifecycle-bound to the skill. Supported events: PreToolUse, PostToolUse, Stop.
See references/advanced-frontmatter.md for full syntax and comparison with hooks.json.
Provides autocomplete hint text shown in the / menu for the skill's expected arguments:
---
argument-hint: "<file-path> [--verbose]"
---
Purely cosmetic — helps users understand what arguments the skill expects. Does not affect argument parsing.
scripts/)Executable code (Python/Bash/etc.) for tasks that require deterministic reliability or are repeatedly rewritten.
scripts/rotate_pdf.py for PDF rotation tasksreferences/)Documentation and reference material intended to be loaded as needed into context.
references/schema.md for database schemas, references/api_docs.md for API specificationsassets/)Files not intended to be loaded into context, but rather used within the output Claude produces.
assets/logo.png for brand assets, assets/slides.pptx for templatesSkills support dynamic content injection and variable substitution for context-aware behavior.
Use variables in skill content that get replaced at runtime:
The session ID is: ${CLAUDE_SESSION_ID}
Arguments passed: $ARGUMENTS
Available substitutions:
$ARGUMENTS - Arguments passed when skill is invoked (e.g., /skill-name arg1 arg2)$ARGUMENTS[0], $ARGUMENTS[1], etc. - Individual positional arguments (zero-indexed). $ARGUMENTS[0] is the first argument after the skill name.$1, $2, $3, etc. - 1-indexed shorthand for positional arguments. $1 is equivalent to $ARGUMENTS[0], $2 to $ARGUMENTS[1], etc.${CLAUDE_SESSION_ID} - Current session identifier${CLAUDE_PLUGIN_ROOT} - Plugin directory pathExecute commands to inject their output into skill context using backtick syntax:
## Current Project Status
The git status is:
[BANG]`git status --short`
Recent commits:
[BANG]`git log --oneline -5`
Syntax: [BANG]`command`
Use cases:
Security note: Commands execute in the user's environment. Only use trusted commands.
Skills use a three-level loading system to manage context efficiently:
*Unlimited because scripts can be executed without reading into context window.
Visibility budget: Claude Code allocates approximately 2% of the context window (or ~16KB fallback) for skill descriptions via SLASH_COMMAND_TOOL_CHAR_BUDGET. When total description text across all installed skills exceeds this budget, some skills may be excluded from auto-discovery. Keep descriptions concise and move detail into the SKILL.md body and references. See references/advanced-frontmatter.md for optimization guidance.
Skills should be designed for re-discoverability after auto-compaction. When Claude's context approaches its limit, older messages are automatically compressed. After compaction:
PreCompact hook: Plugins can use a PreCompact hook to preserve critical information before compaction occurs. Use this to save state that would otherwise be lost.
Cross-plugin budget: Skill descriptions from ALL installed plugins compete for the same visibility budget. Write concise, keyword-rich descriptions to maximize discoverability without consuming excessive space.
To create a skill, follow these six steps. For detailed instructions on each step, see references/skill-creation-workflow.md.
mkdir -p skills/skill-name/{references,examples,scripts}Plugin skills live in the plugin's skills/ directory:
my-plugin/
├── .claude-plugin/
│ └── plugin.json
├── commands/
├── agents/
└── skills/
└── my-skill/
├── SKILL.md
├── references/
├── examples/
└── scripts/
Claude Code automatically discovers skills:
skills/ directorySKILL.mdPlugin skills are distributed as part of the plugin, not as separate ZIP files. Users get skills when they install the plugin.
Test skills by installing plugin locally:
# Test with --plugin-dir
claude --plugin-dir /path/to/plugin
# Ask questions that should trigger the skill
# Verify skill loads correctly
Study the skills in this plugin as examples of best practices:
hook-development skill:
agent-development skill:
plugin-settings skill:
Each demonstrates progressive disclosure and strong triggering.
Before finalizing a skill:
Structure:
name and description fieldsallowed-tools field if restricting tool accesscontext: fork if running in subagentagent field if specifying agent type (requires context: fork)skills array if loading other skills (requires context: fork)user-invocable field if hiding from slash menudisable-model-invocation field if blocking programmatic usemodel field if overriding model (sonnet/opus/haiku/inherit)hooks field for scoped hooks (same format as hooks.json)argument-hint field for autocomplete hintsDescription Quality:
Content Quality:
Testing:
skill-name/
└── SKILL.md
Good for: Simple knowledge, no complex resources needed
skill-name/
├── SKILL.md
├── references/
│ └── detailed-guide.md
└── examples/
└── working-example.sh
Good for: Most plugin skills with detailed documentation
skill-name/
├── SKILL.md
├── references/
│ ├── patterns.md
│ └── advanced.md
├── examples/
│ ├── example1.sh
│ └── example2.json
└── scripts/
└── validate.sh
Good for: Complex domains with validation utilities
DO:
DON'T:
Copy-paste ready skill templates in examples/:
examples/minimal-skill.md - Bare-bones skill with just SKILL.md (git conventions example)examples/complete-skill.md - Full skill with references/, examples/, and scripts/ (API testing example)examples/frontmatter-templates.md - Quick-reference frontmatter patterns for common use casesFor detailed guidance, consult:
references/skill-creation-workflow.md - Plugin-specific skill creation workflow (recommended for plugin skills)references/skill-creator-original.md - Original generic skill-creator methodology (includes init/packaging scripts for standalone skills)Plugin-dev's skills demonstrate best practices:
../hook-development/ - Progressive disclosure, utilities../agent-development/ - AI-assisted creation, references../mcp-integration/ - Comprehensive references../plugin-settings/ - Real-world examples../command-development/ - Clear critical concepts../plugin-structure/ - Good organization