feat: add plugin-create skill and plugin template
Adds the plugin-create skill (.agents/skills/plugin-create/) that scaffolds a new plugin from templates/plugin/, substitutes PLUGIN_NAME/AUTHOR_* markers, registers the plugin in marketplace.json, runs claude plugin validate ., and hands off to /marketplace-architect. Includes evals and the generic template with all components (agents, skills, hooks, MCP, bin, docs) with per-directory READMEs explaining what goes where and which tool reads each directory. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
8
templates/plugin/.claude-plugin/plugin.json
Normal file
8
templates/plugin/.claude-plugin/plugin.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "PLUGIN_NAME",
|
||||
"displayName": "PLUGIN_NAME",
|
||||
"description": "PLUGIN_DESCRIPTION",
|
||||
"author": { "name": "AUTHOR_NAME", "url": "AUTHOR_URL" },
|
||||
"license": "MIT",
|
||||
"keywords": []
|
||||
}
|
||||
3
templates/plugin/.mcp.json
Normal file
3
templates/plugin/.mcp.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"mcpServers": {}
|
||||
}
|
||||
42
templates/plugin/README.md
Normal file
42
templates/plugin/README.md
Normal file
@@ -0,0 +1,42 @@
|
||||
# PLUGIN_NAME
|
||||
|
||||
PLUGIN_DESCRIPTION
|
||||
|
||||
## Install
|
||||
|
||||
**Claude Code:**
|
||||
|
||||
```bash
|
||||
claude plugin marketplace add <owner>/<repo>
|
||||
claude plugin install PLUGIN_NAME@<marketplace-name>
|
||||
```
|
||||
|
||||
**GitHub Copilot CLI:**
|
||||
|
||||
```bash
|
||||
copilot plugin marketplace add <owner>/<repo>
|
||||
copilot plugin install PLUGIN_NAME
|
||||
```
|
||||
|
||||
**Local (development):**
|
||||
|
||||
```bash
|
||||
# Claude Code
|
||||
claude --plugin-dir ./plugins/PLUGIN_NAME
|
||||
|
||||
# GitHub Copilot CLI
|
||||
copilot plugin install ./plugins/PLUGIN_NAME
|
||||
```
|
||||
|
||||
## Contents
|
||||
|
||||
| Component | Path | Description |
|
||||
|---|---|---|
|
||||
| Skills | `skills/` | Slash commands available after install |
|
||||
| Agents | `agents/` | Role-based agents (`.md` for Claude, `.agent.md` for Copilot) |
|
||||
| Hooks | `hooks/hooks.json` (Claude) / `hooks.json` (Copilot) | Event-triggered automation |
|
||||
| MCP servers | `.mcp.json` | Model Context Protocol server definitions |
|
||||
|
||||
## Author
|
||||
|
||||
AUTHOR_NAME
|
||||
13
templates/plugin/agents/PLUGIN_NAME.agent.md
Normal file
13
templates/plugin/agents/PLUGIN_NAME.agent.md
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
name: PLUGIN_NAME
|
||||
description: PLUGIN_DESCRIPTION
|
||||
tools:
|
||||
- read_file
|
||||
- list_directory
|
||||
---
|
||||
|
||||
Replace this with your agent's system prompt and instructions.
|
||||
|
||||
This file is loaded by **GitHub Copilot CLI**. The `tools:` frontmatter field declares
|
||||
which tools the agent can use — add or remove tools as needed.
|
||||
For Claude Code, see `PLUGIN_NAME.md`.
|
||||
8
templates/plugin/agents/PLUGIN_NAME.md
Normal file
8
templates/plugin/agents/PLUGIN_NAME.md
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
name: PLUGIN_NAME
|
||||
description: PLUGIN_DESCRIPTION
|
||||
---
|
||||
|
||||
Replace this with your agent's system prompt and instructions.
|
||||
|
||||
This file is loaded by **Claude Code**. For GitHub Copilot CLI, see `PLUGIN_NAME.agent.md`.
|
||||
13
templates/plugin/agents/README.md
Normal file
13
templates/plugin/agents/README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# agents/
|
||||
|
||||
Agent definitions for this plugin. Each agent needs two files — one per tool:
|
||||
|
||||
| File | Tool | Notes |
|
||||
|---|---|---|
|
||||
| `<name>.md` | Claude Code | Frontmatter: `name`, `description`. No `tools:` field. |
|
||||
| `<name>.agent.md` | GitHub Copilot CLI | Frontmatter: `name`, `description`, `tools:` (array of permitted tool names). |
|
||||
|
||||
The two files share the same system prompt body. Keep them in sync.
|
||||
|
||||
Rename `PLUGIN_NAME.md` and `PLUGIN_NAME.agent.md` to your agent's name (kebab-case).
|
||||
Add additional agent pairs as needed — one pair per agent.
|
||||
11
templates/plugin/bin/README.md
Normal file
11
templates/plugin/bin/README.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# bin/
|
||||
|
||||
**Claude Code only.** Executables placed here are added to PATH when the plugin is installed.
|
||||
|
||||
Use this for CLI tools, helper scripts, or MCP server entry points bundled with the plugin.
|
||||
|
||||
Reference files in this directory from `.mcp.json` or hooks using `${CLAUDE_PLUGIN_ROOT}/bin/<file>`.
|
||||
The `${CLAUDE_PLUGIN_ROOT}` variable resolves to the plugin's install cache path at runtime —
|
||||
do not use relative paths from the repo root, as they will break after install.
|
||||
|
||||
GitHub Copilot CLI does not support `bin/`. If you add executables here, they are Claude Code only.
|
||||
7
templates/plugin/docs/README.md
Normal file
7
templates/plugin/docs/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# docs/
|
||||
|
||||
Plugin documentation. Place usage guides, reference material, and examples here.
|
||||
|
||||
This directory is not read automatically by either Claude Code or GitHub Copilot CLI.
|
||||
Reference specific files from your skill bodies or agent prompts when needed
|
||||
(e.g. `See references/usage.md for examples`).
|
||||
3
templates/plugin/hooks.json
Normal file
3
templates/plugin/hooks.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"hooks": []
|
||||
}
|
||||
27
templates/plugin/hooks/README.md
Normal file
27
templates/plugin/hooks/README.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# hooks/
|
||||
|
||||
**Claude Code only.** Hook definitions that run in response to Claude Code events.
|
||||
|
||||
The `hooks.json` in this directory is read by Claude Code. Structure:
|
||||
|
||||
```json
|
||||
{
|
||||
"hooks": {
|
||||
"PostToolUse": [
|
||||
{
|
||||
"matcher": "Bash",
|
||||
"hooks": [
|
||||
{ "type": "command", "command": "echo 'tool used'" }
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Supported events: `PreToolUse`, `PostToolUse`, `Notification`, `Stop`.
|
||||
|
||||
Use `${CLAUDE_PLUGIN_ROOT}` to reference scripts inside this plugin — the plugin runs
|
||||
from a cache path after install, not its original repo location.
|
||||
|
||||
For GitHub Copilot CLI hooks, see `hooks.json` at the plugin root.
|
||||
3
templates/plugin/hooks/hooks.json
Normal file
3
templates/plugin/hooks/hooks.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"hooks": {}
|
||||
}
|
||||
11
templates/plugin/plugin.json
Normal file
11
templates/plugin/plugin.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "PLUGIN_NAME",
|
||||
"description": "PLUGIN_DESCRIPTION",
|
||||
"author": { "name": "AUTHOR_NAME", "email": "AUTHOR_EMAIL" },
|
||||
"license": "MIT",
|
||||
"keywords": [],
|
||||
"agents": "agents/",
|
||||
"skills": ["skills/"],
|
||||
"hooks": "hooks.json",
|
||||
"mcpServers": ".mcp.json"
|
||||
}
|
||||
18
templates/plugin/skills/README.md
Normal file
18
templates/plugin/skills/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# skills/
|
||||
|
||||
Skills for this plugin. Each skill lives in its own subdirectory:
|
||||
|
||||
```
|
||||
skills/
|
||||
<skill-name>/
|
||||
SKILL.md # required — frontmatter + skill body
|
||||
META.md # required — provenance and audit fields
|
||||
references/ # optional — on-demand reference docs
|
||||
scripts/ # optional — executable helper scripts
|
||||
assets/ # optional — templates, data files, lookup tables
|
||||
```
|
||||
|
||||
**Shared** — both Claude Code and GitHub Copilot CLI read `skills/<name>/SKILL.md`.
|
||||
|
||||
To add a skill, run `/write-skill` in a Claude Code session. Do not write SKILL.md by hand
|
||||
without following the authoring standard — trigger descriptions and self-checks are required.
|
||||
Reference in New Issue
Block a user