A tiny always-visible router plus OpenCode references beats both a big AGENTS.md and skills alone

Asked (summary)

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.

Four mechanisms, six dimensions: where each one wins

Hover or tap a cell for the supporting evidence. Colour marks the effect on maintainability for a team with a large central docs corpus.

favors a reference-first setup caution — context cost or reliability risk neutral / situational

The recommended layering

Always-loaded layers stay tiny; everything heavy is advertised briefly and read on demand.

1 · Global personal AGENTS.md

Optional and tiny. OpenCode calls ~/.config/opencode/AGENTS.md personal — not committed or team-shared. Individual preferences only, never the team source of truth.

always loaded
2 · Project AGENTS.md

Checked in, very small: project purpose, unusual commands, non-negotiable constraints, and a short routing rule pointing at the references.

always loaded
3 · Central docs repository

The single source of truth for Java, frontend, accessibility, security and testing guidance. Nothing is duplicated out of it.

read on demand
4 · OpenCode references

Advertise the central docs with precise "when to use" descriptions. Only descriptions and resolved paths enter context; agents inspect the files when relevant.

descriptions only
5 · OpenCode instructions

Only compact mandatory rules that should always occupy context — every listed file is combined into context, so splitting docs here saves nothing.

always loaded
6 · Skills

Executable, task-shaped workflows (migrations, releases, audits) with clear triggers. Skills link to or read the canonical docs rather than copying them.

loads on trigger
7 · Nested AGENTS.md

Only where a repository has a truly distinct subsystem and local rules must always apply; the nearest file takes precedence.

always, nearest wins

Wiring it in OpenCode

Based 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.

Decision rules and maintenance controls

What the sources say

OpenCode recommends the 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
OpenCode references with descriptions are advertised in agent context as short pointers only; agents inspect the actual files when relevant — the right fit for a large central docs corpus. opencode.ai
In Vercel's Next.js 16 evaluation, a skill was never invoked in 56% of cases and peaked at 79% with explicit triggers, while a compressed 8KB always-present docs index (down from ~40KB) scored 100% — one framework-specific experiment, not a universal law. vercel.com
Matt Pocock's instruction budget: frontier thinking models follow roughly 150–200 instructions with consistency — every AGENTS.md token loads on every request, so be ruthless and progressively disclose the rest. aihero.dev
Anthropic's skills cost about 100 tokens each until triggered and suit packaged workflows; Claude Code's guidance mirrors the pattern — keep the always-loaded file under ~200 lines and move procedures to skills or path-scoped rules. platform.claude.com

The evidence rows

SourceMechanismCore recommendationLoading behaviorLink

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.

This report was generated automatically by Keenable SELECT at a user's request, from publicly available web sources linked herein. Keenable does not review, verify, or endorse its contents and makes no representation as to accuracy, completeness, or timeliness; AI-based extraction may contain errors. Nothing in this report is investment, legal, financial, or other professional advice. All trademarks and referenced content remain the property of their respective owners; no affiliation or endorsement is implied. To report an error, rights concern, or request removal: legal@keenable.ai.

Keenable SELECTAsk your own question
Made with Keenable SELECT