Skip to content

Directory support #9

Open
Open

Description

@jsit

For better organization and modularity, the spec should support additionally crawling files in a directory, such as .agents.

By default, files within that directory will always be added to the context, but can be individually disabled within the IDE or code assistant tool (or with frontmatter, see #10).

For instance, a user might have a structure like this:

|-- .agents
|  |-- naming-conventions.md
|  |-- personality.md
|  |-- project-overview.md
|  `-- testing.md
`-- AGENTS.md

Prior art

Activity

  1. marked .agents Directory Ideas #2 as a duplicate of this issue on Aug 20, 2025
  2. danielmeppiel commented on Aug 25, 2025

    @danielmeppiel

    VSCode / GitHub Copilot is an example of modularization as well:

    You can have any number of .github/instructions/*.instructions.md which already support applyTo in the frontmatter (docs here).

    Matching patterns like applyTo simplify the creation, distribution and reuse of context files.

  3. jsit commented on Aug 25, 2025

    @jsit
    Author

    Matching patterns like applyTo simplify the creation, distribution and reuse of context files.

    @danielmeppiel Thanks, this is addressed in #10.

  4. yordis commented on Aug 25, 2025

    @yordis

    I would prefer something like .agents/rules so that .agents directory is set for future expansion without introducing breaking changes.
    Also, I would expect nested directories inside such rules. I use .agents/rules/internal to have uncommitted rules, as an example.
    Or have hierarchical structure based on technologies or frameworks, or things of that nature

  5. SinOverCos commented on Sep 12, 2025

    @SinOverCos

    Wondering if @dkundel-openai or someone from OAI can comment on this -- is this considered for the spec or is this a dead end?

  6. malhashemi commented on Sep 19, 2025

    @malhashemi

    @yordis totally agree on .agents/rules I was also coming to propose the following features to .agentsdirectory

    • Reusable prompts .agents/prompts/
    • Reusable Sub-Agents (with the contents of the MD files being used as system prompt) .agents/subagents/x.md
    • Rules .agents/rules/
    • Tools .agents/tools/ for any executable tools and scripts

    There are tremendous amount of tools getting added everyday, and with each adding the same feature under different folder structure it is getting tedious having all these different folders in every codebase just to cover the dev tools of every developer.

  7. TomLucidor commented on Oct 7, 2025

    @TomLucidor

    Seconding this + find out only this issue got the Windsurf mention at the moment
    P.S. please check https://github.com/intellectronica/ruler

  8. BradKML commented on Oct 9, 2025

    @BradKML

    @malhashemi but when will this get a PR, or adopted as the new standard? You do know that description (universal?), globs (Cursor only), alwaysApply (Cursor) or auto_execution_mode (Windsurf) etc. shows that IDEs often differ from one another when it comes to headers?

  9. malhashemi commented on Oct 9, 2025

    @malhashemi

    @malhashemi but when will this get a PR, or adopted as the new standard? You do know that description (universal?), globs (Cursor only), alwaysApply (Cursor) or auto_execution_mode (Windsurf) etc. shows that IDEs often differ from one another when it comes to headers?

    @BradKML well they differ coz there is no standard. The standard in my opinion should evolve as more of the functionality becomes widely used enough that they need a standard. Descriptions for example is indeed global enough to be part of the header, there could be some sort of a key like ide that allows for specific vendors header imagine something like

    - ide
      - [vendor]
        - [vendor_specifc_header]

    At least we get to a point where every file can be reusable across IDEs rather than having a mess of various .vendor folders per codebase.

  10. danielmeppiel commented on Oct 9, 2025

    @danielmeppiel

    Hi folks,

    I am proposing a paradigm / tooling to handle this called Agent Package Manager. It basically builds on what we are raising here. Have a look at https://github.com/danielmeppiel/apm

    Allows to install modular instructions/prompts and "compile" instructions that use applyTo patterns into nested Agents.md. So this is portable across clients.

  11. malhashemi commented on Oct 9, 2025

    @malhashemi

    Hi folks,

    I am proposing a paradigm / tooling to handle this called Agent Package Manager. It basically builds on what we are raising here. Have a look at https://github.com/danielmeppiel/apm

    Allows to install modular instructions/prompts and "compile" instructions that use applyTo patterns into nested Agents.md. So this is portable across clients.

    @danielmeppiel Hi, thanks for making this, how would this work with something like OpenCode? Where there are agents, subagents, commands, MCPs, custom tools, AGENTS.md files etc. Or even Claude Code subagents, output-styles etc. If team members who are working on the same project have their own dev workflows that they like to use how would it accommodate that? I have something in mind to build addressing this but was hoping for a standard to emerge rather than the current wild west.

  12. danielmeppiel commented on Oct 9, 2025

    @danielmeppiel

    @malhashemi OpenCode and Claude Code both support the Agents.md standard.

    APM just allows teams to dynamically generate the Agents.md nested hierarchy for their project out of context packages. Coding agents that support the Agents.md standard will just honor those once they've been created. Agents.md is the gluing standard here.

    If they have their own workflows (i.e. prompts), they can just store them locally. Example project here.

  13. BradKML commented on Oct 13, 2025

    @BradKML
  14. mathieufortin01 commented on Oct 16, 2025

    @mathieufortin01

    Also, I would expect nested directories inside such rules. I use .agents/rules/internal to have uncommitted rules, as an example.

    Nested directories should be part of this feature. One other use case is propagating common set of rules to bunch of repos. With cursor we can have a dedicated subfolder, containing a bunch of .mdc files. It makes things well organized and easy to sync. That said, it could also use a dedicated file prefix in a single folder.

  15. waldyrious commented on Oct 24, 2025

    @waldyrious

    FYI, the recently announced Claude Skills are based on a hierarchical structure of files under a base directory, which greatly overlaps with the functionality that would be unlocked by this feature.

  16. BradKML commented on Oct 24, 2025

    @BradKML

    The issue would be whether Claude Skills will be rolled into AGENTS.md standard, or they are just gonna make it exclusive

  17. JolanDeNef commented on Nov 24, 2025

    @JolanDeNef

    Interesting development is that Google's Antigravity (build by the developers they brought over from Windsurf) now uses the .agent/ folder.

    This also means that e.g. rules and workflows from .windsurf will work if you copy (or symlink) them to the .agent folder.
    First step in generalisation?

  18. leochiu-a commented on Dec 3, 2025

    @leochiu-a

    I added support in universal-agents for AGENTS.md to read the .agents/ subfolder.

    .agents/
      skills/
        code-review/
          SKILL.md
      rules/
        api-guideline.md
        react-components-guideline.md
    AGENTS.md
    
  19. TomLucidor commented on Dec 8, 2025

    @TomLucidor

    @danielmeppiel are there ways of creating a less fractured multi-IDE ecosystem for this simple folder-based design? (Ruler vs APM vs Universal Agents vs other services)

  20. jsit commented on Dec 8, 2025

    @jsit
    Author

    @danielmeppiel are there ways of creating a less fractured multi-IDE ecosystem for this simple folder-based design? (Ruler vs APM vs Universal Agents vs other services)

    That’s what AGENTS.md, this very repo, was supposed to solve. But this project seems effectively abandoned.

  21. TomLucidor commented on Dec 8, 2025

    @TomLucidor

    @jsit cus AGENTS.md is a bad spec compared to what everyone else want to do for a whole folder... Which is sad cus OpenAI is gonna do what they want

  22. yordis commented on Dec 17, 2025

    @yordis

    Cursor added support for the RULE.md file, migrating away from *.mdc. Putting the extension aside, I feel that this rules spec should be based on a RULE.md file, where the directory name becomes its name.

    If a RULE.md wants to reference other markdown files, scripts, and so on, having the directory allows that to happen without so many edge cases, such as markdown files leaking into the rules directory and accidentally becoming a rule.

    This is done already by SKILLS.md file as well, same deal there.

  23. stefanlasiewski commented on Mar 10, 2026

    @stefanlasiewski

    So if AGENTS.md is effectively abandoned (I Hardly Knew Ye), is there any other movement towards a common spec?

  24. w0rp commented on Apr 22, 2026

    @w0rp

    I would like to suggest on this issue that the world standard be made using @ to reference other files to import for instructions.

    1. OpenCode supports this: https://opencode.ai/docs/rules/#manual-instructions-in-agentsmd
    2. Claude Code supports this: https://code.claude.com/docs/en/memory#import-additional-files

    I symlink CLAUDE.md to AGENTS.md to make it compatible with what everyone else is doing. If we can simply name files to reference with @ then we'll have a common format that works with Claude Code, OpenCode, Codex, everything.

    The key advantage here is we don't need to bicker about what the best directory name is and then end up with yet another standard, we can just make projects work with whatever folder names we want forever.

  25. tredondo commented on May 3, 2026

    @tredondo
  26. stolsvik commented on Aug 31, 2026

    @stolsvik

    That would also be doable with @-imports (#11), which are more flexible - so rather that!

  27. marked .agents subfolder #62 as a duplicate of this issue on Nov 4, 2026
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