Repository navigation
[Agents] Add pre-commit check for agent files and skills - #59657
Merged
Merged
Conversation
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>
mgoin
requested review from
BugenZhao,
Harry-Chen,
aarnphm,
esmeetu,
hmellor,
khluu,
njhill and
sfeng33
as code owners
October 1, 2026 17:38
Contributor
|
Documentation preview: https://vllm--59657.org.readthedocs.build/en/59657/ |
Member
|
Thanks! |
hmellor
reviewed
Oct 1, 2026
Removed redundant instructions and clarified existing ones in the agent editing guidelines.
Member
Author
|
/ci run |
|
✅ Triggered Buildkite CI #92480 for commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Add a pre-commit hook that checks agent instruction files and skills, and remove the nested
CLAUDE.mdfiles it now rejects. Follow-up to #59638, where a new skill shipped without its.claude/skillssymlink and nothing flagged it.Claims
tools/pre_commit/check_agent_files.pyfails on:.agents/skillswithout a correct.claude/skillssymlink, or anything in.claude/skillsthat is not such a link;SKILL.mdfrontmatter that does not parse, anamethat differs from the directory, or a missing or over-longdescription(limits from the Agent Skills spec);AGENTS.md, 300 for nested ones (both already inediting-agent-instructions.md), 500 forSKILL.md;AGENTS.mdfiles and skills;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 runpasses on this branch, and the hook is clean on currentmainapart from the fiveCLAUDE.mdfiles removed here.description(frontmatter is not valid YAML), and no symlinkSKILL.mdunder.claude/skillsDetails
Removing
CLAUDE.md. #58541 removed the root file because Claude Code readsAGENTS.mddirectly. Per the Claude Code docs, it only does so when there is noCLAUDE.mdin the working directory or above it, so starting Claude Code insiderust/currently skips the rootAGENTS.md. I have not reproduced that; it is read from the docs. Removing the nested pointers lets everyAGENTS.mdload directly.Trade-offs:
rust/CLAUDE.mdalso imported a gitignoredAGENTS.override.md(from [Rust Frontend] Move code fromvllm-frontend-rs#43283). Claude Code does not read that file on its own, so a local override no longer reaches Claude Code inrust/. Codex is unaffected.AGENTS.mddirectly. Remove.gemini/andCLAUDE.md#58541 already accepted this for the root file.Left out on purpose.
agents/openai.yamlstays optional and unchecked: it is display metadata for Codex, which discovers.agents/skillswithout it.debug-ima,kernel-microbenchmark,triton-kernel-writing) are unchanged.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.mdfiles.Pull Request Checklist
I used vLLM's
/pr-checklistskill. (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