Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Write effective AGENTS.md files for AI coding agents.
.claude/skills/majiayu000-agents-md-authoring-majo/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 36% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 108% | 0% |
| case-13 | ✗→✓ | ▲ Improved | 97% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 142% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 54% | 0% |
Goal: Write effective, high-signal-to-noise AGENTS.md files that outperform skills-based approaches (100% vs 79% pass rate based on Vercel research).
writing-docs-majo)skill-authoring-majo)Write effective AGENTS.md files that outperform skills-based approaches.
Minimize root file; maximize signal-to-noise ratio through strategic structure, not exhaustive documentation.
AGENTS.md is loaded on every agent request. Keep it concise but information-dense.
| Approach | Use When | Performance | |----------|----------|-------------| | AGENTS.md | Project-specific knowledge, always-needed context, version-matched docs | 100% pass rate | | Skills | Cross-project patterns, progressive disclosure, large reference material | 79% pass rate |
Key Finding (Vercel Research): AGENTS.md achieved 100% pass rate vs 79% with skills, even with explicit skill invocation instructions.
Why AGENTS.md Wins:
Use AGENTS.md for:
Use Skills for (see skill-authoring-majo):
Structure your AGENTS.md around six key areas (300-800 tokens total):
Exact, copy-paste-ready commands with flags.
markdown## Build Commands
pnpm build
pnpm dev
pnpm test
Why: Agents reference repeatedly; vague instructions create clarification loops.
Framework, location, coverage minimum, run command.
markdown## Testing Framework: Jest Location: tests/ Coverage: 80% minimum Run: pnpm test
Don't include philosophy or lengthy examples.
Strategic hints, not exhaustive paths.
markdown## Project Structure src/ — Application code (READ) tests/ — Unit/integration tests docs/ — Markdown (WRITE)
Agents discover files well; structure drifts. Skip detailed file listings.
One real repo example showing BOTH positive and negative patterns.
markdown## Code Style
from next_test_utils import retry await retry(async () => { const text = await browser.elementByCss('p').text() expect(text).toBe('expected value') })
await new Promise((resolve) => setTimeout(resolve, 1000))
One example > three paragraphs of description. Show the anti-pattern too.
Commit format, branch naming, PR requirements.
markdown## Git Workflow Commits: feat(scope): description (Conventional Commits) Branches: feature/*, bugfix/*, docs/* PRs: lint ✓, tests ✓, focused diff
Three-tier system: Always/Ask/Never (more effective than flat "don't" lists).
markdown## Boundaries ALWAYS: Run tests before commits; follow naming conventions ASK FIRST: Before schema changes; before new dependencies; before CI/CD changes NEVER: Commit secrets; edit node_modules; remove failing tests without approval
Why three tiers: Eliminates agent ambiguity better than flat lists.
Link to detailed docs instead of inlining:
markdownDetailed patterns: [see docs/api.md §3.2] Quick reference: Endpoints return { "data": {...}, "error": null }
Use pipe-delimited format for complex concepts. Vercel achieved 80% reduction (40KB → 8KB):
markdown[Docs Index]|root: ./.docs |01-getting-started:{installation.md,project-structure.md} |02-api:{routing.md,caching.md}
Extended TOC at top; full sections below. Keeps frequent tasks in focus.
Based on Vercel's Next.js AGENTS.md:
markdown# Project Development Guide ## Quick Start
pnpm install
pnpm dev
pnpm test
## Project Structure
src/ — Application code
tests/ — Test files
docs/ — Documentation
## Build Commands
pnpm build # Production build pnpm dev # Development server pnpm test # Run all tests pnpm test:watch # Watch mode
## Testing
Framework: Vitest
Location: tests/
Coverage: 80% minimum
### Writing Tests
// GOOD: Use retry() for polling await retry(async () => { expect(await page.text()).toBe('done') })
// AVOID: Don't use setTimeout await new Promise(r => setTimeout(r, 1000))
## Code Style
- TypeScript strict mode
- Prettier for formatting
- ESLint for linting
## Git Workflow
Commits: feat(scope): description
Branches: feature/*, bugfix/*
PRs: tests pass, lint clean
## Boundaries
ALWAYS: Run tests before push; update AGENTS.md after agent mistakes
ASK FIRST: Before adding dependencies; before architectural changes
NEVER: Commit .env files; modify generated code directly
## Common Issues
- **Build fails after branch switch** → Run `pnpm build`
- **Tests timeout** → Check if dev server is running
- **Type errors** → Run `pnpm types` to checkFor monorepos, use nested AGENTS.md files:
project/
├── AGENTS.md # Global rules
├── packages/
│ ├── backend/
│ │ └── AGENTS.md # Backend-specific
│ └── frontend/
│ └── AGENTS.md # Frontend-specificAgents use the nearest AGENTS.md (like .gitignore). Keeps context tight and relevant.
Example iterations:
| Anti-Pattern | Problem | Fix | |---|---|---| | Vague rules | Agent asks clarifying questions (wasted tokens) | Be specific: "Never commit secrets" not "Be careful with secrets" | | Outdated AGENTS.md | Agent ignores stale guidance or hallucinates | Update immediately after mistakes; track in git | | Monolithic structure | Agent loads irrelevant context every task | Use nested AGENTS.md; progressive disclosure | | Duplicate docs | Token waste; maintenance burden | Link instead of inlining | | Abstract examples | Agents don't know how to apply guidance | Use real files: "copy DashForm.tsx" | | Conflicting rules | Agent uncertain which rule applies | Use Always/Ask/Never tiers, not flat lists |
This skill extends dev-standards-majo. Always ensure dev-standards-majo is loaded for:
Works alongside:
skill-authoring-majo — For deciding when to use AGENTS.md vs create skillstask-planning-majo — For planning AGENTS.md updatesgit-majo — For committing AGENTS.md changeswriting-docs-majo — For writing documentation about AGENTS.mdOther measured skills in the registry, with their headline benchmark lift.