Write SKILL.md YAML frontmatter descriptions that trigger reliably without hijacking unrelated chats
If your frontmatter description is vague, Claude Code and Cursor ignore your skill completely—or fire it on every generic Python question.
Anatomy of a 98%-trigger-accuracy SKILL.md frontmatter block
- 01
State both WHAT the skill does and WHEN to invoke it
Don't write 'Helps with PDFs.' Write 'Extract tables and forms from .pdf files, merge/split pages, or reconcile scanned invoices.'
- 02
Include casual user symptom phrases and file extensions
Users say 'why is my k8s pod stuck pending' more often than 'execute Kubernetes scheduling diagnostics'; include concrete cues.
- 03
Add a crisp 'Do NOT use for...' clause on crowded stacks
When maintaining separate unit-test and Playwright E2E skills, state 'Do NOT use for browser E2E tests (use e2e-playwright instead).'
- 04
Write in third-person metadata voice under 1,024 chars
Frontmatter injects directly into system skill catalogs; concise third-person triggers parse cleanly without prompt-role confusion.
How it works in practice
Frontmatter trigger test
Test 40 natural prompts (20 target, 20 adjacent) against v1: 'Database helper for analytics queries' vs v2: 'Write and optimize read-only DuckDB SQL over .parquet, .csv, and S3 files. Trigger on local file analytics, cohort rollups, or Parquet inspection; do NOT use for prod Postgres DDL migrations.'
Trigger precision & recall
v1 vague description: 45% recall on Parquet prompts, 35% false triggers on Postgres migration chats. v2 explicit trigger+boundary: 95% recall, 0% false triggers.
Because agents only see YAML frontmatter before loading SKILL.md, frontmatter wording single-handedly governs whether your skill ever runs.
Questions and answers
Why didn't the agent load my SKILL.md when the instructions inside are great?
Agents decide whether to open SKILL.md based strictly on the 'name' and 'description' fields in YAML frontmatter—body text is invisible until triggered.
How long can a SKILL.md description field be?
Standard Agent Skills specifications cap 'name' at 64 lowercase hyphenated chars and 'description' at 1,024 chars (aim for 250–550 crisp chars).
How many prompts should I use to test trigger routing?
Test 15–20 realistic indirect user phrasings plus 15 near-neighbor prompts belonging to other installed skills.
Related tasks in this category
See all in Authoring & Publishing SKILL.md Packages-
Organize modular SKILL.md folders with scripts/, references/, and assets/ following open specs
Follow the standard Agent Skills directory layout so your package installs cleanly across Claude Code, Codex, Cursor, and CI harnesses.
-
Transform dusty Confluence and Notion engineering runbooks into executable SKILL.md packages
Human wiki pages mix outdated screenshots, tribal jargon, and implicit safety checks. Refactor static SOPs into testable agent workflows.
-
Enforce strict JSON Schema and Pydantic validation inside skills feeding downstream pipelines
One stray 'Here is the JSON you requested:' preamble breaks downstream webhooks. Combine schema constraints with local validator loops.
-
Apply semantic versioning, compatibility tags, and benchmarked changelogs to published skills
Silent force-pushes to a shared SKILL.md break downstream team workflows overnight. Treat skill releases like real software packages.
-
Adapt SKILL.md packages cleanly across Claude Code, OpenAI Codex CLI, Cursor, and Windsurf
Your team uses three different AI IDEs and CLI agents. Author once with clean cross-harness conventions instead of maintaining four drifted copies.
-
Author crisp negative boundaries in SKILL.md to stop unasked-for refactors, commits, and scope creep
You asked for a two-line bug fix; the agent reformatted 14 files, upgraded TypeScript, and committed to main. Fix overreach with actionable boundaries.