How to Write a High-Quality SKILL.md: Structure, Triggers, and Pitfalls
2026-08-12
A great SKILL.md is not a long essay pasted into a prompt — it is an executable SOP written for an AI agent. Whether you keep it inside your team or publish it on GitHub and askskill, clean structure directly improves trigger precision and output consistency.
Standard Anatomy
A SKILL.md consists of YAML frontmatter at the top and actionable Markdown instructions below:
---
name: api-contract-review
description: Audit REST/JSON API changes for breaking schema drift, missing auth checks, and pagination edge cases. Use when reviewing backend PRs or OpenAPI specs.
---
# API Contract Review
## When to use
- Reviewing diffs touching route handlers, DTOs, or OpenAPI definitions.
## Checklist
1. Compare request/response fields against existing clients...
2. Verify auth middleware and input validation...
Two Rules for Frontmatter
Modern coding agents load only name and description at session startup and read the full body only when a task matches (progressive disclosure):
name: lowercase kebab-case (e.g.db-migration-guard) that states the job plainly — avoid vague names likehelper.description: specify what it does and when to trigger it using concrete file types, commands, or failure modes rather than generic claims like "helps write better code."
Writing Instructions Agents Actually Follow
- Specify verifiable checks, not slogans: replace "ensure high quality" with concrete steps like "verify Zod input validation, pagination bounds, and error status codes."
- Define inputs, outputs, and verification: state which files to inspect first, what output format to produce, and which test or lint command proves completion.
- State explicit guardrails: e.g. "never modify production secrets" or "read the actual schema before editing queries."
- Keep the main file lean: aim for 150–300 lines in
SKILL.mdand offload bulky reference tables into areferences/folder loaded on demand.
Common Anti-Patterns
- Kitchen-sink skills: combining unrelated tasks (status reports + CSS fixes + Kubernetes deploys) destroys trigger accuracy.
- Hardcoded local paths or tokens: breaks immediately on a teammate's machine; use relative paths and environment variable names.
- No failure contract: instruct the agent to stop and report missing credentials or tools rather than fabricating results.
Fast Start
Use Create mode on the homepage to draft a private SKILL.md from a plain-language description, then refine it against the checklist above. When your workflow also needs live external data, pair it with an MCP server.
Further reading: Skill or MCP? The Differences and How to Choose and Build Your AI Workflow Stack by Profession.