creating-plugins
Scannednpx machina-cli add skill wayne930242/Reflexive-Claude-Code/creating-plugins --openclawCreating Plugins
Overview
Creating plugins IS scaffolding a distributable skill package.
Plugins contain skills, commands, agents, and rules that can be installed via claude plugin add.
Core principle: Plugins are reusable across projects. Keep them focused and well-documented.
Violating the letter of the rules is violating the spirit of the rules.
Task Initialization (MANDATORY)
Before ANY action, create task list using TaskCreate:
TaskCreate for EACH task below:
- Subject: "[creating-plugins] Task N: <action>"
- ActiveForm: "<doing action>"
Tasks:
- Gather requirements
- Create directory structure
- Generate plugin manifest
- Create initial skill
- Write README
- Test installation
Announce: "Created 6 tasks. Starting execution..."
Execution rules:
TaskUpdate status="in_progress"BEFORE starting each taskTaskUpdate status="completed"ONLY after verification passes- If task fails → stay in_progress, diagnose, retry
- NEVER skip to next task until current is completed
- At end,
TaskListto confirm all completed
Task 1: Gather Requirements
Goal: Understand what the plugin should contain.
Questions to ask:
- What is the plugin name? (kebab-case)
- What capability does it provide?
- What skills should it include?
- Who is the author?
Naming rules:
- Kebab-case only:
my-plugin - Avoid:
helper,utils,anthropic,claude - Max 64 characters
Verification: Can state plugin name and purpose in one sentence.
Task 2: Create Directory Structure
Goal: Scaffold the plugin directory.
Plugin Structure
<plugin-name>/
├── .claude-plugin/
│ └── plugin.json # Manifest
├── skills/
│ └── <skill-name>/
│ └── SKILL.md
├── commands/ # Optional
│ └── <command>.md
├── agents/ # Optional
│ └── <agent>.md
└── README.md
Verification: Directory structure created with all required paths.
Task 3: Generate Plugin Manifest
Goal: Create the plugin.json manifest file.
Manifest Format
{
"name": "plugin-name",
"description": "What this plugin does",
"version": "1.0.0",
"author": "Author Name",
"skills": []
}
Fields:
| Field | Required | Description |
|---|---|---|
name | Yes | Plugin identifier (kebab-case) |
description | Yes | One-line description |
version | Yes | Semantic version |
author | No | Author name or org |
skills | No | Leave empty for auto-discovery |
Note: Skills are auto-discovered from skills/*/SKILL.md. Only specify explicitly if you need to limit which skills are exposed.
Verification: plugin.json is valid JSON with required fields.
Task 4: Create Initial Skill
Goal: Create the first skill using the writing-skills workflow.
CRITICAL: Invoke the writing-skills skill.
Do not write SKILL.md directly. The writing-skills skill ensures:
- Proper frontmatter format
- TDD baseline testing
- Quality review via skill-reviewer
Verification: Initial skill created and passes skill-reviewer.
Task 5: Write README
Goal: Document the plugin for users.
README Template
# Plugin Name
One-line description.
## Installation
\`\`\`bash
claude plugin add <path-or-url>
\`\`\`
## Skills
| Skill | Description |
|-------|-------------|
| skill-name | What it does |
## Usage
[Examples of how to use the plugin]
## License
[License]
Verification: README has installation instructions and skill list.
Task 6: Test Installation
Goal: Verify the plugin installs and works correctly.
Process:
- Install the plugin locally:
claude plugin add <path> - Verify skills appear in skill list
- Trigger a skill and verify it loads
- Uninstall and clean up:
claude plugin remove <name>
Verification:
- Plugin installs without errors
- Skills are discoverable
- Skills load correctly
Red Flags - STOP
These thoughts mean you're rationalizing. STOP and reconsider:
- "Skip skill creation, I'll add it later"
- "Don't need README for a simple plugin"
- "Skip testing, the manifest is valid"
- "Put everything in one mega-skill"
- "Don't need version numbers yet"
All of these mean: You're about to create a weak plugin. Follow the process.
Common Rationalizations
| Excuse | Reality |
|---|---|
| "Add skills later" | Empty plugins are useless. Ship with at least one. |
| "Skip README" | Undocumented plugins don't get used. |
| "Skip testing" | Broken installs frustrate users. Test it. |
| "One big skill" | Multiple focused skills > one bloated skill. |
| "Version later" | Version from day 1. Semantic versioning matters. |
Flowchart: Plugin Creation
digraph plugin_creation {
rankdir=TB;
start [label="Create plugin", shape=doublecircle];
gather [label="Task 1: Gather\nrequirements", shape=box];
structure [label="Task 2: Create\ndirectory structure", shape=box];
manifest [label="Task 3: Generate\nmanifest", shape=box];
skill [label="Task 4: Create\ninitial skill", shape=box];
readme [label="Task 5: Write\nREADME", shape=box];
test [label="Task 6: Test\ninstallation", shape=box];
test_pass [label="Install\nworks?", shape=diamond];
done [label="Plugin complete", shape=doublecircle];
start -> gather;
gather -> structure;
structure -> manifest;
manifest -> skill;
skill -> readme;
readme -> test;
test -> test_pass;
test_pass -> done [label="yes"];
test_pass -> manifest [label="no"];
}
Publishing
Once your plugin is ready:
- Local sharing: Share the directory path
- Git hosting: Push to GitHub/GitLab
claude plugin add github:username/repo - npm (if applicable): Publish to npm registry
References
- Plugin specification: https://docs.anthropic.com/claude-code/plugins
Source
git clone https://github.com/wayne930242/Reflexive-Claude-Code/blob/main/plugins/rcc/skills/creating-plugins/SKILL.mdView on GitHub Overview
Creating plugins scaffolds a distributable Claude Code skill package. Plugins bundle skills, commands, agents, and rules that can be installed via claude plugin add, and are designed to be reusable across projects with clear documentation.
How This Skill Works
Start with a mandatory TaskCreate for each action, then update Task status from in_progress to completed after verification. The workflow scaffolds the plugin directory, generates plugin.json, creates an initial skill using the writing-skills workflow, writes a README, and finally tests installation to verify skill loading.
When to Use It
- You need to initialize a brand-new Claude Code plugin package for reuse across projects
- You want to scaffold the standard directory structure (<plugin-name>/, skills/, README, etc.)
- You must generate a valid plugin.json manifest and plan which skills are exposed
- You intend to create the initial skill through the dedicated writing-skills workflow (frontmatter, tests, reviews)
- You will test local installation to ensure the plugin and its skills load correctly
Quick Start
- Step 1: Gather requirements, decide the kebab-case plugin name, and outline capabilities
- Step 2: Create directory structure and generate plugin.json manifest
- Step 3: Create initial skill using the writing-skills workflow and test local installation
Best Practices
- Use kebab-case for plugin names and avoid reserved terms like helper, utils, anthropic, or claude
- Keep the plugin focused and well-documented; expose a clear capability and skill set
- Follow the exact directory structure to enable auto-discovery of skills
- Always invoke the writing-skills workflow for the initial skill to ensure quality
- Test installation locally: verify skill presence, loading, and proper integration
Example Use Cases
- Scaffold a new plugin named my-plugin, add a greet skill, and document usage in README
- Create a plugin package that provides a code-analysis skill set with commands and rules
- Generate a plugin for internal tooling with tasks, agents, and a README, ready for local testing
- Derive an image-processor plugin skeleton and wire up an initial image-filtering skill
- Refresh an existing plugin by re-scaffolding structure and validating skill discovery via plugin add