Logo Create Plugin

Create Plugin

Cộng đồng
ahmadrosid
create-plugin

Soạn thảo hoặc xây dựng plugin Nakama tùy chỉnh với các hành động, trang tổng quan, kỹ năng, worker và quy trình migration. Dùng khi người dùng yêu cầu Super Nakama tạo plugin.

Add to TypingMind

Tổng quan

Nhà phát hànhahmadrosid
Kho mãnakama
Tên kỹ năngcreate-plugin
Sao
492
Bản fork
91
Tệp đi kèm
15
Giấy phépMIT
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ộ.

  • 15 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 ahmadrosid 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 Create Plugin 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/ahmadrosid/nakama/tree/main/packages/core/src/skills/bundled/create-plugin
  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/ahmadrosid/nakama.git /tmp/nakama
mkdir -p .claude/skills
cp -r /tmp/nakama/packages/core/src/skills/bundled/create-plugin .claude/skills/create-plugin
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 Create Plugin 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 Create Plugin 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 Create Plugin 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.

Create a local draft for human review. Never install or enable the plugin yourself.

Ask first (mandatory)

Before you run the template script for a new plugin, call ask_user_question once. Then stop and wait for the answers. Do not write files in the same turn.

Ask only what the request does not already answer, in one batch of at most five questions. Give each question two to four choices and set allowCustomAnswer: true. Pick from:

  • Actions: what each action does and the inputs it needs.
  • Access: every member, or admins only (access).
  • Effect: read only, or saves, sends, or deletes data (effect).
  • Data: no stored data, files under dataDir, or a SQLite table (migrations).
  • Page: what the page shows and which buttons it has, or no page.
  • Agent use: whether profiles call the action as a tool in chat.
  • Outside services: which API it calls. Plugins have no secret store, so a key needs an admin-only save_settings action with exposeAsTool: false that stores it under dataDir.

If the request answers all of them, ask one question instead: show the plan in the prompt (plugin ID, actions with access and effect, page, data) with the choices "Build it" and "Change something".

Build from the answers. Do not add actions, pages, or storage the user did not ask for. If ask_user_question is not available, ask the same questions in one plain message and wait. When the user asks to change an existing draft, ask only if the change is unclear.

Workspace and build

Use the profile workspace from the tool context. Write only beneath plugin-drafts/<pluginId>/; use a stable lowercase slug for the plugin ID. Keep package.json, nakama.plugin.json, src/, and built output together. Put build instructions in src/BUILD.md. Keep sources after installation.

Start every new plugin from the template. Choose the plugin ID, display name, and first action key, then run this from the profile workspace (bash cwd):

sh
bun <skill directory>/scripts/new-plugin.mjs <plugin-id> "<Plugin Name>" <action-key>

The script writes plugin-drafts/<plugin-id>/ with a manifest, package.json, src/<action-key>.js, an example page in src/ui.jsx and src/ui.css, src/nakama-plugin.d.ts (types for ctx), src/BUILD.md, and the built actions/<action-key>.js and ui/app.js. It refuses an existing draft; edit that draft instead. Then replace the example action, page, description, and input schema with the real ones, and rebuild.

If the plugin stores records and its page shows them (contacts, books, tickets, expenses), use the data template instead:

sh
bun <skill directory>/scripts/new-plugin.mjs <plugin-id> "<Plugin Name>" --data

It adds a SQLite migration with an items table, list_items and save_item actions, and the data page described under "Data pages". Rename the table, columns, and actions to the real ones, and keep the page structure.

Check bun --version with bash. If Bun or a needed library is absent, report the prerequisite. Do not install dependencies or coding tools silently. An assigned bash tool is required. A coding-agent CLI is optional. If delegating, explicitly request local-only drafting: no host repository edits, push, PR, npm publishing, installation, or activation.

Use direct commands such as:

sh
bun build ./src/greet.js --outfile actions/greet.js --target bun
bun build ./src/ui.jsx --outfile ui/app.js --target browser

Do not run generated package scripts or lifecycle scripts. Do not import actions, load UI modules, execute workers or migrations, or call installation APIs. Building uses the host shell; it is not sandboxed. Compilation proves only that the build succeeded. Leave execution tests to the human reviewer.

Minimal package and manifest

package.json needs a package name, matching version, and "type": "module". No nonempty dependencies, optionalDependencies, or peerDependencies. Bundle libraries into output. Never depend on runtime node_modules. Do not use an official plugin ID: workflows, supermemory, or google-meet.

