agentleFS
caidanwcaidanw/skills/agents-md/SKILL.md

agents-md

Skill9 starsChanged 4 months agoMITView on GitHub

Write effective AGENTS.md files that give coding agents the context they need to work in a repository. Use when creating a new AGENTS.md, improving an existing one, setting up a repo for AI coding agents, or onboarding agents to a codebase. Triggers on: "write AGENTS.md", "create AGENTS.md", "agent instructions", "set up repo for agents", "configure coding agent", "onboard agent to codebase", "agent context file".

25 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use adr, jira and 5 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • asterkinSkill

    adr

    Create Architecture Decision Records (ADRs) following project standards. Guides template usage, process, and best practices for documenting architecturally significant decisions.

    Also in 3 projects that use this

  • MongoDBSkill

    jira

    Use this skill for any Jira operation in the DOCSP project — creating, viewing, searching, updating, transitioning, commenting on, or linking tickets. Also handles follow-up ticket creation to manage scope creep. TRIGGER when: user mentions a DOCSP-XXXXX ticket number or any Jira ticket URL; user asks to view, open, check, update, transition, close, comment on, link, or search tickets; user references \"the ticket\", \"the Jira\", or \"open a ticket\". SKIP: GitHub issues; non-Jira platforms; questions unrelated to ticket operations.

    Also in 3 projects that use this

  • MicrosoftSkill

    unslop

    Cut AI tells from any writing. Must always apply.

    Also in 3 projects that use this

  • SentrySkill

    diagnosing-bugs

    A discipline for hard bugs, flaky tests, CI hangs, and performance regressions in this SDK. Use when the user says "diagnose" or "debug this", reports something broken/throwing/failing/hanging/slow, or a test is flaky. Builds a tight, red-capable feedback loop before hypothesizing.

    Also in 3 projects that use this

  • AWSSkill

    grilling

    Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.

    Also in 3 projects that use this

  • DockerSkill

    research

    Research a documentation topic — locate affected files, understand the problem, identify what to change. Use when investigating an issue, a question, or a topic before writing a fix. Triggers on: "research issue 1234", "investigate what needs changing for #500", "what files are affected by #200", "where is X documented", "is our docs page about Y accurate", "look into how we document Z".

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 3 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 23 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep AGENTS.md short (~100-150 lines).

    line 19
  2. Distinctive:

    Don't list things the agent already knows (like "use const over let").

    line 82
  3. Distinctive:

    Keep nested files focused on what's different about that package.

    line 162

“Common” is measured: kept by at least 6 in 10 of the 23 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Writing Effective AGENTS.md Files

