opencode-primer AGENTS.md

A documentation repository that teaches developers how to use OpenCode, an AI coding tool, with prompts, configuration examples, integrations, and practical workflows.

In plain words
What is it for?
Learning about OpenCode's terminal interface, custom agents, commands, skills, plugins, MCP integrations, and workflow configuration.
Why use it?
It organizes setup guidance and examples so users can configure OpenCode without guessing how its features fit together.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/wesammustafa/opencode-primer/agents-md
Clone the repo
git clone --depth 1 https://github.com/wesammustafa/opencode-primer

Made for: Codex, OpenCode.

Per session 1,646 This file is loaded in full into every session.
When invoked 1,646 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01646 $0.01646
Opus 5 $0.00823 $0.00823
Sonnet 5 $0.00329 $0.00329
Haiku 4.5 $0.00165 $0.00165

Measured 2d ago against content hash 45b9d91cdc27, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

opencode-primer AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 131 lines

How it starts

The opening of the file, as written. The whole thing — 131 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

Project instructions for OpenCode. Read every session.

What this repo is

A practical, opinionated guide to using OpenCode — README, supporting docs, drop-in agent prompts, MCP walkthroughs, and a worked example of a fully-configured .opencode/ directory. It's a documentation repository, not application code.

Repo layout

.
├── README.md                       # Main guide (the centerpiece)
├── AGENTS.md                       # This file
├── CONTRIBUTING.md                 # How to contribute
├── SECURITY.md · CODE_OF_CONDUCT.md
├── LICENSE                         # MIT
├── opencode.json · tui.json        # Example configs with safe defaults
├── docs/
│   ├── quickstart.md               # 5-minute getting-started
│   ├── zen.md                      # Zen model gateway details
│   ├── tui.md                      # TUI mastery
│   ├── agents.md                   # Custom agent deep dive
│   ├── commands.md                 # Custom slash commands
│   ├── skills.md                   # Agent skills
│   ├── plugins.md                  # Plugin/hook system
│   ├── mcp.md                      # MCP integration
│   ├── workflows.md                # Real-world recipes
│   ├── migration.md                # Migration from Claude Code / Cursor
│   └── reference/
│       ├── cli.md                  # All CLI commands
│       ├── slash-commands.md       # All TUI slash commands
│       ├── permissions.md          # Permission model
│       ├── changelog.md            # OpenCode releases
│       ├── faq.md                  # FAQ + troubleshooting
│       └── further-reading.md      # External resources
├── .opencode/
│   ├── agents/                     # Example custom agents
│   ├── commands/                   # Example custom commands
│   ├── plugins/                    # Example plugins (audit log, secret blocker)
│   └── skills/                     # Example agent skills
├── .github/                        # CI (lint-docs.yml), issue/PR templates
├── mcp-servers/                    # MCP server walkthroughs
├── specialized-agents/             # Drop-in specialist prompts
│   ├── system-prompts/             # System prompts (7 roles)
│   └── descriptions/               # Role descriptions
└── Images/                         # Banner, diagrams, screenshots

Read the full file on GitHub · 131 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 131 lines · 1,646 tokens per session scan A 45b9d91cdc27

Subscribe to this mod's changes

opencode-primer AGENTS.md is an instructions file published in the GitHub repository wesammustafa/opencode-primer (384 stars, last pushed 1mo ago), licensed MIT. It adds 1,646 tokens to every session, about $0.0082 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.