Skip to content

Proposal: AGENTS.md v1.1: Making Implicit Semantics Explicit, Clarifying Scope, and Recommendation for Progressive Disclosure #135

Closed

Description

@johncmunson

Preamble (or, why this proposal?)

AGENTS.md has achieved broad adoption, but many of its most important behaviors are currently implicit. Tool authors and end users rely on shared assumptions about how AGENTS.md files are discovered, layered, and prioritized, yet those assumptions are undocumented.

This proposal makes those implicit conventions explicit, without introducing breaking changes.

Specifically, it aims to:

  • Codify existing best practices (hierarchical scope, precedence, progressive disclosure)
  • Establish a shared understanding of how agents should handle AGENTS.md files
  • Clarify that AGENTS.md is primarily about behavioral expectations, rules, and constraints
  • Position AGENTS.md as complementary to—rather than competing with—SKILL.md

The goal is alignment and predictability, not enforcement.

AGENTS.md v1.1 (Draft Proposal)

A simple, open format for guiding AI agents with contextual instructions and behavioral expectations.

Think of AGENTS.md as a README for agents: a dedicated, predictable place to provide the context, conventions, and constraints that help AI coding agents work effectively in your project.

# AGENTS.md

## Setup commands
- Install deps: `pnpm install`
- Start dev server: `pnpm dev`
- Run tests: `pnpm test`

## Code style
- TypeScript strict mode
- Single quotes, no semicolons
- Use functional patterns where possible

Overview

README.md files are for humans: quick starts, project descriptions, and contribution guidelines.

AGENTS.md complements this by providing the extra context that AI coding agents need—build commands, testing conventions, code style preferences, and behavioral constraints that might clutter a README or aren't relevant to human contributors.

Why a separate file?

  • Gives agents a clear, predictable place for instructions. Agents know to look for AGENTS.md files and can load them based on where they're operating.
  • Keeps READMEs focused on human contributors. Agent-specific details don't dilute documentation meant for people.
  • Enables contextual guidance. Different parts of a codebase can have different instructions, and AGENTS.md files can be placed throughout a project hierarchy.

AGENTS.md is an open format that works with any agent or tool that chooses to support it. Rather than introducing a proprietary configuration file, we chose a name and format that could work for anyone.


Philosophy

AGENTS.md is guided by a small set of design principles:

README for Agents

The guiding metaphor is simple: AGENTS.md is a README, but for agents instead of humans. It should contain the kind of information you'd tell a new teammate who happens to be an AI—how things work around here, what to watch out for, and what's expected.

Guidance, Not Governance

AGENTS.md files are a lightweight communication channel for humans to provide contextual guidance to agents. The format describes behavioral expectations and preferences. An AGENTS.md file is advice from the project maintainer—agents should generally follow it, but the specification does not attempt to mandate or enforce perfect compliance, both with respect to the specification itself and with respect to instructional guidance found within an AGENTS.md file.

Implementation Agnosticism

AGENTS.md does not prescribe how agent or harness authors should implement support for the format. Whether adherence to the specification is achieved through probabilistic prompting, deterministic harness mechanisms, or other approaches is left to implementers. The specification describes what should generally happen, not how or when it must happen.

Intuitive and Pragmatic

While this specification takes a stance on expected behaviors—how multiple AGENTS.md files interact, how guidance accumulates, how agents should discover and load instructions—we are committed to conventions that are intuitive, simple, and align with what most people would expect anyway. If you've never read this specification but guessed how AGENTS.md files should work in a nested directory structure, you'd probably guess correctly. The specification codifies common sense rather than inventing new paradigms.


How AGENTS.md Works

AGENTS.md files use the filesystem hierarchy to provide contextual, layered guidance. Understanding four key concepts will help you write effective AGENTS.md files and implement robust support for them.

Jurisdiction

An AGENTS.md file applies to all files and subdirectories within its containing folder. A file at ./frontend/AGENTS.md provides guidance for everything under ./frontend/, but has no bearing on ./backend/ or other sibling directories.

project/
├── AGENTS.md                  # Applies to entire project
├── frontend/
│   ├── AGENTS.md              # Applies to frontend/ and below
│   └── components/
│       └── Button.tsx         # Governed by frontend/AGENTS.md
├── backend/
│   ├── AGENTS.md              # Applies to backend/ and below
│   └── api/
│       ├── AGENTS.md          # Applies to api/ and below
│       └── routes.ts          # Governed by backend/api/AGENTS.md
└── README.md

Jurisdiction is strictly ancestor-based. When an agent operates on a file, only AGENTS.md files in that file's directory or parent directories apply.

Accumulation

Guidance accumulates as you traverse the directory tree. A local AGENTS.md file extends and builds upon the guidance in ancestor AGENTS.md files rather than replacing it entirely.

For example, if the root AGENTS.md establishes project-wide conventions (code style, commit message format) and ./frontend/AGENTS.md adds React-specific guidance, an agent working in ./frontend/ should consider both sets of guidance together.

Precedence

When guidance conflicts, more specific instructions take precedence over more general ones. Local AGENTS.md files override ancestor AGENTS.md files.

More broadly, the precedence chain in an agentic system that recognizes the AGENTS.md format would typically be as follows:

Highest priority
    ↓   LLM System Prompt
    ↓   Agent System Prompt  
    ↓   User Prompt
    ↓   Local AGENTS.md
    ↓   Ancestor AGENTS.md files (nearest first)
Lowest priority

User instructions override AGENTS.md guidance. A child AGENTS.md file can explicitly disable or modify guidance inherited from an ancestor. The specific syntax for expressing overrides is left to file authors.

