Навык create-plugin
✓ ПровереноСоздание шаблонов OpenCode-плагинов для iPolloWork с корректной структурой API, определениями инструментов и регистрацией хуков.
- Звёзды на GitHub
- 7 451
- Файлы
- 1
- Последний коммит
- 11 нояб. 2026 г.
- Лицензия
- —
- Разрешённые инструменты
- —
Что делает навык create-plugin?
create-plugin — это Agent Skill. Создание шаблонов OpenCode-плагинов для iPolloWork с корректной структурой API, определениями инструментов и регистрацией хуков.
Сводка сгенерирована из SKILL.md навыка.
О skill create-plugin
Этот навык позволяет разработчикам создавать шаблоны OpenCode-плагинов для iPolloWork, если они хотят расширить среду выполнения с помощью пользовательских инструментов и хуков. Когда агент получает запрос на создание или написание плагина, он использует этот навык для генерации TypeScript-файла, содержащего асинхронную функцию-фабрику. Эта функция создает объект хуков, который определяет поведение инструментов, трансформацию системных промптов и реакции на события жизненного цикла.
Навык гарантирует, что сгенерированный код соответствует специфическим требованиям, таким как использование схем Zod для аргументов инструментов и возврат строк или определенных объектов метаданных из функций выполнения. Он берет на себя структурную настройку плагинов, расположенных в директориях проекта, папках глобальной конфигурации или внешних npm-пакетах. Автоматизируя создание этих файлов и предоставляя необходимые шаги регистрации для конфигурации opencode.json, он помогает разработчикам реализовывать внутрипроцессную логику, используя стандартные возможности Node или Bun, такие как fetch и доступ к файловой системе.
Что агент может делать с ним
- 1Генерация нового файла плагинаСоздание TypeScript-файла плагина в локальной директории проекта для добавления новых возможностей в iPolloWork.
- 2Определение пользовательских инструментов агентаРазработка новых инструментов со специфическими формами аргументов Zod и логикой выполнения для вызова агентом.
- 3Изменение системных инструкцийРеализация хука, который внедряет дополнительные инструкции в системный промпт агента.
- 4Регистрация плагинов в конфигурацииОбновление файла opencode.json для обеспечения автоматического обнаружения только что созданного плагина.
Написано на основе skill SKILL.md. Каждый сценарий использования проверен по цитате из него.
Как установить навык create-plugin
Каждая команда копирует папку навыка в каталог навыков клиента. Перезапустите клиент или начните новую сессию, чтобы загрузить его.Установка навыка create-plugin в Claude Code
~/.claude/skills/create-plugin/SKILL.md
$ npx degit Devin-AXIS/iPolloWork/.opencode/skills/create-plugin ~/.claude/skills/create-pluginУстановка навыка create-plugin в Claude Code (project)
.claude/skills/create-plugin/SKILL.md
$ npx degit Devin-AXIS/iPolloWork/.opencode/skills/create-plugin .claude/skills/create-pluginУстановка навыка create-plugin в Codex
~/.agents/skills/create-plugin/SKILL.md
$ npx degit Devin-AXIS/iPolloWork/.opencode/skills/create-plugin ~/.agents/skills/create-pluginУстановка навыка create-plugin в Gemini CLI
~/.gemini/skills/create-plugin/SKILL.md
$ npx degit Devin-AXIS/iPolloWork/.opencode/skills/create-plugin ~/.gemini/skills/create-pluginУстановка навыка create-plugin в Claude.ai
npx degit Devin-AXIS/iPolloWork/.opencode/skills/create-plugin create-plugin && zip -r create-plugin.zip create-plugin # claude.ai → Customize → Skills → + → Create skill → Upload a skill → create-plugin.zip
Автоматические проверки
Запущено 14 нояб. 2026 г.Полный отчёт →Прошёл наши автоматические проверки. Это не аудит безопасности: прочитайте скрипты, прежде чем агент их запустит. Как работают проверки
- Связанный и доступный исходный репозиторийdevin-axis/ipollowork/.opencode/skills/create-plugin is public and reachablegithub.com/devin-axis/ipollowork/tree/HEAD/.opencode/skills/ ↗Пройдено
- Open source лицензия (OSI)No licenseПроблема
- Коммит или релиз за последний годLast commit 2026-11-11github.com/devin-axis/ipollowork/commits ↗Пройдено
- В скриптах нет загрузки с запуском и кражи учётных данныхNo scripts in the skill folderПройдено
- В SKILL.md нет скрытых инструкцийNo override phrases, safeguard switches, credential requests or hidden charactersgithub.com/devin-axis/ipollowork/blob/HEAD/.opencode/skills/ ↗Пройдено
- Заранее разрешённые инструменты ограниченыNo pre-approved tools; the agent asks before using onegithub.com/devin-axis/ipollowork/blob/HEAD/.opencode/skills/ ↗Пройдено
SKILL.md
Открыть на GitHubSkill: Create an OpenCode Plugin
Scaffold a working OpenCode plugin for use in iPolloWork.
When to use
- User asks "create a plugin that does X"
- User asks "write a plugin" or "make a plugin"
- User wants to extend iPolloWork/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")).join("\n") || "No notes yet.";
} catch {
return "No notes yet.";
}
},
},
},
});
Scaffold workflow
When the user describes what they want the plugin to do:
- Create
.opencode/plugins/<name>.tswith the plugin code. - Add it to
opencode.jsonpluginarray if not already present. - Tell the user to restart their session for the plugin to load.
Файлы в этом навыке
1Вопросы о навыке create-plugin
Как установить навык create-plugin в Claude Code?
Выполните npx degit Devin-AXIS/iPolloWork/.opencode/skills/create-plugin ~/.claude/skills/create-plugin. Claude Code загружает навыки из ~/.claude/skills (все проекты) или .claude/skills (один проект) и использует навык, когда его описание соответствует задаче.
Какие клиенты могут использовать навык create-plugin?
Любой клиент, который читает формат Agent Skills: Claude Code, Codex, Gemini CLI и claude.ai (загрузить как ZIP). Скрипты в навыке выполняются только там, где клиент разрешает выполнение кода.
Совместимы ли OpenCode-плагины с плагинами Anthropic?
Нет, это разные форматы. OpenCode-плагины используют асинхронную функцию-фабрику и схемы Zod, в то время как плагины Anthropic используют Manifest JSON и JSON Schema.