CLAUDE CODE SKILLS

Extend Claude with reusable knowledge, workflows & capabilities
Big idea: A Claude Code Skill is a reusable SKILL.md-based instruction package. Claude can load it automatically when relevant, or you can invoke it directly with /skill-name. Skills are especially useful for repeated instructions, checklists, multi-step procedures, and domain knowledge.
SKILL.mdDescriptionDiscover/skill-nameWorkflow

1. What Is a Skill?

Think of a Skill as a reusable instruction pack for Claude Code.

Without SkillWith Skill
Repeat the same instructions in chat.Write instructions once in SKILL.md.
Explain a workflow every time.Reuse the workflow.
Large reference material may pollute context.Reference files can load only when needed.
Repeated prompts are manual.A slash command provides a reusable entry point.
Remember: CLAUDE.md is for persistent project facts/rules; Skills are excellent for reusable knowledge and procedures that load when needed.

2. When Should You Create a Skill?

  • You keep pasting the same instructions.
  • You have a repeated checklist or multi-step procedure.
  • A large section of CLAUDE.md has become a procedure rather than a fact.
  • You want a reusable /command.
  • You want Claude to automatically recognize a specialized workflow.

📚 Knowledge

API conventions, domain rules, architecture patterns, style guides.

🔁 Workflow

Deployment, issue fixing, release preparation, code review, migrations.

🧩 Reusable command

Turn a repeated prompt into /deploy, /review, etc.

🤖 Automatic help

Claude can choose a Skill when the request matches its description.

3. Skill Anatomy

.claude/
└── skills/
    └── summarize-changes/
        └── SKILL.md

Every Skill needs SKILL.md. It has YAML frontmatter followed by Markdown instructions.

---
name: summarize-changes
description: Summarize uncommitted changes and flag risks.
---

## Current changes
!`git diff HEAD`

## Instructions
Summarize the changes in 2–3 bullets.
Flag risks and tests that need updating.
Important: The opening --- must be the first line for Claude Code to parse frontmatter.

4. Create Your First Skill

Step 1 — Create directory

mkdir -p ~/.claude/skills/summarize-changes

Step 2 — Create SKILL.md

---
description: Summarizes uncommitted changes and flags risky changes.
---

## Current changes
!`git diff HEAD`

## Instructions
Summarize the changes in two or three bullets.
List risks such as missing error handling, hardcoded values,
or tests that need updating.

Step 3 — Use it

claude
What did I change?

Or:

/summarize-changes

5. Where Skills Load

ScopePathWhere it works
EnterpriseManaged .claude/skills/Organization-managed users
Personal~/.claude/skills/<name>/SKILL.mdAll projects on that machine
Project.claude/skills/<name>/SKILL.mdSessions in repository
Nested<subdir>/.claude/skills/Sessions working in that subtree
Additional directory.claude/skills/ under --add-dirThat session
Plugin<plugin>/skills/<name>/Where plugin is enabled
claude.ai accountSynced SkillsCowork/cloud sessions

6. Monorepos & Nested Skills

Claude Code loads project Skills from the start directory and parent directories up to the repository root. Skills below the start directory can become available when Claude first works with files there; supported versions can also use /add-dir to load them sooner.

repo/
├── .claude/skills/deploy/SKILL.md
└── apps/web/.claude/skills/frontend-test/SKILL.md

If names collide, both can remain available and nested Skills may have qualified commands such as:

/apps/web:deploy

7. Skill Command Names

.claude/skills/deploy-staging/SKILL.md
→ /deploy-staging

For plugins, Skills are namespaced:

/my-plugin:review
Modern terminology: Custom commands have been merged into Skills. Existing .claude/commands/ files still work, but Skills are preferred for new work.

8. Frontmatter Reference

FieldPurpose
nameDisplay name; normal project/personal command name still comes from directory.
descriptionWhat the Skill does and when Claude should use it.
when_to_useExtra trigger/use guidance.
argument-hintAutocomplete hint for expected arguments.
argumentsNamed positional arguments.
disable-model-invocationStops Claude from automatically invoking it.
user-invocableIf false, user cannot invoke it directly.
allowed-toolsPre-approves listed tools for the Skill's invocation turn.
disallowed-toolsRemoves listed tools while Skill is active.
contextCan fork the Skill into an isolated subagent context.
agentSubagent configuration used with context: fork.
backgroundControls waiting/background behavior for forked Skills.
pathsLimits automatic activation to matching file patterns.
shellShell used by injected commands.
metadataFree-form map for external tooling; Claude Code does not act on it.
licenseLicense metadata.
compatibilityEnvironment requirements; max 500 characters.

9. The Two Most Important Invocation Controls

disable-model-invocation: true

