docs/docs/en/ai-dev/capabilities.md
:::tip Prerequisites
Before reading this page, make sure you have completed the environment setup following AI Plugin Development Quick Start.
:::
The AI plugin development capability is powered by the nocobase-plugin-development Skill. If you have already initialized via the NocoBase CLI (nb init), this Skill is automatically installed.
Here is a list of everything AI can currently help you do. Each capability comes with a sample prompt that you can copy and adapt to your own requirements.
:::warning Note
client (v1) to client-v2, and client-v2 is still under development. The client code generated by AI development is based on client-v2 and can only be used under the /v/ path. It is available for early access and experimentation, but is not recommended for production use.:::
| I want to... | AI can help you |
|---|---|
| Create a new plugin | Generate a complete scaffold, including frontend and backend directory structure |
| Define collections | Generate Collection definitions, supporting all field types and relationships |
| Build a custom block | Generate BlockModel + settings panel + register it in the "Add Block" menu |
| Build a custom field | Generate FieldModel + bind it to a field interface |
| Add a custom action button | Generate ActionModel + popup/drawer/confirmation dialog |
| Build a plugin settings page | Generate frontend form + backend API + storage |
| Write a custom API | Generate Resource Action + route registration + ACL configuration |
| Configure permissions | Generate ACL rules to control access by role |
| Support multiple languages | Automatically generate Chinese and English language packs |
| Write a migration script | Generate Migration, supporting DDL and data migration |
AI can generate a complete NocoBase plugin directory structure based on your requirements -- including frontend and backend entry files, type definitions, and base configuration.
Sample prompt:
Help me create a NocoBase plugin called @my-scope/plugin-todo
AI will run yarn pm create @my-scope/plugin-todo and generate a standard directory:
packages/plugins/@my-scope/plugin-todo/
├── src/
│ ├── server/
│ │ └── plugin.ts
│ ├── client-v2/
│ │ └── plugin.tsx
│ └── locale/
│ ├── zh-CN.json
│ └── en-US.json
├── package.json
└── ...
AI can generate Collection definitions for all NocoBase field types, including relationships (one-to-many, many-to-many, etc.).
Sample prompt:
Help me use nocobase-plugin-development skill to develop a NocoBase plugin called @my-scope/plugin-order,
then define an "orders" table with the following fields: order number (auto-increment),
customer name (string), amount (decimal), status (single select: pending/processing/completed),
and created time.
Orders have a many-to-one relationship with customers.
AI will generate a defineCollection definition, including field types, default values, relationship configuration, and more.
Blocks are the most fundamental way to extend the NocoBase frontend. AI can help you generate block models, settings panels, and menu registration.
Sample prompt:
Help me use nocobase-plugin-development skill to develop a NocoBase plugin called @my-scope/plugin-simple-block.
Create a custom display block (BlockModel) where users can enter HTML content in the settings panel,
and the block renders that HTML. Register this block in the "Add Block" menu.
AI will generate a BlockModel, create a settings panel via registerFlow + uiSchema, and register it in the "Add Block" menu.
For a complete example, see Build a Custom Display Block.
If NocoBase's built-in field rendering components don't meet your needs, AI can help you create a custom display component to replace the default field rendering.
Sample prompt:
Help me use nocobase-plugin-development skill to develop a NocoBase plugin called @my-scope/plugin-rating.
Create a custom field display component (FieldModel) that renders integer type fields as star icons,
supporting 1-5 ratings. Clicking a star should directly modify the rating value and save it to the database.
AI will generate a custom FieldModel to replace the default rendering component for integer fields.
Action buttons can appear at the top of a block (collection level), in the action column of each table row (record level), or in both locations simultaneously. Clicking them can trigger prompts, open form popups, call APIs, and more.
Sample prompt:
Help me use nocobase-plugin-development skill to develop a NocoBase plugin called @my-scope/plugin-simple-action.
Create three custom action buttons (ActionModel):
1. A collection-level button that appears at the top of the block, showing a success message when clicked
2. A record-level button that appears in the action column of each table row, displaying the current record's ID when clicked
3. A both-level button that appears in both locations, showing an info message when clicked
AI will generate an ActionModel, control button placement via ActionSceneEnum, and handle click events via registerFlow({ on: 'click' }).
For a complete example, see Build a Custom Action Button.
Many plugins need a settings page for users to configure parameters -- such as third-party service API keys, webhook URLs, etc.
Sample prompt:
Help me use nocobase-plugin-development skill to develop a NocoBase plugin called @my-scope/plugin-settings-page.
Create a plugin settings page that registers an "External Service Configuration" entry under the "Plugin Settings" menu, with two tabs:
1. "API Configuration" tab: a form containing API Key (string, required), API Secret (password, required), Endpoint (string, optional), saved to the database via a backend API
2. "About" tab: displays the plugin name and version information
The frontend should use Ant Design form components, and the backend should define externalApi:get and externalApi:set endpoints.
AI will generate the frontend settings page component, backend Resource Action, collection definition, and ACL configuration.
For a complete example, see Build a Plugin Settings Page.
If the built-in CRUD endpoints aren't sufficient, AI can help you write custom REST APIs. Below is a complete frontend-backend example -- the backend defines collections and APIs, while the frontend creates a custom block to display the data.
Sample prompt:
Help me use nocobase-plugin-development skill to develop a NocoBase plugin called @my-scope/plugin-todo.
Create a frontend-backend integrated Todo data management plugin:
1. Backend defines a todoItems table with fields: title (string), completed (boolean), priority (string, default medium)
2. Frontend creates a custom TableBlock that only displays todoItems data
3. The priority field should use colored Tags (high in red, medium in orange, low in green)
4. Add a "New Todo" button that opens a form to create a record when clicked
5. Logged-in users can perform all CRUD operations
AI will generate server-side Collection definitions, Resource Actions, ACL configuration, as well as client-side TableBlockModel, custom FieldModel, and ActionModel.
For a complete example, see Build a Frontend-Backend Integrated Data Management Plugin.
AI will automatically configure appropriate ACL rules for generated APIs and resources. You can also explicitly specify permission requirements in your prompt:
Sample prompt:
Help me use nocobase-plugin-development skill to develop a NocoBase plugin called @my-scope/plugin-todo.
Define a todoItems collection (with title, completed, priority fields).
Permission requirements: logged-in users can view, create, and edit; only admin role can delete.
AI will configure the corresponding access rules on the server side via this.app.acl.allow().
AI generates Chinese and English language packs (zh-CN.json and en-US.json) by default -- you don't need to ask for them separately.
If you need additional languages:
Help me use nocobase-plugin-development skill to develop a NocoBase plugin called @my-scope/plugin-order.
I need Chinese, English, and Japanese language packs.
When a plugin needs to update the database schema or migrate data, AI can help you generate Migration scripts.
Sample prompt:
Help me use nocobase-plugin-development skill to write a migration script for the NocoBase plugin @my-scope/plugin-order.
Add a "notes" field (long text, optional) to the "orders" table,
and set the default value of the notes field to "N/A" for all existing orders.
AI will generate a versioned Migration file, including DDL operations and data migration logic.