Skip to content

Proposal: Standardize a .agent Directory for Comprehensive Project Context #71

Open

Description

@haoranba

Summary

This proposal suggests establishing a standardized .agent directory within project repositories to serve as a single, version-controlled source of truth for AI agents. The goal is to provide them with accurate, comprehensive, and up-to-date context that goes beyond just the source code, enabling more complex and reliable autonomous operations.

The Problem

Currently, AI agents often lack a standardized mechanism for accessing comprehensive project-wide context. Their understanding is typically limited to the code they can read and any context provided in a prompt. They struggle to access critical non-code assets in a structured way, such as:

  • Product requirements (PRDs)
  • Technical design documents and architecture diagrams
  • UI/UX mockups (e.g., Figma links)
  • Project management tasks (e.g., Jira tickets)
  • Live system monitoring dashboards and configurations

This information gap forces agents to make assumptions, leads to outputs that are misaligned with project goals, and limits their ability to perform high-level tasks like validating code against specifications or performing root cause analysis.

The Proposal: The .agent Standard

We propose the adoption of a "Directory as Context" strategy, centered around a .agent directory at the root of a project. This directory would act as a centralized, standardized index for all project-related assets, both textual and external.

Reference Directory Structure

Here is a proposed reference model for the structure:


├── AGENT.md       # A core file guiding the Agent's behavior, defining coding standards, the directory structure, and context consumption meta-rules.
└── .agent/
    ├── spec/          # The project's "blueprint": formal, version-controlled specification documents.
    │   ├── requirement.md # PRD, user stories, business rules.
    │   ├── design.md      # Technical design, architecture, API definitions, links to UI/UX mockups.
    │   └── tasks.md       # Development tasks broken down from requirements.
    │
    ├── wiki/          # The project's "encyclopedia": stable, global guides for knowledge accumulation.
    │   ├── architecture.md # System architecture, core components, and interactions.
    │   └── domain.md       # Core business domain concepts, processes, etc.
    │
    ├── links/         # The project's "address book": manages all external asset links.
    │   └── resources.md   # Lists external URIs and the tools (e.g., MCPs) required to access them.
    │
    └── ... (Extensible with other directories like middleware/, integrations/, tests/, etc.)

How It Works

The agent would consume this context in a hybrid model:

  • Agent's "Long-Term Memory": The AGENT.md file serves as a meta-guide, loaded by default. It instructs the agent on how to behave, what coding standards to follow, and how to interpret and utilize the rest of the .agent directory.

  • Local Context Consumption: The agent uses its built-in file system tools (search, grep, read_file) to directly read text-based assets within .agent/ (e.g., spec/requirement.md, wiki/architecture.md). This allows it to build a "mental model" of the project, much like a human engineer reading documentation.

  • External Context Consumption: The agent parses links/resources.md to discover URIs for non-textual or dynamic assets. It then uses the appropriate tools (or "MCPs") to fetch external information, such as reading metadata from a Figma design, getting the latest status of a Jira task, or pulling data from a monitoring dashboard.

Why This Matters for the openai/agents Initiative

Interoperability & Standardization: This creates a common standard that any agent (from any developer or organization) can rely on. An agent could clone any compliant repository and immediately know where to find the project's foundational context.

  • Enhanced Agent Capabilities: With access to this rich context, agents can perform significantly more advanced tasks:

  • Validate code against requirements in spec/requirement.md.

  • Generate code that adheres to the architecture described in wiki/architecture.md.

  • Analyze the impact of a change by understanding component interactions.

  • Perform root cause analysis by correlating a bug with recent PRs and links to monitoring data.

Extensibility: The structure is not rigid. Teams can add custom directories (security/, performance/) to suit their specific needs, making the standard adaptable.

Improved Human-Agent Collaboration: It provides a clear, version-controlled contract between human developers and AI agents. Humans provide the context in a structured way, and agents consume it reliably.

Next Steps

We believe that establishing a context standard like this would be a massive leap forward for the entire AI agent ecosystem. We would like to open a discussion with the community and the maintainers of this project on the feasibility and potential adoption of the .agent directory as a recommended best practice or formal standard.

