Chapter 1 · Introduction¶
Modern coding agents are astonishingly capable and astonishingly forgetful. They don't know your deploy checklist, your commit message convention, the four steps your team follows for a hotfix, or which of your seven lint commands is the right one. You end up re-explaining the same workflow in prompts, over and over — and the agent improvises slightly differently each time.
Agent Skills fix this by turning your knowledge into a file the agent loads at exactly the right moment.
What is a skill?¶
A skill is a folder containing a SKILL.md file with metadata and
instructions, plus any supporting material:
commit-crafter/
├── SKILL.md # Required: metadata + instructions
├── references/ # Optional: docs the agent reads on demand
├── scripts/ # Optional: executable code the agent can run
└── assets/ # Optional: templates and static resources
The SKILL.md carries two things:
- Frontmatter — a short YAML header with a
nameand adescription. The description is always visible to the agent and is how it decides when the skill is relevant. - A markdown body — the actual instructions, loaded only when needed.
That's the entire required format. Everything else — scripts, templates, references — is optional structure around it.
The format is an open standard¶
The skill format was originally developed by Anthropic and released as an open standard, now documented and evolved at agentskills.io. It has been adopted by a long list of agents and IDEs, including:
- Claude Code and Claude
- Cursor and OpenAI Codex
- Gemini CLI and GitHub Copilot / VS Code
- OpenCode, Goose, Amp, ZCode, and many more
One skill, written once, runs in all of them. That portability is the core
reason to prefer skills over tool-specific configuration: a .cursorrules
file is locked to one editor; a skill is not.
How agents load skills: progressive disclosure¶
Skills are cheap to keep around because agents load them in three stages, pulling in more detail only as the task calls for it:
flowchart LR
A["1 · Discovery<br><i>always loaded</i><br>name + description<br>(~100 tokens)"] -->
B["2 · Activation<br><i>when the task matches</i><br>full SKILL.md body<br>(under 5,000 tokens)"] -->
C["3 · Execution<br><i>as needed</i><br>scripts, references,<br>templates (unbounded)"]
- Discovery. At startup the agent reads only each skill's name and description — roughly 100 tokens per skill. This is why you can install dozens of skills without filling the context window.
- Activation. When a task matches a description, the agent loads the
full
SKILL.mdbody into context. - Execution. While working, the agent reads referenced files and runs bundled scripts only as the task requires.
Why this matters for you as an author
The three stages create a design discipline: the description is a routing decision, the body is a lean procedure, and everything heavy (long docs, big examples, code) moves to files the agent opens only when it needs them. Chapters 4 and 5 turn this into concrete rules.
Skills vs. everything else¶
Skills overlap with several other extension mechanisms, and picking the wrong tool is the most common beginner mistake. The short version:
| Mechanism | What it is | Loaded when | Use it for |
|---|---|---|---|
| Skill | Folder of instructions + optional code | When the task matches the description | Procedures, workflows, domain expertise, output formats |
| MCP server | External tools and data the agent can call | Tools are always listed; results on call | Connecting to systems: databases, APIs, browsers, issue trackers |
| Rules / instructions files | Always-on preferences (AGENTS.md, .cursorrules) |
Every conversation | Project-wide conventions, style, guardrails |
| Slash commands | A prompt you trigger by name | Only when you type it | Shortcuts you invoke deliberately |
| Hooks | Deterministic shell commands on agent events | Fixed events (pre/post commit, save…) | Guardrails: format on save, block dangerous commands |
A practical rule of thumb:
- If it should be always in context → rules file (
AGENTS.md). - If it needs new capabilities (talk to Postgres, drive a browser) → MCP.
- If it must run deterministically on an event → hooks.
- If it's knowledge and procedure that matters only for certain tasks → skill.
And the tools compose, which is where skills get powerful: a skill can orchestrate MCP tools, scripts can enforce what instructions merely suggest, and hooks can remind the agent to load a skill. Chapter 9 covers composition in depth.
A mental model¶
Think of a skill as the onboarding document you'd hand a brilliant new teammate on their first day — except the agent:
- reads it at exactly the right moment (progressive disclosure),
- can run code that ships with the document (
scripts/), - works from templates you provide (
assets/), - and writes down what it learned for the next shift (memory).
If you wouldn't put it in an onboarding doc, it probably doesn't belong in a skill either. And if you would — you're writing it once, for every agent, forever.
What you'll build¶
This tutorial follows three example skills that grow in capability:
commit-crafter— writes conventional-commit messages from staged diffs. Built from scratch in the quickstart, then upgraded in every subsequent chapter with references, a validation script, and tests.changelog-forge— generates changelogs from git history with a deterministic Python script and a markdown template.lessons-keeper— a memory protocol: the agent records durable lessons to a versioned file and recalls them before starting work.
Each one is a real, installable folder under
examples/
with unit tests running in CI.
Chapter 2 · Anatomy of a Skill — the folder, the frontmatter spec, and where skills live on disk.