Logo Plugin Builder

Plugin Builder

Tổ chức
AIDotNet
plugin-builder

Author, package, and debug NextCoWork plugins — the single entry point. Covers the manifest (package.json) and the permission model with per-call capability gates, every contribution point (commands, menus, keybindings, custom editors, views, web apps, agent tools, card views, configuration, bundled Skills) including which install cleanly but do nothing yet, the ncw:doc document channel, result / live-progress / interactive cards, the nextcowork runtime API namespaces, the sandbox and isolation model, and build + ZIP + market publishing rules. Use for scaffolding a plugin, choosing what to contribute, writing or reviewing a manifest, picking or debugging a permission, taking over a file type, bundling Skills with a plugin, giving the agent new tools, or fixing a plugin that builds, installs, activates, renders, or publishes wrong. Detailed material lives in references/ next to this file.

Tổng quan

Nhà phát hànhAIDotNet
Kho mãNextCoWork
Tên kỹ năngplugin-builder
Sao
639
Bản fork
130
Tệp đi kèm
7
Giấy phépApache-2.0
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • 7 tệp đi kèm

    Các tập lệnh, mẫu và tài liệu tham khảo mà mô hình có thể đọc khi làm việc. Các tệp chỉ cho phép đọc và không bao giờ được thực thi.

  • Mã nguồn mở

    Được AIDotNet công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Plugin Builder trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/AIDotNet/NextCoWork/tree/main/resources/skills/plugin-builder
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AIDotNet/NextCoWork.git /tmp/NextCoWork
mkdir -p .claude/skills
cp -r /tmp/NextCoWork/resources/skills/plugin-builder .claude/skills/plugin-builder
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Plugin Builder trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Plugin Builder ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Plugin Builder với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

NextCoWork Plugin Builder

Build plugins that extend the NextCoWork desktop app and its AI agent. A plugin is a self-contained package that runs sandboxed and talks to the host over a small, permissioned RPC surface.

Read the reference you need — this page is the map

The details live in references/, next to this SKILL.md. Read the file that matches the task; this page alone is not enough to write a working plugin.

TaskReference
Every contributes key, what it does, and which ones do nothing yetreferences/contribution-points.md
Manifest fields, the permission model, what needs which capabilityreferences/manifest-permissions.md
Method → permission, one row per RPCreferences/permission-map.md
Taking over file types (custom editors), views, the document channelreferences/custom-editors.md
Contributing agent tools, result / live / interactive cardsreferences/agent-tools.md
Runtime API namespaces (workspace / net / process / storage / secrets / window / tabs / …)references/runtime-api.md
Build, ZIP layout, installer checks, market publishreferences/packaging.md

How to open them: the paths above are relative to this Skill's own package directory — the directory holding this SKILL.md. Bundled Skills are installed into the app's global Skill root (<userData>/skills/plugin-builder/), which differs between dev and packaged builds; if you don't know it, locate the package first (for example a Glob search for **/skills/plugin-builder/SKILL.md) and read the reference by its absolute path. Do not look for them relative to the user's workspace — they are not part of it.

The isolation model (read this first)

Every plugin runs with no access to the host DOM or Node. Two surfaces exist:

  • Background host window — a hidden BrowserWindow (sandbox, contextIsolation, nodeIntegration:false) on a dedicated session partition, serving your main ESM entry from ncw-plugin://<publisher>.<name>/. This is where activate() and your tool/command handlers run.
  • View / card iframes — your HTML (contributes.views, contributes.customEditors, contributes.cardViews) rendered in a cross-origin ncw-plugin:// iframe inside the main window. Sandboxed: no popups, no modals, no top-navigation. Views cannot import nextcowork — that shim only loads in the host window; views talk to the host exclusively through the document channel and the theme shim (see references/custom-editors.md).

You reach the host only through the nextcowork module API (host window side). Every capability is gated by a permission the user granted, plus an argument gate (path inside the workspace, host in hostPermissions, command in allowedCommands).

Package anatomy

<publisher>.<name>/
├── package.json            # the manifest (required)
├── dist/
│   ├── extension.js        # single-file ESM entry (manifest.main)
│   ├── views/*.html        # view / cardView HTML (optional)
│   └── ...
├── l10n/                   # zh-CN.json + en-US.json (required if you use %keys%)
└── icon.png                # optional (≤256 KB)

Install by ZIP (top-level single dir named <publisher>.<name>), from a directory in dev, or from the market.

The smallest plugin is zero code

If all you want is to bring a website in ("open Bilibili in a tab"), you do not need an entry module, a bundler, or a host process. Declare "kind": "webapp" and one webApps entry — that's the whole package:

jsonc
{
  "publisher": "ncw", "name": "bilibili", "kind": "webapp",
  "displayName": "哔哩哔哩", "description": "…", "version": "0.1.0",
  "engines": { "nextcowork": "^0.3.0" }, "l10n": "./l10n",
  "permissions": [],
  "hostPermissions": ["https://www.bilibili.com/*"],
  "contributes": { "webApps": [
    { "id": "home", "title": "%app.home%", "icon": "tv", "url": "https://www.bilibili.com/" }
  ] }
}

Installing it puts an entry in the sidebar; clicking it opens the site in a workspace tab, signed in already (it shares the workspace browser session). Full rules — including why main in a webapp manifest is an error rather than an ignored field — in references/manifest-permissions.md. Working example: examples/ncw.bilibili.

Minimal working plugin (with code)

package.json:

jsonc
{
  "publisher": "acme", "name": "hello", "displayName": "Hello", "description": "demo",
  "version": "0.1.0", "engines": { "nextcowork": "^0.3.0" }, "main": "./dist/extension.js",
  "l10n": "./l10n", "activationEvents": ["onTool:say_hello"],
  "permissions": [],
  "contributes": { "tools": [{ "name": "say_hello", "title": "%tool.hello%", "shape": "orchestration" }] }
}

dist/extension.js:

ts
import * as ncw from 'nextcowork'
export function activate(context) {
  context.subscriptions.push(
    ncw.tools.registerTool('say_hello', {
      description: 'Greet someone.',
      inputSchema: { type: 'object', properties: { name: { type: 'string' } }, required: ['name'] },
      readOnly: true, destructive: false, needsNetwork: false,
      async invoke({ input }) {
        return { content: [{ text: `Hello, ${input.name}!` }] }
      }
    })
  )
}

l10n/zh-CN.json → { "plugin.acme.hello.tool.hello": "打个招呼" }, l10n/en-US.json → { "plugin.acme.hello.tool.hello": "Say hello" }.

Activation model

Declared plugins wake lazily on the first matching event. Waking a plugin wakes its declared dependencies first.

  • onStartup — wakes at launch. The market rejects this by default (memory risk). Avoid unless essential.
  • onCommand:<commandId>, onCustomEditor:<viewType>, onTool:<toolName>, onView:<viewId>, onWorkspaceContains:<glob>

★ The event you declare must be one the host actually dispatches: onCommand: fires when the user runs the command; onCustomEditor: fires when a tab opens for that viewType — the host wakes the plugin before mounting the view iframe, because view files are only servable for plugins that have been spawned at least once (an unwoken plugin's iframe is a bare 403 "forbidden"). Prefer these specific events over onStartup.

Idle plugins sleep after ~5 minutes; the next event re-wakes them. Sleeping stops your background code but does not stop serving your view files.

Gotchas that bite every new author

  • Titles/messages are l10n keys, not text — ship both locales or install fails.
  • The manifest is the capability ceiling; permissions.request() for anything outside permissions ∪ optionalPermissions is silently denied. See references/manifest-permissions.md for what each capability unlocks, per API call.
  • Contributing a resource (view / custom editor / command / tool registration) itself needs no permission — permissions gate the runtime RPCs you call, not the contribution points. A pure custom editor that saves via the document channel needs zero permissions.
  • Tool inputSchema is not validated by the host — validate input yourself.
  • Result/live/interactive cards are UI-only; the model only ever sees content text.
  • connect() needs both the plugins permission and a declared dependencies entry.
  • nextcowork must be external in the host-side bundle; views must bundle everything (CSP gives no network). See references/packaging.md.

Inspect the host implementation when behavior is unclear: manifest schema src/shared/plugin/manifest.ts, RPC + permissions src/shared/plugin/protocol.ts, permission model src/shared/plugin/permission.ts, contribution points src/shared/plugin/contribution.ts, custom editor matching src/shared/plugin/custom-editor.ts, lifecycle src/main/plugin/manager.ts, protocol/CSP src/main/plugin/protocol.ts, cards src/renderer/src/views/chat/CardRenderer.tsx, full typed API packages/plugin-api/nextcowork.d.ts.

Plugin views (custom editors) are React-ready: the host serves react, react-dom and its own control kit as nextcowork/ui over an injected import map, so a view bundle carries neither. Mark them external, import Button / Dialog / TextArea from nextcowork/ui and the document channel from nextcowork/view. See references/custom-editors.md.

Working examples live in examples/ — ncw.bilibili (zero-code web app: three files, no JavaScript), acme.note-editor (React view on the host kit, zero dependencies), acme.excalidraw (custom editor + command + onStartup), acme.image-studio (image editor over the document channel's base64 branch, zero permissions), acme.markdown-studio (editor + rich split view, zero permissions, code-split chunks).

Tệp đi kèm

Khi kỹ năng đã được tải, mô hình có thể đọc các tệp này nếu cần. Các tệp này chỉ dùng để đọc và không bao giờ được thực thi.

Câu hỏi thường gặp

Kỹ năng AI Plugin Builder làm được gì?

Author, package, and debug NextCoWork plugins — the single entry point. Covers the manifest (package.json) and the permission model with per-call capability gates, every contribution point (commands, menus, keybindings, custom editors, views, web apps, agent tools, card views, configuration, bundled Skills) including which install cleanly but do nothing yet, the ncw:doc document channel, result / live-progress / interactive cards, the nextcowork runtime API namespaces, the sandbox and isolation model, and build + ZIP + market publishing rules. Use for scaffolding a plugin, choosing what to...

Vì sao nên dùng Plugin Builder trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Plugin Builder là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Plugin Builder trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/AIDotNet/NextCoWork/tree/main/resources/skills/plugin-builder. TypingMind đọc tệp SKILL.md, đóng gói các tệp đi kèm rồi cài đặt cả gói dưới dạng một kỹ năng mà bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Plugin Builder?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Plugin Builder với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Plugin Builder với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Plugin Builder có miễn phí không?

Có. Kỹ năng này được AIDotNet phát hành trên GitHub theo giấy phép Apache-2.0. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