AI Engineering Curriculum
Phase 1: Claude Code Mastery·5 min read

Module 1.3

Skills

What Skills Are

Skills extend what Claude can do by giving it custom instructions it can follow on demand. You write a SKILL.md file, and Claude adds it to its toolkit.

Two ways they activate:

  • You invoke it - type /skill-name and Claude immediately follows the skill's instructions
  • Claude invokes it automatically - if your request matches the skill's description, Claude loads and applies it on its own

Custom slash commands (.claude/commands/) have been merged into skills. They're the same thing. Skills add more features on top.


File Structure

Each skill is a directory with SKILL.md as the required entrypoint:

my-skill/
├── SKILL.md           ← main instructions (required)
├── template.md        ← template for Claude to fill in
├── examples/
│   └── sample.md      ← example output showing expected format
└── scripts/
    └── validate.sh    ← script Claude can execute

Keep SKILL.md under 500 lines. Move large docs to separate files.


Where Skills Live

LocationPathApplies to
Personal~/.claude/skills/<name>/SKILL.mdAll your projects
Project.claude/skills/<name>/SKILL.mdThis project only
Plugin<plugin>/skills/<name>/SKILL.mdWhere plugin is enabled
EnterpriseManaged settingsAll org users

When skills share the same name, priority is: enterprise > personal > project.


Anatomy of a SKILL.md

YAML
--- name: explain-code description: Explains code with visual diagrams and analogies. Use when explaining how code works or when the user asks "how does this work?" --- When explaining code, always include: 1. **Start with an analogy** - compare to something from everyday life 2. **Draw a diagram** - use ASCII art to show flow or structure 3. **Walk through the code** - explain step by step 4. **Highlight a gotcha** - what's a common mistake?

Two parts:

  • YAML frontmatter (between ---) - tells Claude when and how to use it
  • Markdown body - the actual instructions Claude follows

All Frontmatter Fields

FieldRequiredDescription
nameNoBecomes the /slash-command. Uses directory name if omitted.
descriptionRecommendedWhat it does and when to use it. Claude uses this to decide when to auto-load it.
argument-hintNoHint shown in autocomplete. E.g. [issue-number]
disable-model-invocationNotrue = only YOU can invoke it. Claude won't auto-trigger it.
user-invocableNofalse = hidden from / menu. Only Claude can invoke it.
allowed-toolsNoTools Claude can use without asking permission when this skill is active.
modelNoOverride the model used when this skill runs.
contextNoSet to "fork" to run in an isolated subagent.
agentNoWhich subagent type to use when context: fork is set.
hooksNoHooks scoped to this skill's lifetime only.

Controlling Who Invokes a Skill

FrontmatterYou can invokeClaude auto-invokes
(default)
disable-model-invocation: true
user-invocable: false

disable-model-invocation: true - use for skills with side effects you control: /deploy, /commit, /send-slack-message.

user-invocable: false - use for background knowledge Claude applies automatically but that isn't meaningful as a slash command.


Passing Arguments

YAML
--- name: fix-issue disable-model-invocation: true --- Fix GitHub issue $ARGUMENTS following our coding standards.

/fix-issue 123 → Claude receives "Fix GitHub issue 123 following our coding standards..."

Positional arguments:

YAML
Migrate the $0 component from $1 to $2.

/migrate-component SearchBar React Vue$0=SearchBar, $1=React, $2=Vue


Dynamic Context Injection

The !`command` syntax runs a shell command before Claude sees anything. Output gets injected into the skill content.

YAML
--- name: pr-summary context: fork agent: Explore allowed-tools: Bash(gh *) --- ## Pull request context - PR diff: !`gh pr diff` - PR comments: !`gh pr view --comments` ## Your task Summarize this pull request clearly and concisely.

Claude only sees the rendered result with actual PR data - not the commands themselves.


Running Skills in a Subagent

Add context: fork to run in isolation - no access to conversation history, only the skill content as its task.

YAML
--- name: deep-research description: Research a topic thoroughly using codebase exploration context: fork agent: Explore --- Research $ARGUMENTS thoroughly: 1. Find relevant files using Glob and Grep 2. Read and analyze the code 3. Summarize findings with specific file references

agent options: Explore, Plan, general-purpose, or any custom subagent. Defaults to general-purpose.


Real Examples

/commit - structured git commit

YAML
--- name: commit description: Create a structured git commit message disable-model-invocation: true allowed-tools: Bash(git *) --- Review staged changes and create a commit: 1. Run `git diff --staged` 2. Write message: imperative verb, under 50 chars, explain the why in the body 3. Run `git commit -m "..."`

/standup - daily standup from git history

YAML
--- name: standup disable-model-invocation: true allowed-tools: Bash(git *) --- Yesterday: !`git log --oneline --since="2 days ago" --until="yesterday" --author="$(git config user.name)"` Today's staged: !`git diff --staged --stat` Format as: Yesterday / Today / Blockers

/explain - explain code simply

YAML
--- name: explain description: Explain code or a concept simply. Use when user asks "what does this do?" --- Explain $ARGUMENTS as if to someone who doesn't code: 1. One sentence summary 2. A real-world analogy 3. What problem it solves 4. What would break if it didn't exist

String Substitutions

VariableDescription
$ARGUMENTSEverything passed after the skill name
$ARGUMENTS[N]Specific argument by 0-based index
$NShorthand for $ARGUMENTS[N]
${CLAUDE_SESSION_ID}Current session ID

Power User Tips

  • /context - check if skills are hitting the context budget limit (descriptions always load; full content loads only on invocation)
  • Monorepo support - packages/frontend/.claude/skills/ is auto-discovered when working in that package
  • Restrict skill access - deny Skill in /permissions, or use Skill(deploy *) to block specific ones
  • ultrathink in skill content - enables extended thinking mode for that skill

Sources