agentleFS
nisarthnisarth/claude-skills-store/skills/devtools/plugin-development/SKILL.md

Plugin Development

Skill1 starsChanged 7 months agoMITView on GitHub

Develop Claude Code plugins that bundle skills, commands, hooks, and MCP servers into distributable .claude-plugin packages. Full lifecycle from scaffold to publish. Trigger phrases: "create a plugin", "build a plugin", "plugin development", "new claude plugin", "package a plugin", "plugin scaffold"

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 12 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈12

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Create, bundle, and distribute Claude Code plugins that package skills, commands, hooks, and MCP servers into a single installable unit.

    line 15
  2. Distinctive:

    Create the plugin directory:

    line 43
  3. Very specific:

    Create plugin.json with required fields:

    line 67
  4. Very specific:

    Skills: Write SKILL.md files following the standard skill format with frontmatter, workflow steps, examples, and best practices.

    line 101
  5. Distinctive:

    Document each setting with description and valid values

    line 113
  6. Distinctive:

    Verify each skill triggers correctly

    line 119
  7. Distinctive:

    Test all slash commands with various inputs

    line 120
  8. Distinctive:

    Test configuration loading and validation

    line 123
  9. Distinctive:

    Run the build step for any compiled components

    line 127
  10. Distinctive:

    Create the distributable package

    line 129
  11. Distinctive:

    Version all components: - use the plugin version to track breaking changes

    line 167
  12. Distinctive:

    Isolate MCP server dependencies: - avoid conflicts with the host environment

    line 168
  13. Distinctive:

    Handle missing dependencies gracefully: - check and report, do not crash

    line 170
  14. Distinctive:

    Test across platforms: - verify on macOS, Linux, and Windows

    line 171

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill 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
SKILL.md

Plugin Development

Create, bundle, and distribute Claude Code plugins that package skills, commands, hooks, and MCP servers into a single installable unit.

Prerequisites

  • Claude Code CLI installed and configured
  • Node.js 18+ for build tooling
  • At least one skill, command, or MCP server to package
  • Understanding of the plugin manifest format

Workflow

Step 1: Plan the Plugin

Define the plugin scope:

  1. Plugin name - human-readable name (e.g., "Docker Workflow Tools")
  2. Plugin ID - unique kebab-case identifier (e.g., docker-workflow-tools)
  3. Components - list what the plugin includes:
    • Skills (SKILL.md files)
    • Slash commands
    • Event hooks (pre-commit, post-push, etc.)
    • MCP servers
    • Configuration templates
  4. Dependencies - external tools or services required
  5. Target audience - who will use this plugin

Step 2: Scaffold the Plugin Structure

Create the plugin directory:

<plugin-id>/
  plugin.json           # Plugin manifest (required)
  skills/
    <skill-name>/
      SKILL.md          # Skill definition
  commands/
    <command-name>.js   # Slash command handlers
  hooks/
    pre-commit.js       # Git hook handlers
    post-push.js
  mcp-servers/
    <server-name>/      # Bundled MCP server
      src/
      package.json
  config/
    defaults.json       # Default configuration values
  README.md             # Plugin documentation

Step 3: Write the Plugin Manifest

Create plugin.json with required fields:

{
  "id": "<plugin-id>",
  "name": "<Plugin Name>",
  "version": "1.0.0",
  "description": "What this plugin does",
  "author": "<author>",
  "license": "MIT",
  "skills": ["skills/<skill-name>"],
  "commands": {
    "<command>": "commands/<command-name>.js"
  },
  "hooks": {
    "pre-commit": "hooks/pre-commit.js"
  },
  "mcpServers": {
    "<server-name>": {
      "command": "node",
      "args": ["mcp-servers/<server-name>/dist/index.js"]
    }
  },
  "config": {
    "schema": "config/schema.json",
    "defaults": "config/defaults.json"
  }
}

Step 4: Implement Components

For each component type:

Skills: Write SKILL.md files following the standard skill format with frontmatter, workflow steps, examples, and best practices.

Commands: Implement slash command handlers that receive user arguments and return responses. Each command exports a handler function.

Hooks: Implement event handlers that run at specific lifecycle points. Hooks receive context about the triggering event and can modify behavior.

MCP Servers: Build standalone MCP servers that the plugin manages. Include build scripts and proper dependency isolation.

Step 5: Add Configuration

  1. Define a JSON Schema for plugin settings
  2. Set sensible defaults in config/defaults.json
  3. Document each setting with description and valid values
  4. Support environment variable overrides for secrets

Step 6: Test the Plugin

  1. Install the plugin locally for development testing
  2. Verify each skill triggers correctly
  3. Test all slash commands with various inputs
  4. Confirm hooks fire at the right lifecycle events
  5. Validate MCP servers start and respond properly
  6. Test configuration loading and validation

Step 7: Package and Distribute

  1. Run the build step for any compiled components
  2. Validate the manifest against the plugin schema
  3. Create the distributable package
  4. Publish to the plugin registry or distribute directly

Output Format

The skill produces:

  • Complete plugin directory with all components
  • Valid plugin.json manifest
  • Implemented skills, commands, hooks, and/or MCP servers
  • Configuration schema and defaults
  • README with installation and usage instructions

Examples

Example 1: CI/CD Plugin

User: "Create a plugin for managing CI/CD pipelines"

Action: Scaffold a plugin with skills for pipeline configuration, commands for triggering builds, hooks for pre-push validation, and an MCP server for build status queries.

Example 2: Code Quality Plugin

User: "Build a plugin that enforces code quality standards"

Action: Scaffold a plugin with a linting skill, pre-commit hooks for formatting, commands for running quality checks, and configuration for rule customization.

Example 3: Documentation Plugin

User: "Make a plugin for auto-generating project documentation"

Action: Scaffold a plugin with skills for API doc generation, a command for doc preview, and hooks that update docs on file changes.

Best Practices

  1. Keep plugins focused - one domain or workflow per plugin
  2. Minimize dependencies - fewer external requirements means easier adoption
  3. Provide sensible defaults - the plugin should work out of the box
  4. Version all components - use the plugin version to track breaking changes
  5. Isolate MCP server dependencies - avoid conflicts with the host environment
  6. Document installation steps - include any system-level prerequisites
  7. Handle missing dependencies gracefully - check and report, do not crash
  8. Test across platforms - verify on macOS, Linux, and Windows

Error Handling

ErrorCauseRecovery
Invalid manifestMalformed plugin.jsonValidate against schema, fix syntax
Missing componentReferenced file not foundCheck paths in manifest match actual files
Dependency conflictVersion mismatch with hostPin versions, use isolated node_modules
Hook failureHook script throws errorAdd try-catch, log errors, allow skip
MCP server crashServer process exits unexpectedlyImplement restart logic and health checks
Config validationInvalid user settingsReport which fields failed and valid options

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.