create-plugin-scaffold

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Create plugin scaffold

创建插件脚手架

Trigger

触发场景

You need to create a new Cursor plugin from scratch and make it ready for local use or marketplace submission.
当你需要从零开始创建一个新的Cursor插件,并使其可用于本地使用或提交至插件市场时。

Required Inputs

必填输入项

  • Plugin name (lowercase kebab-case)
  • Plugin purpose and target users
  • Component set to include (
    rules
    ,
    skills
    ,
    agents
    ,
    commands
    ,
    hooks
    ,
    mcpServers
    )
  • Repository style (
    single-plugin
    or
    multi-plugin marketplace
    )
  • 插件名称(小写短横线命名格式,kebab-case)
  • 插件用途与目标用户
  • 需包含的组件集合(
    rules
    skills
    agents
    commands
    hooks
    mcpServers
  • 仓库类型(
    single-plugin
    multi-plugin marketplace

Output Location

输出位置

By default, create the plugin inside the user's local plugin directory:
~/.cursor/plugins/local/<plugin-name>/
This path makes the plugin immediately available to Cursor without any install step. If the user explicitly asks to create the plugin elsewhere (e.g. inside an existing repo or a specific directory), respect that choice instead.
默认情况下,在用户本地插件目录内创建插件:
~/.cursor/plugins/local/<plugin-name>/
该路径无需任何安装步骤即可让Cursor立即识别插件。如果用户明确要求在其他位置创建插件(例如现有仓库内或指定目录),则遵循用户的选择。

Workflow

工作流程

  1. Validate plugin name format: lowercase kebab-case, starts and ends with an alphanumeric character.
  2. Determine the target directory:
    • Default:
      ~/.cursor/plugins/local/<plugin-name>/
    • Override: use the path the user specifies, if any.
    • Create the directory (and parents) if it does not exist.
  3. Create base files inside the target directory:
    • .cursor-plugin/plugin.json
    • README.md
    • LICENSE
    • optional
      CHANGELOG.md
  4. Populate
    plugin.json
    :
    • Required:
      name
    • Recommended:
      version
      ,
      description
      ,
      author
      ,
      license
      ,
      keywords
    • Add explicit component paths only when non-default discovery is needed.
  5. Create component files with valid frontmatter:
    • Rules:
      .mdc
      with
      description
      ,
      alwaysApply
      , optional
      globs
    • Skills:
      skills/<skill-name>/SKILL.md
      with
      name
      ,
      description
    • Agents:
      agents/*.md
      with
      name
      ,
      description
    • Commands:
      commands/*.(md|txt)
      with
      name
      ,
      description
  6. If repository uses
    .cursor-plugin/marketplace.json
    , add plugin entry:
    • name
    • source
    • optional metadata (
      description
      ,
      keywords
      ,
      category
      ,
      tags
      )
  7. Ensure all manifest paths are relative, valid, and do not use absolute paths or parent traversal.
  1. 验证插件名称格式:小写短横线命名,首尾为字母数字字符。
  2. 确定目标目录:
    • 默认:
      ~/.cursor/plugins/local/<plugin-name>/
    • 自定义:若用户指定路径,则使用该路径。
    • 若目录不存在,创建该目录(及父目录)。
  3. 在目标目录内创建基础文件:
    • .cursor-plugin/plugin.json
    • README.md
    • LICENSE
    • 可选的
      CHANGELOG.md
  4. 填充
    plugin.json
    内容:
    • 必填项:
      name
    • 推荐项:
      version
      description
      author
      license
      keywords
    • 仅当需要非默认发现机制时,添加明确的组件路径。
  5. 创建带有有效前置元数据的组件文件:
    • Rules:
      .mdc
      文件,包含
      description
      alwaysApply
      ,可选
      globs
    • Skills:
      skills/<skill-name>/SKILL.md
      文件,包含
      name
      description
    • Agents:
      agents/*.md
      文件,包含
      name
      description
    • Commands:
      commands/*.(md|txt)
      文件,包含
      name
      description
  6. 如果仓库使用
    .cursor-plugin/marketplace.json
    ,添加插件条目:
    • name
    • source
    • 可选元数据(
      description
      keywords
      category
      tags
  7. 确保所有清单路径均为相对路径、有效路径,不使用绝对路径或父目录遍历。

Guardrails

约束规则

  • Keep the plugin focused on one use case.
  • Prefer concise, actionable skill and rule text over long prose.
  • Do not reference files that do not exist.
  • Use folder discovery defaults unless custom paths are required.
  • Always save to
    ~/.cursor/plugins/local/<plugin-name>/
    unless the user provides a different path.
  • 插件需聚焦单一使用场景。
  • 技能和规则文本优先选择简洁、可执行的内容,避免冗长描述。
  • 不得引用不存在的文件。
  • 除非需要自定义路径,否则优先使用文件夹发现默认设置。
  • 除非用户提供其他路径,否则始终保存至
    ~/.cursor/plugins/local/<plugin-name>/

Output

输出内容

  • Created file tree for the plugin (with full path to the output directory)
  • Final
    plugin.json
  • Marketplace entry (if applicable)
  • Short validation report of required fields and component metadata
  • Confirmation that the plugin is saved under
    ~/.cursor/plugins/local/
    and ready for use
  • 插件的完整文件树(包含输出目录的完整路径)
  • 最终的
    plugin.json
    内容
  • 插件市场条目(如适用)
  • 必填字段和组件元数据的简短验证报告
  • 确认插件已保存至
    ~/.cursor/plugins/local/
    并可立即使用