shelf Docs
On this page
shelf lint [<name>...]
ArgumentDescription
<name>... (optional)Skill names. Default: all

Also takes the global options --json and --actor (CLI overview).

What it does

Lints the named skills, or every skill in the library. For each it prints the estimated tokens (characters / 4) of the description, which loads in every session, and of the body, which loads on use, then any issues.

LevelCheck
errorSKILL.md must start with YAML frontmatter between --- lines.
errorThe frontmatter must be valid YAML, and key: value pairs.
errorname is required: a string of at most 64 lowercase letters, digits and single hyphens, matching the directory.
errorThe directory name is a valid skill name.
errordescription is required: a string of at most 1024 characters.
warningThe description is over 300 characters ("every session loads it").
warningThe description doesn't say when to use the skill (no "when", "whenever", "if you", "if the user", "use for", "use to").
warningThe body is empty.

Errors make a skill invalid for some harnesses; warnings make it costly or hard for an agent to pick. Only errors change the exit code.

lint goes by the library's directories, so it also checks skills that don't load. A library directory without frontmatter, without a description, with a description over 1024 characters, or whose name doesn't match its directory isn't loaded by other commands (shelf doctor reports it under library); lint reports why, as errors. The dashboard's lint strip runs the same checks on the unsaved draft as you type.

Examples

terminal
shelf lint
api-design  ~31 description + ~18 body tokens  ok
git-hygiene  ~17 description + ~18 body tokens
  warning: description doesn't say when to use the skill: add "Use when …"
pdf-tools  ~32 description + ~17 body tokens  ok
terminal
shelf lint
Bad_Name  ~7 description + ~1 body tokens
  error: directory "Bad_Name" is not a valid skill name: rename it (and name:) to lowercase letters, digits and single hyphens
  error: name must be lowercase letters, digits and single hyphens, e.g. pdf-tools
ok-skill  ~7 description + ~0 body tokens
  warning: The body is empty: add the instructions an agent follows
echo $?
1

JSON output

json
{"schemaVersion":1,"ok":true,"data":{"skills":[{"skill":"git-hygiene","issues":[{"level":"warning","message":"description doesn't say when to use the skill: add \"Use when …\""}],"descriptionTokens":17,"bodyTokens":18}],"errors":0}}
FieldMeaning
skills[].issues[]level (error or warning) and message.
skills[].descriptionTokensDescription size estimate.
skills[].bodyTokensSize estimate of everything after the frontmatter.
errorsTotal errors across all skills.

When errors is above 0, the envelope still says "ok": true (the command ran) and the exit code is 1.

Errors

CodeWhen
SKILL_NOT_FOUNDNo library directory with that name has a SKILL.md.