AGENTS.md is a README for coding agents. It lives at the repo root and tells agents how to build, test, lint, navigate, and contribute to the project. Based on the agents.md open format (https://agents.md) and lessons from OpenAI's harness engineering approach.

Core Principle: Map, Not Manual

Keep AGENTS.md short (~100-150 lines). It's a table of contents, not an encyclopedia.

The "one big instruction file" approach fails because:

  • Context is scarce. A giant file crowds out the actual task and code.
  • Everything-is-important becomes nothing-is-important. Agents pattern-match locally instead of navigating intentionally.
  • It rots instantly. A monolithic manual becomes a graveyard of stale rules.
  • It's hard to verify. A single blob doesn't lend itself to freshness checks.

Point to deeper docs elsewhere. The agent starts with AGENTS.md and drills into references as needed.

What to Include

1. Dev Environment & Commands

The most immediately useful section. Concrete commands, not prose.

## Commands
- Install: `npm install`
- Dev server: `npm run dev`
- Test single file: `npx vitest run path/to/test.ts`
- Test all: `npm test`
- Lint: `npm run lint`
- Format: `npm run format`
- Type check: `npm run typecheck`

Include any prerequisites or non-obvious setup. If the project uses Docker, Nix, or a custom build system, say so here.

2. Repository Structure

Key paths and what lives where. Keep it high-level — 1 line per directory.

## Repository Structure
- `src/api/` — HTTP API layer, routes and validation
- `src/store/` — Database access, all SQL lives here
- `src/worker/` — Background job processing
- `src/types/` — Shared domain types
- `tests/` — Test files mirror source structure
- `docs/` — Architecture and design documentation

For the full treatment of how to write an architecture codemap with boundaries and invariants, see the architecture-md skill.

3. Architecture Boundaries

What can depend on what. What's deliberately absent. These are the rules agents violate most often without explicit guidance.

## Architecture Boundaries
- API layer never accesses the database directly — always goes through `src/store/`
- `src/types/` has zero dependencies on other source modules
- Workers communicate via the store interface, never import API code
- No circular dependencies between top-level modules

4. Coding Standards (Non-Obvious Only)

Don't list things the agent already knows (like "use const over let"). List only project-specific conventions the agent couldn't infer from reading the code.

## Coding Standards
- Strict TypeScript — no `any`, no `as` casts except in test files
- Errors: use `Result<T, E>` pattern from `src/types/result.ts`, not thrown exceptions
- Logging: always use structured logger from `src/logger.ts`, never `console.log`
- Naming: database columns are snake_case, TypeScript properties are camelCase

5. Testing Instructions

How to run tests, where they live, patterns to follow, what to cover.

## Testing
- Tests live next to source: `src/foo.ts` -> `src/foo.test.ts`
- Use `describe`/`it` blocks, not `test()`
- Mock external services, never hit real APIs in tests
- New features require tests — cover success, failure, and edge cases
- Run relevant tests before submitting: `npx vitest run src/path/`

6. PR & Commit Conventions

## Commits & PRs
- Conventional commits: `feat:`, `fix:`, `refactor:`, `test:`, `docs:`
- PR title format: `type(scope): description`
- Run `npm run lint && npm test` before committing
- Keep PRs focused — one logical change per PR

7. Boundaries (Do / Don't / Ask First)

Explicit guardrails prevent costly mistakes.

## Boundaries
- **Never:** commit secrets, credentials, or tokens
- **Never:** use destructive git operations (force push, hard reset) without asking
- **Never:** edit generated files by hand when a generation workflow exists
- **Ask first:** large cross-module refactors, new dependencies, migration changes

8. References

Pointers to deeper documentation. This is where the "table of contents" pattern pays off — keep AGENTS.md lean, point elsewhere for depth.

## References
- Architecture: see `ARCHITECTURE.md`
- API docs: see `docs/api-reference.md`
- Design decisions: see `docs/design-docs/`
- Deployment: see `docs/deployment.md`

What to Omit

  • README content — Don't duplicate project description, installation for end users, badges
  • Language basics — Don't explain TypeScript/Python/Rust fundamentals
  • Every lint rule — Only list non-obvious, project-specific ones
  • Prose paragraphs — Use bullet points and code blocks. Agents parse structure, not essays
  • Things that change every PR — Only include stable conventions
  • Implementation details — "How the scheduler works" belongs in ARCHITECTURE.md, not here

Monorepo Pattern

Root AGENTS.md for global rules. Nested AGENTS.md per package for package-specific instructions. The closest file to the edited code wins.

AGENTS.md                    # global: commit conventions, CI, shared tooling
packages/api/AGENTS.md       # API-specific: routes, middleware, auth patterns
packages/worker/AGENTS.md    # worker-specific: job patterns, retry behavior
packages/shared/AGENTS.md    # shared lib: no side effects, pure functions only

Keep nested files focused on what's different about that package. Don't repeat global rules — the agent reads both the nearest file and the root.

Anti-Patterns

  • The novel — 500+ lines of prose. Nobody reads it, agent or human.
  • Stale rules — "Always use library X" when the team switched to Y months ago. Stale rules are worse than no rules — agents follow them faithfully.
  • Redundant guidance — Restating what the linter already enforces. If eslint catches it, don't list it.
  • Vague instructions — "Write clean code" is useless. "Use structured logger, never console.log" is actionable.
  • Missing commands — The agent should be able to build, test, and lint from AGENTS.md alone without reading CI config.

Quality Checklist

Before finishing, verify:

  • Can an agent build, test, lint, and format using only the commands listed?
  • Is the repository structure documented at the directory level?
  • Are architecture boundaries explicit (what can't depend on what)?
  • Are only non-obvious coding standards listed?
  • Are there clear "never do" guardrails?
  • Does it point to deeper docs rather than trying to contain everything?
  • Is it under ~150 lines?
  • Would a stale rule here cause real damage? If so, can it be enforced mechanically instead?

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.