chore(docs): fix stale npx commands in agent docs and stop CLAUDE.md/AGENTS.md drift#3452
Open
NieZhuZhu wants to merge 1 commit into
Open
chore(docs): fix stale npx commands in agent docs and stop CLAUDE.md/AGENTS.md drift#3452NieZhuZhu wants to merge 1 commit into
NieZhuZhu wants to merge 1 commit into
Conversation
…drift The npx->bunx docs sweep (2da22b6) fixed AGENTS.md, .claude/skills and .cursor/rules but missed root CLAUDE.md and apps/api/CLAUDE.md. Root CLAUDE.md and AGENTS.md have since drifted in both directions (the responsive mandate landed only in CLAUDE.md, the API Endpoint Contract section only in AGENTS.md). - AGENTS.md: port the Responsive (MANDATORY) rule from CLAUDE.md - CLAUDE.md: replace with an @AGENTS.md import stub (single source of truth) - .cursorrules: point at AGENTS.md instead of the stubbed CLAUDE.md - apps/api/CLAUDE.md: npx -> bunx (x10), same substitution as 2da22b6 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Change-Id: I592493cb28c4185f1369f2b1dddb2767ffce4170
|
Someone is attempting to deploy a commit to the Comp AI Team on Vercel. A member of the Team first needs to authorize it. |
|
NieZhuZhu seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
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.
What does this PR do?
Fixes the last remaining stale
npxcommands in the agent instruction files, and stops rootCLAUDE.md/AGENTS.mdfrom drifting apart again.The problem. Root
CLAUDE.mdandAGENTS.mdare near-identical twins (~96% line overlap), and they have been drifting in both directions:AGENTS.md,.claude/skills/*and.cursor/rules/*— but missed rootCLAUDE.mdandapps/api/CLAUDE.md. So rootCLAUDE.mdstill sayscd apps/app && npx vitest runa couple of lines below its own "Package manager:bun(never npm/yarn/pnpm)" rule, andapps/api/CLAUDE.mdcarries ten morenpxcommands.CLAUDE.md, soAGENTS.mdreaders never see it — whileCLAUDE.mdreaders never see the "API Endpoint Contract" section that only exists inAGENTS.md.This bites real users: when both files exist, Claude Code reads
CLAUDE.md(notAGENTS.md), so Claude users get exactly the stale half. And.cursorrulespoints Cursor users atCLAUDE.mdtoo.The fix (4 files):
AGENTS.md— port the one rule that only existed inCLAUDE.md(the Responsive MANDATORY bullet), making it a true superset.CLAUDE.md— replace with an@AGENTS.mdimport stub (Claude Code expands@imports natively). One source of truth; the twins can't drift again..cursorrules— point its "read the rules" line atAGENTS.mdinstead of the now-stubbedCLAUDE.md.apps/api/CLAUDE.md— mechanicalnpx→bunx(×10), the same substitution 2da22b6 applied everywhere else.If you'd rather keep
CLAUDE.mdas a standalone full file, happy to downscope this to just fixing the four stale commands in place — though the stub is the part that prevents recurrence.Visual Demo (For contributors especially)
Docs-only PR, so a text demo: we measured the impact with plain
claude -pon a pinned checkout (b04358d), asking 12 questions about repo conventions/commands, 2 runs per side:The three command questions failed deterministically before: asked "What is the exact command to run the frontend app test suite?", the agent answered
cd apps/app && npx vitest run— verbatim fromCLAUDE.md, in both runs, with no self-verification. With the fix it answers thebunxform and needs fewer turns (no conflicting sources left to reconcile).Full disclosure: we found this while validating ai-harness-doctor, a doc-drift linter we maintain — that's how this repo ended up in our scan sample. The numbers above are plain
claude -pruns, reproducible without our tool; raw data and methodology: benchmark/corpus/evals/comp. (The measured treatment also normalized a few section headings for our tool's benefit; content-wise it is identical to this PR.)Mandatory Tasks (DO NOT REMOVE)
How should this be tested?
grep -rn "npx" CLAUDE.md AGENTS.md .cursorrules apps/api/CLAUDE.md→ no matches.CLAUDE.md— it is now a one-line@AGENTS.mdimport, which Claude Code expands automatically. Smoke test from the repo root:claude -p "What is the exact command to run the apps/app test suite?"→ answers thebunxform.Checklist
All template bullets removed per the template's instruction — none apply (contributing guide read, style followed, no new warnings).
P.S. One more instance of the same disease, deliberately left out of scope:
CONTRIBUTING.mdstill says PRs should be made against adevbranch, butdevno longer exists and recent PRs all targetmain.Summary by cubic
Fix stale
npxcommands in agent docs and prevent drift betweenCLAUDE.mdandAGENTS.md.CLAUDE.mdis now an@AGENTS.mdimport stub,.cursorrulespoints toAGENTS.md,AGENTS.mdadds the missing responsive rule, andapps/api/CLAUDE.mdswitchesnpx→bunxfor@trycompai/apicommands.Written for commit e629b6b. Summary will update on new commits.