You invoke it. Claude cannot automatically choose it. Great for deploy, commit, release, or messaging workflows.

---
name: deploy
description: Deploy to production
disable-model-invocation: true
---

user-invocable: false

Claude invokes it. The user does not get it as a normal slash command. Good for background knowledge.

---
name: legacy-context
description: Explains the legacy system
user-invocable: false
---
ConfigurationUserClaude
DefaultYesYes
disable-model-invocation: trueYesNo
user-invocable: falseNoYes

10. Reference Skill vs Task Skill

Reference SkillTask Skill
Provides knowledge.Performs a procedure.
API conventions.Deploy application.
Domain rules.Fix GitHub issue.
Style guide.Create release.
Rule of thumb: Reference Skills can be automatic; side-effect-heavy Task Skills are often better as manual-only Skills.

11. Supporting Files

my-skill/
├── SKILL.md
├── reference.md
├── examples.md
└── scripts/
    └── helper.py

Keep SKILL.md focused and point Claude to detailed files:

## Additional resources
- Complete API details: reference.md
- Usage examples: examples.md
Best practice: Keep SKILL.md under about 500 lines and move detailed reference material into separate files.

12. Arguments

$ARGUMENTS

---
name: fix-issue
description: Fix a GitHub issue
disable-model-invocation: true
---

Fix GitHub issue $ARGUMENTS.
/fix-issue 123

Indexed arguments

---
name: migrate-component
description: Migrate a component
---

Migrate $0 from $1 to $2.
/migrate-component SearchBar JavaScript TypeScript
PlaceholderMeaning
$ARGUMENTSAll arguments.
$ARGUMENTS[0]First argument.
$0First argument shorthand.
$1Second argument.
$nameNamed argument from arguments.

13. Named Arguments

---
name: migrate-component
description: Migrate a component
arguments: [component, from, to]
---

Migrate $component from $from to $to.

Run:

/migrate-component SearchBar JavaScript TypeScript

14. Stack Multiple Skills

/write-tests /fix-issue 123

Current Claude Code can expand the first Skill plus up to five more stacked inline user-invocable Skills. Expansion stops when a token is not another inline Skill.

15. Dynamic Context Injection

The !`command` syntax runs a shell command before the Skill content is sent to Claude. The command output replaces the placeholder.

---
name: pr-summary
description: Summarize a pull request
allowed-tools: Bash(gh *)
---

## Pull request context
- PR diff: !`gh pr diff`
- PR comments: !`gh pr view --comments`
- Changed files: !`gh pr diff --name-only`

## Task
Summarize this pull request.
SkillRun commandCapture outputInsertClaude sees live context

16. Multi-line Dynamic Commands

## Environment
```!
node --version
git status --short
npm test
```

Injected commands run before Claude sees the rendered Skill content.

17. Shell Behavior & Failures

FrontmatterMeaning
shell: bashUse Bash.
shell: powershellUse PowerShell when enabled.
No shellClaude Code chooses based on environment.
Important: A failed injected command normally aborts the whole Skill invocation. Permission checks also apply; injected commands never pause for an interactive permission prompt.

18. Useful Claude Variables

VariableUse
${CLAUDE_SESSION_ID}Current session ID.
${CLAUDE_EFFORT}Current effort level.
${CLAUDE_SKILL_DIR}Skill's directory.
${CLAUDE_PROJECT_DIR}Project root.
${CLAUDE_PLUGIN_ROOT}Plugin installation directory.
${CLAUDE_PLUGIN_DATA}Persistent plugin data directory.

Bundled script pattern

---
name: render-chart
description: Render a chart from CSV
allowed-tools: Bash(${CLAUDE_SKILL_DIR}/scripts/render.sh *)
---

Run:
${CLAUDE_SKILL_DIR}/scripts/render.sh data.csv

19. Run Skills in a Subagent

---
name: deep-research
description: Research a topic thoroughly
context: fork
agent: Explore
---

Research $ARGUMENTS thoroughly:
1. Find relevant files.
2. Read and analyze them.
3. Summarize findings with file references.
Main sessionSkillForkSubagentSummary

The forked subagent does not receive your conversation history. The Skill content becomes its task. Supported agent choices include Explore, Plan, general-purpose, or a custom subagent.

Use fork for tasks, not just passive guidelines. A pure API-style reference without an actionable task is usually not useful as a forked Skill.

20. Background Forked Skills

Forked Skills can run in the background in supported interactive contexts. Set background: false when you want to wait for the result. Non-interactive -p, Agent SDK, scheduled tasks, and some settings can change this behavior.

21. Skills + Subagents

PatternMeaning
Skill + context: forkSkill becomes the task for a subagent.
Subagent + SkillsSubagent can use Skills as preloaded/reference material.

22. Restrict Skill Access

