opencode-plugin-idioms

opencode-plugin-idioms is a skill for Claude Code, Codex from kagan-sh/kagan. It costs 64 tokens per session (4,331 once invoked), scanned A, original, MIT.

A reference guide to event data, session timing, interface notifications, and child-session tags for OpenCode plugins.

In plain words
What is it for?
Use it when developing or debugging OpenCode server or terminal-interface plugins, especially event hooks and session lifecycle handling.
Why use it?
It prevents plugin code from assuming the wrong event fields or reacting at the wrong point in an OpenCode session.

Skill for Claude CodeCodex

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 skills/kagan-sh/kagan/opencode-plugin-idioms
Any agent
npx skills add kagan-sh/kagan --skill opencode-plugin-idioms
Clone the repo
git clone --depth 1 https://github.com/kagan-sh/kagan

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for opencode-plugin-idioms

README.md
[![agentmods](https://agentmods.dev/badge/skills/kagan-sh/kagan/opencode-plugin-idioms.svg)](https://agentmods.dev/skills/kagan-sh/kagan/opencode-plugin-idioms)
Your own site
<a href="https://agentmods.dev/skills/kagan-sh/kagan/opencode-plugin-idioms"><img src="https://agentmods.dev/badge/skills/kagan-sh/kagan/opencode-plugin-idioms.svg" alt="Measured on agentmods" height="20"></a>
Per session 64 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,331 The whole file, excluding the scripts and references it only reads on demand.
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.00064 $0.04331
Opus 5 $0.00032 $0.02166
Sonnet 5 $0.00013 $0.00866
Haiku 4.5 $0.00006 $0.00433

Measured 3d ago against content hash 079866b52abb, 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-idioms 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 3d 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.

.claude/skills/opencode-plugin-idioms/SKILL.md · 191 lines

How it starts

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

Version check: repo pins @opencode-ai/[email protected]; vendored copy at references/opencode/packages/plugin/package.json should match — verify there, never from memory.

1. Event hook: what fires, exact payload, and ordering guarantees

Hooks.event receives { event: Event } where Event is a tagged union — references/opencode/packages/plugin/src/index.ts:224 and the generated union at references/opencode/packages/sdk/js/src/gen/types.gen.ts:704-736.

Session-lifecycle members (the ones this repo's src/server.ts event hook switches on):

type properties fires when
session.created { info: Session } client.session.create() resolves — distinct event, not folded into session.updated. Schema: types.gen.ts:562-567.
session.updated { info: Session } any subsequent session.update() (metadata patch, title change, etc). types.gen.ts:569-574.
session.deleted { info: Session } client.session.delete(). types.gen.ts:576-581.
session.idle { sessionID: string } agent turn finishes and session goes idle. types.gen.ts:475-480.
session.status { sessionID, status: SessionStatus } status transition (running/idle/etc). types.gen.ts:467-473.
session.compacted { sessionID } compaction completes. types.gen.ts:482-487.
permission.updated Permission a permission request is created/changed. types.gen.ts:439-442.
permission.replied { sessionID, permissionID, response } human answers a permission prompt. types.gen.ts:444-450.
command.executed { name, sessionID, arguments, messageID } slash command runs. types.gen.ts:523-529.
file.edited { file } types.gen.ts:489-493.
todo.updated { sessionID, todos } types.gen.ts:515-521.
tui.toast.show { title?, message, variant, duration } published via client.tui.showToast(...) — see §3. types.gen.ts (search EventTuiToastShow).

Note the wire shape differs from the raw schema definition: packages/schema/src/v1/session.ts:571-587 defines Created/Updated/Deleted with both sessionID and info fields, but the generated SDK type collapses this to properties: { info: Session } only (types.gen.ts:562-581) — read the session ID off info.id, not properties.sessionID. This repo's src/server.ts:246,252-253 already does this correctly.

Creation timing — no race. Session.createNext builds the row in memory and calls yield* events.publish(SessionV1.Event.Created, { sessionID, info }) synchronously within the same Effect (references/opencode/packages/opencode/src/session/session.ts:537), before returning to the caller. The durable-event pipeline runs all registered projectors — including the one that db.insert(SessionTable, ...) (references/opencode/packages/core/src/session/projector.ts:215-224) — synchronously and awaited (for (const projector of list) { yield* projector(committed) }, references/opencode/packages/core/src/event.ts:320-322) before notify() delivers the event to any listener (event.ts:389 calls notify after commitDurableEvent resolves; notify fans out to plugin listeners at event.ts:406-416). Net effect: by the time a plugin's event hook receives session.created, client.session.get({ path: { id } }) is guaranteed to find the row. No polling or retry needed.

Read the full file on GitHub · 191 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. 3d ago First seen · 191 lines · 64 tokens per session scan A 079866b52abb

Subscribe to this mod's changes

opencode-plugin-idioms is a skill published in the GitHub repository kagan-sh/kagan (10 stars, last pushed 1mo ago), licensed MIT. It adds 64 tokens to every session and 4,331 once invoked, about $0.0003 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.

Related

Other skills, from other repositories

collattice

Operate a Collattice kanban board through its Model Context Protocol (MCP) endpoint — connecting, authentication, the board model, identifier rules (board-level reads need a board GUID, not a slug), the Markdown a board renders, and the full tool reference: reading and creating cards, moving and reordering lanes…

MrBildo/collattice · 111 tokens

trello-cli

Trello board, list and card management via CLI. Activate when user mentions "Trello" - examples: "Show my Trello tasks", "Add card to Trello", "Move on Trello", "Trello board", "List Trello", "Trello cards".

ZenoxZX/trello-cli · 61 tokens

sanban

Simple kanban that just works. JSON-backed boards with REST API + MCP server.

aancw/sanban · 20 tokens

aspire

Orchestrates Aspire distributed applications using the Aspire CLI for running, debugging, and managing distributed apps. USE FOR: aspire start, aspire stop, start aspire app, aspire describe, list aspire integrations, debug aspire issues, view aspire logs, add aspire resource, aspire dashboard, update aspire apphost.…

MrBildo/collattice · 150 tokens

coss

Helps implement coss UI components correctly. Use when building UIs with coss primitives (buttons, dialogs, selects, forms, menus, tabs, inputs, toasts, etc.), migrating from shadcn/Radix to coss/Base UI, composing trigger-based overlays, or troubleshooting coss component behavior. Covers imports, accessibility…

usekaneo/kaneo · 80 tokens

kanban-board

To do / In progress / In review / Done 四列, 卡片 + 头像 + 泳道.

nexu-io/html-anything · 26 tokens