Skip to content
fullstackhero

Reference

AGENTS.md & the .agents Folder

The canonical AGENTS.md guide, the CLAUDE.md/GEMINI.md bridges, the .agents folder structure, and the on-demand rule files that encode every convention.

views 0 Last updated

AGENTS.md — the canonical guide

AGENTS.md at the repo root is the single source of truth for AI tools. It’s deliberately lean: a repo map, the tech stack, full-stack build/run commands, a short list of “golden rules” that must never be broken, and an index pointing into .agents/rules/. Conventions are edited there — not in the bridges.

CLAUDE.md (Claude Code) and GEMINI.md (Gemini CLI) are one-line bridges that import it:

CLAUDE.md
# Claude Code
The canonical project guide is **`AGENTS.md`** (tool-neutral). It is imported below; edit conventions there, not here.
@AGENTS.md

So every tool — and every contributor — reads the same guide, and there’s exactly one place to update.

The .agents/ folder

AGENTS.md ← canonical guide (CLAUDE.md / GEMINI.md import it)
.agents/
├── rules/ ← conventions & footguns (read on demand)
│ ├── architecture.md module boundaries, registration, middleware order
│ ├── api-conventions.md endpoints, CQRS, validation, exceptions, permissions
│ ├── database.md EF Core, migrations, tenant isolation, query filters
│ ├── eventing.md domain vs integration events, Outbox/Inbox
│ ├── caching.md jobs.md resilience.md storage.md
│ ├── security.md CORS, security headers, rate limiting, idempotency, quotas
│ ├── realtime.md logging.md testing.md integration-testing.md
│ ├── modules/ one file per module (identity, multitenancy, chat, files,
│ │ webhooks, auditing, billing, catalog, tickets, notifications)
│ └── frontend/ shared.md · admin.md · dashboard.md (the two React apps)
├── skills/ ← task recipes (see Skills & Workflows)
│ └── {skill}/SKILL.md
└── workflows/ ← review / orchestration playbooks
└── {workflow}.md

Rules — conventions, read on demand

A rule is knowledge the agent reads before working in an area — the conventions and the footguns that are easy to get wrong. Rules don’t restate what the code or tests already enforce; they point at the enforcement and capture the non-obvious. The root AGENTS.md carries the index, e.g. “before EF or migration work, read database.md.”

Working on…Rule
Module structure, boundaries, registration, middleware orderarchitecture.md
Endpoints, CQRS, validation, exceptions, permissionsapi-conventions.md
EF Core, entities, migrations, tenant isolationdatabase.md
Cross-module events, Outbox/Inbox, idempotent handlerseventing.md
Caching · jobs · HTTP resilience · file storagecaching.md · jobs.md · resilience.md · storage.md
CORS, security headers, rate limiting, idempotency, quotassecurity.md
SignalR / SSE · logging & OpenTelemetryrealtime.md · logging.md
Unit tests · integration tests (Testcontainers)testing.md · integration-testing.md
A specific module’s quirksmodules/{module}.md
Any React work · the operator app · the tenant appfrontend/shared.md · frontend/admin.md · frontend/dashboard.md

A few examples of the kind of footgun these capture: registering a module touches four places (Mediator assemblies + module array, in both the API and DbMigrator hosts); tenant isolation is default-on via BaseDbContext; new entity ids use Guid.CreateVersion7(); log messages must be structured (no string interpolation). Each is one read away when the agent needs it.

Next: the Skills & Workflows that turn these conventions into repeatable actions.