create-plugin
Fungsinya
Skill ini memandu agent membangun plugin untuk alat pengodean OpenCode. Skill ini untuk pengembang yang ingin menambahkan alat atau perilaku kustom ke OpenCode.
Kapan dipakai
- βSaat Anda ingin alat kustom ditambahkan ke OpenCode.
- βKetika Anda meminta agent menulis atau membuat plugin untuk OpenCode.
- βSaat Anda ingin memperluas OpenCode dengan perilaku baru yang terhubung ke peristiwanya.
Link skill
https://github.com/Devin-AXIS/iPolloWork/blob/main/.opencode/skills/create-plugin/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
βBuat plugin untuk OpenCode yang menambahkan alat untuk memeriksa ukuran berkas di proyek saya.β
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent memakai bentuk plugin standar: fungsi async yang mengembalikan alat dan hook, dengan aturan masukan yang ditulis dalam zod. Berkas ditempatkan di folder plugin yang benar.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Skill: 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")
Pertanyaan umum
Di mana berkas plugin disimpan?
Bisa di folder plugin proyek, folder konfigurasi global, atau dibagikan sebagai paket.
Apakah saya perlu tahu TypeScript?
Contohnya ditulis dalam TypeScript, jadi sedikit pengalaman akan membantu. Agent menulis sebagian besar kodenya untuk Anda.
Apa yang dikembalikan sebuah alat?
Langkah execute alat mengembalikan hasil teks, atau objek dengan keluaran dan detail opsional.
Detail
Deskripsi asli dari pembuat
Create an OpenCode plugin for iPolloWork. 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: Devin-AXIS/iPolloWork
Popularitas
- Bintang GitHub
- 7.4k
- Peringkat
- #13287
- Lisensi
- β
- Diperbarui
- 2/11/2026
Komentar
- β¦
Skill lain dari repositori ini
image-editing
7.4kMembantu agent Anda mengedit bagian yang dipilih dari gambar yang sudah ada, membiarkan bagian lainnya tidak berubah, dan menyimpan hasilnya sebagai berkas baru.
image-generation
7.4kMembantu agent Anda membuat gambar baru lewat layanan gambar iPolloWork, untuk gambar yang diminta atau visual pendukung dalam sebuah desain.
ipollowork-design-editorial
7.4kMembantu agent Anda membuat atau merevisi artikel dan laporan di dalam desain iPolloWork Anda, dengan menjaga token gaya dan tata letak Anda tetap utuh.
ipollowork-design-graphics
7.4kMembantu agent Anda membuat atau mengedit poster dan rangkaian kartu sosial di sesi desain iPolloWork Anda, dengan gaya kartu yang konsisten.
Skill serupa
diffs
394kMemungkinkan agent Anda menghasilkan diff perubahan yang nyata dan dapat dibagikan sebagai tautan viewer atau file gambar, bukan ringkasan yang ditulis manual.
coding-agent
394kMembantu agent Anda menyerahkan pekerjaan pemrograman besar ke Codex, Claude Code, atau OpenCode di latar belakang, lalu memeriksa kemajuannya.
gh-issues
394kMembantu agent Anda menemukan issue GitHub, memilih yang dikerjakan, dan membuka pull request perbaikan, termasuk tindak lanjut komentar tinjauan.