ax-check rule

AXC-D026: SKILL.md over 500 lines

SKILL.md is longer than the 500 lines the specification recommends, so activation loads a lot of context.

ax-check is a checker being prepared for release. This page documents the rule ahead of that release; see all 50 rules.

Severityinfo
KindConformance. A finding is a fact about the input.
Modeax-check lint
Applies toSKILL.md
Pattern tagsskills, context-budget
Fix in one lineMove reference material into files under references/ and link to them.

SKILL.md is longer than the 500 lines the Agent Skills specification recommends. When a skill activates, its whole body is loaded into the agent’s context, so a long body costs context on every use, including the parts the task does not need. This is information, not a failure: the fix is usually to move reference material into separate files.

What it checks

ax-check counts the lines of each SKILL.md file, frontmatter and body together, and reports a file longer than 500 lines.

Why it matters

The Agent Skills specification says: “Keep your main SKILL.md under 500 lines. Move detailed reference material to separate files.” Files in references/, scripts/ and assets/ are loaded only when required, so detail that lives there costs nothing until the agent needs it.

Skill bodies are not free. Wang et al. (arXiv 2610.04832, 4 October 2026) report that loading a skill’s body raised episode tokens by 50% on average across four agents (the paper’s claim). The same paper reports that the gain from adding rules to a skill came mainly from rules that name a command or path the old skill did not mention (also the paper’s claim).

How to fix

  • Keep in the body only what the agent needs on every use: the steps, the commands and the decisions.
  • Move tables, long examples, API references and background into files under references/.
  • Link to each file from the step that needs it, with a relative path, so the agent loads it only then.

Example

Before

---
name: invoice-review
description: Checks a draft invoice before it is sent. Use this when asked to review an invoice.
---

# Invoice review

1. Open the draft invoice and read every line item.
2. Check the tax rate for the customer's country.

## Tax rates by country
(a 300-line table)

## Payment terms reference
(250 lines)

After

---
name: invoice-review
description: Checks a draft invoice before it is sent. Use this when asked to review an invoice.
---

# Invoice review

1. Open the draft invoice and read every line item.
2. Check the tax rate in [the tax table](references/tax-rates.md).
3. Check the due date against [the payment terms](references/payment-terms.md).

How ax-check detects it

ax-check counts every line of SKILL.md: the opening ---, the frontmatter, the closing --- and the body. It removes a leading byte order mark and converts Windows line endings first, and a final line break at the end of the file does not add an extra line. A file with more than 500 lines is reported. The finding gives the count and points at the first line of the body. If the frontmatter is missing or not closed, the whole file is counted in the same way.

What it ignores: files under references/ and other bundled files are not counted. AXC-D017 reports the approximate tokens that skill bodies add when they activate.

Known false positives: blank lines and lines inside code blocks count like any other line, so a file padded with long code samples may be reported although its instructions are short. Moving those samples into references/ is usually the right fix anyway.

If the finding does not apply, silence it with --disable AXC-D026.

Sources

  • Specification: Agent Skills specification, agentskills.io, retrieved 2026-10-08. https://agentskills.io/specification. “Keep your main SKILL.md under 500 lines. Move detailed reference material to separate files.” Bundled files load only when required.
  • Paper: Wang et al., “Agent Skill Evolution: How Revisions Affect Coding Agents”, arXiv 2610.04832, 4 October 2026. https://arxiv.org/abs/2610.04832. The paper’s claim, across four agents: loading a skill’s body raised episode tokens by 50% on average; added rules raised the rate of the required action by +0.23 on average, mainly from rules that name a command or path.

Records in the AX evidence register that share a pattern tag with this rule. A shared tag means the record is about the same pattern, not that it tests this rule. Read the evidence class before the number.