agentleFS
goca-segoca-se/dotcontext/templates/AGENTS.md

dotcontext / templates

AGENTS.md9 starsChanged 4 months agoMITView on GitHub

[Project description - one line] IMPORTANT: Before implementing any change, check .context/decisions/ for related ADRs. If a requested change conflicts with an existing decision: 1. Stop and inform the user which ADR(s) would be affected 2. Ask explicitly if they want to: - Proceed and update the decision - Modify the approach to comply with existing decision - Cancel the change 3. If updating a decision, create a new version: - Change status to Superseded by ADR-XXX - Create new…

We split this AGENTS.md into the rules it gives an agent

9 rules. About 0 are common, 5 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    IMPORTANT: Before implementing any change, check .context/decisions/ for related ADRs.

    line 13
  2. Distinctive:

    If a requested change conflicts with an existing decision:

    line 15
  3. Distinctive:

    Ask explicitly: if they want to:

    line 17
  4. Distinctive:

    Create new ADR with updated decision

    line 23
  5. Very specific:

    Important: Check if this project uses Docker (docker-compose.yml, Dockerfile).

    line 35
  6. Distinctive:

    Always ask before assuming: - When there is ambiguity, multiple valid approaches, or decisions to be made, ask the user to clarify before …

    line 53
  7. Distinctive:

    Test results and error output

    line 82
  8. Very specific:

    When running spec-dc, write the spec artifact in the same language the user used to describe the feature (a Portuguese request produces a …

    line 117
  9. Very specific:

    When a workflow needs to clarify requirements, ask the user with your structured-question tool (AskUserQuestion / ask_user / question / …

    line 123

≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “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
AGENTS.md

{{projectName}}

[Project description - one line]

<!-- This is the canonical project-instructions file, read by AGENTS.md-compatible agents (Codex, opencode, Copilot, Cursor, …). Claude Code and Gemini CLI read it through thin import stubs (CLAUDE.md / GEMINI.md → @AGENTS.md). Edit this file. -->

Decision Compliance

IMPORTANT: Before implementing any change, check .context/decisions/ for related ADRs.

If a requested change conflicts with an existing decision:

  1. Stop and inform the user which ADR(s) would be affected
  2. Ask explicitly if they want to:
    • Proceed and update the decision
    • Modify the approach to comply with existing decision
    • Cancel the change
  3. If updating a decision, create a new version:
    • Change status to Superseded by ADR-XXX
    • Create new ADR with updated decision
    • Reference the previous ADR

Stack

  • [Language and version]
  • [Framework]
  • [Database]
  • [Other major dependencies]

Commands

Important: Check if this project uses Docker (docker-compose.yml, Dockerfile). If so, run commands via Docker (e.g., docker compose exec app npm test instead of npm test).

# Development
# [dev command]

# Testing
# [test command]

# Linting
# [lint command]

# Build/Deploy
# [build command]

Critical Rules

  1. Always ask before assuming - When there is ambiguity, multiple valid approaches, or decisions to be made, ask the user to clarify before proceeding (use your interactive question mechanism if you have one). Never assume user intent.
  2. [Rule 1] - [Why it matters]
  3. [Rule 2] - [Why it matters]
  4. [Rule 3] - [Why it matters]

Architecture

[Section 1]

[Brief description of key architectural pattern]

[Section 2]

[Brief description of another key pattern]

Efficiency Rules

  • Read before changing — Always read a file before editing it. Never modify code based on assumptions about its content.
  • Follow existing patterns — Before implementing something new, look at how similar things are done in the codebase. Match the existing style, conventions, and patterns.
  • Scope reads to the task — Only read files directly relevant to the change. Do not explore broadly before acting on focused tasks.
  • Load context progressively — Start with the minimum files needed. Only expand to related files when the current context is insufficient to complete the task.
  • Code only — When implementing changes, output code. Skip explanations, preamble, and commentary unless the user asks for them.
  • Skip summaries — After making changes, do not summarize what you did unless asked. Show git diff instead.
  • Run targeted tests — After a change, run only tests related to the modified files. Only run the full suite when asked or before committing.
  • Never read generated files — Do not read lock files, build output, vendored dependencies, or source maps. These are listed in .claudeignore.

Compact Instructions

When compacting, preserve:

  • Test results and error output
  • File paths and code changes made
  • Key decisions and their rationale

Remove:

  • Exploratory file reads that did not lead to changes
  • Verbose command output that has been summarized
  • Discussion of rejected approaches

Workflows

These are explicit, user-invoked workflows. On Claude Code they are slash commands in .claude/commands/; on opencode they are commands in .opencode/commands/; on GitHub Copilot they are prompt files in .github/prompts/. On agents without per-repo command files (Gemini, Cursor, Codex), the user describes the task and you execute the matching workflow below. Run them only when the user asks — never auto-fire a workflow that commits, opens a PR, or writes files.

WorkflowPurpose
setup-contextAnalyze the codebase and populate .context/
spec-dcWrite a behavior spec — the WHAT, with dual review (step 1 of spec → plan → execute)
plan-dcTurn a spec into an implementation plan — the HOW, with ADR review (step 2)
execute-dcImplement a plan in parallel waves, with dual review — the DO (step 3)
code-reviewMulti-agent review of the current changes
commitSmart, style-aware commit message
create-prCreate a PR with an auto-generated description
pr-commentAdd a comment to an existing PR
deep-contextStructured 4-step codebase exploration
fix-bugTest-driven bug fixing (reproduce → fix → verify)
add-decisionAdd an architectural decision record (ADR)
add-skillAdd a skill guide
add-commandCreate a custom command

When running spec-dc, write the spec artifact in the same language the user used to describe the feature (a Portuguese request produces a Portuguese spec), defaulting to the repository's primary language, then English. This applies to the spec's prose only — keep the seven section headings exactly as written in the template, and the filename slug in ASCII kebab-case; both are structural anchors that plan-dc relies on. plan-dc and execute-dc stay in English.

When a workflow needs to clarify requirements, ask the user with your structured-question tool (AskUserQuestion / ask_user / question / cursor/ask_question / request_user_input) rather than assuming — present concrete options. Do not degrade to silent assumptions.

Additional Context

  • Domain and architecture → .context/CONTEXT.md
  • Architectural decisions → .context/decisions/
  • Task-specific skills → .claude/skills/
  • Bug reproduction guide → .claude/skills/bug-reproduction/SKILL.md
  • Batch operations guide → .claude/skills/batch-operations/SKILL.md
  • Git platform detection → .claude/skills/git-platform/SKILL.md
  • API documentation (OpenAPI SSOT) → .claude/skills/update-api-documentation/SKILL.md

Download now (ZIP)

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 28,693 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository7 other files it gives its agents.

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.