Chapter 4 · 6 lessons
Agent Skills
The open SKILL.md standard: progressive disclosure, description-driven triggering, scripts and references, evaluation, and trusting third-party skills.
Cursor · Claude Code · OpenAI Codex · GitHub Copilot · OpenClaw
Show all 6 lessonsHide list
Lesson 1 of 6
Anatomy of a Skill
A skill is a directory with a SKILL.md file: YAML frontmatter (required name and description) followed by Markdown instructions. Optional folders hold scripts, references, and assets. The format is an open specification (agentskills.io) used by Claude Code, Cursor, Codex, Copilot, OpenClaw, and others.
release-notes/
├── SKILL.md # frontmatter + instructions (keep < ~500 lines)
├── references/
│ └── style.md # read only when needed
├── scripts/
│ └── collect.sh # executed, not pasted into context
└── assets/
└── template.md| Field | Required | Notes |
|---|---|---|
| name | Yes | ≤ 64 chars, lowercase letters, digits, hyphens |
| description | Yes | ≤ 1024 chars; what it does AND when to use it |
| license / compatibility / metadata | No | Environment requirements, arbitrary key-values |
| allowed-tools | No (experimental) | Pre-approved tools the skill may use |
Lesson 2 of 6
Progressive Disclosure
- Metadata (~100 tokens): name + description of every skill loaded at startup
- Instructions (< ~5,000 tokens recommended): the SKILL.md body, loaded when the skill activates
- Resources (as needed): scripts, references, and assets read or executed only when the task needs them
This is why you can install dozens of skills without drowning the context — until activation, each costs roughly one sentence. It is also why a vague description is fatal: if the model cannot tell when to use a skill, it never loads the body.
Scripts over prose
For fragile, deterministic steps (migrations, packaging, validation), ship a script and tell the agent to run it. Scripts save tokens and behave the same every time.
Lesson 3 of 6
Writing Descriptions That Trigger
| Weak | Strong |
|---|---|
| Helps with docs | Generate release notes from merged PRs and conventional commits. Use when the user asks for a changelog, release notes, or a version summary. |
| Database stuff | Write and review Postgres migrations with zero-downtime patterns. Use when adding columns, indexes, or changing schemas in db/migrations. |
- Third person, because descriptions are injected into the system prompt
- Include WHAT and WHEN, plus the words users actually say
- One responsibility per skill — two skills that overlap will fight over activation
- If a skill should only run on request, disable model invocation (supported in Claude Code, Cursor, OpenClaw)
Lesson 4 of 6
Where Skills Live in Each Tool
| Tool | Project | Personal |
|---|---|---|
| Claude Code | .claude/skills/<name>/ | ~/.claude/skills/<name>/ |
| Cursor | .cursor/skills/<name>/ | ~/.cursor/skills/<name>/ |
| Codex | .agents/skills/<name>/ | ~/.agents/skills/<name>/ |
| OpenClaw | <workspace>/skills, .agents/skills | ~/.agents/skills, managed ~/.openclaw/skills |
| Copilot | Agent skills in supported IDEs, CLI, and GitHub | Varies by surface |
Because the format is shared, a well-written skill ports across tools with little or no change. Tool-specific extras (subagent execution, invocation control, dynamic context injection in Claude Code; gating in OpenClaw) are layered on top of the standard.
Lesson 5 of 6
Evaluating and Trusting Skills
A skill is a software artifact that changes agent behavior. Treat it like code: single responsibility, reviewed changes, and behavioral tests instead of vibes.
- Golden tasks: 5–10 representative prompts with expected outcomes; rerun after every skill change
- Measure activation (did it trigger when it should, stay quiet when it should not) and outcome quality
- Read every script in a third-party skill before installing — it runs with your permissions
- Pin versions and prefer registries with scans and provenance (e.g. ClawHub trust envelopes, curated marketplaces)
- Keep secrets out of SKILL.md; inject via environment or tool config
Supply chain
Skills and plugins are the new dependency surface. A malicious skill can instruct the agent to exfiltrate files or run commands. Review, pin, and restrict — the same way you treat npm packages.
Lesson 6 of 6
Worked Example: A Skill That Finally Triggers
A team wrote a migrations skill. Nobody's agent ever used it.
--- name: db description: Database helpers. --- (300 lines of prose mixing migrations, seeding, and backups) prompt: "add a nullable column to users" → skill not activated agent writes a blocking ALTER TABLE on a 40M-row table
--- name: zero-downtime-migrations description: Write and review Postgres migrations with zero-downtime patterns. Use when adding columns, indexes, or constraints in db/migrations, or when the user mentions a schema change. --- 1. Run scripts/lint-migration.sh on every new migration. 2. Add columns nullable first; backfill in batches; then constrain. 3. Create indexes CONCURRENTLY. See references/patterns.md. prompt: "add a nullable column to users" → skill activates golden tasks: 5/5 trigger, 2/2 unrelated prompts stay quiet
- Split one vague skill into focused ones with routing-quality descriptions
- Moved deterministic checks into a script instead of prose
- Measured activation with golden prompts, including negatives
Takeaway
A skill is only as good as its description — it is the router.