agentleFS
mahiepitmahiepit/SkillLint/skills/writing-agent-skills/SKILL.md

writing-agent-skills

Skill0 starsChanged 39 days agoMITView on GitHub

Writes, reviews and lints Agent Skills (SKILL.md folders) so they load and trigger correctly in Claude Code, OpenAI Codex, Cursor, Gemini CLI and GitHub Copilot, using the SkillLint CLI. Use when creating or editing a SKILL.md, when a skill does not load or trigger, or before publishing skills or a Claude Code plugin.

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. piousp/llm-skills★ 2same name
    2. msewell/agent-stuff★ 0same name
    3. xingkaixin/skills★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Keep exactly one level: skills/<name>/SKILL.md.

    line 34
  2. Distinctive:

    Start from assets/SKILL.template.md.

    line 38
  3. Distinctive:

    Write the description in the third person and include both *what* and *when*: "Extracts tables from PDF files.

    line 44
  4. Very specific:

    Keep SKILL.md under 500 lines (about 5000 tokens).

    line 49
  5. Very specific:

    Keep references one level deep: link reference files from SKILL.md, not from other reference files.

    line 51
  6. Very specific:

    No absolute or user-specific paths (C:\Users\..., /Users/...), no backslash paths, and no wording that goes stale ("until next month", "the …

    line 53
  7. Very specific:

    Run from the repository root (Node.js 18+):

    line 57
  8. Very specific:

    Add the GitHub Action so every pull request is linted: uses: mahiepit/SkillLint@v1.

    line 86

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Writing and linting Agent Skills

A skill is a folder with a SKILL.md file: YAML frontmatter (name, description) followed by Markdown instructions. Agents read only name and description at startup and load the body when the description matches the task, so the description decides whether the skill is ever used.

Workflow

Copy this checklist and tick it off:

- [ ] 1. Pick the folder name and location
- [ ] 2. Write the frontmatter
- [ ] 3. Write the body and bundled files
- [ ] 4. Run SkillLint and fix every error
- [ ] 5. Re-run until it reports no errors

1. Folder name and location

  • The folder name is the skill name: lowercase a-z, digits and single hyphens, at most 64 characters, e.g. processing-invoices. No uppercase, underscores or spaces.
  • Where agents look for project skills:
    • .claude/skills/<name>/ — Claude Code (also read by Cursor and Copilot)
    • .agents/skills/<name>/ — Codex, Cursor, Gemini CLI and Copilot
    • skills/<name>/ — inside a Claude Code plugin
  • Keep exactly one level: skills/<name>/SKILL.md. Claude Code and Gemini CLI do not find deeper nesting.

2. Frontmatter

Start from assets/SKILL.template.md. Rules that break loading:

  • The file must be named exactly SKILL.md and start with --- on line 1 (no BOM, nothing before it).
  • name must equal the folder name.
  • description is required, at most 1024 characters, and under 500 characters if the skill must also load in Codex.
  • Quote the description if it contains : or # — otherwise YAML fails or silently cuts the text. When in doubt, use double quotes.
  • Write the description in the third person and include both what and when: "Extracts tables from PDF files. Use when the user mentions PDFs, forms or invoices." Never "I can help you ...".
  • For portable skills use only the spec fields: name, description, license, compatibility, metadata (string values; quote versions such as "1.0"), allowed-tools (a space-separated string). See references/portability.md for which agent supports which extra field.

3. Body and bundled files

  • Keep SKILL.md under 500 lines (about 5000 tokens). Move long reference material into references/, scripts into scripts/, templates into assets/.
  • Link every bundled file from SKILL.md with a relative path and forward slashes, and say when to use it. Files that are never mentioned are invisible to the agent.
  • Keep references one level deep: link reference files from SKILL.md, not from other reference files.
  • Scripts need a shebang (#!/usr/bin/env python3), LF line endings and the executable bit (git update-index --chmod=+x <file> on Windows).
  • No absolute or user-specific paths (C:\Users\..., /Users/...), no backslash paths, and no wording that goes stale ("until next month", "the new API since last year").

4. Lint

Run from the repository root (Node.js 18+):

npx --yes github:mahiepit/SkillLint .

Lint one skill, or check only the agents you ship to:

npx --yes github:mahiepit/SkillLint .claude/skills/my-skill
npx --yes github:mahiepit/SkillLint --target claude,codex .

In Claude Code with the SkillLint plugin installed, the same CLI is also on the Bash PATH as skilllint.js.

Reading the output: each line is line:column severity message rule-id, followed by a fix: hint.

  • error — at least one agent will not load the skill, or loads it wrong. Fix all of them.
  • warning — it loads, but triggers poorly or breaks for some agents. Fix unless the warning is about an agent you do not target (then pass --target).
  • info — housekeeping (unreferenced files, CRLF, missing table of contents).

--fix applies the safe fixes (BOM, CRLF in scripts, trailing whitespace, name casing when it matches the folder). Every rule is explained at https://github.com/mahiepit/SkillLint/blob/main/docs/RULES.md.

5. Iterate

Fix, re-run, and repeat until the summary says 0 errors. Then test the skill for real: ask the agent a question that should trigger it and check that it does; if not, add the user's words to the description.

Publishing

  • Add the GitHub Action so every pull request is linted: uses: mahiepit/SkillLint@v1.
  • For a Claude Code plugin, SkillLint also checks .claude-plugin/plugin.json and .claude-plugin/marketplace.json (names, ./ paths, sources).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.