Give opencode project rules with AGENTS.md

agents & rules

// what it does

AGENTS.md at the repo root is loaded every session as standing instructions — conventions, build and test commands, architecture notes. A global ~/.config/opencode/AGENTS.md applies everywhere, and the instructions config key pulls in extra files by glob. When no AGENTS.md exists, opencode falls back to CLAUDE.md.

// shell

$ ./AGENTS.md
$ ~/.config/opencode/AGENTS.md
$ { "instructions": ["CONTRIBUTING.md", ".cursor/rules/*.md"] }

// gotcha

Precedence is nearest-first: a local AGENTS.md beats the global one, and AGENTS.md beats CLAUDE.md. Disable the Claude Code fallback entirely with OPENCODE_DISABLE_CLAUDE_CODE=1.

// resources