Skip to content

Commit 5621b95

Browse files
authored
refactor(plugin-dev): make plugin self-contained and migrate commands to skills (#256)
* refactor(plugin-dev): make plugin self-contained and migrate commands to skills Move the multi-format generator into plugin-dev so the plugin no longer depends on repo-root scripts/, add $schema fields to the Claude and generated Antigravity manifests, and consolidate the 5 slash commands into 3 skills with a shared references/ folder. - Move scripts/multi-format.ts and scripts/multi-format.test.ts into plugins/plugin-dev/scripts/. Add scripts/run.ts as the CLI entry point holding the generateMultiFormat() orchestration previously in scripts/cli.ts, which now re-exports it so `bun scripts/cli.ts multi-format` keeps working. Extend vitest.config.ts to discover the relocated test file. - Add "$schema" to plugin-dev's .claude-plugin/plugin.json (Claude source) and to the generator's Antigravity output (root plugin.json), with a new generator test covering the emitted schema URL. - Fix a pre-existing bug: plugin-dev previously shipped only a root-level plugin.json with no .claude-plugin/plugin.json, which fails `claude plugin validate`. Migrate the manifest to .claude-plugin/plugin.json as the Claude source of truth, with the generator producing the root plugin.json as the Antigravity manifest — matching the pattern already used by the bun plugin. - Replace commands/{scaffold,multi-format,validate,best-practices, migrate-gemini}.md with three skills modeled on the Codex plugin-creator and Cursor create-plugin reference skills: skills/plugin-authoring (scaffold + multi-format + best practices, with references/{plugin-json-spec,multi-runtime-manifests, best-practices}.md), skills/validating-plugins, and skills/migrating-gemini-extensions. Update README.md's Commands section to Skills and fix the stale claude-at-root comment in the generator. All 132 tests pass; `claude plugin validate plugins/plugin-dev` passes. * chore(plugin-dev): apply AI code review suggestions - declare skills path in manifest so Codex exposes them (Greptile P1) - rename skill names to lowercase-hyphen matching directories (cubic P1) - correct $schema and Codex-marketplace-scope wording in reference (cubic P3) - extract helpers so generateMultiFormat stays under the function-length guideline (Gemini)
1 parent 289183b commit 5621b95

20 files changed

Lines changed: 731 additions & 1039 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
3+
"name": "plugin-dev",
4+
"version": "1.1.0",
5+
"description": "Best practices, guidelines, and validation tools for Claude Code plugin development",
6+
"author": {
7+
"name": "Passion Factory",
8+
"email": "support@passionfactory.ai",
9+
"url": "https://github.com/pleaseai"
10+
},
11+
"homepage": "https://github.com/pleaseai/claude-code-plugins/tree/main/plugins/plugin-dev",
12+
"repository": "https://github.com/pleaseai/claude-code-plugins",
13+
"license": "MIT",
14+
"keywords": [
15+
"plugin",
16+
"development",
17+
"best-practices",
18+
"validation",
19+
"guidelines",
20+
"scaffold"
21+
],
22+
"skills": [
23+
"./skills/"
24+
]
25+
}

plugins/plugin-dev/.codex-plugin/plugin.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@
3030
"validation",
3131
"guidelines",
3232
"scaffold"
33-
]
33+
],
34+
"skills": "./skills/"
3435
}

plugins/plugin-dev/README.md

Lines changed: 29 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Best practices, guidelines, and validation tools for Claude Code plugin developm
44

55
## Overview
66

7-
`plugin-dev` is a comprehensive toolkit for Claude Code plugin developers. It provides commands, validation hooks, and expert guidance to help you create high-quality plugins that follow best practices.
7+
`plugin-dev` is a comprehensive toolkit for Claude Code plugin developers. It provides skills, validation hooks, and expert guidance to help you create high-quality plugins that follow best practices. The skills activate automatically when you describe a plugin-development task — no slash commands to remember.
88

99
## Features
1010

@@ -28,101 +28,37 @@ claude
2828
/plugin install plugin-dev@pleaseai
2929
```
3030

31-
## Commands
31+
## Skills
3232

33-
### `/plugin-dev:best-practices`
33+
These skills activate automatically when your request matches — just describe what you want to do.
34+
Three focused skills, with deep material factored into `references/` (loaded on demand).
3435

35-
Get comprehensive guidance on Claude Code plugin development best practices.
36+
### `plugin-authoring`
3637

37-
**Use cases:**
38-
- Learning plugin development standards
39-
- Reviewing plugin architecture decisions
40-
- Understanding component best practices
41-
- Getting answers to specific development questions
38+
The umbrella workflow: author, scaffold, or edit a plugin **once** in Claude Code format, then
39+
generate the Codex, Antigravity, and Cursor manifests from it (`bun scripts/cli.ts multi-format`,
40+
bundled in this plugin at `scripts/run.ts` + `scripts/multi-format.ts`). Covers scaffolding,
41+
multi-format generation, and best practices inline, and points to its references:
4242

43-
**Example:**
44-
```
45-
/plugin-dev:best-practices
46-
47-
How should I structure my plugin's hooks for optimal performance?
48-
```
49-
50-
### `/plugin-dev:validate`
51-
52-
Perform comprehensive validation of your plugin structure and configuration.
53-
54-
**Validates:**
55-
- ✅ Plugin manifest (plugin.json) correctness
56-
- ✅ Directory structure compliance
57-
- ✅ Command file formats
58-
- ✅ Hook configurations
59-
- ✅ MCP server definitions
60-
- ✅ Documentation completeness
61-
62-
**Example:**
63-
```
64-
/plugin-dev:validate
43+
- `references/plugin-json-spec.md` — manifest + marketplace field guide with canonical samples.
44+
- `references/multi-runtime-manifests.md` — per-runtime mapping, the generator, diff scoping.
45+
- `references/best-practices.md` — quality checklist, pitfalls, testing.
6546

