|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Repository Overview |
| 6 | + |
| 7 | +This repository is a **Claude Code plugin marketplace** - a centralized catalog for discovering, installing, and managing Claude Code extensions across a team or organization. The marketplace is defined by a single JSON file that lists available plugins and describes where to find them. |
| 8 | + |
| 9 | +## Core Architecture |
| 10 | + |
| 11 | +### Marketplace Configuration |
| 12 | +- **Location**: `.claude-plugin/marketplace.json` |
| 13 | +- **Schema**: Follows the official Claude Code marketplace specification |
| 14 | +- **Structure**: |
| 15 | + - `name`: Marketplace identifier (must be kebab-case) |
| 16 | + - `owner`: Maintainer information (name and email) |
| 17 | + - `metadata`: Optional description and version |
| 18 | + - `plugins`: Array of plugin entries |
| 19 | + |
| 20 | +### Plugin Sources |
| 21 | +Plugins can be hosted in three ways: |
| 22 | +1. **Local (relative paths)**: Plugin source code in `plugins/` directory within this repo |
| 23 | +2. **GitHub repositories**: External GitHub repos specified with `{"source": "github", "repo": "owner/name"}` |
| 24 | +3. **Git URLs**: Any git repository specified with `{"source": "url", "url": "https://..."}` |
| 25 | + |
| 26 | +### Plugin Entry Schema |
| 27 | +Each plugin entry in the marketplace can include: |
| 28 | +- **Required**: `name` (identifier), `source` (location) |
| 29 | +- **Recommended**: `description`, `version`, `author` |
| 30 | +- **Advanced**: `commands`, `agents`, `hooks`, `mcpServers` (custom component paths) |
| 31 | +- **Control**: `strict` (default: `true`) - when `false`, plugin.json is optional |
| 32 | + |
| 33 | +## Common Development Tasks |
| 34 | + |
| 35 | +### Validate Marketplace JSON |
| 36 | +```bash |
| 37 | +# Using Claude Code validation |
| 38 | +claude plugin validate . |
| 39 | + |
| 40 | +# Manual JSON syntax check (requires jq) |
| 41 | +cat .claude-plugin/marketplace.json | jq . |
| 42 | +``` |
| 43 | + |
| 44 | +### Test Marketplace Locally |
| 45 | +```bash |
| 46 | +# In Claude Code, add this marketplace locally |
| 47 | +/plugin marketplace add /workspaces/claude-plugins |
| 48 | + |
| 49 | +# Install a plugin from the marketplace |
| 50 | +/plugin install plugin-name@claude-plugins |
| 51 | + |
| 52 | +# List all marketplaces |
| 53 | +/plugin marketplace list |
| 54 | + |
| 55 | +# Update marketplace metadata |
| 56 | +/plugin marketplace update claude-plugins |
| 57 | +``` |
| 58 | + |
| 59 | +### Adding a New Plugin |
| 60 | + |
| 61 | +**For locally hosted plugins:** |
| 62 | +1. Create plugin directory: `plugins/plugin-name/` |
| 63 | +2. Add plugin files (commands, agents, hooks, etc.) |
| 64 | +3. Add entry to `.claude-plugin/marketplace.json`: |
| 65 | +```json |
| 66 | +{ |
| 67 | + "name": "plugin-name", |
| 68 | + "source": "./plugins/plugin-name", |
| 69 | + "description": "What the plugin does", |
| 70 | + "version": "1.0.0", |
| 71 | + "author": {"name": "Author Name"} |
| 72 | +} |
| 73 | +``` |
| 74 | + |
| 75 | +**For externally hosted plugins:** |
| 76 | +Add entry pointing to external source: |
| 77 | +```json |
| 78 | +{ |
| 79 | + "name": "plugin-name", |
| 80 | + "source": {"source": "github", "repo": "owner/repo"}, |
| 81 | + "description": "What the plugin does" |
| 82 | +} |
| 83 | +``` |
| 84 | + |
| 85 | +### Updating the Marketplace |
| 86 | +1. Edit `.claude-plugin/marketplace.json` to add/modify plugin entries |
| 87 | +2. Validate JSON syntax |
| 88 | +3. Test locally before committing |
| 89 | +4. Update README.md's "Available Plugins" section if needed |
| 90 | + |
| 91 | +## Repository Structure |
| 92 | + |
| 93 | +``` |
| 94 | +.claude-plugin/ |
| 95 | + marketplace.json # Main marketplace configuration file |
| 96 | +plugins/ # Optional: locally hosted plugin source code |
| 97 | + plugin-name/ # Individual plugin directory |
| 98 | + plugin.json # Plugin manifest (optional if strict: false) |
| 99 | + .claude/ |
| 100 | + commands/ # Command files |
| 101 | + agents/ # Agent definitions |
| 102 | +README.md # Marketplace usage documentation |
| 103 | +CONTRIBUTING.md # Plugin contribution guidelines |
| 104 | +CLAUDE.md # This file |
| 105 | +``` |
| 106 | + |
| 107 | +## Important Considerations |
| 108 | + |
| 109 | +### Marketplace Name |
| 110 | +- Must be kebab-case (lowercase with hyphens) |
| 111 | +- Used as identifier when installing: `/plugin marketplace add owner/repo` |
| 112 | +- Cannot contain spaces or special characters |
| 113 | + |
| 114 | +### Plugin Naming |
| 115 | +- Use kebab-case for plugin names |
| 116 | +- Must be unique within the marketplace |
| 117 | +- Descriptive and clear (e.g., "deployment-tools", "code-formatter") |
| 118 | + |
| 119 | +### Version Management |
| 120 | +- Use semantic versioning (MAJOR.MINOR.PATCH) |
| 121 | +- Update version numbers when plugin functionality changes |
| 122 | +- Document version changes in commit messages |
| 123 | + |
| 124 | +### JSON Validation |
| 125 | +- Marketplace JSON must be valid before committing |
| 126 | +- Use `claude plugin validate .` or `jq` to verify syntax |
| 127 | +- Common errors: trailing commas, unescaped quotes, missing brackets |
| 128 | + |
| 129 | +### Testing Workflow |
| 130 | +Always test plugins locally before adding to marketplace: |
| 131 | +1. Add marketplace locally with absolute path |
| 132 | +2. Install the plugin |
| 133 | +3. Verify all plugin components work (commands, agents, hooks) |
| 134 | +4. Check for any errors or missing dependencies |
| 135 | + |
| 136 | +### Strict vs Non-Strict Plugins |
| 137 | +- `strict: true` (default): Plugin must have `plugin.json` file; marketplace fields supplement it |
| 138 | +- `strict: false`: plugin.json is optional; marketplace entry can serve as complete manifest |
| 139 | +- Use non-strict mode for simple plugins without separate manifest files |
| 140 | + |
| 141 | +## Git Workflow |
| 142 | + |
| 143 | +### Branch Naming |
| 144 | +- Feature branches: `add-plugin-<plugin-name>` |
| 145 | +- Updates: `update-plugin-<plugin-name>` |
| 146 | +- Fixes: `fix-<issue-description>` |
| 147 | + |
| 148 | +### Commit Messages |
| 149 | +```bash |
| 150 | +# Adding new plugin |
| 151 | +git commit -m "Add <plugin-name> plugin" |
| 152 | + |
| 153 | +# Updating plugin |
| 154 | +git commit -m "Update <plugin-name> to v<version>" |
| 155 | + |
| 156 | +# Fixing marketplace |
| 157 | +git commit -m "Fix marketplace JSON syntax error" |
| 158 | +``` |
| 159 | + |
| 160 | +## References |
| 161 | + |
| 162 | +- [Claude Code Plugin Documentation](https://docs.claude.com/en/plugins) |
| 163 | +- [Plugin Marketplace Guide](https://docs.claude.com/en/plugin-marketplaces) |
| 164 | +- [Plugin Development Guide](https://docs.claude.com/en/plugins#develop-more-complex-plugins) |
| 165 | +- [Plugins Reference](https://docs.claude.com/en/plugins-reference) |
0 commit comments