opencode-plugin AGENTS.md

Project guidance for an AI coding agent working on opencode-plugin, a compatibility layer that lets OpenCode use Claude Code plugins and marketplaces.

In plain words
What is it for?
Finding architecture notes, understanding plugin and marketplace behavior, and following the project's intended conventions.
Why use it?
It gives the agent the project's background, design rules, file locations, and important implementation details.

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/gzb1128/opencode-plugin/agents-md
Clone the repo
git clone --depth 1 https://github.com/gzb1128/opencode-plugin

Made for: Codex, OpenCode.

Per session 1,823 This file is loaded in full into every session.
When invoked 1,823 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.01823 $0.01823
Opus 5 $0.00911 $0.00911
Sonnet 5 $0.00365 $0.00365
Haiku 4.5 $0.00182 $0.00182

Measured yesterday against content hash 6eddf354c39c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

opencode-plugin 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 yesterday.

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 · 150 lines

How it starts

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

AGENTS.md — opencode-plugin

本文档供 AI Agent 阅读,记录项目背景、技术决策和隐式知识。

项目概述

opencode-plugin 是一个 Claude Code 插件生态兼容层。它的核心目标是让 Claude Code 的 plugin marketplace 生态能在 opencode 上无缝运行——用户可以用和 Claude Code 相同的 marketplace.json 格式、相同的 plugin 目录结构、相同的 CLI 命令来安装和管理插件。

设计原则

  1. 兼容而非替代:我们不重新实现 Claude Code 已有的能力(如 plugin initplugin validate),让 AI agent 自己完成这些操作更原生
  2. 只做搬运层:CLI 负责 marketplace 发现、plugin 下载/缓存、symlink 管理、MCP 配置注入;不负责 plugin 内容的创建或校验
  3. 对齐 Claude Code 数据格式marketplace.jsonplugin.json.mcp.json 等文件格式完全兼容 Claude Code 规范
  4. 渐进式实现:Hooks、LSP、Monitors、Themes 等组件先解析存储,等 opencode runtime 支持后激活

导航

主题 文档
架构设计 docs/design/ARCHITECTURE.md
Plugin 模块 docs/design/PLUGIN.md
Marketplace 模块 docs/design/MARKETPLACE.md
CLI 命令设计 docs/design/CLI.md
配置管理 docs/design/CONFIGURATION.md
OpenCode 集成 docs/design/OPENCODE.md
MCP 实现(用户指南) docs/MCP.md
MCP 模块设计 docs/design/MCP.md
使用指南 docs/USAGE.md

关键隐式知识

Plugin Source 的类型与 update 行为

marketplace.json 中每个 plugin 的 source 字段决定 plugin update 从哪里取代码。 parsePluginSourceinternal/marketplace/parser.go)支持 7 种类型,按行为分成两组:

Local Source(相对路径字符串) — plugin 代码在 marketplace 仓库内

{ "source": "./plugins/my-plugin" }
  • plugin updatemarketplace 缓存目录 读取(即 market update 克隆下来的那份)
  • 必须先 market updateplugin update,否则拿到旧代码

Remote Source(对象形式) — plugin 代码在独立仓库/包,不依赖 marketplace 缓存

{ "source": { "source": "github", "repo": "owner/my-plugin" } }

取代码的方式由 source 字段决定(见 internal/plugin/version.goIsRemoteSource / clonePluginSource):

source 必填字段 取代码方式
github repo git clone https://github.com/<repo>.git
git url git clone <url>
git-subdir url/repo+path git clone 后取子目录
url url 当作 git 仓库 clone(同 git任意 URL 下载)
npm package npm install
pip package ⚠️ 解析已支持,安装尚未实现version.go:186 返回 not implemented)

Read the full file on GitHub · 150 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. yesterday First seen · 150 lines · 1,823 tokens per session scan A 6eddf354c39c

Subscribe to this mod's changes

opencode-plugin AGENTS.md is an instructions file published in the GitHub repository gzb1128/opencode-plugin (1 stars, last pushed 2mo ago), licensed MIT. It adds 1,823 tokens to every session, about $0.0091 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-31.