{} Claude Skills ยท ch.3 ยท SKILL.md anatomy
๐Ÿ“„ Chapter 3 ยท What goes in the body

What goes in the body

The frontmatter is two fields. The body is Claude's reading material โ€” direct instructions in markdown, short enough to re-read on every invocation.

Chapter 2 showed you how to write the description โ€” the bit Claude reads at session start to decide whether to invoke. This chapter is about everything that lives below the second --- line: the body Claude actually follows once the skill fires.

The short version: two required frontmatter fields, then markdown the way Claude likes to read it. Direct verbs. Numbered steps. Headings Claude can scan. Short enough that re-reading it on every invocation doesn't tax the context.

1The frontmatter โ€” small but mighty

Every SKILL.md starts with a YAML block between two --- lines. Only two fields are strictly required:

  • name โ€” must match the directory name. This is how the skill is addressed.
  • description โ€” the trigger. Covered in depth in Chapter 2.

That's the whole list. You'll occasionally see optional metadata โ€” metadata.type, version tags, custom keys โ€” and some tooling reads those. Claude itself only needs name and description. Anything else is bookkeeping for tools that wrap around skills.

Here's what minimal vs maxed-out looks like side by side:

minimal ยท just the essentials required

        
maxed ยท with optional metadata optional

        
๐ŸŽฏ
When in doubt, write the minimal frontmatter. Optional fields are noise unless something downstream actually reads them. Start small; add metadata when a tool asks for it.

2The body is Claude's reading material

When the skill triggers, Claude reads the body top-to-bottom and follows it as instructions. This is the part people most often get backwards: the body isn't documentation aimed at humans. It can be readable to humans (and often is), but its actual reader is Claude, on duty, mid-task.

What that means in practice:

  • Direct language. "Read the file at X." Not "you might want to consider reading the file at X."
  • Numbered steps for workflows. Numbers make order unambiguous.
  • Code blocks for commands and snippets. Fenced blocks are visually distinct from prose, so they're easy to pattern-match.
  • Tables for choices ("when X do Y, when X' do Y'"). Faster to scan than nested bullet lists.

Think of it as writing a short tutorial for someone who already knows the language but hasn't done this particular task before. Crisp. Imperative. No throat-clearing.

3Headings that scan well

The top-level # heading is the skill's display title (usually the same as name, in Title Case). The ## headings are major sections. Stick to a small vocabulary of conventional names โ€” Claude pattern-matches on these during retrieval, so predictable headings mean predictable behaviour.

HeadingWhat goes there
# Skill NameOne-paragraph what-the-skill-produces. Sets context.
## When to useThe bulleted conditions under which this skill is the right answer.
## Workflow / ## UsageNumbered steps. Concrete commands. This is the recipe.
## ExamplesShort, copy-pasteable input โ†’ output samples.
## Files in this skillDirectory tree of supporting files with one-line each.
## Notes / ## Edge casesCaveats, things that look right but aren't.

You don't need all of them โ€” most skills use three or four. But picking from this set beats inventing names like "How it Works" or "Background" that don't tell Claude (or you) what to expect underneath.

Interactive ยท annotated SKILL.md viewer Pick a skill ยท hover the colored regions
hover any region Mouse over the highlighted parts above to see what each region of the file does.
viewing ยท youtube-transcript

4Inline content vs supporting files

Here's the central decision when writing the body: does this content live in SKILL.md, or does it live in a separate file SKILL.md links to?

The rule of thumb is about reading cost. Claude re-reads SKILL.md on every single invocation of the skill โ€” that's tokens spent every time. Supporting files only get read when SKILL.md actually points Claude at them. So:

  • Short, hot-path content stays inline. The 5-step workflow you always run. The trigger format. The two commands to run. The list of "when to use".
  • Long or rarely-needed content moves to a file. A 200-line decision table. A full prompt template. A reference doc you only consult under specific conditions. SKILL.md just says "see references/X.md for ...".

Rule of thumb for total SKILL.md size: under 200 lines is comfortable, 200โ€“500 is verbose, over 500 is almost always wrong. If your SKILL.md is creeping past 500 lines, there's content in there that doesn't need to be loaded every time.

