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.
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/audit/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/anti-duplication.mdcCursor rule
- .cursor/rules/claude-skills.mdcCursor rule
- .cursor/rules/cursor-rules-best-practices.mdcCursor rule
- .cursor/rules/git-commit-attribution.mdcCursor rule
- .cursor/rules/official-docs.mdcCursor rule
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
- Very specific: line 80
Find the plugin location: Look in ~/.claude/plugins/marketplaces/ for installed plugins
- Distinctive: line 81
Respect the structure: Keep components in their designated directories
≈ “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.
Files
---
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
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
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.

