DEV Community

Sadra Khorvash
Sadra Khorvash

Posted on

Why your SKILL.md fails validation

An Agent Skill is a folder of instructions an AI agent loads when a task calls for it. The folder has one required file, SKILL.md: YAML frontmatter between two --- lines, then Markdown instructions. Agents read only the name and description at startup and load the rest when they decide the skill fits.

That makes the frontmatter the part that has to be right. Here are the mistakes that make a SKILL.md fail validation, in the order a validator finds them. The rules come from the Agent Skills specification: https://agentskills.io/specification

1. The delimiters and the YAML

The file must start with --- on line 1, and the frontmatter must close with another ---. Our validator fails a file with a blank line or a comment above the first ---.

Inside, the frontmatter must be valid YAML. The usual breakers:

  • An unclosed quote, for example description: "Writes handoffs with no closing ".
  • Bad indentation under metadata, where one key sits a space off from the others.
  • A colon inside an unquoted value, such as description: Use when: the user asks. Quote the whole value.

If your description runs over several lines, use a block scalar (| or >) instead of letting plain text wrap.

2. The name rules

name is required, and it is strict:

  • 1 to 64 characters;
  • lowercase letters, digits and hyphens only;
  • no hyphen at the start or end, and never two hyphens in a row;
  • the same as the skill's folder name.

Write-Handoff, write_handoff and -write-handoff all fail. So does write-handoff sitting in a folder called handoff.

3. The description

description is required and must be 1 to 1024 characters. It should say what the skill does and when to use it, because that sentence is what the agent reads to decide whether to load the skill at all. An empty description fails validation. One that only says what the skill is will validate, but quietly fail at its job.

4. Only the spec's fields

The spec defines six frontmatter fields:

Field Required Rule
name yes the rules above
description yes 1-1024 characters
license no a license name or a bundled license file
compatibility no 1-500 characters
metadata no string keys to string values
allowed-tools no a space-separated string

Two traps here. First, metadata values are strings, so quote numbers: version: "1.0", not version: 1.0. Second, our validator flags any field outside these six, even if one product reads it. Claude Code documents some extra fields of its own (https://code.claude.com/docs/en/skills). They are fine for Claude Code, but a spec validator will flag them, so know which target you are writing for.

5. The body

The spec puts no format rules on the body, but our validator flags an empty one. The spec recommends keeping the file under 500 lines, which a validator treats as a warning, not an error. Long reference material belongs in separate files the body links to.

6. What a validator can't tell you

A clean result means the file is well formed. It does not mean the skill works. A validator does not:

  • run the skill or test what it does;
  • open scripts/, references/, assets/ or any file the body links to;
  • judge whether the description will make the agent pick the skill at the right time;
  • check that the tools in allowed-tools exist.

The only way to know a skill triggers and works is to try it on real requests, including ones where it should not load.

Check yours in the browser

We built a free SKILL.md generator and validator that runs entirely in the page: nothing you paste is sent anywhere or saved. It checks everything in sections 1 to 5, lists anything outside its YAML subset by line instead of guessing, and comes with sample files for each common failure.

Validate your SKILL.md here: https://linkgents.ai/tools/skill-md-validator/?utm_source=devto&utm_campaign=engine&utm_content=B1-36

Top comments (0)