Interactive ยท length-cost meter Drag to see how big the per-invocation cost grows
SKILL.md size: 100 lines โ‰ˆ 300 tokens / invocation
10 200 300 500
comfortable โ€” fits easily in any invocation
Every invocation re-reads SKILL.md; long bodies tax every use.
Interactive ยท inline or supporting file? Click your call ยท see the rationale
0 / 5

5Anti-patterns in the body

If you find any of these in a SKILL.md you wrote, it's a tell that the file needs trimming:

  • Wall of text with no headings. Claude reads top-to-bottom; structure helps the model find the relevant section fast. So does a future human reader.
  • Nested decision trees buried mid-paragraph. If a step branches three ways, that's a numbered list or a table โ€” not a sentence.
  • Code blocks longer than the prose. If your body is 80% code, the code itself probably wants to be a script in scripts/ that SKILL.md references.
  • Mixing two skills in one file. "Use this skill when X โ€” but also when Y, and if Y, do this completely different thing." Make it two skills.
  • Describing implementation instead of when-to-use. "Internally this skill calls the foo API with bar headers..." โ€” Claude doesn't care. Tell it when to fire and what to do, not how the sausage gets made.
โš ๏ธ
The most common one is the last one. People who've written documentation for years instinctively reach for "how it works" prose. SKILL.md isn't documentation โ€” it's a runbook for an agent. Different genre, different style.

6Real-world examples โ€” read these three

The fastest way to internalise good shape is to read good examples. Three skills, three sizes, three different shapes โ€” all valid, all working in production.

youtube-transcript / SKILL.md minimal ยท ~47 lines one job, done well

The poster child for "small SKILL.md". Three commands, a list of supported URL formats, a small ## Output section with a critical rule, and a few notes. No supporting files beyond a single scripts/get_transcript.py. Zero ceremony.


      
book-builder / SKILL.md medium ยท ~120 lines with supporting-file references

The middle case. Three different build paths, a list of constraints, and explicit links out to templates/build-chapter.md, references/voice-rule.md, and references/palette-registry.md. SKILL.md tells Claude which file to read for the deep instructions, but doesn't carry them inline.


      
claude-api / SKILL.md long ยท 300+ lines ships with Claude Code

The upper bound of what an inline SKILL.md can reasonably hold. Deep instructions on caching, thinking, tool use, model migrations โ€” all in one file because every section is hot-path for the same trigger ("imports anthropic"). When in doubt about a skill that long, ask: does every invocation really need every section? If yes, keep it inline; if no, extract.


      
๐Ÿ“–
Open these three on disk if you have them: ~/.claude/skills/youtube-transcript/SKILL.md, ~/.claude/skills/book-builder/SKILL.md, and whichever claude-api bundle ships with your CLI. Reading working skills beats reading any guide.

7Writing for an agent, not a human

The genre shift takes some getting used to. Documentation hedges. Tutorials chat. SKILL.md does neither.

Instead of (human voice)Write (agent voice)
"You might want to consider reading the config first.""Read config.json first."
"It's usually a good idea to validate the input.""Validate the input against the schema in schemas/x.json."
"This skill uses the YouTube transcript API to fetch captions, which...""Run uv run scripts/get_transcript.py "URL"."
"Generally speaking, you should report progress as you go.""After each step, print one line: step N: done."

The pattern: direct verbs, concrete artifacts, no hedging. Claude treats the SKILL.md as instructions it will execute. Vague language survives in human docs because humans interpret around it. An agent following instructions to the letter is much happier with letters.

8Skeleton vs bloated SKILL.md

Two versions of the "same" skill, side by side. The skeleton is the pattern you'll reach for most of the time. The bloated version shows what happens when too much content stays inline.

Skeleton: about 25 lines. Every section earns its place. Bloated: about 80 lines and growing, with <!-- MOVE TO references/ --> markers showing where the body is doing too much. The fix isn't more discipline โ€” it's moving the long bits out to files SKILL.md links to.