Implicit Inheritance

Guidance in an ancestor AGENTS.md file is implicitly inherited by all AGENTS.md files beneath it. There is no need for child AGENTS.md files to restate guidance already declared in ancestors—agents should treat the guidance as cumulative.

This means a leaf AGENTS.md file can be small and focused, containing only what's specific to that directory. Project-wide conventions belong in the root AGENTS.md.


FAQ

How does AGENTS.md relate to README.md?

When in use for a project, AGENTS.md is the primary source of behavioral guidance for agents. README.md is not a peer to AGENTS.md for agents; it is a fallback.

How does AGENTS.md relate to SKILL.md?

AGENTS.md focuses on behavior (rules, constraints, workflows).
SKILL.md focuses on capabilities (what an agent knows how to do).

AGENTS.md can technically describe skills, but it is not optimized for that purpose. When both formats are used, AGENTS.md should avoid detailing skills and may reference SKILL.md instead.

The two formats are intended to be complementary.


Specification

Filename

The canonical filename is AGENTS.md (plural, uppercase, with .md extension). Implementations may support aliases (such as AGENT.md) for compatibility, but AGENTS.md is the standard.

Format

AGENTS.md files are Markdown documents. The body content has no required structure—use whatever headings and organization best communicate your guidance.

Optional Frontmatter

AGENTS.md files may optionally include YAML frontmatter to support progressive disclosure and efficient context management. Frontmatter enables agents and harnesses to build lightweight indexes of available guidance without loading full file contents upfront.

