跳到正文
cccskills
免费在 GitHub 公开

create-plugin

Create an OpenCode plugin for iPolloWork with custom tools and hooks, which run code at specific events. The skill builds the TypeScript file and adds it to the configuration so it can load after a session restart.

中文简介正在准备中。当前显示英语简介。

原文查看原文说明

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'.

查看安装方法

适用场景

  • Add custom tools to iPolloWork
  • Create tools for saving and listing notes
  • Run custom code before or after tool execution
  • Adapt Anthropic plugin definitions for OpenCode

包含的文件(1)

  • SKILL.md5.1 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

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.json plugin array
  • URL: file: or https: path in the plugin array

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

  1. Export default an async function that returns the hooks object.
  2. Tool args use zodSchema.shape (a ZodRawShape), not the ZodObject.
  3. execute returns a string or { output: string; metadata?: Record<string, unknown> }.
  4. Tools are declared, not registered imperatively — return them in the hooks object.
  5. fetch() works — plugins run in-process inside the OpenCode runtime.
  6. process.env is 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:

AspectOpenCode PluginAnthropic Plugin
Entry pointAsync factory functionManifest JSON
Tool argsZod schema .shapeJSON Schema
RuntimeIn-process (Bun/Node)Sandboxed container
Authprocess.envOAuth/API key in manifest
Distributionnpm / file path / URLAnthropic marketplace

To adapt an Anthropic plugin for OpenCode:

  1. Rewrite the tool definitions using Zod instead of JSON Schema.
  2. Move any auth from the manifest to env vars or opencode.json provider config.
  3. Export the async factory function instead of the manifest.
  4. 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:

  1. Create .opencode/plugins/<name>.ts with the plugin code.
  2. Add it to opencode.json plugin array if not already present.
  3. Tell the user to restart their session for the plugin to load.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Search the private research library in Acme Research and summarize relevant material. Include each returned document's title and source URL so readers can identify the sources and check the material behind the summary.

中文简介正在准备中。当前显示英语简介。

  • Searching a private research library by topic
  • Summarizing research material
  • Reviewing findings with document titles and source links
Devin-AXIS/iPolloWork70882026年10月18日 更新

Capture product screenshots for landing pages, newsletters, social posts, and presentations by operating the real app. Check page structure, image pixels, and visual appearance, then retake images with overlapping text, clipping, or other visible defects.

中文简介正在准备中。当前显示英语简介。

  • Capture app screenshots for landing pages or newsletters
  • Prepare screenshots at aspect ratios suited to social posts or slides
  • Retake screenshots with clipped text or unwanted panels
Devin-AXIS/iPolloWork70882026年10月18日 更新

Find the right official documentation before answering technical questions. It identifies the library and version, retrieves focused references and examples, and explains relevant APIs while separating documented behavior from inference.

中文简介正在准备中。当前显示英语简介。

  • Checking API usage for an installed library version
  • Finding official guidance before upgrading
  • Separating documented behavior from assumptions
Devin-AXIS/iPolloWork70882026年10月18日 更新

Implement or upgrade code using the project's exact dependency versions and matching Context7 documentation. Check available APIs, make the smallest compatible change, run package checks, and identify behavior that still needs verification in a running application.

中文简介正在准备中。当前显示英语简介。

  • Implementing features with APIs supported by installed versions
  • Checking migration guidance before upgrading dependencies
  • Finding supported alternatives to unavailable APIs
Devin-AXIS/iPolloWork70882026年10月18日 更新

Launch a standalone Chrome browser in a Daytona sandbox and control it through CDP, a browser debugging connection. Use it to complete sign-in, OAuth authorization, and web administration flows, then verify the visible results.

中文简介正在准备中。当前显示英语简介。

  • Signing into Den Web in a standalone browser
  • Completing OAuth authorization pages
  • Configuring settings available only on the web
Devin-AXIS/iPolloWork70882026年10月18日 更新

Set up the iPolloWork server in Daytona, connect an Electron desktop client through public preview URLs, and check service health and logs. Supports cloud feature validation with separate server and desktop test environments.

中文简介正在准备中。当前显示英语简介。

  • Start a Daytona server test environment
  • Connect Electron to cloud services
  • Validate marketplace and organization policy flows
Devin-AXIS/iPolloWork70882026年10月18日 更新

查看 Devin-AXIS 的全部技能

报告此技能的问题