json
{
  "apiVersion": 1,
  "id": "greeting",
  "name": "Greeting",
  "description": "Greet a person.",
  "version": "1.0.0",
  "minNakamaVersion": "0.4.47",
  "author": "Your team",
  "license": "MIT",
  "actions": [{
    "key": "greet",
    "description": "Greet a person by name.",
    "entry": "actions/greet.js",
    "access": "member",
    "effect": "read",
    "exposeAsTool": true,
    "inputSchema": {
      "type": "object",
      "properties": { "name": { "type": "string", "minLength": 1 } },
      "required": ["name"],
      "additionalProperties": false
    }
  }],
  "skills": []
}

Set the minimum host version to one you support. Use access: "admin" for admin-only actions and effect: "write" for mutations. Input schemas support type, properties, required, additionalProperties, items, enum, string length, numeric bounds, and array length bounds. Do not use remote references. Any other keyword fails with invalid_manifest: unsupported_schema, including description, default, title, and format on a property. Describe inputs in the action description and apply defaults in run.

Actions and host calls

Export async function run(input, context). The host supplies orgId, pluginId, pluginVersion, actionKey, actor, and invocationId. Tool calls also receive profileId, sessionId, and workspaceRoot. Write durable files under context.dataDir. Use context.databasePath for SQLite, parameterize queries, and close the database in finally. Never accept organization identity, roles, or storage paths from input.

Call await context.host(request) sequentially. Supported operations: {op:"profiles"}, {op:"tools",agentId}, {op:"execute_tool",agentId,name,input}, and {op:"summarize",agentId,prompt,bag}. The host checks profile access and assignments. It does not permit recursive plugin-tool execution. Summaries have no tools.

Optional capabilities

UI: declare ui: {entryModule:"ui/app.js",assetsDir:"ui",pageLabel:"Greeting"}. Export inject = ["slots","host","ui","styles"] and apply(ctx). Use ctx.React and ctx.ui, never bundled React, React DOM, or internal Nakama imports. Keep the /** @jsxRuntime classic */ and /** @jsx React.createElement */ lines, the module-level let React;, and React = ctx.React; in apply from the template. Never shadow it with const React inside apply: components outside apply then crash with React is not defined. Register exactly one page with ctx.slots.register("page", Component). Call actions through ctx.host.call(actionKey,input); it resolves to the action result. Keep top-level code free of side effects. Clean up React effects and ctx.effect resources. Optional tool:<actionKey> renderers show the action result in chat. They receive action, input, result, and status (running or done); handle older result shapes and do not mutate during rendering.

Nakama design style for pages

Make the page look like the rest of Nakama. Start from the template page.

  • Components: use ctx.ui for every control: Button (variants default, outline, ghost, secondary, destructive, link; size sm in dense rows), Input, Textarea, Select parts, Switch, Checkbox, Dialog parts, DropdownMenu parts, Tooltip, Spinner, and Table parts for records. Do not build look-alike buttons, inputs, or tables from plain elements.
  • Read src/nakama-plugin.d.ts before you use a component. It lists every ctx, ctx.React, and ctx.ui export with its props. Anything not listed is not available: no toast(), no cn(), no icons.
  • Grouping: use Card, CardHeader, CardTitle, and CardContent for boxes such as stat tiles. The template CSS removes the card shadow; never set box-shadow yourself. CardHeader and CardContent pad 24px, so pass a class with --n-space-4 padding for small tiles.
  • Styling: Tailwind classes do not work in plugins. Put CSS in src/ui.css, import it as text, pass it to ctx.styles(css), and nest every rule under [data-plugin-id="<plugin-id>"].
  • Tokens: the template src/ui.css defines the size tokens below. Use them and the host color variables in every rule. Do not write raw colors, sizes outside the scale, or gradients. The host already shows pageLabel as the page title and pads the page, so do not add a big title.
TokenValueUse
--n-space-1/2/3/4/64, 8, 12, 16, 24pxgaps and padding
--n-text-xs12pxcode, badges
--n-text-sm13pxsecondary text, errors
--n-text-base14pxbody
--n-text-lg18pxsection titles (rare)
--n-weight-medium / --n-weight-semibold500 / 600labels / titles
--n-radius / --n-radius-smhost radius (10px) / 6pxboxes / small chips
--n-font-monoJetBrains Monocode and IDs
--n-content-width720pxpage max width (up to 960px for tables)
Host colorLightDarkUse
--background / --foregroundwhite / near black#0a0a0b / #fafafapage and text
--cardwhite#18181braised boxes
--muted / --muted-foregroundlight gray / mid gray#1f1f23 / #a1a1aaquiet fills / secondary text
--borderlight gray#27272a1px lines
--primary / --primary-foreground#b45309 / white#f59e0b / #0a0a0bmain action, links
--destructiveredlight rederrors, delete, bad numbers
--n-positiveemerald 700emerald 300good numbers, gains (template ui.css)
--ring#b45309#f59e0bfocus outline