# Allow
Skill(commit)
Skill(review-pr *)

# Deny
Skill(deploy *)

Skill(name) matches exactly; Skill(name *) matches the name plus arguments.

Security: A Skill can grant itself broad tool access through allowed-tools. Review Skills checked into unfamiliar repositories before running them.

23. skillOverrides

ValueClaude sees/ menu
onName + descriptionYes
name-onlyName onlyYes
user-invocable-onlyHiddenYes
offHiddenHidden
{
  "skillOverrides": {
    "legacy-context": "name-only",
    "deploy": "off"
  }
}

24. Skill Content Lifecycle

When a Skill is invoked, its rendered content enters the conversation and stays across later turns. Its instructions persist, but an allowed-tools grant clears when the next user message is sent.

Design rule: Write Skill content as standing instructions when the guidance should continue throughout a task.

25. Editing & Removing Skills

Claude Code watches supported Skill directories for changes to SKILL.md. Personal/project Skills can be removed by deleting their directories. Plugin Skills are removed by disabling/uninstalling the plugin. Synced Skills are controlled from the account where they were enabled.

26. Bundled Skills

/doctor

Setup/environment diagnostics.

/code-review

Code review workflow.

/batch

Large multi-change workflows.

/debug

Debugging workflow.

/loop

Loop-oriented workflow.

/claude-api

Claude API workflow.

27. /run, /verify & /run-skill-generator

SkillPurpose
/runLaunch and drive the application to see a change working.
/verifyBuild/run the application and confirm the change against the running app.
/run-skill-generatorRecord a project-specific recipe for building/launching the app.

The generator is especially useful when a project needs databases, environment files, graphical sessions, or multiple startup steps.

28. Visual Output with Skills

~/.claude/skills/codebase-visualizer/
├── SKILL.md
└── scripts/
    └── visualize.py
---
name: codebase-visualizer
description: Generate an interactive codebase tree
allowed-tools: Bash(python3 *)
---

Run:
python3 ${CLAUDE_SKILL_DIR}/scripts/visualize.py .

Skills can bundle scripts to create HTML reports, dependency graphs, coverage reports, database diagrams, and other visual output.

29. Sharing Skills

MethodBest use
Project SkillsCommit .claude/skills/ to Git for team sharing.
PluginsPackage reusable Skills across projects/teams.
Managed SkillsOrganization-wide deployment.

30. Skills vs CLAUDE.md

CLAUDE.mdSkills
Persistent project facts/rules.Reusable knowledge/workflows.
Session/project context.Full body generally loads when used.
Architecture facts.Procedures, commands, domain references.
Stable facts/rules → CLAUDE.md   |   Repeated procedures/knowledge → Skills

31. Skills vs Commands, Agents, Hooks & MCP

FeatureSimple mental model
Skill“Follow this reusable procedure / use this knowledge.”
Old custom commandOlder format; still works, but Skills are preferred for new work.
Subagent“Have another Claude worker do this in its own context.”
Hook“When this lifecycle event happens, run this.”
MCP“Give Claude access to an external system/tool.”

32. Real-World Example — Next.js

API Review Skill

.claude/skills/api-review/SKILL.md

---
name: api-review
description: Review Next.js API routes for validation, auth, errors, and response consistency.
---

Check:
1. Input validation
2. Authentication/authorization
3. Error handling
4. HTTP status codes
5. Response shape
6. Database access
7. Logging
8. Tests

Staging Deployment Skill

---
name: deploy-staging
description: Deploy the application to staging
disable-model-invocation: true
---

1. Run tests.
2. Build.
3. Verify environment.
4. Deploy.
5. Check deployment.
6. Report status.

Use:

/api-review
/deploy-staging

33. Real-World Example — Spring Boot

.claude/skills/spring-boot-review/SKILL.md

---
name: spring-boot-review
description: Review Spring Boot code for services, transactions, JPA, validation, and exceptions.
---

Check:
- Controller/service/repository separation
- DTO boundaries
- Transaction boundaries
- JPA fetching and N+1 risks
- Validation
- Exception handling
- Logging
- Tests

34. Best Practices

1. Write a strong description

Use natural keywords users actually say.

2. Keep SKILL.md focused

Move large references into supporting files.

3. Protect side effects

Use disable-model-invocation: true for manual workflows when appropriate.

4. Use arguments

Make one Skill reusable across issues, branches, files, or components.

5. Use fork for independent tasks

Research and isolated work fit context: fork.

6. Review permissions

Check allowed-tools before running repository Skills.

35. Common Mistakes

MistakeBetter approach
Huge SKILL.mdMove references into separate files.
Weak descriptionUse clear, natural trigger language.
Auto-running deployUse disable-model-invocation: true.
Hardcoded workflowUse arguments.
Everything in CLAUDE.mdMove repeated procedures into Skills.
Broad allowed-toolsGrant only what the Skill needs.
Forking passive guidelinesFork explicit tasks such as research.

36. Evaluate a Skill

A Skill triggering does not prove it works well. Test two things separately:

  1. Does Claude invoke it when it should?
  2. Does the output match the intended behavior?

Use realistic prompts in fresh sessions and compare with the Skill enabled and disabled.

/plugin install skill-creator@claude-plugins-official

The current skill-creator workflow can help with test cases, isolated runs, grading, benchmarks, version comparison, and description tuning.

37. Troubleshooting — Not Triggering

  1. Use natural keywords in the description.
  2. Check that the Skill appears in the available list.
  3. Rephrase the request.
  4. Try /skill-name directly.
  5. Check YAML frontmatter.
  6. Use --debug for parsing issues.

38. Troubleshooting — Triggering Too Often

  • Make the description more specific.
  • Add clearer use conditions.
  • Use disable-model-invocation: true for manual-only workflows.

39. Troubleshooting — Too Many Skills

Skill descriptions are included in the listing Claude uses to know what is available. If many Skills exist, descriptions can be shortened to fit the listing budget. Current Claude Code provides /skill-doctor in supported versions to inspect Skill usage/context costs.

40. Complete Skill Design Pattern

.claude/
└── skills/
    └── release/
        ├── SKILL.md
        ├── checklist.md
        ├── examples.md
        └── scripts/
            └── verify-release.sh
---
name: release
description: Prepare a production release by checking tests, versioning, changelog, and readiness.
disable-model-invocation: true
allowed-tools:
  - Bash(git status *)
  - Bash(git diff *)
  - Bash(npm test *)
---

# Release
1. Check branch.
2. Run tests.
3. Review changes.
4. Read checklist.
5. Verify version.
6. Prepare release summary.

41. Mental Model

Write SKILL.mdClaude sees descriptionRequest matchesFull Skill loadsArguments/context expandTask runs

42. Quick Decision Guide

NeedUse
Permanent project ruleCLAUDE.md
Repeated procedureSkill
Reusable domain knowledgeSkill
External service/toolMCP
Lifecycle automationHook
Independent workerSubagent
Many coordinated workersAgent team/workflow

43. Interview Questions

  1. What is a Claude Code Skill?
  2. What is SKILL.md?
  3. Where can Skills live?
  4. Project vs personal Skill?
  5. Skill vs CLAUDE.md?
  6. What does description do?
  7. What does disable-model-invocation do?
  8. What does user-invocable: false mean?
  9. How does $ARGUMENTS work?
  10. What are $0 and $1?
  11. What is context: fork?
  12. What is dynamic context injection?
  13. What is ${CLAUDE_SKILL_DIR}?
  14. How do permission rules restrict Skills?
  15. Why use supporting files?
  16. How do Skills and subagents work together?
  17. How do Skills differ from hooks?
  18. How do Skills differ from MCP?
  19. How do you test a Skill?
  20. How do you fix a Skill that triggers too often?

44. Practice Exercises

  • Create a /standup Skill using Git history.
  • Create a manual-only /deploy-staging Skill.
  • Create an API review Skill.
  • Add $ARGUMENTS to a GitHub issue Skill.
  • Create a Skill with named arguments.
  • Add allowed-tools.
  • Use !`git diff HEAD`.
  • Add a supporting reference.md.
  • Create a research Skill using context: fork.
  • Create a Skill that generates an HTML report with Python.
  • Create a nested monorepo Skill.
  • Compare output with Skill enabled vs disabled.

45. Final Cheat Sheet

ConceptRemember
Skill fileSKILL.md
Project path.claude/skills/name/SKILL.md
Personal path~/.claude/skills/name/SKILL.md
Invoke/name
Automatic matchingdescription
Manual-onlydisable-model-invocation: true
Claude-onlyuser-invocable: false
All arguments$ARGUMENTS
First argument$0
Named argument$name
Dynamic context!`command`
Skill directory${CLAUDE_SKILL_DIR}
Project root${CLAUDE_PROJECT_DIR}
Forked subagentcontext: fork
Tool pre-approvalallowed-tools
Supporting docsFiles beside SKILL.md
GOLDEN RULE: Repeated instructions → SKILL.md → clear description → reusable /command → optional arguments/context/scripts → evaluate and improve.

46. Final Takeaway

Start simple: create a Skill directory, add SKILL.md, write a strong description, and put the reusable procedure in the body. As the workflow grows, add arguments, supporting files, dynamic context, tool permissions, or a forked subagent.

“Is this something I keep explaining to Claude?”
If yes, it is a strong candidate for a Skill.