A team maintains several projects, all on OpenCode with identical filesystems, and already has a central documentation repository (team guidelines, frontend and accessibility tips). Should global guidance live in a global AGENTS.md, in auto-invoked skills, or as references/paths to the existing docs? Is referencing instead of duplicating acceptable, and what is today's maintainable, clean best practice?
Eight evidence rows from six independent sources, as of 2 Oct 2026: OpenCode's docs on rules, references and skills; Claude Code and Anthropic guidance; Vercel's Next.js 16 evaluation; Matt Pocock's AGENTS.md guide; and the AGENTS.md standard. The answer is a hybrid, reference-first architecture — keep AGENTS.md tiny, keep the central repo canonical, expose it through OpenCode references, and reserve skills for workflows.
Hover or tap a cell for the supporting evidence. Colour marks the effect on maintainability for a team with a large central docs corpus.
Always-loaded layers stay tiny; everything heavy is advertised briefly and read on demand.
Optional and tiny. OpenCode calls ~/.config/opencode/AGENTS.md personal — not committed or team-shared. Individual preferences only, never the team source of truth.
Checked in, very small: project purpose, unusual commands, non-negotiable constraints, and a short routing rule pointing at the references.
always loadedThe single source of truth for Java, frontend, accessibility, security and testing guidance. Nothing is duplicated out of it.
read on demandAdvertise the central docs with precise "when to use" descriptions. Only descriptions and resolved paths enter context; agents inspect the files when relevant.
descriptions onlyOnly compact mandatory rules that should always occupy context — every listed file is combined into context, so splitting docs here saves nothing.
always loadedExecutable, task-shaped workflows (migrations, releases, audits) with clear triggers. Skills link to or read the canonical docs rather than copying them.
loads on triggerOnly where a repository has a truly distinct subsystem and local rules must always apply; the nearest file takes precedence.
always, nearest winsBased only on documented OpenCode configuration: references (local directory and Git repository), an optional tiny instructions entry, and a minimal AGENTS.md router.
opencode.json — references advertise the central docs; only the descriptions are always in context
{
"references": {
"team-docs": {
// identical filesystem at work: a common local path works
"path": "/work/shared/team-docs",
"description": "Use for Java source/build changes;
team Java guidelines and build conventions."
},
"frontend-docs": {
// or a Git repository reference for versioning/portability
"repo": "git@git.internal:platform/team-docs.git",
"description": "Use for frontend UI changes;
includes accessibility requirements."
}
},
"instructions": [
// only genuinely mandatory, compact rules — always loaded
"docs/mandatory-security-rules.md"
]
}
Project AGENTS.md — a tiny router, always loaded, never a copy of the docs
# Payments service Spring Boot payments API; frontend in /web. ## Commands Build: ./gradlew build Test: ./gradlew check ## Routing Follow the team guidelines before writing code: - Java work: consult the @team-docs reference. - Frontend work: consult @frontend-docs (accessibility rules are mandatory). Never restate guidelines here; read the source docs.
Always loaded vs on demand
AGENTS.md and every file in instructions are combined into context on every turn. Reference descriptions and resolved paths are always advertised, but the referenced content loads only when the agent reads it. A path written conversationally inside AGENTS.md can work, but OpenCode does not automatically parse such references — configured references are the reliable route. Commit opencode.json or distribute it via managed bootstrap tooling.
instructions field to reuse central rules without duplicating them into AGENTS.md — but all listed files are combined into context, so it saves duplication, not tokens. opencode.ai| Source | Mechanism | Core recommendation | Loading behavior | Link |
|---|
Qualitative synthesis of 8 shaped evidence rows from 6 independent hosts (OpenCode, Claude Code, Anthropic, Vercel, aihero.dev, agents.md), gathered as of 2026-10-02. Percentages are pass/trigger rates from Vercel's single Next.js 16 evaluation and are not a cross-agent benchmark. Recommendation and loading-behavior text is excerpted; full evidence quotes were cut for space.