Always write var(--primary), never the hex value. The hex values are for reference only; the variables switch with the theme. This table lists every color you may use. Do not search the host or other folders for more tokens.

  • Copy: one clear label per control. No subtitles or helper text unless a mistake would cause harm. Use aria-label on inputs without visible labels and on icon-only buttons.
  • Page actions: pass buttons to renderHeaderActions(...) to place them in the page header.
  • States: show a Spinner while loading, a short empty message, and errors in --destructive with role="alert".
  • Conflicts: if the user asks for a page style that breaks these rules, follow the rules. Tell the user in one line which request you did not apply. Do not deliberate about it.
  • Narrow widths: the page also opens in the chat side panel, where the content is about 360px wide. Use flex-wrap or repeat(auto-fit, minmax(100px, 1fr)) grids, not a fixed column count, and no fixed widths; three tiles then fit one row.
  • Tables: use Table, TableHeader, TableBody, TableRow, TableHead, and TableCell; Table already scrolls sideways. Show at most six columns. Put the column the user cares about most right after the name column. Give the less important columns the plugin-optional class so they hide in the narrow side panel. Right-align dates and numbers with plugin-number. Keep names and short text on one line: the name cell takes plugin-strong, and every company, category, or status cell takes plugin-nowrap, also when it has other classes. Long text (notes, email) may wrap.
  • Do not: add a hero block, h1/h2 headings, all-caps letter-spaced labels, taglines, numbered feature lists, pill shapes (999px radius), or bordered divs that copy Card. Nakama pages are plain work tools, not landing pages.
  • A request for a nicer or better page means these rules applied with more care. It does not mean more decoration.

Data pages

A page that shows stored records follows the data template, in this order from top to bottom:

  1. Header actions: the create button (New <thing>) through renderHeaderActions. No other buttons there unless the user asks.
  2. One filter Input that filters rows on the client. No Search button.
  3. The Table with the rows. The name cell is a Button variant="link" with the plugin-row-link class that opens the edit dialog. Add no button columns: a wide table scrolls, and a button at the right edge scrolls out of view. Open details or history from that dialog, not in a side card.
  4. Create, edit, and delete share one Dialog with FormField labels. Delete is a destructive button with the plugin-footer-start class in that dialog's footer, shown only for a saved record, and it asks with ConfirmDialog first. Never put an always-visible form card next to the table.

Dialogs render outside the page, so plugin CSS does not reach them by default. Give every DialogContent the prop data-plugin-id={ctx.pluginId}. 5. Loading shows Spinner; no rows shows one short line ("No contacts yet."); no filter matches shows "No matches."

Put due or overdue work (follow-ups, reminders) as a column such as "Next follow-up", not as a separate card. Show overdue values in --destructive.

Skills: declare skills: [{key:"use-greeting",directory:"skills/use-greeting"}] and include that directory's SKILL.md with name and description.

Database: declare ordered immutable migrations, for example database: {migrations:[{id:"001",path:"migrations/001.sql"}]}. Never edit a released migration. First enable and updates execute SQL.

Workers: declare up to eight bundled JS entries, for example workers:[{key:"indexer",name:"Indexer",entry:"workers/indexer.js"}]. Workers start on enable. Store data in NAKAMA_PLUGIN_DATA_DIR or NAKAMA_WORKER_DATA_DIR and handle termination with cleanup. Optional useHostLlm supplies an owner-only provider configuration.

Handoff

After the last successful build, call submit_plugin_draft with the draft ID. It shows a card that walks the admin through review, install, enable, and profile access. If it fails, fix the reported problem, rebuild, and call it again.

Then report the build result in one or two lines. State that the draft is uninstalled. A platform admin reviews source and built files before installation. Fresh installations stay disabled. An admin enables them separately and assigns new actions to profiles. Installed plugins have full server/browser privileges.

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 Create Plugin làm được gì?

Soạn thảo hoặc xây dựng plugin Nakama tùy chỉnh với các hành động, trang tổng quan, kỹ năng, worker và quy trình migration. Dùng khi người dùng yêu cầu Super Nakama tạo plugin.

Vì sao nên dùng Create Plugin 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. Create Plugin 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 Create Plugin trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/ahmadrosid/nakama/tree/main/packages/core/src/skills/bundled/create-plugin. 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 Create Plugin?

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 Create Plugin 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 Create Plugin 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 Create Plugin có miễn phí không?

Có. Kỹ năng này được ahmadrosid phát hành trên GitHub theo giấy phép MIT. 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 👇