Skip to content

[Agents] Add pre-commit check for agent files and skills - #59657

Merged
vllm-bot merged 3 commits into
vllm-project:mainfrom
mgoin:agent-files-lint
Oct 2, 2026
Merged

vllm-bot merged 3 commits into
vllm-project:mainfrom
mgoin:agent-files-lint

Conversation

@mgoin

@mgoin mgoin commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Overview

Add a pre-commit hook that checks agent instruction files and skills, and remove the nested CLAUDE.md files it now rejects. Follow-up to #59638, where a new skill shipped without its .claude/skills symlink and nothing flagged it.

Claims

tools/pre_commit/check_agent_files.py fails on:

  • a skill in .agents/skills without a correct .claude/skills symlink, or anything in .claude/skills that is not such a link;
  • SKILL.md frontmatter that does not parse, a name that differs from the directory, or a missing or over-long description (limits from the Agent Skills spec);
  • line budgets: 200 for the root AGENTS.md, 300 for nested ones (both already in editing-agent-instructions.md), 500 for SKILL.md;
  • relative links and heading anchors that do not resolve, in AGENTS.md files and skills;
  • any tracked CLAUDE.md.

A description that never says when to use the skill prints an advisory note: and does not fail.

Validation

  • cd tests && pytest tools/test_check_agent_files.py: 14 passed. One case per rule, each breaking a minimal repo; wired into the CPU Buildkite job.
  • pre-commit run passes on this branch, and the hook is clean on current main apart from the five CLAUDE.md files removed here.
  • Run against open PR trees, it catches:
PR Finding
#57088 unquoted colon in description (frontmatter is not valid YAML), and no symlink
#57786 no symlink
#50527 real SKILL.md under .claude/skills

Details

Removing CLAUDE.md. #58541 removed the root file because Claude Code reads AGENTS.md directly. Per the Claude Code docs, it only does so when there is no CLAUDE.md in the working directory or above it, so starting Claude Code inside rust/ currently skips the root AGENTS.md. I have not reproduced that; it is read from the docs. Removing the nested pointers lets every AGENTS.md load directly.

Trade-offs:

Left out on purpose.

  • agents/openai.yaml stays optional and unchecked: it is display metadata for Codex, which discovers .agents/skills without it.
  • The three existing descriptions that trigger the advisory note (debug-ima, kernel-microbenchmark, triton-kernel-writing) are unchanged.
  • No behavioral skill tests (prompt routing, with/without-skill A/B); this is static checking only.

Anchors are compared on alphanumerics only, because slug rules differ between GitHub and MkDocs. The hook's files: filter only covers agent files locally; CI runs pre-commit with --all-files, so a link broken by a docs change is still caught there.

Not a duplicate: no open PR adds an agent-file check or touches these CLAUDE.md files.


Pull Request Checklist
  • I used vLLM's /pr-checklist skill. (Mandatory for agents, optional for humans).

  • AI assistance was used during the creation of this PR.

  • Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.

  • Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.

  • Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.

  • Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.

🤖 Generated with Claude Code

Check that every skill in .agents/skills is symlinked into .claude/skills, has valid frontmatter, and stays within its line budget, and that relative links in AGENTS.md files and skills resolve.

Remove the nested CLAUDE.md files and reject new ones: Claude Code reads AGENTS.md directly, but not from or below a directory with a CLAUDE.md.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: mgoin <mgoin64@gmail.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@mergify

mergify Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Documentation preview: https://vllm--59657.org.readthedocs.build/en/59657/

@mergify mergify Bot added documentation Improvements or additions to documentation ci/build rust tool-calling agents Related to information for agents labels Oct 1, 2026

@sfeng33 sfeng33 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@benchislett

Copy link
Copy Markdown
Member

Thanks!

Comment thread docs/contributing/editing-agent-instructions.md Outdated
mgoin added 2 commits October 1, 2026 15:40
Removed redundant instructions and clarified existing ones in the agent editing guidelines.
@mgoin

mgoin commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

/ci run

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

✅ Triggered Buildkite CI #92480 for commit 7209daa0d88f.

@vllm-bot
vllm-bot merged commit 1ab1859 into vllm-project:main Oct 2, 2026
142 of 144 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Related to information for agents ci/build documentation Improvements or additions to documentation rust tool-calling

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants