orderly-plugin-gen

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Orderly Plugin Generator

Orderly 插件生成器

Quickly generate plugin project scaffolding in the Orderly SDK monorepo.
快速在Orderly SDK monorepo中生成插件项目脚手架。

Trigger

触发条件

When the user's message contains the following keywords, proactively ask whether to use this Skill to generate a plugin template:
  • create a plugin / generate a plugin / develop a plugin / register a plugin
Example prompt: "Detected that you want to create an Orderly plugin. Would you like to use the orderly-plugin-gen scaffold to generate a template?"
当用户消息包含以下关键词时,主动询问是否使用此Skill生成插件模板:
  • create a plugin / generate a plugin / develop a plugin / register a plugin
示例提示语:"检测到您想要创建Orderly插件。是否要使用orderly-plugin-gen脚手架生成模板?"

Workflow

工作流程

Step 1: Gather information

步骤1:收集信息

Ask the user for the following (using the AskQuestion tool):
  1. Plugin name (required): e.g.
    orderbook-flash
    ,
    pnl-card
    . Only lowercase letters, numbers, and hyphens are allowed.
  2. Plugin type (required):
    widget
    /
    page
    /
    layout
  3. Output path (optional): Parent path for the plugin directory. Defaults to the current project's
    packages/
    directory.
向用户询问以下信息(使用AskQuestion工具):
  1. 插件名称(必填):例如
    orderbook-flash
    pnl-card
    。仅允许小写字母、数字和连字符。
  2. 插件类型(必填):
    widget
    /
    page
    /
    layout
  3. 输出路径(可选):插件目录的父路径。默认为当前项目的
    packages/
    目录。

Step 2: Run the script

步骤2:运行脚本

Run the generation script with the Shell tool (Node.js >=20.19.0 required):
bash
node ~/.cursor/skills/orderly-plugin-gen/scripts/create-plugin.mjs \
  --name <plugin-name> \
  --type <widget|page|layout> \
  --path <absolute-parent-path>
使用Shell工具运行生成脚本(需要Node.js >=20.19.0):
bash
node ~/.cursor/skills/orderly-plugin-gen/scripts/create-plugin.mjs \
  --name <plugin-name> \
  --type <widget|page|layout> \
  --path <absolute-parent-path>

Step 3: Report results

步骤3:报告结果

After the script runs, report to the user:
  1. The generated plugin ID
  2. The list of created files
  3. Follow-up steps:
    • Run
      pnpm install
      to install dependencies
    • Edit
      src/index.tsx
      to add business logic
    • Register the plugin in the host app via the
      plugins
      prop of
      OrderlyProvider
脚本运行完成后,向用户报告:
  1. 生成的插件ID
  2. 创建的文件列表
  3. 后续步骤:
    • 运行
      pnpm install
      安装依赖
    • 编辑
      src/index.tsx
      添加业务逻辑
    • 通过
      OrderlyProvider
      plugins
      属性在宿主应用中注册插件

Generated Structure

生成的结构

plugin-<name>/
├── package.json
├── tsconfig.json
├── tsup.config.ts
└── src/
    ├── index.tsx
    └── components/
        └── .gitkeep
plugin-<name>/
├── package.json
├── tsconfig.json
├── tsup.config.ts
└── src/
    ├── index.tsx
    └── components/
        └── .gitkeep

Additional Resources

附加资源

  • For plugin system API reference, see reference.md
  • 插件系统API参考,请查看reference.md