ai-tools: Skill for Claude Code

.agents/skills/writing-opencode-plugins/SKILL.md

writing-opencode-plugins is a skill for Claude Code, Codex from sveltejs/ai-tools. It costs 63 tokens per session (1,309 once invoked), scanned A, original, MIT.

A guide for creating OpenCode plugins, which are extensions that add server features or interactive terminal-interface features. It covers hooks, tools, commands, keybindings, routes, dialogs, and packaging.

In plain words
What is it for?
Use it when creating, editing, testing, reviewing, or publishing OpenCode server or terminal-interface plugins.
Why use it?
It helps keep plugin code aligned with the current OpenCode API and separates server features from terminal-interface features correctly.

Skill for Claude CodeCodex ✓ vendor

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents); mentions OpenCode.

This is sveltejs/ai-tools's own configuration. It tells Claude Code and Codex how to work on ai-tools itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ai-tools configures →

About the project

Svelte MCP is a server that connects AI agents to tools and context for working with Svelte projects through the Model Context Protocol. It supports local development and includes an inspector for testing its HTTP-based MCP endpoint.

sveltejs/ai-tools · 335 stars · on GitHub · mcp.svelte.dev

Reuse

Borrowing it

Nothing to install: this file belongs to sveltejs/ai-tools. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/sveltejs/ai-tools/main/.agents/skills/writing-opencode-plugins/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/sveltejs/ai-tools

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 writing-opencode-plugins

README.md
[![agentmods](https://agentmods.dev/badge/skills/sveltejs/ai-tools/writing-opencode-plugins/github.svg)](https://agentmods.dev/skills/sveltejs/ai-tools/writing-opencode-plugins)
Your own site
<a href="https://agentmods.dev/skills/sveltejs/ai-tools/writing-opencode-plugins"><img src="https://agentmods.dev/badge/skills/sveltejs/ai-tools/writing-opencode-plugins/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for writing-opencode-plugins

Your own site · 80×15
<a href="https://agentmods.dev/skills/sveltejs/ai-tools/writing-opencode-plugins"><img src="https://agentmods.dev/badge/skills/sveltejs/ai-tools/writing-opencode-plugins.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 63 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,309 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high System Prompt Leakage · line 87
    Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
    Fix: Remove any instructions that reveal, print, or output system prompts or internal rules. System instructions should never be exposed to end users.
How audits are shown
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.1 $0.00063 $0.01309
Opus 5.5 $0.00025 $0.00524
Sonnet 5.5 $0.00013 $0.00262
Haiku 4.5 $0.00006 $0.00131

Measured 1mo ago against content hash f9687fb8abc9, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

writing-opencode-plugins 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 1mo 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/skills/writing-opencode-plugins/SKILL.md · 127 lines

How it starts

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

Writing OpenCode Plugins

Use this skill to implement production-quality OpenCode plugins. Treat the repository's exported types and runtime as authoritative because plugin APIs are evolving and public docs may lag.

Start Here

  1. Decide which runtime owns the feature.
  2. Read the relevant public type before writing code.
  3. Find one focused in-repository example using the same API.
  4. Implement the smallest target-specific module.
  5. Test loading, behavior, failure, and cleanup in the owning package.
Need Plugin target Import Configuration
Hooks, tools, auth, providers, model parameters, shell environment Server @opencode-ai/plugin opencode.json or auto-discovered .opencode/plugins/*.{ts,js}
Commands, keybindings, routes, dialogs, slots, themes, notifications TUI @opencode-ai/plugin/tui Explicit tui.json plugin entry
Both Two target-only entrypoints Both imports in separate files Package exports ./server and ./tui

Never export server and tui from the same module. Do not use server event hooks as a substitute for interactive TUI APIs.

Verify The Current Contract

Read these files before implementing unfamiliar behavior:

  • packages/plugin/src/index.ts: authoritative server plugin and hook types.
  • packages/plugin/src/tool.ts: custom tool schema, context, permission, metadata, attachments, and result types.
  • packages/plugin/src/tui.ts: authoritative TUI API and module types.
  • packages/opencode/specs/tui-plugins.md: TUI loading, packaging, lifecycle, and API semantics.
  • packages/opencode/src/plugin/shared.ts: target validation, IDs, and entrypoint resolution.
  • packages/opencode/src/plugin/loader.ts: install, compatibility, and import behavior.

Read the full file on GitHub · 127 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 1mo ago First seen · 127 lines · 63 tokens per session scan A f9687fb8abc9

Subscribe to this mod's changes

writing-opencode-plugins is a skill published in the GitHub repository sveltejs/ai-tools (335 stars, last pushed today), licensed MIT. It adds 63 tokens to every session and 1,309 once invoked, about $0.0003 per session on Opus 5.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.

Related

Other skills, from other repositories

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

chat-pet-sprite-creation

Use when creating or changing VS Code chat pet sprite art, sprite sheets, state animations, eye treatments, Stable/Insiders variants, or pet transitions under src/vs/workbench/contrib/chat/browser/widget/media/chatPet.

microsoft/vscode · 53 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens