Authoring a Claude Skill: SKILL.md, Frontmatter, Progressive Disclosure and the Description That Triggers It
Pack a support team's ticket-triage routine into one skill folder, then watch three requests load one, two or all three levels: the catalog, the SKILL.md body, and a script whose code never enters the context.
What you will learn
- Lay out a skill folder with SKILL.md, a script and a reference file
- Write name and description frontmatter that passes the rules and triggers at the right time
- Explain the three levels of progressive disclosure and what each request loads
- Choose where a skill lives: project, personal or inside a plugin
Before you start
- CLAUDE.md, settings.json and plugins
- Basic Python
A support team sorts tickets every day with the same three steps. On Monday someone pastes those steps into a chat. On Tuesday, again. By Friday someone forgets a step. Copy and paste is slow, and the steps drift.
A skill fixes that. You pack the job once into a folder with a SKILL.md and a script, and Claude loads it when a request fits. The idea that makes it cheap is called progressive disclosure.
A cookbook on a shelf
Think of cookbooks on a shelf.
- The spine: a title and one line, always visible. That's the skill's
nameanddescription. - The recipe: you open it only when you pick that book. That's the body of
SKILL.md. - The pantry: tools you fetch only when a step asks for them. Those are the scripts and reference files.
Many skills can sit on the shelf. Only the one you pick gets opened.
One folder per skill, three homes
Each skill is a folder with a SKILL.md inside. Claude Code reads skills from three places:
| Home | Path | Who gets it |
|---|---|---|
| Project | .claude/skills/<name>/SKILL.md | Commit it and the whole team gets it |
| Personal | ~/.claude/skills/<name>/SKILL.md | You, in every project on that machine |
| Plugin | the plugin's own skills/ folder | Everyone who installs the plugin; called with the plugin name in front |
claude.ai and the API keep their own skills, separate from the folders Claude Code reads.
Our project has two skills:
.claude/skills/
ticket-triage/
SKILL.md
priority_rules.md
scripts/priority.py
release-notes/
SKILL.md
SKILL.md
---
name: ticket-triage
description: >-
Sort a support ticket into a priority and a queue. Use when the user
asks to triage, prioritise or route a support ticket.
---
# Ticket triage
Give every ticket one priority and one queue.
## Steps
1. Read the ticket text.
2. Run `python scripts/priority.py "<ticket text>"`.
3. Reply with the ticket id, the priority and the queue.
## Rules
For the full priority table, read [priority_rules.md](priority_rules.md).
Only open it when the script's answer looks wrong.
- Frontmatter sits between the two
---lines: anameand adescription. - The body below it loads only when the skill triggers.
- A step can run a script, here
scripts/priority.py. - It can point to a reference file, which Claude opens only if it needs it.
Two fields, and one trigger
name: lowercase letters, numbers and hyphens, 64 characters at most.description: must not be empty, 1024 characters at most. It should say what the skill does and when to use it.
Compare a weak description, "Helps with tickets", with ours. The weak one doesn't say what it does or when it should fire, so Claude has nothing to match against. Ours says both. The description is what Claude matches your request against.
A skill loads in two ways: Claude loads it when the request fits, or you type /ticket-triage yourself. Set disable-model-invocation: true in the frontmatter and Claude won't load it on its own; only you can call it.
The script: rules in code
"""Pick a priority and a queue for one ticket. Prints a single line."""
import re
import sys
RULES = [("P1", "urgent", ("cannot log in", "outage", "down")),
("P2", "billing", ("refund", "invoice"))]
def triage(text):
low = text.lower()
for priority, queue, words in RULES:
if any(w in low for w in words):
return priority, queue
return "P3", "general"
if __name__ == "__main__":
text = " ".join(sys.argv[1:])
ticket = re.search(r"T-\d+", text)
priority, queue = triage(text)
print(f"{ticket.group() if ticket else 'T-?'} {priority} queue={queue}")
The rules live in code, so they're the same every time. The script prints one line, and that one line is all Claude sees.
A loader that shows the levels: skill_loader.py
The project models the three levels in plain Python:
def catalog():
"""Level 1: only name and description of every skill."""
folders = [f for f in sorted(SKILLS.iterdir()) if f.is_dir()]
return {f.name: read_skill(f)[0] for f in folders}
def load_body(name):
"""Level 2: the SKILL.md body, read once the skill is chosen."""
return read_skill(SKILLS / name)[1]
def run_script(name, script, arg):
"""Level 3: run the script. Only its printed output comes back."""
path = SKILLS / name / "scripts" / script
done = subprocess.run([sys.executable, str(path), arg],
capture_output=True, text=True, check=True)
return done.stdout.strip(), len(path.read_text(encoding="utf-8"))
def lint(fields):
"""The frontmatter rules from the Agent Skills docs."""
problems = []
if not NAME_OK.match(fields.get("name", "")):
problems.append("name: lowercase letters, numbers, hyphens, 64 max")
if not fields.get("description"):
problems.append("description: must not be empty")
elif len(fields["description"]) > 1024:
problems.append("description: 1024 characters max")
return problems
Three requests, one folder
run_all.py puts the catalog in the system prompt and sends three requests. The model is a stand-in (the Anthropic SDK on an httpx mock transport, no API key): its replies are scripted, and it picks a skill by counting words shared with each description. A real model judges by meaning. Here is the real output:
level 1: name and description of every skill
release-notes description 130 chars
ticket-triage description 122 chars
system prompt carries 287 chars for 2 skills
request 1: Please triage support ticket T-201: customer cannot log in
test model reply: use skill ticket-triage
level 2: SKILL.md body 344 chars
level 3: priority.py ran, 610 chars of code stay out
level 3: output T-201 P1 queue=urgent
request 2: Draft release notes for version 3.2
test model reply: use skill release-notes
level 2: SKILL.md body 184 chars
request 3: What is the capital of France?
test model reply: no skill needed
loaded: level 1 only
frontmatter check
release-notes ok
ticket-triage ok
Ticket Triage name: lowercase letters, numbers, hyphens, 64 max
Ticket Triage description: must not be empty
- Request 1 matches ticket-triage: the body loads, then the script runs. All three levels. The 610 characters of
priority.pynever enter the context; one output line does. - Request 2 matches release-notes: the body loads, and there's no script. Two levels.
- Request 3 matches nothing, so only the 287-character catalog is in context. One level.
- The check rejects a name with capitals and a space, and an empty description.
Common mistakes
- Pasting the steps into every chat. Slow, and the steps drift. Write the skill once.
- A vague description. "Helps with tickets" gives Claude nothing to match, so the skill fires at the wrong time or not at all.
- One huge SKILL.md. Everything loads at once when it triggers. Keep the body short and move tables and long rules into files the body points to.
- Rules in prose that a script should own. If the answer must be the same every time, put it in code and let only the output come back.
To decide whether a job wants a skill, a hook, a subagent or a plugin, see Choosing a Claude Code Extension. To ship a skill to a team inside a plugin, see CLAUDE.md, settings.json and Plugins.
Quick recap
| Level | What loads | When |
|---|---|---|
| 1 | name and description | Always, for every skill |
| 2 | The SKILL.md body | When the skill triggers |
| 3 | Scripts (output only) and reference files | As a step needs them |
Try it yourself
Add a third skill, refund-check, with the description "Check whether an order can be refunded. Use when the user asks if an order is refundable." Run the three requests again. How many characters does the catalog carry now, and does any request change its level?
Related course on Udemy
Claude Certified Developer - Foundations (CCDV-F) Exam Prep
Build and ship Claude apps: the API, agents, tools and MCP, prompts, evals, security and model choice.View on Udemy ↗: Claude Certified Developer - Foundations (CCDV-F) Exam Prep (paid course, opens in a new tab)Related posts
CLAUDE.md, settings.json and Plugins: Which Claude Code File Advises, Which Enforces, Which Packages
Three needs in one repo: a test command, a rule that Claude must never read .env, and a shared deploy skill. See which file each belongs in, how the settings layers merge, and what a plugin manifest carries.
One Change, Four Environments: Where a Claude Config Edit Lands in Dev, Staging, Prod and CI
Change one line in a repo and ask where it lands. A small resolver for bookshop-bot shows that a new model id in settings.json reaches only CI, a prompt bump reaches dev and CI, and a prod block edit reaches only prod.
Claude in the SDLC: Prompts in Git, a Change Gate by Path, a Claude Review That Advises and a Person Who Merges
Follow one prompt edit from a branch to a merge: version prompts and the model pin like code, keep the API key in GitHub Secrets, gate changes by path, let Claude review the diff, and leave the merge to a person.
Hooks That Block Destructive Actions: a PreToolUse Gate That Allows, Asks or Denies
A coding agent is told to clean up the data folder and picks rm -rf data/. A PreToolUse hook sees the call before the tool runs: tests and single-file deletes pass, a force push asks a person, and rm -rf, DROP TABLE and a write to .env are denied with a reason.