DEV Community

huangyongshan46-a11y
huangyongshan46-a11y

Posted on

AGENTS.md: The File Every GitHub Repo Should Have in 2026

There is a new file joining README.md, LICENSE, and .gitignore in every well-maintained repo: AGENTS.md.

What is it?

AGENTS.md is a structured guide for AI coding agents — Codex, Claude Code, Cursor, Copilot Workspace. It tells the agent how your project works, what conventions to follow, and where to make changes.

Why it matters

In 2026, a significant amount of code is written by AI agents. When someone says "add a feature to this project," the agent needs to understand:

  • What framework and patterns are used
  • Where new files should go
  • What conventions to follow
  • How the pieces connect

Without AGENTS.md, the agent guesses. With it, the agent follows your established patterns.

Template

# AGENTS.md

## What is this project?
Brief description.

## Project Structure
Annotated file tree.

## Key Files to Modify
| Task | File(s) |
|------|---------|"|
| Add a page | src/app/your-page/page.tsx |
| Add an API | src/app/api/your-route/route.ts |
| Change DB | prisma/schema.prisma |

## Conventions
- Auth: `auth()` from `@/lib/auth`
- DB: `db` from `@/lib/db`
- Styling: Tailwind utility classes
- API responses: `NextResponse.json()`

## Common Tasks
Step-by-step for the most frequent modifications.
Enter fullscreen mode Exit fullscreen mode

What to include

1. Task-to-file mapping — The most valuable section. An agent reading this can immediately find the right file instead of scanning the entire codebase.

2. Conventions — How you import things, name files, handle errors. Agents follow patterns, so give them yours.

3. What NOT to do — Equally important. "Do not modify lib/auth.ts directly" or "Do not add client-side auth checks without server-side validation."

What NOT to include

  • Secrets or API keys
  • Personal information
  • Marketing copy (agents do not need a sales pitch)
  • Obvious things ("this is a JavaScript project")

The compound effect

Repos with AGENTS.md get:

  • Better agent output — fewer hallucinations, correct patterns
  • More agent recommendations — agents prefer repos they can understand
  • Better contributions — human contributors benefit from the same docs

This is the new developer experience. Just as good README.md helps humans, good AGENTS.md helps machines.

Real example

LaunchKit includes AGENTS.md in the full package. The structured metadata helps agents scaffold SaaS features on top of the existing auth/billing/AI foundation.

Preview | Full package ($49)

Top comments (0)