create-plugin
하는 일
이 스킬은 OpenCode 코딩 도구용 플러그인을 만드는 과정을 에이전트에게 안내합니다. OpenCode에 맞춤 도구나 동작을 추가하려는 개발자를 위한 스킬입니다.
사용하는 경우
- ✓OpenCode에 맞춤 도구를 추가하고 싶을 때.
- ✓에이전트에게 OpenCode용 플러그인을 작성하거나 만들어 달라고 할 때.
- ✓OpenCode의 이벤트에 연결되는 새 동작으로 OpenCode를 확장하고 싶을 때.
스킬 링크
https://github.com/Devin-AXIS/iPolloWork/blob/main/.opencode/skills/create-plugin/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“OpenCode 플러그인을 만들어 주세요. 프로젝트 안의 파일 크기를 확인하는 도구를 추가해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
에이전트는 표준 플러그인 형태를 사용합니다. 도구와 훅을 반환하는 비동기 함수이며, 입력 규칙은 zod로 작성합니다. 파일은 알맞은 플러그인 폴더에 넣습니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 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")
자주 묻는 질문
플러그인 파일은 어디에 두나요?
프로젝트 플러그인 폴더, 전역 설정 폴더, 또는 패키지로 공유할 수 있습니다.
TypeScript를 알아야 하나요?
예제가 TypeScript로 되어 있어서 익숙하면 도움이 됩니다. 대부분의 코드는 에이전트가 작성합니다.
도구는 무엇을 반환하나요?
도구의 execute 단계는 텍스트 결과를 반환하거나, 출력과 선택적 세부 정보가 담긴 객체를 반환합니다.
상세 정보
작성자의 원본 설명
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
인기도
- GitHub 스타
- 7.4k
- 순위
- #13287
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
image-editing
7.4k에이전트가 기존 이미지의 선택한 부분만 편집하고 나머지는 그대로 두며, 결과를 새 파일로 저장하도록 돕습니다.
image-generation
7.4k에이전트가 iPolloWork 이미지 서비스로 새 이미지를 만들고, 요청한 그림이나 디자인의 보조 시각 자료를 제공하도록 돕습니다.
ipollowork-design-editorial
7.4k에이전트가 iPolloWork 디자인 프로젝트 안에서 기사와 보고서를 만들거나 편집하고, 스타일 토큰과 레이아웃을 그대로 유지하도록 돕습니다.
ipollowork-design-graphics
7.4k에이전트가 iPolloWork 디자인 세션에서 포스터와 소셜 카드 시리즈를 만들거나 편집하며, 카드 스타일의 일관성을 유지하도록 돕습니다.