--- name: plugin-builder description: Build Cursor plugin scaffolds. Use this skill when the user wants to create a new Cursor plugin, scaffold plugin skills/commands/rules/hooks, or set up MCP connector configurations. Triggers include "create a plugin", "build a plugin", "scaffold a plugin", "new plugin for [domain]", or any task involving Cursor plugin development. --- # Cursor Plugin Builder Build Cursor plugin scaffolds. The plugin can include rules, skills, hooks, agents, commands, and MCP connector configurations. ## Directory Context 1. Run `ls -la` to understand the current directory structure 2. Check if this is already a plugin marketplace (look for `.cursor-plugin/marketplace.json`) 3. If it's a marketplace, new plugins should be created as subdirectories 4. **Always confirm the target location with the user before creating files** ## Workflow ### Step 1: Gather Requirements Ask the user for structured input: **Question 1: Plugin basics** - Plugin name (kebab-case slug, e.g., `customer-support`) - 1-2 sentence description **Question 2: Components to include** (multi-select) - Rules (.mdc files) -- persistent AI guidance - Skills (SKILL.md) -- specialized agent capabilities - Commands (.md) -- explicit user-invoked actions - Hooks (hooks.json) -- automation on agent events - Agents (.md) -- custom agent behaviors - MCP servers (.mcp.json) -- external tool integrations **Question 3: If skills selected -- automation preference** - "Fully automated" -- Skills trigger automatically based on context - "Manual triggers only" -- Commands require explicit invocation - "Both" -- Skills for automation, Commands as explicit fallback **Question 4: If MCP tools needed -- tool categories** - Ask which external services to integrate, grouped by category (CRM, ticketing, analytics, etc.) ### Step 2: Generate Plugin Structure ``` / ├── .cursor-plugin/ │ └── plugin.json ├── rules/ # if rules selected │ └── .mdc ├── skills/ # if skills selected │ └── / │ └── SKILL.md ├── commands/ # if commands selected │ └── .md ├── agents/ # if agents selected │ └── .md ├── hooks/ # if hooks selected │ └── hooks.json ├── .mcp.json # if MCP tools needed └── README.md ``` ### File Templates **plugin.json:** ```json { "name": "", "description": "<1-2 sentence description>", "version": "1.0.0", "author": { "name": "" }, "keywords": ["", ""] } ``` **Rule (.mdc):** ```markdown --- description: alwaysApply: true --- ## - Rule point 1 - Rule point 2 ``` For glob-scoped rules (apply only to matching files): ```markdown --- description: globs: - "**/*.ts" - "**/*.tsx" --- ``` **SKILL.md:** ```markdown --- name: description: --- # ## When to Use ## Workflow ## Best Practices ``` **Command (.md):** ```markdown --- name: description: --- # ## Usage Invoke via `/plugin-name:command-name` ## Workflow ``` **Agent (.md):** ```markdown --- name: description: --- # ``` **hooks.json:** ```json { "hooks": { "": [{ "command": "./scripts/