Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

nocobase-plugin-development

БесплатноБез исполняемых скриптовНе проверен

NocoBase 2 only; never use in a NocoBase 3 project. Step-by-step playbook for developing a NocoBase plugin, covering scaffolding, server-side code…

nocobaseот nocobase★ 54 звезды на GitHub

Об этом скилле

Goal

Guide an AI agent through the complete process of developing a NocoBase plugin — from requirement analysis to working code — producing a plugin that follows NocoBase conventions and can be enabled immediately.

Scope

  • Analyze user requirements and map them to NocoBase extension points.
  • Scaffold a new plugin with nb scaffold plugin.
  • Generate server-side code: collections, ACL, custom APIs, migrations, install hooks.
  • Generate client-side code: blocks, fields, actions, settings pages, routes.
  • Generate i18n locale files.
  • Enable and verify the plugin.
  • Troubleshoot common issues using FAQ checklist and source code (when available).

Non-Goals

  • Do not build NocoBase applications through the UI (that's nocobase-ui-builder).
  • Do not handle plugin publishing to external registries.
  • Do not modify NocoBase core code.
  • Do not migrate existing plugins from client v1 to v2 (that's nocobase-client-v2-plugin-migration).

Hard Constraints

These rules apply to ALL generated plugin code. Violating them is always wrong.

NEVER use this.app.use() or React Providers

this.app.use() is an internal API. Plugins must NEVER use it to wrap the app with React providers. This is not a suggestion — it is a hard rule with no exceptions.

Providers add unnecessary React rendering layers, hurt performance, and make plugins harder to maintain. When implementing global effects (watermarks, overlays, theming, tracking, global listeners, etc.), use these approaches instead:

  1. FlowEngine mechanisms (preferred) — registerModelLoaders, registerFlow, registerModels for UI capabilities.
  2. FlowEngine context — this.context holds global data (e.g., this.context.api, this.context.dataSourceManager, this.context.logger). Read from it directly instead of creating Providers to pass data around. Note: some properties like user, viewer, message, themeToken are only available after React renders — use them in flow handlers or components, not in load().
  3. API requests — if the plugin needs data, use this.app.apiClient.request() to fetch it directly. Axios interceptors are allowed but should not be the first choice — prefer direct requests or reading from context when possible.
  4. Pure DOM manipulation — operate on the DOM directly in load() for visual effects. No React component needed.
  5. EventBus — this.app.eventBus for reacting to app lifecycle events.

If you find yourself thinking "I need a Provider for this", stop and reconsider. There is always a better alternative.

Client code goes in client-v2 ONLY

All client-side plugin code must be written in src/client-v2/. The src/client/ directory is for the legacy v1 client — do NOT write or modify any files there. Import Plugin from @nocobase/client-v2, never from @nocobase/client.

Modern client runs under the /v/ URL prefix

The client-v2/ source directory corresponds to the /v/ runtime URL prefix. After login, users land on /v/admin/ by default. When telling users where to access something, use the /v/ URL pattern:

What you registered Accessible at
Plugin manager, built-in admin pages /v/admin/
Plugin settings pages /v/admin/settings/<menuKey>
Custom routes via this.router.add('xxx', { path: '/foo' }) /v/foo (NOT /v/admin/foo)

If the user says "I enabled the plugin but nothing shows up" or hits a 404, the most common cause is they are on a /admin/... URL (v1 plugin manager, which calls pm:listEnabled) instead of /v/admin/ (modern plugin manager, which calls pm:listEnabledV2). Tell them to switch to the /v/ URL.

Input Contract

Input Required Default Validation Clarification Question
requirement yes none non-empty natural language description "What should this plugin do?"
nocobase_root yes current working directory must expose a NocoBase source tree: a CLI-managed Git-source app (has source/packages/core/) or a NocoBase source repo (has packages/core/) "Where is your NocoBase source project? Plugin development needs a Git-source install or a cloned source repo."
plugin_name no derived from requirement @<scope>/plugin-<name> format "What should the plugin package name be?"

Rules:

  • If nocobase_root is not provided, check if the current working directory is a NocoBase project with a source tree.
  • If it is a NocoBase app without a source tree (Docker or npm install), stop and walk the user through the options in Step 0 — a source tree is required and cannot be worked around.
  • If plugin_name is not provided, derive a reasonable name from the requirement and confirm with the user.
  • If user says "you decide", use documented defaults.

Mandatory Clarification Gate

  • Max clarification rounds: 2
  • Max questions per round: 3
  • Mutation preconditions:
    • nocobase_root exposes a NocoBase source tree (source/packages/core/ for CLI-m
Полный SKILL.md на GitHub

Установить nocobase-plugin-development в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Bash
Read
Write
Edit
Grep
Glob
Agent
WebFetch

Вложенные файлы

references/build.mdreferences/client/action.mdreferences/client/block.mdreferences/client/component.mdreferences/client/ctx.mdreferences/client/field.mdreferences/client/flow.mdreferences/client/i18n.mdreferences/client/plugin.mdreferences/client/resource.mdreferences/client/router.mdreferences/getting-started.mdreferences/index.mdreferences/server/acl.mdreferences/server/collection.mdreferences/server/context.mdreferences/server/data-source-manager.mdreferences/server/database.mdreferences/server/i18n.mdreferences/server/middleware.mdreferences/server/migration.mdreferences/server/plugin.mdreferences/server/resource-manager.mdreferences/server/test.md

FAQ

Что делает скилл nocobase-plugin-development?

NocoBase 2 only; never use in a NocoBase 3 project. Step-by-step playbook for developing a NocoBase plugin, covering scaffolding, server-side code (collections, APIs, ACL, migrations), client-side code (blocks, fields, actions, settings pages, routes, components), i18n, and verification. TRIGGER when: user asks to create, build, implement, or develop a NocoBase plugin, mentions 'NocoBase plugin', or describes a feature to be built as a NocoBase plugin. This skill contains NocoBase-specific conventions and templates that general coding cannot replicate — always invoke it instead of planning from scratch.

Как установить скилл nocobase-plugin-development?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл nocobase-plugin-development запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить nocobase-plugin-development с