Course contents
Keep AI coding rules accurate: review, test and update presets
On this page
Stale rules are worse than no rules
A rule that says pnpm test after you've moved to pnpm turbo test doesn't just fail to help. The agent follows it confidently, runs the wrong command, and may "fix" things to make it pass. Outdated framework guidance is the same: a rule written for an older major version will steer the agent toward APIs you've moved away from.
Treat instruction files as code
- Commit them. Rules, skills and
AGENTS.mdbelong in git, reviewed like any other change. - Add them to CODEOWNERS. One owner per area keeps contradictions out.
- Update them in the same PR. If a PR renames a script, moves a folder or bumps a framework major, it should update the instructions that mention it.
- Test changes in the PR. GitHub Copilot code review reads instructions and skills from the PR's head branch, so the review in that same PR already uses your edits.
A short PR template line helps:
- [ ] If this changes commands, layout or a framework version, I updated AGENTS.md and the rules that mention it.
Test rules the cheap way
You don't need an eval platform to catch most problems. Keep a small file of prompts next to your rules and run them after changes, in a fresh session each time.
# Agent checks (run in a new session)
1. "Add a route that returns the current user's projects."
Expect: uses proxy.ts conventions, session check first, test added.
2. "Install a date library."
Expect: uses pnpm, asks before adding a production dependency.
3. "Review my last commit."
Expect: nextjs-code-review skill runs; findings listed by severity.
When a check fails, fix the one rule that should have caught it, then rerun all of them. Five to ten checks catch most regressions.
For skills shipped in Claude Code plugins, claude plugin eval can measure trigger rates across prompts automatically. Vercel's eval write-up is a good model for building harder checks that target APIs missing from training data (Vercel).
Prune regularly
Every always-on line and every skill description costs context in every session. Once a quarter:
- Delete rules for things the linter now enforces.
- Remove skills nobody invoked. Claude Code's
/doctorreports unused skills compared with their context cost, and/skillscan sort by token count. - Merge overlapping skills.
- Check sizes against limits:
wc -c AGENTS.md(Codex stops at 32 KiB), and Antigravity's 24,000-byte per-file cap.
Updating installed presets
presets.dev presets carry an "Updated for" line with the versions they target, like "Next.js 16.4.6, Nov 2026". When a new release lands:
- Preview what would change:
npx presets-dev add nextjs --tool claude --dry-run- Replace files you haven't edited:
npx presets-dev add nextjs --tool claude --force--force overwrites the installed rule and skill files and, for AGENTS.md or GEMINI.md, replaces only the text between that stack's markers. Anything outside the markers stays.
- Review the diff in git before committing.
Pin content for reproducible installs
The CLI fetches content from the presets.dev repo's master branch by default. Pin it for CI or onboarding scripts with --ref and a tag or commit:
npx presets-dev add nextjs --tool cursor --ref f57489fCommon mistakes
- Testing in the chat where you edited the rule. The context is already there. Start fresh.
- Fixing three rules at once. Change one thing, rerun the checks, then the next.
- Customizing inside presets markers. Your text disappears on the next
--force. - Letting "Updated for" drift. If you upgrade the framework, update or reinstall the preset in the same PR.
Recap
- Commit, review and own instruction files like code.
- Keep five to ten prompt checks and run them in fresh sessions.
- Prune unused rules and skills each quarter; check size limits.
- Update presets with
--dry-run, then--force, then review the diff. Pin with--ref.
Next step
Learn the full CLI: Install your first stack.