agentleFS
Prorise-coolProrise-cool/claude-code-plugins/.cursor/rules/claude-code-plugins.mdc

claude-code-plugins / rules

Cursor rule1 starsChanged 11 months agoMITView on GitHub

Use when working with Claude Code plugins, skills, agents, hooks, commands, or MCP servers. Plugins extend Claude Code with reusable components that may be installed in user/global locations outside the project.

The file

We split this claude-code-plugins.mdc into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Find the plugin location: Look in ~/.claude/plugins/marketplaces/ for installed plugins

    line 80
  2. Distinctive:

    Respect the structure: Keep components in their designated directories

    line 81

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
claude-code-plugins.mdc
---
description: Use when working with Claude Code plugins, skills, agents, hooks, commands, or MCP servers. Plugins extend Claude Code with reusable components that may be installed in user/global locations outside the project.
alwaysApply: false
---

# Claude Code Plugin System

Claude Code extensions (skills, agents, commands, hooks, MCP servers) are organized into **plugins** which can be installed globally or per-user, separate from the project repository.

## Plugin Installation Locations

Plugins are installed via marketplaces and stored in user-level directories:

| Platform | Typical Location |
|----------|-----------------|
| macOS/Linux | `~/.claude/plugins/marketplaces/{marketplace-name}/{plugin-name}/` |
| Windows | `%USERPROFILE%\.claude\plugins\marketplaces\{marketplace-name}\{plugin-name}\` |

**Note**: The exact path depends on Claude Code configuration. Use `${CLAUDE_PLUGIN_ROOT}` environment variable in plugin scripts for reliable path resolution.

## Plugin Directory Structure

```text
plugin-name/
├── .claude-plugin/
│   └── plugin.json          # Required: plugin manifest
├── commands/                 # Slash commands (*.md files)
│   └── my-command.md
├── agents/                   # Subagents (*.md files)
│   └── my-agent.md
├── skills/                   # Agent Skills
│   └── my-skill/
│       └── SKILL.md
├── hooks/                    # Event handlers
│   └── hooks.json
├── .mcp.json                 # MCP server definitions
└── scripts/                  # Supporting scripts
```

## Key Files

### plugin.json (Required)

Located at `.claude-plugin/plugin.json`:

```json
{
  "name": "plugin-name",
  "version": "1.0.0",
  "description": "What this plugin does",
  "author": { "name": "Author Name" }
}
```

### SKILL.md (For Skills)

Each skill lives in `skills/{skill-name}/SKILL.md` with optional supporting files in the same directory.

### hooks.json (For Hooks)

Event handlers configured in `hooks/hooks.json` or inline in plugin.json.

### .mcp.json (For MCP Servers)

MCP server definitions at plugin root.

## Component Types

| Component | Location | Format | Purpose |
|-----------|----------|--------|---------|
| Commands | `commands/` | Markdown with frontmatter | Slash commands |
| Agents | `agents/` | Markdown with frontmatter | Specialized subagents |
| Skills | `skills/*/SKILL.md` | Markdown with frontmatter | Model-invoked capabilities |
| Hooks | `hooks/hooks.json` | JSON | Event handlers |
| MCP Servers | `.mcp.json` | JSON | External tool integration |

## When Working with Plugin Components

1. **Check if it's from a plugin**: Components may be in the project OR in a user-installed plugin
2. **Find the plugin location**: Look in `~/.claude/plugins/marketplaces/` for installed plugins
3. **Respect the structure**: Keep components in their designated directories
4. **Use ${CLAUDE_PLUGIN_ROOT}**: For paths in hooks and MCP configs

## Marketplace Structure

Marketplaces are collections of plugins with a manifest at `.claude-plugin/marketplace.json`:

```json
{
  "name": "marketplace-name",
  "owner": { "name": "Owner" },
  "plugins": [
    {
      "name": "plugin-name",
      "source": "./plugin-name",
      "description": "Plugin description"
    }
  ]
}
```

## Related Rules

- See `claude-skills.mdc` for detailed skill workflow guidance

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.