create-plugin
Что он делает
Этот скилл создает каркас плагина OpenCode, то есть расширения, которое добавляет собственные инструменты и хуки в агент для написания кода OpenCode. Он нужен людям, которые хотят расширить этот агент своими инструментами.
Когда использовать
- ✓Когда вы просите плагин, который добавляет OpenCode новый инструмент.
- ✓Когда вы хотите написать файл плагина для проекта или глобальной папки настроек.
- ✓Когда нужна правильная структура плагина OpenCode с описаниями инструментов.
Ссылка на скилл
https://github.com/different-ai/openwork/blob/dev/.opencode/skills/create-plugin/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Напишите плагин для OpenCode, который добавляет инструмент проверки погоды в городе.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
ИИ пишет файл плагина с правильным экспортом, описаниями инструментов и схемами аргументов. Файл помещается туда, где OpenCode может его найти.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
Skill: Create an OpenCode Plugin
Scaffold a working OpenCode plugin for use in OpenWork.
When to use
- User asks "create a plugin that does X"
- User asks "write a plugin" or "make a plugin"
- User wants to extend OpenWork/OpenCode with custom tools
Plugin API
An OpenCode plugin is an async factory function that returns a hooks object.
File location
Plugins can live in:
- Project:
.opencode/plugins/my-plugin.ts(auto-discovered) - Global:
~/.config/opencode/plugins/my-plugin.ts - npm: published as a package, referenced in
opencode.jsonpluginarray - URL:
file:orhttps:path in thepluginarray
Minimal shape
import { z } from "zod";
export default async () => ({
tool: {
my_tool_name: {
description: "What this tool does.",
args: z.object({
input: z.string().describe("The input parameter."),
}).shape, // NOTE: .shape, not the ZodObject itself
async execute(args: { input: string }) {
// Your logic here. Can use fetch(), fs, child_process, etc.
return `Result: ${args.input}`;
},
},
},
});
Key rules
- Export default an async function that returns the hooks object.
- Tool args use
zodSchema.shape(aZodRawShape), not theZodObject. executereturns astringor{ output: string; metadata?: Record<string, unknown> }.- Tools are declared, not registered imperatively — return them in the hooks object.
fetch()works — plugins run in-process inside the OpenCode runtime.process.envis accessible — use env vars for secrets/config.
Available hooks
{
// Modify the system prompt
"experimental.chat.system.transform": async (input, output: { system: string[] }) => {
output.system.push("Extra instruction for the agent.");
},
// Define tools the agent can call
tool: {
tool_name: { description, args, execute },
},
// Run code before/after a tool executes
"tool.execute.before": async ({ tool, args }) => { /* ... */ },
"tool.execute.after": async ({ tool, args, result }) => { /* ... */ },
// React to lifecycle events
event: async ({ event }) => { /* ... */ },
}
Registering the plugin
Add to opencode.json:
{
"plugin": [
".opencode/plugins/my-plugin.ts"
]
}
Or install from npm:
{
"plugin": [
"my-published-plugin"
]
}
Anthropic / Claude plugin compatibility
OpenCode plugins are NOT the same as Anthropic's plugin format. Key differences:
| Aspect | OpenCode Plugin | Anthropic Plugin |
|---|---|---|
| Entry point | Async factory function | Manifest JSON |
| Tool args | Zod schema .shape |
JSON Schema |
| Runtime | In-process (Bun/Node) | Sandboxed container |
| Auth | process.env |
OAuth/API key in manifest |
| Distribution | npm / file path / URL | Anthropic marketplace |
To adapt an Anthropic plugin for OpenCode:
- Rewrite the tool definitions using Zod instead of JSON Schema.
- Move any auth from the manifest to env vars or
opencode.jsonprovider config. - Export the async factory function instead of the manifest.
- HTTP-based Anthropic plugins can often be wrapped as MCP servers instead.
Example: plugin with multiple tools
import { z } from "zod";
export default async () => ({
"experimental.chat.system.transform": async (_input: unknown, output: { system: string[] }) => {
output.system.push("You have access to a note-taking system. Use save_note and list_notes.");
},
tool: {
save_note: {
description: "Save a note with a title and body.",
args: z.object({
title: z.string().describe("Note title"),
body: z.string().describe("Note content"),
}).shape,
async execute(args: { title: string; body: string }) {
const fs = await import("node:fs/promises");
const path = `.opencode/notes/${args.title.replace(/[^a-zA-Z0-9-_]/g, "_")}.md`;
await fs.mkdir(".opencode/notes", { recursive: true });
await fs.writeFile(path, `# ${args.title}\n\n${args.body}\n`);
return `Saved note: ${path}`;
},
},
list_notes: {
description: "List all saved notes.",
args: {},
async execute() {
const fs = await import("node:fs/promises");
try {
const files = await fs.readdir(".opencode/notes");
return files.filter(f => f.endsWith(".md")).jo
Частые вопросы
Где лежит файл плагина?
В папке plugins проекта, в глобальной папке настроек или как опубликованный пакет.
Что экспортирует плагин?
Асинхронную функцию, которая возвращает объект с хуками и инструментами.
Используется ли zod?
В примере скилла zod описывает аргументы инструментов.
Подробности
Оригинальное описание автора
Create an OpenCode plugin for OpenWork. Scaffolds the plugin file with the correct API shape, tool definitions, and hook registration. Use when the user asks to 'create a plugin', 'write a plugin', or 'make a plugin that does X'.
repo: different-ai/openwork
Популярность
- Звёзды на GitHub
- 24k
- Место в рейтинге
- #10110
- Лицензия
- —
- Обновлён
- 02.11.2026
Комментарии
- …
Другие скиллы из этого репозитория
shadcn
24kПомогает агенту добавлять, находить и исправлять готовые элементы интерфейса в проектах shadcn/ui, например кнопки, карточки и формы.
upload-photo
24kПозволяет агенту прикрепить скриншот или видео к запросу на слияние или задаче GitHub с альтернативным текстом для доступности.
connect-openwork-mcp
24kПомогает агенту подключиться к шлюзу OpenWork MCP, чтобы использовать скиллы, плагины и подключения вашей команды в OpenWork.
install-openwork
24kПозволяет агенту установить бесплатное настольное приложение OpenWork на ваш компьютер и помочь выполнить первую задачу.
Похожие скиллы
diffs
394kПозволяет агенту создать настоящее сравнение правок в виде ссылки или файла изображения, которым можно поделиться, вместо ручной сводки.
coding-agent
394kПомогает агенту передать большую задачу по коду в Codex, Claude Code или OpenCode как фоновому исполнителю, а затем проверять ее ход.
gh-issues
394kПомогает агенту находить задачи GitHub, выбирать, над какими работать, и открывать запросы на слияние с исправлениями, включая ответы на комментарии рецензентов.