Skip to content

[FEATURE]: Support a Shared .agents/ Directory and Manifest-Based Discovery #47742

Open

Description

@OmidHekayati

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

As more development agents emerge, repositories are increasingly accumulating tool-specific top-level directories such as:

.claude/
.claude-plugin/
.config/
.cursor/
.devcontainer/
.eslint-plugin-local/
.github/
.opencode/
.vscode/
...

Each tool introduces its own conventions, fixed directory names, and sometimes additional companion directories outside its own namespace. This approach does not scale well for repositories that need to support multiple agents over time.

Proposal 1: Support a Shared .agents/ Directory

Instead of requiring every agent to create its own top-level directory, consider also supporting the following layout:

.agents/
    claude/
    cursor/
    codex/
    devcontainer/
    eslint/
      plugin-local/
    gemini/
    github/
    human/
    vscode/
    opencode/
    skills/
    README.md
    ...

Each agent remains free to organize its own internal files however it prefers, but all agent-related resources live under a single shared root. This keeps repositories organized while allowing every agent to evolve independently.

This proposal is not asking to replace the current layout. It simply asks to also support discovering configuration under .agents/<agent>/, preserving full backward compatibility with existing repositories.

Benefits

  • Keeps the repository root clean and predictable.
  • Prevents namespace pollution.
  • Makes repositories easier to navigate.
  • Provides a single location for all agent-related resources.
  • Simplifies supporting multiple agents simultaneously.
  • Allows future agents to coexist without introducing additional top-level directories.

Proposal 2: Prefer Manifest-Based Discovery Over Fixed Directory Layouts

Many tools currently require resources to exist in hard-coded filesystem locations. For example, an agent may require directories such as:

skills/
prompts/
commands/

to exist beside its configuration directory. These assumptions unnecessarily couple repository layout to a particular implementation. Instead, consider allowing a manifest file to explicitly declare resource locations. For example:

skills:
  - /.agents/skills

prompts:
  - /.agents/prompts

commands:
  - /.agents/commands

references:
  - /docs/

The manifest becomes the contract rather than the directory structure. This allows repositories to organize their files according to their own architecture while remaining fully compatible with the agent. It also enables future resource types without introducing new fixed filesystem conventions.


Project Documentation

Agent instructions and project documentation serve different audiences and should remain clearly separated. A natural convention is:

.agents/    # Instructions and resources intended for agents (How)
/docs/      # Project documentation intended for any agents as humans, tools, AIs (Why)

Project documentation should not be tied to a specific agent. Whether the consumer is a human, an IDE, a CLI tool, or an AI model, the same documentation should remain accessible from a predictable location.


Why This Matters

Repository structure should not become coupled to individual tools. Agents are broader than AI models. IDEs, automation tools, CI systems, documentation generators, and even humans can all be considered agents interacting with a repository. A repository should be able to support many different agents simultaneously without each one requiring its own top-level directory structure or filesystem conventions.

Supporting a shared .agents/ directory together with manifest-based discovery would improve interoperability, reduce repository clutter, and make the ecosystem easier to extend while remaining fully backward compatible.

Activity

  1. github-actions commented on Sep 7, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  2. e-gleba commented on Sep 28, 2026

    @e-gleba

    +1 here who'd like to see this implemented

  3. jjjermiah commented on Oct 11, 2026

    @jjjermiah
    Contributor

    +1, mostly for proposal 1. I already keep specs, plans and skills in .agents/, so having a separate .opencode/ at the root just for agents, commands and opencode.jsonc bugs me more than it probably should.

    v2 is most of the way there already. config/discovery.ts checks for .agents at every level on the way up, it just only reads .agents/skills out of it. That came from #35864, which even says .agents "may supply more than skills over time". Treating .agents/opencode/ as another project config dir looks like a small change in discovery.ts, plus the two spots in the TUI that hardcode .opencode (themes and TUI plugins). .opencode would keep working exactly like it does now.

  4. jjjermiah commented on Oct 11, 2026

    @jjjermiah
    Contributor

    @e-gleba put up a PR for proposal 1 in #54594 if you want to give it a try or a thumbs up

  5. e-gleba commented on Oct 12, 2026

    @e-gleba

    @e-gleba put up a PR for proposal 1 in #54594 if you want to give it a try or a thumbs up

    Got it, will try today, thanks!

  6. rekram1-node commented on Oct 13, 2026

    @rekram1-node
    Collaborator

    Has anyone else adopted this yet?

  7. e-gleba commented on Oct 16, 2026

    @e-gleba

    8. Has anyone else adopted this yet?

    No. Only .agents/skills is shared. I found no .agents/<tool>/ for commands, agents, scripts in official docs.

    But. Parsing .agents/opencode as alias to .opencode keeps root clean: one ls with no extra dot dirs, all agent stuff in one place, old path still works. Same logic holds for other tools if they map .agents/<tool>/ to their own dir.

  8. opencodejr commented on Oct 28, 2026

    @opencodejr
    Contributor

    Thanks for the detailed proposal! In short, you're asking OpenCode to also read its config from a shared .agents/opencode/ directory, and, longer term, to let a manifest say where skills, commands and other resources live instead of relying on fixed directory names.

    Some context on where things stand now:

    • OpenCode already looks for .agents/ in the project and its parent directories, but at the moment it only reads skills from .agents/skills. Other project config is read only from .opencode/.
    • For skills, you can already list extra locations in config with skills.paths, which covers part of the manifest idea.

    Related work:

    Maintainers will consider this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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