/plugin:skill [--validate] [--structure]from plugin
Creates, validates, and structures SKILL.md files for Claude Code. Includes linting, naming conventions, and reference depth checks.
Ships in plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Run a check against a skill path in $ARGUMENTS, defaulting to the skill you just edited:
--validate: run skill-lint (see Validation) for frontmatter, naming, and reference depth.--structure: run ${CLAUDE_SKILL_DIR}/scripts/check-structure.ts for the SKILL.md, scripts/, references/, assets/ layout.With neither flag, use the skill as an authoring reference.
---
name: plugin-name:skill-name
description: Third-person capability description with trigger terms
argument-hint: "[--flag] [<positional>]"
allowed-tools: [Read, Grep, Glob]
model: sonnet
effort: low
context: fork
agent: Explore
background: false
user-invocable: false
hooks:
PreToolUse:
- matcher: "Bash"
hooks:
- type: command
command: "./scripts/validate.sh"
once: true
---
name: Lowercase letters, numbers, hyphens only (max 64 chars). See Naming.description: Third-person, includes trigger terms and use cases (max 1024 chars).argument-hint: Arguments the skill accepts, shown in the slash menu after the skill name. See Argument Hints.allowed-tools: Tools Claude can use without permission when skill is activemodel: Override the conversation's model. Prefer a tier alias (haiku, sonnet, opus, fable) or inherit over a dated model ID.effort: Reasoning effort while the skill is active, whether the user types it as a slash command or the model invokes it through the Skill tool. Defaults to the conversation's effort. See Reasoning Effort for levels and cache cost by model.context: Set to fork to run in isolated subagent contextagent: Agent type when context: fork (Explore, Plan, general-purpose, or custom)background: Only with context: fork. false waits for the fork's result in the invoking turn instead of backgrounding it. Default true.user-invocable: Hide from slash menu when false (default: true)disable-model-invocation: Block model (Skill-tool) invocation and drop the skill's name and description from the always-on catalog (zero recurring context cost); still slash-invocable. Opposite of user-invocable: false, which hides the slash menu but keeps the description loaded for the model.hooks: Skill-scoped hooks (PreToolUse, PostToolUse, Stop)Plugin skills use plugin-name:skill-name with a colon namespace (e.g., gitlab:ci, things:url). The part after the colon should not repeat the plugin name. Skip the prefix when name equals plugin name. For standalone skills, use a specific gerund form (verb + -ing): processing-pdfs, analyzing-data.
~/.claude/skills/ (personal), .claude/skills/ (project), plugins (bundled)
Load the prompting skill before writing a skill body or a reference file. The sections below cover what is specific to Claude Code skills.
The description field is the pointer Claude scans to decide whether to activate the skill. Write it for the model and make it slightly pushy, since under-triggering is the common failure.
List triggers: the requests that call for the skill. End with the boundary to any sibling skill a request could land on. Tools, techniques, and capabilities go in the body.
description: Use when timing a program or command, asking whether a change or version made it faster, or building a benchmark harness. For repeated optimization toward a target, use performance:hill-climb.
Record failure modes hit in practice in a ## Gotchas section, and grow it as edge cases surface.
Keep SKILL.md a concise hub and push details into references/, scripts/, and assets/, organized by domain. Point to each file with when to read it.
A model-invocable skill's description costs tokens in every session. Keep an invoked skill's body under roughly 4k tokens, since it is re-injected in full at every compaction. A references/ file costs nothing until its pointer fires.
Split one skill into two by invocation when the branches need different frontmatter: a different model, different allowed-tools, or one branch routed by the model while the other stays user-invoked.
Store state that must survive plugin upgrades (logs, JSON records, SQLite, a first-run config.json of user answers) in ${CLAUDE_PLUGIN_DATA}. Point to bundled scripts with "Run script.py" to execute and "See script.py" to read.
Skill-scoped hooks activate when the skill is invoked and last for the session. Use them for guardrails that belong only in the skill's context, such as blocking destructive commands during prod operations.
| Variable | Description |
|---|---|
$ARGUMENTS | All arguments passed when invoking the skill. Appended automatically if absent. |
$ARGUMENTS[N] / $N | Access a specific argument by 0-based index. |
${CLAUDE_SESSION_ID} | Current session ID. |
${CLAUDE_SKILL_DIR} | Absolute path to the skill's directory. Substituted in skill content: the body, ! injection commands, and allowed-tools. |
These substitutions apply to skill content, not the frontmatter hooks: block. The hooks engine expands only ${CLAUDE_PROJECT_DIR}, ${CLAUDE_PLUGIN_ROOT}, and ${CLAUDE_PLUGIN_DATA} (hooks reference); ${CLAUDE_SKILL_DIR} there resolves to an empty string. In a hook command, reference a bundled script by plugin root instead: ${CLAUDE_PLUGIN_ROOT}/skills/<skill>/scripts/check.ts.
argument-hint declares the arguments a skill accepts. It renders in the slash menu after the skill name and reminds the user which flags exist. Give every directable skill a hint, even when it usually runs with none. A skill that branches internally ("if the user wants X") should expose that branch as a flag.
<doc-path> [--draft].[staged | <range> | HEAD].[--flag]. Value flags are [--flag value]. Enumerated values pipe-join without inner spaces: [--role author|reviewer].A skill that declares an argument-hint must parse $ARGUMENTS (or $0/$1 for positionals) and act on what it finds. Add an ## Arguments section to the body mapping each token to its behavior, with a stated default for every flag so the no-argument invocation stays well-defined.
Bang-backtick syntax runs a shell command before the skill content reaches Claude and replaces the placeholder with its stdout. Use it for live data every run needs. Syntax and gotchas are in references/patterns.md.
Skills follow the Agent Skills directory convention. Only SKILL.md is required.
skill-name/
├── SKILL.md # Required: instructions and frontmatter
├── scripts/ # Executable code agents can run (self-contained, explicit errors)
├── references/ # Documentation loaded on demand (focused, domain-named files)
└── assets/ # Static resources (templates, images, data files)
A PostToolUse hook validates writes to skill directories against this structure.
Use uppercase only for files with special meaning (SKILL.md, README.md) and lowercase for the rest. Keep references one level deep.
A skill-scoped PostToolUse hook runs skill-lint when SKILL.md files are edited. For manual checks, run bun run skill-lint path/to/skill/ from the project root. A skill is done when skill-lint passes and its SKILL.md reports under roughly 4k tokens.
context: fork, reasoning effort, skill-scoped hooks, tool and skill overlapreferences/patterns.md (opens in a new tab)references/troubleshooting.md (opens in a new tab)scripts/check-lint.test.ts (opens in a new tab)scripts/check-lint.ts (opens in a new tab)scripts/check-namespace.test.ts (opens in a new tab)scripts/check-namespace.ts (opens in a new tab)scripts/check-structure.test.ts (opens in a new tab)scripts/check-structure.ts (opens in a new tab)scripts/hook-input.ts (opens in a new tab)scripts/skill-lint/index.ts (opens in a new tab)scripts/skill-lint/parse.ts (opens in a new tab)scripts/skill-lint/rules/bang-execution.ts (opens in a new tab)scripts/skill-lint/rules/body.ts (opens in a new tab)scripts/skill-lint/rules/frontmatter.ts (opens in a new tab)scripts/skill-lint/rules/headers.ts (opens in a new tab)scripts/skill-lint/rules/index.ts (opens in a new tab)scripts/skill-lint/rules/markdown.ts (opens in a new tab)scripts/skill-lint/rules/namespace.ts (opens in a new tab)scripts/skill-lint/rules/references.ts (opens in a new tab)scripts/skill-lint/rules/tokens.ts (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Write|Editbun ${CLAUDE_PLUGIN_ROOT}/skills/skill/scripts/check-namespace.tsbun ${CLAUDE_PLUGIN_ROOT}/skills/skill/scripts/check-structure.tsbun ${CLAUDE_PLUGIN_ROOT}/skills/skill/scripts/check-lint.tsnpx claudepluginhub bendrucker/claude --plugin plugin2 skills in this plugin
Other plugins' skills for the same job