We welcome feedback, suggestions, and further discussion.

Activity

  1. BradKML commented on Oct 13, 2025

    @BradKML

    Duplicate? #9

  2. ecki commented on Dec 17, 2025

    @ecki

    I think that goes too far, especially having stuff like a wiki in the .agents folder.

    If You have Specs just mention the directories in a table in agents.md, that also helps with human Discovery of them.

  3. OriNachum commented on Dec 23, 2025

    @OriNachum

    Thank you @BradKML
    @ecki, .agent is very similar to Agent Skills, which Anthropic recently announced.
    I think we can align with that.
    It has the folders: scripts (Code used by the agent), references (Documentation and the like), assets (Code examples, or templates, etc.)

    I don't care about the ego of which issue is used, and I generally prefer alignment (And Agent Skills is adopted by Codex now as well).
    I think it should be a standard so that other agentic tools, like Gemini CLI, align as well.

    Edit:
    I was also referring to my own ticket:
    #3

  4. kmturley commented on Feb 7, 2026

    @kmturley

    It would be great to narrow down to a standard as contributors to the same repo can use different agents:

    Coding Agent / Tool Directory for Agent Specs / Prompts Notes
    Kiro .kiro/specs Native Kiro spec location
    Cursor .cursor/rules
    .cursor/prompts
    Rules + reusable prompts
    GitHub Copilot .github/copilot-instructions.md
    .github/prompts/
    Repo-level Copilot guidance
    Claude (Anthropic) .claude/instructions.md
    .claude/prompts/
    Claude Code conventions
    OpenAI / ChatGPT .chatgpt/instructions.md
    .chatgpt/prompts/
    Repo-scoped instructions
    Aider .aider.conf.yml
    .aider/prompts.md
    Config + prompt file
    Continue.dev .continue/config.json
    .continue/prompts/
    JSON config + prompt dir
    Sweep AI .sweep/config.yaml
    .sweep/prompts/
    Automation-focused agent
    Sourcegraph Cody .sourcegraph/cody.json
    .sourcegraph/prompts/
    Enterprise-friendly setup
    Tabnine .tabnine/config.json Limited prompt support
    Auto-GPT / Agent Frameworks agents/
    agents/specs/
    prompts/
    Flexible, framework-defined
    LangChain / CrewAI agents/
    agents/specs/
    prompts/
    Common open-agent pattern
  5. OriNachum commented on Feb 7, 2026

    @OriNachum

    Adding to @kmturley very strong point - please align with Agent Skills owners so we have 1 location for all AI Coder agents configurations.

    If it is .agents - every should put their stuff there, and also make sure to coordinate.

    There is room for both notations together.

  6. waldyrious commented on Feb 7, 2026

    @waldyrious

    Speaking of consolidation, why isn't this issue being closed on favor of #9?

  7. OriNachum commented on Feb 7, 2026

    @OriNachum

    Speaking of consolidation, why isn't this issue being closed on favor of #9?

    Because it is fundamentally different.
    I am against loading all .agent content to context - it's lazy and consuming.

    Agent Skills notation solves it by both introducing an agentic rule, and bundling the items only if the rule passes.

  8. kmturley commented on Feb 7, 2026

    @kmturley

    I don't think anyone suggested loading all context to all agents?

    More of a standard way to load context to agents. Even if there are conditional includes to other agent-specific directories.

    Skills would be a good solution, but it appears they perform worse than regular markdown files:
    https://vercel.com/blog/agents-md-outperforms-skills-in-our-agent-evals

    If we could define something similar to web crawling, where there is a site map indicating where to look for context.

    AGENTS.md could contain the context tree with paths for where to look for context depending on the agent?

  9. zbynekwinkler commented on Feb 11, 2026

    @zbynekwinkler

    That vercel blog never mentions which model they were working with. It is a key info, since it is the model that decides what to read next based on the information it already has. We do not need to define anything new, the smart models are just better looking up info. Before skills, I had links in my agents.md file with more info and all the SOTA models read it at the relevant time (but i.e. gpt-oss-120b does not), thus getting "skills" without any support from the agent harness. Just take a look at https://opencode.ai/docs/rules/#manual-instructions-in-agentsmd.

  10. kmturley commented on Feb 13, 2026

    @kmturley

    The page you referenced has exactly what I was suggesting for AGENTS.md

    While opencode doesn’t automatically parse file references in AGENTS.md, you can achieve similar functionality in two ways:

    1. Using opencode.json
      The recommended approach is to use the instructions field in opencode.json:

    2. Manual Instructions in AGENTS.md
      You can teach opencode to read external files by providing explicit instructions in your AGENTS.md.
      https://opencode.ai/docs/rules/#referencing-external-files

    Perhaps a third option too 3. Invoking skills from AGENTS.md
    It would be great to align and explicitly document these approaches in AGENTS.md project too.

    Another reference:

    CLAUDE.md files can import additional files using @path/to/import syntax:

    https://code.claude.com/docs/

  11. tredondo commented on May 3, 2026

    @tredondo

    I'd like to suggest settling on .agents as the directory name (rather than agents, so the directory stands out and can be sorted away from other domain-specific directories in the project. Also, .agents (plural), to align with AGENTS.md.

    Speaking of consolidation, why isn't this issue being closed on favor of #9?

    Because it is fundamentally different.

    @OriNachum: agree, and as @kmturley pointed out, OpenCode provided a simple syntax and example for lazy-loading agent rules in other files.

  12. section9-lab commented on May 11, 2026

    @section9-lab

    Building on the proposed structure, I'd like to suggest adding plans/ as a sibling to spec/, wiki/, and links/.

    Today, many coding agents write planning artifacts to tool-specific, out-of-tree locations (e.g., Claude Code persists plans under ~/.claude/plans/...). This means:

    • Plans are invisible to teammates and to other agents working on the same repo.
    • Plans aren't version-controlled alongside the code they describe.
    • Reviewers can't see the "intended approach" the agent committed to before the diff.

    Proposed addition:

    ```
    .agents/
    ├── spec/ # what to build
    ├── wiki/ # how the system works
    ├── links/ # external resources
    └── plans/ # how the agent intends to build it (per-task implementation plans)
    ```

    `plans/` would hold short-lived, per-task implementation plans the agent produces before editing — the kind of artifact Claude Code's plan mode, Cursor's "plan-first" flows, and Kiro-style spec workflows already generate, but currently scatter into per-tool homedirs.

    Benefits:

    • In-tree & reviewable: plans land in PRs next to the diff they describe.
    • Cross-agent portable: any AGENTS.md-aware tool can read prior plans before re-planning the same task.
    • Lazy-loaded: like the rest of `.agents/`, agents only read individual plan files when relevant (consistent with the lazy-loading concerns raised above by @OriNachum / @kmturley) — not bulk-loaded into context.

    This keeps `.agents/` as the single in-repo home for all durable agent context — specs, knowledge, links, and planning trails — rather than splitting "what the agent thinks" between the repo and `~/.{tool}/`.

  13. stackbilt-admin commented on Jun 11, 2026

    @stackbilt-admin

    Related: I've posted a progressive-disclosure proposal in #135 that builds on the dedicated-directory direction proposed here — an optional, HTML-comment-fenced module index inside AGENTS.md that points at per-topic Markdown files with deterministic keyword triggers, while keeping flat AGENTS.md files fully conformant and degrading gracefully on tools that don't implement it. Whatever directory name this issue settles on (.agent/, .agents/, AGENTS.md.d/), the index mechanism works with it.

  14. Pjrich1313 commented on Jun 12, 2026

    @Pjrich1313

    I have no idea, why anyone is calling building your own agent a lazy load. I had this issue recently taken care of. For some reason, I was blocked. There is no rule that I am breaking it my own personal work. I'm using so why am I being blocked

  15. Pjrich1313 commented on Jun 12, 2026

    @Pjrich1313

    What's the problem

  16. Pjrich1313 commented on Jun 13, 2026

    @Pjrich1313

    OpenAI is to be used to make sure that mistakes are not made obviously there, are a huge amount of mistakes made by humans. So why are you upset. I come from my payout and, I come with an auditor and timestamps and POW. Why am I being stopped I paid for my copilot. I will follow the rules and will be taking this to the higher courts if need to be.

  17. faliqadlan commented on Jul 17, 2026

    @faliqadlan

    Instead of waiting for tool vendors to natively support parsing the .agents directory, a Prompt-Bootstrapped Protocol can be established to serve as the universal discovery contract today. For example, a conversation can be started with this exact snippet:

    Before handling my request, read .agents/AGENTS.md and follow its
    workspace-wide instructions. Load only the context and skills relevant
    to the request.
    
    Request:
    <user request>
    

    I implement this at: https://github.com/faliqadlan/dot-agents-template

    Through this approach, various agents (such as Antigravity, Codex, and others) can adhere to the .agents folder conventions dynamically.

  18. Pjrich1313 commented on Jul 17, 2026

    @Pjrich1313

    I would love to but being I can't even be paid for my work use my AI and being threatened can't discuss anything g

  19. dopry commented on Aug 10, 2026

    @dopry

    The current proposal seems to be focused on spec driven development and less on defining how the agents should behave within the project. https://dotagentsprotocol.com/ feels like a better general fit, as it tries to consolidate existing common protocols and configuration used by most agents.

  20. BradKML commented on Aug 19, 2026

    @BradKML

    @dopry if that gets more stars then maybe it can become the new standards vs current "skill" standards

  21. BradKML commented on Aug 22, 2026

    @BradKML

    @dopry please make it go viral and iterate the design fast, can't just watch this die for OpenCode/Codex/Claude

  22. dopry commented on Aug 22, 2026

    @dopry

    Not sure how I'd do that. Maybe you can post about it on hacker news or something

  23. Dakta commented on Sep 8, 2026

    @Dakta

    Agent Skills are only one aspect of a project's total Agent configuration.

    Any .agents/ standard SHOULD NOT invent new standards (this is overreach and scope creep). It SHOULD build on existing supported standards. Individual features MUST be optional so that this standard itself and implementers can add and adopt new standards incrementally. Adopted standards MUST coexist with their existing behavior.

    • AGENTS.md—provides the high level overview and steering.
    • mcp.json—isn't formally standardized, but most vendors who implement MCP itself have adopted the mcpServers config dict. Many vendors call it something like mcp.json, which seems like the simplest and most obvious name, although some store it alongside other configuration. Adding a load target is trivial, however, and does not represent a "new" standard so much as a clarification of an existing one.
    • Agent Skills—standardized, and most vendors store them under a skills/ directory in their existing configs.

    We should start by consolidating these existing standards to a simple, canonical location:

    .agents/
    ├─ AGENTS.md # allow moving this out of the project root
    ├─ mcp.json # vendors adopt loading `mcpServers` JSON dict from this file
    ├─ skills/
    │  ├─ my-skill/ # standard Agent Skills directory
    │     ├─ SKILL.md
    

    Supporting AGENTS.md allows the same directory structure to be located globally (~/.agents/ or ~/.config/agents/ for XDG compat) as well as per-project (<project>/.agents/). Many vendors already discover AGENTS.md across the entire working tree, so this location is free for them.

    We SHOULD NOT attempt to support any of these non-standardized features:

    • Tasks, personas, SOPs—IMO all of these can currently be encoded as Agent Skills. (I think many people underestimate the flexibility of Skills for dynamic customization.)
    • Memory/knowledge bases/persistence—highly experimental, not standardized, and likely to remain fairly diverse across projects.
    • Planning/specs/docs—Highly workflow- and project-specific, not really "configuration" material.
    • Rules—Another example, IMO, of something that can be achieved with AGENTS.md and custom Agent Skills.
    • Custom/sub-agents—This is the biggest miss right now. However, we should not burden or delay this consolidation effort with such a large additional requirement.

    When a new standard emerges that covers any of those features, or something new entirely, it can easily be incorporated by reference into this standard.


    Appendix

    Bad/abandoned/conflicting prior art:

    Compatible prior art and inertia in this direction:

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