Frontmatter is optional because AGENTS.md files rely primarily on positional context—the path itself serves as the identifier. Frontmatter fields like description and tags aid in selection (helping agents decide when to load a file's full contents), but they're not required because filesystem position often provides sufficient context. Requiring frontmatter would break backwards compatibility with existing AGENTS.md files and add friction for simple use cases where the path alone is descriptive enough.

---
description: React component conventions and testing patterns for the frontend.
tags: [react, components, vitest, frontend]
---

# Component Structure
...

Frontmatter Fields

Field Required Description
description No A concise summary (recommended under 200 characters) of the guidance this file contains.
tags No A list of keywords that help agents identify when this guidance may be relevant.

Unrecognized frontmatter fields should be ignored for forward compatibility.

When Frontmatter Helps

Frontmatter becomes valuable when:

  • Filesystem position alone is ambiguous
  • A project contains many AGENTS.md files
  • The guidance within is specialized enough to warrant explicit description
  • You want to aid agent discovery without requiring full file loads

Validation

A valid AGENTS.md file:

  • Is named AGENTS.md (case-sensitive, unless an implementation supports aliases)
  • Contains valid Markdown
  • If frontmatter is present, uses standard YAML frontmatter syntax (triple-dash --- delimiters) with valid YAML

For File Authors

What to Include

AGENTS.md can contain any guidance that helps an agent work effectively in your project. Common sections include:

Project context — Brief orientation to what this part of the codebase does, key architectural decisions, or important background.

Build and development commands — How to install dependencies, run the development server, build for production.

Testing instructions — How to run tests, testing conventions, what to test.

Code style and conventions — Formatting preferences, naming conventions, patterns to follow or avoid.

Constraints and boundaries — Files or directories not to modify, actions requiring confirmation, security considerations.

Workflow preferences — Branch naming, commit message format, PR conventions.

Best Practices

Keep files focused. A single AGENTS.md file should remain readable and digestible. As a guideline, aim for under 500 lines. If guidance becomes extensive, consider splitting across multiple AGENTS.md files in subdirectories or referencing external documentation.

Put general guidance at the root. Project-wide conventions, code style, and universal constraints belong in the root AGENTS.md. Use nested files for directory-specific guidance.

Be specific and actionable. Vague guidance is hard for agents to follow. Prefer concrete instructions over general principles.

Update as your project evolves. Treat AGENTS.md as living documentation. When conventions change, update the relevant AGENTS.md files.

Examples

Root-Level AGENTS.md

# Overview

This is a TypeScript CLI tool for processing markdown files.

## Setup commands
- Install deps: `pnpm install`
- Start dev server: `pnpm dev`
- Run tests: `pnpm test`

## Code style
- TypeScript strict mode
- Single quotes, no semicolons
- Use functional patterns where possible

Nested AGENTS.md With Frontmatter

apps/frontend/AGENTS.md

---
description: React + TypeScript frontend app built with Vite.
tags: [frontend, react, vite]
---

# Overview

Main user-facing frontend package. Built with React, TypeScript, and Vite inside the monorepo.

## Dev environment tips
- Install deps: `pnpm install --filter frontend`
- Start dev server: `pnpm dev` (or `pnpm turbo run dev --filter frontend`)
- Default dev URL: `http://localhost:5173`
- Use configured path aliases instead of deep relative imports.

## Code style
- Function components and hooks only.
- TypeScript strict mode; avoid `any`.
- Keep components small and focused.
- Follow ESLint and Prettier defaults.

## Testing instructions
- Run all tests: `pnpm test`
- From repo root: `pnpm turbo run test --filter frontend`
- Single test: `pnpm vitest run -t "<test name>"`
- Add or update tests for changed components.

## PR instructions
- Title format: `[frontend] <Title>`
- Run `pnpm lint` and `pnpm test` before committing.
- Include screenshots for UI changes.

For Implementers

This section provides guidance for agent and harness authors implementing AGENTS.md support.

Progressive Disclosure

Rather than loading all AGENTS.md content upfront, agents benefit from discovering and loading files progressively based on where they are operating. This keeps context usage efficient and guidance relevant.

Recommended approach:

  1. Index — At session start, scan for AGENTS.md files and extract paths and any frontmatter metadata.
  2. Inject index — Provide the agent with a lightweight index of available AGENTS.md files.
  3. Load on demand — Instruct the agent to load AGENTS.md files as needed for the task at hand.

Index Format

When injecting an index of available AGENTS.md files into agent context, include the path and any available frontmatter. The specific format is left to implementers. Example formats:

JSON:

[
  {
    "path": "AGENTS.md"
  },
  {
    "path": "frontend/AGENTS.md",
    "description": "React frontend conventions and component patterns.",
    "tags": ["react", "frontend", "components"]
  },
  {
    "path": "backend/AGENTS.md",
    "description": "REST API endpoint conventions and patterns.",
    "tags": ["backend", "api", "rest", "express"]
  }
]

XML:

<available_agents_files>
  <file>
    <path>AGENTS.md</path>
  </file>
  <file>
    <path>frontend/AGENTS.md</path>
    <description>React frontend conventions and component patterns.</description>
    <tags>react, frontend, components</tags>
  </file>
  <file>
    <path>backend/api/AGENTS.md</path>
    <description>REST API endpoint conventions and patterns.</description>
    <tags>backend, api, rest, express</tags>
  </file>
</available_agents_files>

Markdown:

## Available AGENTS.md Files

- `AGENTS.md`
- `frontend/AGENTS.md`
  - Description: React frontend conventions and component patterns.
  - Tags: react, frontend, components
- `backend/AGENTS.md`
  - Description: REST API endpoint conventions and patterns.
  - Tags: backend, api, rest, express

Probabilistic vs Deterministic Enforcement

While adherence to the AGENTS.md specification is often achieved probabilistically through prompting, harness authors may implement deterministic enforcement of certain directives where appropriate. For example, by injecting applicable AGENTS.md files into context when certain tools are invoked.

Compaction and Summarization

This specification does not mandate how to handle compaction and summarization of AGENTS.md files. However, the following suggestions are provided for consideration:

What to Preserve During Compaction

When AGENTS.md content is compacted or summarized, implementations should prioritize preserving guidance that materially affects agent behavior.

Preserve first:

  • Explicit constraints and prohibitions (“must not,” “do not,” “always”)
  • Behavioral requirements (tests, workflows, review steps)
  • Scope-specific overrides and deviations from ancestor guidance
  • Required commands, flags, or execution ordering
  • Architectural boundaries or invariants that affect correctness

Lower priority and safe to compact or omit:

  • Explanatory or motivational prose
  • Redundant inherited guidance
  • Long examples or tutorials
  • Non-critical stylistic preferences
  • Information implied by directory structure or task context

When space is constrained, favor fewer, more directive instructions over broader but weaker guidance.

Avoid Duplicate Representations

An implementation should not retain both a summarized and a full representation of the same AGENTS.md file in context at the same time. If an AGENTS.md file has been compacted or summarized, implementers should either prevent the full file from being loaded again, or replace the summary with the full contents if the file becomes highly relevant later as the agent progresses through the task.

Allow Discard and Reload Based on Relevance

If context compaction determines that an AGENTS.md file is no longer relevant to the agent’s current scope of work, it may be discarded. If that file becomes relevant again later as the agent progresses, it should be reloaded and made available to the agent at that time.


About

AGENTS.md emerged from collaborative efforts across the AI software development ecosystem, including OpenAI Codex, Amp, Jules from Google, Cursor, and Factory.

The format is stewarded by the Agentic AI Foundation under the Linux Foundation, with a commitment to maintaining AGENTS.md as an open standard that benefits the entire developer community.


Changelog

v1.1 (Proposal)

This proposal codifies implicit assumptions that the community has broadly adopted while preserving full backwards compatibility. All existing AGENTS.md files remain valid.

Clarifications:

  • Explicit documentation of jurisdiction, accumulation, precedence, and inheritance semantics
  • Recognition of three primary audiences: agents, file authors, and implementers
  • Acknowledgement that agentic systems are inherently probabilistic and adherence to the specification represents expectations, not guarantees

Additions:

  • Optional YAML frontmatter (description, tags) to support progressive disclosure
  • Guidance for implementers on index formats and progressive loading
  • Design principles section articulating the spec's philosophy

Unchanged:

  • Filename convention (AGENTS.md)
  • Markdown format with no required structure
  • Flexibility in content and organization

Activity

  1. changed the title [-]PROPOSAL: AGENTS.md v1.1 – Backwards-Compatible Clarifications for Scope, Precedence, and Discovery[/-] [+]AGENTS.md v1.1: Making Implicit Semantics Explicit, Clarifying Scope, and Recommendation for Progressive Disclosure[/+] on Jan 9, 2026
  2. changed the title [-]AGENTS.md v1.1: Making Implicit Semantics Explicit, Clarifying Scope, and Recommendation for Progressive Disclosure[/-] [+]Proposal: AGENTS.md v1.1: Making Implicit Semantics Explicit, Clarifying Scope, and Recommendation for Progressive Disclosure[/+] on Jan 9, 2026
  3. dgenio commented on Mar 2, 2026

    @dgenio

    Research data for the "Best Practices" and "What to Include" sections

    I recently reviewed 7 academic papers and official blog posts (2025–2026) on AI context engineering, then applied the findings to a production monorepo (PR). Several findings are directly relevant to the v1.1 spec — sharing them here as potential inputs.


    1. Word-count guidance: 335–535 words is the sweet spot

    The current "Best Practices" section says:

    Keep files focused. … aim for under 500 lines.

    500 lines ≈ 5,000 words, which is very generous. Research from Chatlatanagulchai et al. (2025) (arxiv 2511.12884) analyzed high-quality context files and found:

    • Optimal length: 335–535 words (median range)
    • Files beyond this range show diminishing returns

    This aligns with Anthropic's CLAUDE.md guidance: "smallest possible set of high-signal tokens."

    Suggestion: Consider adding word-count guidance alongside the line guidance, e.g.: "Aim for 300–500 words per file. If guidance becomes extensive, split across nested AGENTS.md files."


    2. File localization should be a stronger recommendation

    The spec lists "Project context" as one of many optional "What to Include" sections. However, ContextBench (2025) (arxiv 2602.05892) found:

    File localization (knowing which file to edit) is the #1 failure mode for AI agents. When the agent edits the wrong file, everything downstream fails — it's a cascade.

    Suggestion: Elevate "key file locations" from optional to a stronger recommendation. Something like: "Include key file paths (entry points, base classes, configuration files) — agents that can't locate the right file fail at everything else."


    3. Testing instructions are the #1 most common category

    The spec's example already includes a testing section (great!), but Chatlatanagulchai et al. (2025) found:

    Testing instructions appear in 75% of high-quality context files — the most common category by far.

    Suggestion: The "What to Include" section could note this explicitly: "Testing instructions are the single most common section in effective AGENTS.md files — include them even if nothing else."


    4. Benchmark data validating the format

    Lulla et al. (2025) (arxiv 2601.20404) measured the impact of well-structured AGENTS.md files on SWE-bench Verified with Claude 3.5 Sonnet:

    • 28.64% reduction in task completion runtime
    • 16.58% reduction in token usage

    These numbers could be powerful for the spec's motivation section or the website. They answer the "why bother?" question with hard data.


    5. Warning against AI-generated AGENTS.md files

    Gloaguen (2025) (arxiv 2602.11988) found:

    LLM-generated documentation hurts agent performance by ~3% compared to human-written docs. AI-generated docs introduce subtle inaccuracies that mislead the model itself.

    Suggestion: Consider adding to Best Practices: "Write AGENTS.md by hand. AI-generated context files can introduce subtle inaccuracies that degrade agent performance."


    Summary table

    Finding Source Suggested spec impact
    335–535 words optimal Chatlatanagulchai 2025 Refine "under 500 lines" to word-based guidance
    File localization = #1 failure mode ContextBench 2025 Strengthen "key file paths" recommendation
    Testing in 75% of quality files Chatlatanagulchai 2025 Emphasize testing as the #1 section to include
    28.64% runtime / 16.58% token reduction Lulla 2025 Cite in motivation / "Why AGENTS.md?"
    AI-generated docs hurt by ~3% Gloaguen 2025 Add "write by hand" best practice
    4,860 context files analyzed; AGENTS.md is the interoperable standard Galster 2025 Validates the spec's direction

    Happy to provide more detail on any of these. Full paper references available on request.

  4. johncmunson commented on Mar 4, 2026

    @johncmunson
    Author

    IMO, the number one anti-pattern that I've seen people make is letting the agent or LLM generate the AGENTS.md file rather than authoring it by hand.

  5. AlexKenbo commented on Apr 21, 2026

    @AlexKenbo

    @dgenio's data point that file localization is the #1 failure mode is a strong argument for the content-level clarifications in v1.1 — what should live inside AGENTS.md. A complementary plane worth considering as v1.2 scope is orthogonal to content: how a harness should treat an AGENTS.md fragment once it is already on the prompt tape.

    The v1.1 "Compaction and Summarization" section already covers preservation, discard, and reload by relevance. But in a production harness the same fragment participates in at least three further internal classifiers, each of which currently has to be re-derived by every implementer:

    1. Rollback / trimming. An AGENTS.md fragment carried inside a user message must not create a user-turn boundary. In one production harness the rule is: is_user_turn_boundary is true only for a user Message whose content is not recognised as a contextual user fragment (or for assistant InterAgentCommunication) — so drop_last_n_user_turns skips AGENTS.md-bearing messages instead of over-trimming real user intent.

    2. Memory stage-1 exclusion. AGENTS_MD_FRAGMENT and SKILL_FRAGMENT are excluded from memory stage-1 inputs because they are prompt scaffolding, not conversation content, and do not improve resulting memory; ENVIRONMENT_CONTEXT_FRAGMENT and SUBAGENT_NOTIFICATION_FRAGMENT are kept because they carry useful execution context or subtask outcomes. Without this split, style rules leak into long-term memory as if the user had uttered them.

    3. Fragment registry. A single contextual-user-fragments registry (AGENTS_MD / ENVIRONMENT_CONTEXT / SKILL / USER_SHELL_COMMAND / TURN_ABORTED / SUBAGENT_NOTIFICATION — six types) drives both classifiers above consistently, so token-accounting and rollback agree turn-to-turn.

    Each rule is individually defensible; without codification every harness diverges. Exact formulations from one production harness: https://github.com/AlexKenbo/codex-harness-internals/blob/main/SRC-0011/rules.json

    — @AlexKenbo

  6. stackbilt-admin commented on Jun 11, 2026

    @stackbilt-admin

    Proposal: Progressive disclosure via an optional module index

    AGENTS.md works because it is one predictable file. It degrades for the same reason:

    1. Truncation is silent. Codex caps project docs at 32 KiB by default; content past the cap is dropped without warning. Other hosts enforce smaller caps. Authors have no signal that half their rules never reached the model.
    2. Attention dilutes before truncation does. Field guidance already converges on keeping AGENTS.md under ~150–200 lines because adherence falls off in long flat files. Real repos need far more than 200 lines of rules — they just don't need them all at once.
    3. The workaround is fragmenting the standard. Teams are inventing ad-hoc splits today: AGENTS.md.d/ directories, per-tool symlinks, skill-style frontmatter staging. Each is tool-specific, none is discoverable by other agents, and the spec's main asset — predictability — erodes with every private convention.

    The spec needs an official answer to "my rules don't fit in one attention span," or it will accumulate unofficial ones.

    Design constraints

    Any solution should preserve what made AGENTS.md win:

    • Flat files stay valid. A plain AGENTS.md with no modules must remain fully conformant forever.
    • Graceful degradation. A tool that has never heard of this proposal must still get useful behavior from a modular repo, with zero code changes.
    • Deterministic resolution. Selecting which modules apply must not require an LLM call. String matching only.
    • No new file format. Modules are plain Markdown.

    Proposal

    1. Module directory

    A repo MAY add a module directory alongside AGENTS.md (aligning with the dedicated-directory direction in #71, which proposes .agent/ — see open question 1):

    AGENTS.md          # entry point — always read first (unchanged)
    .agents/
      testing.md       # loaded when the task involves tests
      frontend.md      # loaded when the task involves UI work
      security.md      # loaded when the task touches auth/secrets
    

    2. Module index in AGENTS.md

    AGENTS.md declares its modules in an index — ordinary Markdown, fenced by HTML comments so tools can parse it deterministically:

    <!-- agents-modules -->
    ## Additional instructions
    
    Read the matching file before working in these areas:
    
    - `.agents/testing.md` — test conventions. Triggers: test, vitest, coverage, mock
    - `.agents/frontend.md` — UI rules. Triggers: react, css, component, a11y
    - `.agents/security.md` — auth/secrets handling. Triggers: auth, token, secret, cookie
    <!-- /agents-modules -->

    Conforming tools parse the index and inject matching modules' contents when the task description or touched file paths match a trigger (case-insensitive substring match — deliberately primitive, deliberately deterministic — a knowing simplification of the stricter prefix-stem rule Charter uses in production).

    Non-conforming tools see an ordinary Markdown list instructing the agent to read specific files in specific situations. Current frontier models follow that instruction unaided — modular repos work today on tools that have never implemented this spec. That is the graceful-degradation property: the fallback is not "broken," it is "slightly less token-efficient."

    3. Optional budget hint

    A module line MAY end with a size hint, e.g. (~600 tokens). Tools MAY use hints to warn when always-loaded content approaches host caps (the silent-truncation problem becomes a lint error instead). Hints are advisory; tools MUST NOT fail on their absence.

    Explicitly out of scope

    • No new syntax beyond the two comment fences. No YAML frontmatter requirement, no schema file, no manifest format.
    • No nesting (modules cannot declare sub-modules) in v1 — keep resolution single-pass.
    • No conditional logic beyond keyword triggers. If/else belongs in tools, not the spec.

    Prior art and evidence

    This mechanism is not speculative — it is extracted from a system running in production:

    • Charter (Apache-2.0, github.com/Stackbilt-dev/charter) has shipped trigger-based modular agent context since early 2026: a manifest declares always-loaded vs. on-demand modules with trigger keywords and per-bundle token budgets; a bundler composes exactly the modules a task needs. The repo governs itself with the mechanism on every commit.
    • The migration direction is solved: Charter's adf migrate classifies an existing flat config file (CLAUDE.md, AGENTS.md, .cursorrules) by rule strength and routes content into modules automatically — so adoption does not require hand-splitting files.
    • The compatibility direction is implemented: charter adf compile --target agents renders the modular source back to a flat AGENTS.md (with the module index exactly as above) for tools that want one file, and --check gates CI on drift between the two.

    I'd be glad to contribute a conformance test suite (fixture repos + expected module-selection outputs) and adapt Charter's tooling as a neutral reference implementation under whatever home the Agentic AI Foundation (AAIF) prefers.

    Open questions for maintainers

    1. .agents/ vs .agent/ vs AGENTS.md.d/ — this proposal works with any; Proposal: Standardize a .agent Directory for Comprehensive Project Context #71 should settle the name.
    2. Should triggers match on the user's task text, on touched file paths, or both? (Charter's experience: both, union semantics, is what users expect.)
    3. Does the index belong in AGENTS.md itself (this proposal — keeps one entry point) or in a separate manifest file (cleaner parsing, but breaks the "one file to read first" invariant)?
    4. Minimum conformance: is parsing the fenced index required for v1.1 compliance, or a MAY with the Markdown fallback as the floor?
  7. AF0BL commented on Aug 24, 2026

    @AF0BL

    AGENTS.md is initial context, pure and simple.
    Declaring a convention of whether it lands before harness instructions or after, and whether ./A/AGENTS.md or ./a/AGENTS.md or ./A/b/AGENTS.md loads first, would be valuable.
    IMO everything else should be left up to harness and user.

  8. heo4200000 commented on Aug 24, 2026

    @heo4200000

    Preambulė (arba kodėl šis pasiūlymas?)

    AGENTS.md yra plačiai naudojamas, tačiau daugelis svarbiausių jo veikimo principų šiuo metu yra numanomi. Įrankių autoriai ir galutiniai vartotojai remiasi bendromis prielaidomis apie tai, kaip AGENTS.md failai aptinkami, sluoksniuojami ir suskirstomi pagal prioritetus, tačiau šios prielaidos nėra dokumentuotos.

    Šis pasiūlymas šias numanomas konvencijas padaro aiškias, neįvedant esminių pakeitimų.

    Konkrečiai, juo siekiama:

    • Kodifikuoti esamą geriausią praktiką (hierarchinė taikymo sritis, precedentas, laipsniškas atskleidimas)
    • Sukurti bendrą supratimą, kaip agentai turėtų tvarkyti AGENTS.md failus
    • Paaiškinkite, kad AGENTS.md pirmiausia yra apie elgesio lūkesčius, taisykles ir apribojimus.
    • Pozicionuoti AGENTS.md kaip SKILL.md papildančią, o ne konkuruojančią platformą

    Tikslas yra suderinimas ir nuspėjamumas, o ne vykdymas.

    AGENTAI.md v1.1 (Pasiūlymo projektas)

    Paprastas, atviras formatas, skirtas dirbtinio intelekto agentams vadovauti pateikiant kontekstines instrukcijas ir elgesio lūkesčius.

    Įsivaizduokite AGENTS.md kaip agentų README failą : specialią, nuspėjamą vietą, kurioje pateikiamas kontekstas, konvencijos ir apribojimai, padedantys dirbtinio intelekto kodavimo agentams efektyviai dirbti jūsų projekte.

    AGENTS.md

    Setup commands

    • Install deps: pnpm install
    • Start dev server: pnpm dev
    • Run tests: pnpm test

    Code style

    • TypeScript strict mode
    • Single quotes, no semicolons
    • Use functional patterns where possible

    Apžvalga

    README.md failai skirti žmonėms: greitos pradžios instrukcijos, projektų aprašymai ir įnašo gairės.

    „AGENTS.md“ tai papildo pateikdamas papildomą kontekstą, kurio reikia dirbtinio intelekto kodavimo agentams – kūrimo komandas, testavimo konvencijas, kodo stiliaus nuostatas ir elgesio apribojimus, kurie gali užgriozdinti README failą arba būti neaktualūs žmonėms.

    Kodėl atskiras failas?

    • Suteikia agentams aiškią, nuspėjamą vietą instrukcijoms. Agentai žino, kur ieškoti AGENTS.md failų, ir gali juos įkelti atsižvelgdami į tai, kur jie dirba.
    • Sutelkia README failus į žmones, kurie prisideda. Su agentais susijusi informacija nesumenkina žmonėms skirtos dokumentacijos.
    • Įgalina kontekstinį valdymą. Skirtingos kodo bazės dalys gali turėti skirtingas instrukcijas, o AGENTS.md failus galima patalpinti visoje projekto hierarchijoje.

    AGENTS.md yra atviras formatas, veikiantis su bet kuriuo agentu ar įrankiu, kuris pasirenka jį palaikyti. Užuot įvedę patentuotą konfigūracijos failą, pasirinkome pavadinimą ir formatą, kurie tiktų visiems.

    Filosofija

    AGENTS.md vadovaujasi nedideliu dizaino principų rinkiniu:

    README agentams

    Pagrindinė metafora paprasta: AGENTS.md yra README failas, skirtas agentams, o ne žmonėms. Jame turėtų būti tokia informacija, kokią pasakytumėte naujam komandos nariui, kuris yra dirbtinis intelektas – kaip viskas veikia čia, į ką atkreipti dėmesį ir ko tikėtis.

    Guidance, Not Governance

    AGENTS.md files are a lightweight communication channel for humans to provide contextual guidance to agents. The format describes behavioral expectations and preferences. An AGENTS.md file is advice from the project maintainer—agents should generally follow it, but the specification does not attempt to mandate or enforce perfect compliance, both with respect to the specification itself and with respect to instructional guidance found within an AGENTS.md file.

    Implementation Agnosticism

    AGENTS.md does not prescribe how agent or harness authors should implement support for the format. Whether adherence to the specification is achieved through probabilistic prompting, deterministic harness mechanisms, or other approaches is left to implementers. The specification describes what should generally happen, not how or when it must happen.

    Intuitive and Pragmatic

    While this specification takes a stance on expected behaviors—how multiple AGENTS.md files interact, how guidance accumulates, how agents should discover and load instructions—we are committed to conventions that are intuitive, simple, and align with what most people would expect anyway. If you've never read this specification but guessed how AGENTS.md files should work in a nested directory structure, you'd probably guess correctly. The specification codifies common sense rather than inventing new paradigms.

    How AGENTS.md Works

    AGENTS.md files use the filesystem hierarchy to provide contextual, layered guidance. Understanding four key concepts will help you write effective AGENTS.md files and implement robust support for them.

    Jurisdiction

    An AGENTS.md file applies to all files and subdirectories within its containing folder. A file at ./frontend/AGENTS.md provides guidance for everything under ./frontend/, but has no bearing on ./backend/ or other sibling directories.

    project/
    ├── AGENTS.md                  # Applies to entire project
    ├── frontend/
    │   ├── AGENTS.md              # Applies to frontend/ and below
    │   └── components/
    │       └── Button.tsx         # Governed by frontend/AGENTS.md
    ├── backend/
    │   ├── AGENTS.md              # Applies to backend/ and below
    │   └── api/
    │       ├── AGENTS.md          # Applies to api/ and below
    │       └── routes.ts          # Governed by backend/api/AGENTS.md
    └── README.md
    

    Jurisdiction is strictly ancestor-based. When an agent operates on a file, only AGENTS.md files in that file's directory or parent directories apply.

    Accumulation

    Guidance accumulates as you traverse the directory tree. A local AGENTS.md file extends and builds upon the guidance in ancestor AGENTS.md files rather than replacing it entirely.

    For example, if the root AGENTS.md establishes project-wide conventions (code style, commit message format) and ./frontend/AGENTS.md adds React-specific guidance, an agent working in ./frontend/ should consider both sets of guidance together.

    Precedence

    When guidance conflicts, more specific instructions take precedence over more general ones. Local AGENTS.md files override ancestor AGENTS.md files.

    More broadly, the precedence chain in an agentic system that recognizes the AGENTS.md format would typically be as follows:

    Highest priority
        ↓   LLM System Prompt
        ↓   Agent System Prompt  
        ↓   User Prompt
        ↓   Local AGENTS.md
        ↓   Ancestor AGENTS.md files (nearest first)
    Lowest priority
    

    User instructions override AGENTS.md guidance. A child AGENTS.md file can explicitly disable or modify guidance inherited from an ancestor. The specific syntax for expressing overrides is left to file authors.

    Implicit Inheritance

    Guidance in an ancestor AGENTS.md file is implicitly inherited by all AGENTS.md files beneath it. There is no need for child AGENTS.md files to restate guidance already declared in ancestors—agents should treat the guidance as cumulative.

    This means a leaf AGENTS.md file can be small and focused, containing only what's specific to that directory. Project-wide conventions belong in the root AGENTS.md.

    FAQ

    How does AGENTS.md relate to README.md?

    When in use for a project, AGENTS.md is the primary source of behavioral guidance for agents. README.md is not a peer to AGENTS.md for agents; it is a fallback.

    How does AGENTS.md relate to SKILL.md?

    AGENTS.md focuses on behavior (rules, constraints, workflows). SKILL.md focuses on capabilities (what an agent knows how to do).

    AGENTS.md can technically describe skills, but it is not optimized for that purpose. When both formats are used, AGENTS.md should avoid detailing skills and may reference SKILL.md instead.

    The two formats are intended to be complementary.

    Specification

    Filename

    The canonical filename is AGENTS.md (plural, uppercase, with .md extension). Implementations may support aliases (such as AGENT.md) for compatibility, but AGENTS.md is the standard.

    Format

    AGENTS.md files are Markdown documents. The body content has no required structure—use whatever headings and organization best communicate your guidance.

    Optional Frontmatter

    AGENTS.md files may optionally include YAML frontmatter to support progressive disclosure and efficient context management. Frontmatter enables agents and harnesses to build lightweight indexes of available guidance without loading full file contents upfront.

    Frontmatter is optional because AGENTS.md files rely primarily on positional context—the path itself serves as the identifier. Frontmatter fields like description and tags aid in selection (helping agents decide when to load a file's full contents), but they're not required because filesystem position often provides sufficient context. Requiring frontmatter would break backwards compatibility with existing AGENTS.md files and add friction for simple use cases where the path alone is descriptive enough.


    description: React component conventions and testing patterns for the frontend.
    tags: [react, components, vitest, frontend]

    Component Structure

    ...

    Frontmatter Fields

    Field Required Description
    description No A concise summary (recommended under 200 characters) of the guidance this file contains.
    tags No A list of keywords that help agents identify when this guidance may be relevant.
    Unrecognized frontmatter fields should be ignored for forward compatibility.

    When Frontmatter Helps

    Frontmatter becomes valuable when:

    • Filesystem position alone is ambiguous
    • A project contains many AGENTS.md files
    • The guidance within is specialized enough to warrant explicit description
    • You want to aid agent discovery without requiring full file loads

    Validation

    A valid AGENTS.md file:

    • Is named AGENTS.md (case-sensitive, unless an implementation supports aliases)
    • Contains valid Markdown
    • If frontmatter is present, uses standard YAML frontmatter syntax (triple-dash --- delimiters) with valid YAML

    For File Authors

    What to Include

    AGENTS.md can contain any guidance that helps an agent work effectively in your project. Common sections include:

    Project context — Brief orientation to what this part of the codebase does, key architectural decisions, or important background.

    Build and development commands — How to install dependencies, run the development server, build for production.

    Testing instructions — How to run tests, testing conventions, what to test.

    Code style and conventions — Formatting preferences, naming conventions, patterns to follow or avoid.

    Constraints and boundaries — Files or directories not to modify, actions requiring confirmation, security considerations.

    Workflow preferences — Branch naming, commit message format, PR conventions.

    Best Practices

    Keep files focused. A single AGENTS.md file should remain readable and digestible. As a guideline, aim for under 500 lines. If guidance becomes extensive, consider splitting across multiple AGENTS.md files in subdirectories or referencing external documentation.

    Put general guidance at the root. Project-wide conventions, code style, and universal constraints belong in the root AGENTS.md. Use nested files for directory-specific guidance.

    Be specific and actionable. Vague guidance is hard for agents to follow. Prefer concrete instructions over general principles.

    Update as your project evolves. Treat AGENTS.md as living documentation. When conventions change, update the relevant AGENTS.md files.

    Examples

    Root-Level AGENTS.md

    Overview

    This is a TypeScript CLI tool for processing markdown files.

    Setup commands

    • Install deps: pnpm install
    • Start dev server: pnpm dev
    • Run tests: pnpm test

    Code style

    • TypeScript strict mode
    • Single quotes, no semicolons
    • Use functional patterns where possible

    Nested AGENTS.md With Frontmatter

    apps/frontend/AGENTS.md


    description: React + TypeScript frontend app built with Vite.
    tags: [frontend, react, vite]

    Overview

    Main user-facing frontend package. Built with React, TypeScript, and Vite inside the monorepo.

    Dev environment tips

    • Install deps: pnpm install --filter frontend
    • Start dev server: pnpm dev (or pnpm turbo run dev --filter frontend)
    • Default dev URL: http://localhost:5173
    • Use configured path aliases instead of deep relative imports.

    Code style

    • Function components and hooks only.
    • TypeScript strict mode; avoid any.
    • Keep components small and focused.
    • Follow ESLint and Prettier defaults.

    Testing instructions

    • Run all tests: pnpm test
    • From repo root: pnpm turbo run test --filter frontend
    • Single test: pnpm vitest run -t "<test name>"
    • Add or update tests for changed components.

    PR instructions

    • Title format: [frontend] <Title>
    • Run pnpm lint and pnpm test before committing.
    • Include screenshots for UI changes.

    For Implementers

    This section provides guidance for agent and harness authors implementing AGENTS.md support.

    Progressive Disclosure

    Rather than loading all AGENTS.md content upfront, agents benefit from discovering and loading files progressively based on where they are operating. This keeps context usage efficient and guidance relevant.

    Recommended approach:

    1. Index — At session start, scan for AGENTS.md files and extract paths and any frontmatter metadata.
    2. Inject index — Provide the agent with a lightweight index of available AGENTS.md files.
    3. Load on demand — Instruct the agent to load AGENTS.md files as needed for the task at hand.

    Index Format

    When injecting an index of available AGENTS.md files into agent context, include the path and any available frontmatter. The specific format is left to implementers. Example formats:

    JSON:

    [
    {
    "path": "AGENTS.md"
    },
    {
    "path": "frontend/AGENTS.md",
    "description": "React frontend conventions and component patterns.",
    "tags": ["react", "frontend", "components"]
    },
    {
    "path": "backend/AGENTS.md",
    "description": "REST API endpoint conventions and patterns.",
    "tags": ["backend", "api", "rest", "express"]
    }
    ]
    XML:

    <available_agents_files>

    AGENTS.md


    frontend/AGENTS.md
    React frontend conventions and component patterns.
    react, frontend, components


    backend/api/AGENTS.md
    REST API endpoint conventions and patterns.
    backend, api, rest, express

    </available_agents_files>
    Markdown:

    Available AGENTS.md Files

    • AGENTS.md
    • frontend/AGENTS.md
      • Description: React frontend conventions and component patterns.
      • Tags: react, frontend, components
    • backend/AGENTS.md
      • Description: REST API endpoint conventions and patterns.
      • Tags: backend, api, rest, express

    Probabilistic vs Deterministic Enforcement

    While adherence to the AGENTS.md specification is often achieved probabilistically through prompting, harness authors may implement deterministic enforcement of certain directives where appropriate. For example, by injecting applicable AGENTS.md files into context when certain tools are invoked.

    Compaction and Summarization

    This specification does not mandate how to handle compaction and summarization of AGENTS.md files. However, the following suggestions are provided for consideration:

    What to Preserve During Compaction

    When AGENTS.md content is compacted or summarized, implementations should prioritize preserving guidance that materially affects agent behavior.

    Preserve first:

    • Explicit constraints and prohibitions (“must not,” “do not,” “always”)
    • Behavioral requirements (tests, workflows, review steps)
    • Scope-specific overrides and deviations from ancestor guidance
    • Required commands, flags, or execution ordering
    • Architectural boundaries or invariants that affect correctness

    Lower priority and safe to compact or omit:

    • Explanatory or motivational prose
    • Redundant inherited guidance
    • Long examples or tutorials
    • Non-critical stylistic preferences
    • Information implied by directory structure or task context

    When space is constrained, favor fewer, more directive instructions over broader but weaker guidance.

    Avoid Duplicate Representations

    An implementation should not retain both a summarized and a full representation of the same AGENTS.md file in context at the same time. If an AGENTS.md file has been compacted or summarized, implementers should either prevent the full file from being loaded again, or replace the summary with the full contents if the file becomes highly relevant later as the agent progresses through the task.

    Allow Discard and Reload Based on Relevance

    If context compaction determines that an AGENTS.md file is no longer relevant to the agent’s current scope of work, it may be discarded. If that file becomes relevant again later as the agent progresses, it should be reloaded and made available to the agent at that time.

    About

    AGENTS.md emerged from collaborative efforts across the AI software development ecosystem, including OpenAI Codex, Amp, Jules from Google, Cursor, and Factory.

    The format is stewarded by the Agentic AI Foundation under the Linux Foundation, with a commitment to maintaining AGENTS.md as an open standard that benefits the entire developer community.

    Changelog

    v1.1 (Proposal)

    This proposal codifies implicit assumptions that the community has broadly adopted while preserving full backwards compatibility. All existing AGENTS.md files remain valid.

    Clarifications:

    • Explicit documentation of jurisdiction, accumulation, precedence, and inheritance semantics
    • Recognition of three primary audiences: agents, file authors, and implementers
    • Acknowledgement that agentic systems are inherently probabilistic and adherence to the specification represents expectations, not guarantees

    Additions:

    • Optional YAML frontmatter (description, tags) to support progressive disclosure
    • Guidance for implementers on index formats and progressive loading
    • Design principles section articulating the spec's philosophy

    Unchanged:

    • Filename convention (AGENTS.md)
    • Markdown format with no required structure
    • Flexibility in content and organization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions