Use when creating new skills, optimizing existing skills, or auditing skill quality. Guides skill development following Claude Code official best practices.
40:T3b84,
Guides the creation and optimization of Claude Code skills using official best practices. Use this whenever:
For the complete technical reference on all frontmatter fields, advanced patterns, and troubleshooting, see reference.md.
A skill is a reusable set of instructions that tells Claude Code how to handle a specific task. Skills live in .claude/skills/[skill-name]/SKILL.md inside your project. When you type /skill-name or describe what you need in natural language, Claude loads the skill's instructions and follows them.
Think of skills as SOPs for Claude. Instead of re-explaining a workflow every conversation, you write it once and invoke it forever.
How they work under the hood:
CLAUDE.md instructions are always loaded, every conversationWhen building a new skill, run the Discovery Interview first. Do NOT start writing files until discovery is complete.
Ask questions using AskUserQuestion, one round at a time. Each round covers one topic. Move to the next round only after the user answers. Keep going until you're 95% confident you understand the skill well enough to build it without further clarification.
Round 1: Goal & Name
Why this matters: A clear goal prevents scope creep. The name becomes the /slash-command, so it needs to be memorable and specific.
Round 2: Trigger
Why this matters: The description field is how Claude decides whether to load your skill. Bad trigger words mean Claude never uses it. Too broad means Claude fires it when you don't want it.
/slash-command), Claude-auto-invocable, or both?Round 3: Step-by-Step Process Why this matters: Claude follows instructions literally. Vague steps produce vague results. Specific steps produce consistent output every time.
Round 4: Inputs, Outputs & Dependencies Why this matters: Skills that don't specify where to find inputs or where to put outputs produce inconsistent results. Nailing this down makes the skill reliable.
Round 5: Guardrails & Edge Cases Why this matters: Skills without guardrails can produce unexpected behavior -- wrong outputs, unnecessary API costs, or actions you didn't intend.
Round 6: Confirmation Why this matters: Misunderstandings caught here save you from rebuilding the skill later.
After all rounds, summarize your understanding back to the user in this format:
## Skill Summary: [name]
**Goal:** [one sentence]
**Trigger:** `/name` + [natural language phrases]
**Arguments:** [what it accepts, or "none"]
**Process:**
1. [step]
2. [step]
...
**Inputs:** [what it reads/needs]
**Outputs:** [what it produces + where]
**Dependencies:** [APIs, scripts, agents, reference files]
**Guardrails:** [what can go wrong, what to avoid]
Ask: "Does this capture it? Anything to add or change?" Only proceed to building once the user confirms.
Skipping rounds: If the user provides enough context upfront (e.g., they describe the full workflow in their first message), skip rounds that are already answered. Don't re-ask what you already know.
Once discovery is complete, build the skill following these steps:
Step 1: Choose the skill type
/name or natural language. Examples: generate a report, summarize a PR, deploy code.Step 2: Configure frontmatter
Set these fields based on what you learned in discovery:
name -- Matches the directory name. Lowercase, hyphens, max 64 chars.description -- Written as: "Use when someone asks to [action], [action], or [action]." Include natural keywords from the trigger phrases.disable-model-invocation: true -- Set if the skill has side effects (file generation, API calls, costs money). Prevents Claude from auto-invoking.argument-hint -- Set if the skill accepts arguments. Shows in the / menu autocomplete.context: fork + agent -- Set if the skill is self-contained and doesn't need conversation history.model -- Set if a specific model capability is needed.allowed-tools -- Set if the skill should have restricted tool access.Only set fields you actually need. Don't add frontmatter just because you can.
For the full field reference and invocation control matrix, see reference.md.
Step 3: Write the skill content
Structure task skills as:
Content rules:
$ARGUMENTS / $N for dynamic input from arguments.!command`` for dynamic context injection (preprocessing).Step 4: Add supporting files (if needed)
If your skill needs detailed reference docs, examples, or scripts, add them alongside SKILL.md in the same directory. Reference them from SKILL.md so Claude knows they exist. Supporting files are NOT loaded automatically -- they load only when Claude needs them. See reference.md for the full pattern.
Step 5: Deploy, Backup & Register in Installer
All skills are backed up to the central skill repository and deployed to their target project.
Backup location (always): ~/workspace/x85446/claudecodetricks/skills/[skill-name]/
This is the canonical copy. The installer script deploys from here.
Deploy location: The target project's .claude/skills/ directory. Ask the user which project to deploy to using AskUserQuestion. There is no default -- the user must specify.
Known deploy targets (for reference):
| Target | Path |
|---|---|
| Izuma Marketing | ~/workspace/izuma/marketing/.claude/skills/ |
| Travis Taxes (Google Drive) | ~/Library/CloudStorage/[email protected]/My Drive/TRAVIS_Taxes/.claude/skills/ |
| ClaudeCodeTricks (finance pipeline) | ~/workspace/x85446/claudecodetricks/temp/.claude/skills/ |
Then:
~/workspace/x85446/claudecodetricks/skills/[skill-name]/[deploy-path]/.claude/skills/[skill-name]/~/workspace/x85446/claudecodetricks/skills/skillinstall.sh:# In the do_install() function, add:
<skill-name>) install_skill <skill-name> "$TARGET_VAR" ;;
Where $TARGET_VAR is one of the predefined deploy target variables at the top of skillinstall.sh:
$IMARKETING — Izuma Marketing$TAXES — Travis Taxes (Google Drive)$CCTRICKS — ClaudeCodeTricks finance pipelineIf the deploy target doesn't have a variable yet, add one to the "Deploy targets" section of skillinstall.sh.
If the user declines a location (skips deploy), still write to backup and register in the installer.
Step 6: Document in CLAUDE.md
Your project's CLAUDE.md file is where Claude loads project-wide instructions every conversation. After creating a skill, add a brief entry so you (and your team) know what's available:
/slash-commandThis isn't required for the skill to work, but it keeps your project organized and helps Claude understand how skills fit into your broader workflow.
Step 7: Test
Test both invocation methods:
description field to include the keywords you used/skill-name with test arguments
$ARGUMENTS / $N are substituting correctly/context to confirm your skill's description is being loaded. If it's not, your total descriptions may exceed the budget (see reference.md for details).If issues arise, see Troubleshooting in reference.md.
Here's a minimal but complete skill you can use as a starting template:
File: .claude/skills/meeting-notes/SKILL.md
---