66-
Please validate my plugin at ./plugins/my-plugin
67-
```
47+
> "I need a new plugin called *api-tools* for API testing." · "Regenerate *plugins/api-tools*' Codex and Cursor manifests."
6848
69-
### `/plugin-dev:scaffold`
49+
### `validating-plugins`
7050

71-
Generate a new plugin with proper structure and best practices baked in.
51+
Audit a plugin's manifest, directory structure, commands, skills, hooks, and MCP config, with
52+
findings grouped by severity.
7253

73-
**Creates:**
74-
- Complete directory structure
75-
- plugin.json manifest
76-
- Example commands
77-
- Hook templates
78-
- README and documentation
79-
- License and changelog
54+
> "Validate my plugin at ./plugins/my-plugin."
8055
81-
**Example:**
82-
```
83-
/plugin-dev:scaffold
56+
### `migrating-gemini-extensions`
8457

85-
I need a new plugin called "api-tools" that provides commands for API testing
86-
```
58+
Convert a Gemini CLI extension to a Claude Code plugin, preserving functionality and backwards
59+
compatibility.
8760

88-
### `/plugin-dev:multi-format`
89-
90-
Generate the Codex, Antigravity, and Cursor manifests for the marketplace's local plugins from the
91-
Claude Code source of truth. The Claude manifest is the only file you author by hand — this command
92-
keeps every runtime in sync.
93-
94-
**Generates (per local plugin):**
95-
- `.codex-plugin/plugin.json` (+ `.mcp.json` when MCP is present)
96-
- root `plugin.json` + `mcp_config.json` + `hooks.json` (Antigravity)
97-
- `.cursor-plugin/plugin.json`
98-
- `.agents/plugins/marketplace.json` and `.cursor-plugin/marketplace.json`
99-
100-
**Example:**
101-
```
102-
/plugin-dev:multi-format
103-
104-
I just edited plugins/api-tools — regenerate its Codex and Cursor manifests
105-
```
106-
107-
> The generator rewrites all local plugins; scope your commit to the plugin(s) you changed.
108-
109-
### `/plugin-dev:migrate-gemini`
110-
111-
Migrate existing Gemini CLI extensions to Claude Code plugins.
112-
113-
**Handles:**
114-
- Converting gemini-extension.json → plugin.json
115-
- Migrating context files to SessionStart hooks
116-
- Updating MCP server configurations
117-
- Maintaining backwards compatibility
118-
- Updating documentation
119-
120-
**Example:**
121-
```
122-
/plugin-dev:migrate-gemini
123-
124-
Help me migrate my Gemini extension at ./extensions/my-extension
125-
```
61+
> "Help me migrate my Gemini extension at ./extensions/my-extension."
12662
12763
## Automatic Validation
12864

@@ -194,24 +130,22 @@ plugin-name/
194130

195131
## Development Workflow
196132

197-
1. **Create plugin structure**
198-
```bash
199-
/plugin-dev:scaffold
200-
```
133+
1. **Create plugin structure** — describe the plugin; the `plugin-authoring` skill activates.
201134

202135
2. **Develop components**
203136
- Add commands in `commands/`
204137
- Create agents in `agents/`
138+
- Add skills in `skills/`
205139
- Configure hooks in `hooks/`
206140

207-
3. **Generate multi-runtime manifests**
141+
3. **Generate multi-runtime manifests** (the `plugin-authoring` skill)
208142
```bash
209-
/plugin-dev:multi-format
143+
bun scripts/cli.ts multi-format
210144
```
211145

212-
4. **Validate continuously**
146+
4. **Validate continuously** — ask to validate the plugin (the `validating-plugins` skill), and run
213147
```bash
214-
/plugin-dev:validate
148+
claude plugin validate plugins/<name>
215149
```
216150

217151
5. **Test locally**
@@ -251,7 +185,7 @@ chmod +x hooks/script.sh
251185

252186
### Validation errors
253187
**Problem**: Invalid JSON or missing required fields
254-
**Solution**: Run `/plugin-dev:validate` to see specific issues
188+
**Solution**: Ask to validate the plugin (the `validating-plugins` skill) to see specific issues
255189

256190
## Resources
257191

@@ -274,7 +208,7 @@ See these plugins for real-world examples:
274208
Contributions welcome! Please:
275209

276210
1. Follow the best practices outlined in this plugin
277-
2. Validate your changes with `/plugin-dev:validate`
211+
2. Validate your changes (the `validating-plugins` skill)
278212
3. Update documentation
279213
4. Add examples for new features
280214

plugins/plugin-dev/commands/best-practices.md

Lines changed: 0 additions & 101 deletions
This file was deleted.

0 commit comments

Comments
 (0)