|
| 1 | +# Add a plugin |
| 2 | + |
| 3 | +Add a new plugin under `plugins/` and register it in `.cursor-plugin/marketplace.json`. |
| 4 | + |
| 5 | +## 1. Create plugin directory |
| 6 | + |
| 7 | +Create a new folder: |
| 8 | + |
| 9 | +```text |
| 10 | +plugins/my-new-plugin/ |
| 11 | +``` |
| 12 | + |
| 13 | +Add the required manifest: |
| 14 | + |
| 15 | +```text |
| 16 | +plugins/my-new-plugin/.cursor-plugin/plugin.json |
| 17 | +``` |
| 18 | + |
| 19 | +Example manifest: |
| 20 | + |
| 21 | +```json |
| 22 | +{ |
| 23 | + "name": "my-new-plugin", |
| 24 | + "displayName": "My New Plugin", |
| 25 | + "version": "0.1.0", |
| 26 | + "description": "Describe what this plugin does", |
| 27 | + "author": { |
| 28 | + "name": "Your Org" |
| 29 | + }, |
| 30 | + "logo": "assets/logo.svg" |
| 31 | +} |
| 32 | +``` |
| 33 | + |
| 34 | +## 2. Add plugin components |
| 35 | + |
| 36 | +Add only the components you need: |
| 37 | + |
| 38 | +- `rules/` with `.mdc` files (YAML frontmatter required) |
| 39 | +- `skills/<skill-name>/SKILL.md` (YAML frontmatter required) |
| 40 | +- `agents/*.md` (YAML frontmatter required) |
| 41 | +- `commands/*.(md|mdc|markdown|txt)` (frontmatter recommended) |
| 42 | +- `hooks/hooks.json` and `scripts/*` for automation hooks |
| 43 | +- `mcp.json` for MCP server definitions |
| 44 | +- `assets/logo.svg` for marketplace display |
| 45 | + |
| 46 | +## 3. Register in marketplace manifest |
| 47 | + |
| 48 | +Edit `.cursor-plugin/marketplace.json` and append a new entry: |
| 49 | + |
| 50 | +```json |
| 51 | +{ |
| 52 | + "name": "my-new-plugin", |
| 53 | + "source": "./plugins/my-new-plugin", |
| 54 | + "description": "Describe your plugin" |
| 55 | +} |
| 56 | +``` |
| 57 | + |
| 58 | +`source` is the relative path from the repository root to the plugin folder. |
| 59 | + |
| 60 | +## 4. Validate |
| 61 | + |
| 62 | +```bash |
| 63 | +node scripts/validate-template.mjs |
| 64 | +``` |
| 65 | + |
| 66 | +Fix all reported errors before committing. |
| 67 | + |
| 68 | +## 5. Common pitfalls |
| 69 | + |
| 70 | +- Plugin `name` not kebab-case. |
| 71 | +- `source` path in marketplace manifest does not match folder name. |
| 72 | +- Missing `.cursor-plugin/plugin.json` in plugin folder. |
| 73 | +- Missing frontmatter keys (`name`, `description`) in skills, agents, or commands. |
| 74 | +- Rule files missing frontmatter `description`. |
| 75 | +- Broken relative paths for `logo`, `hooks`, or `mcpServers` in manifest files. |
0 commit comments