create-plugin
하는 일
이 스킬은 OpenCode 플러그인의 뼈대를 만듭니다. 플러그인은 OpenCode 코딩 에이전트에 사용자 도구와 훅을 추가하는 확장 기능입니다. 자신만의 도구로 이 에이전트를 확장하려는 사람을 위한 스킬입니다.
사용하는 경우
- ✓OpenCode에 새 도구를 주는 플러그인을 요청할 때.
- ✓프로젝트나 전역 설정 폴더에 플러그인 파일을 작성하고 싶을 때.
- ✓도구 정의가 있는 OpenCode 플러그인의 올바른 구조가 필요할 때.
스킬 링크
https://github.com/different-ai/openwork/blob/dev/.opencode/skills/create-plugin/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“도시의 날씨를 확인하는 도구를 추가하는 OpenCode 플러그인을 작성해 주실 수 있나요?”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
AI는 올바른 내보내기, 도구 정의, 인수 스키마가 있는 플러그인 파일을 작성합니다. 파일은 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
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
shadcn
24k에이전트가 shadcn/ui 프로젝트에서 버튼, 카드, 양식 같은 기성 인터페이스 부품을 추가하고, 찾고, 고치도록 돕습니다.
upload-photo
24k에이전트가 스크린샷이나 동영상을 GitHub 풀 리퀘스트나 이슈에 첨부하도록 돕습니다. 접근성을 위해 대체 텍스트도 붙일 수 있습니다.
connect-openwork-mcp
24k에이전트가 OpenWork MCP 게이트웨이에 연결해, 팀의 OpenWork 스킬, 플러그인, 연결 기능을 사용하도록 돕습니다.
install-openwork
24k에이전트가 무료 데스크톱 앱 OpenWork를 컴퓨터에 설치하고 첫 작업을 시작하도록 돕습니다.