plugin-factory
Skill0 starsChanged 6 months agoMITView on GitHub
Scaffolds new plugins, skills, and MCP servers in this repository. Creates directory layout, SKILL.md files, MCP tool scripts and server code, and registers everything in manifests. Use when the user wants to bootstrap or scaffold a new plugin or skill, set up a new skill repo, wire MCP tools/prompts, generate `mcp_tools.json` boilerplate, register entries in `skills/manifest.json` or `marketplace.json`, or validate plugin/skill structure — even when they don't explicitly say "scaffold". Do NOT use for editing an existing skill's prose/description (use skill-creator), packaging skills for distribution to external registries, or general MCP server development outside this repo's conventions.
- Reads credentials
- Installs packages
In this repository7 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- aws-eks-updaterSkill
- azure-aks-updaterSkill
- github-actions-writerSkill
- agent-toolkitSkill
- post-work-checksSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
32 rules. About 0 are common, 12 are distinctive, and 20 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.
20
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 30
Don't overwrite existing files without explicit user confirmation — silent overwrites have destroyed in-progress work in this repo before.
- Distinctive: line 38
Use kebab-case for skill, plugin, and directory names — required by the manifest loader and by Codex/Claude plugin discovery.
- Very specific: line 40
When adding an MCP server: declare it in .mcp.json and walk the user through restart — the harness reads .mcp.json only at startup, so …
- Distinctive: line 58
If yes, go through Phase 2b after scaffolding the plugin.
- Very specific: line 76
Run meta__scaffold_plugin with the plugin name and metadata to generate:
- Distinctive: line 88
Verify the output and show the user what was created.
- Distinctive: line 126
Keep each tool focused on one action.
- Distinctive: line 127
Use Python type annotations — FastMCP reflects them into the tool schema.
- Very specific: line 129
Add a requirements.txt in server/ listing mcp and any other deps.
- Very specific: line 133
Update the plugin's .mcp.json to declare the server under mcpServers.
- Distinctive: line 173
No local process is spawned.
- Distinctive: line 190
Keep inline definitions to a single, short expression — anything complex belongs in a real script file.
- Distinctive: line 195
After writing the files, tell the user exactly what to do based on approach:
- Very specific: line 201
Verify the server appears: run /mcp in Claude Code and confirm the server name is listed.
- Very specific: line 207
Verify with /mcp — the remote server should appear as connected.
- Very specific: line 214
If the plugin's skills will call tools from this MCP server, add them to requires_mcp in each relevant SKILL.md frontmatter:
- Very specific: line 230
Run meta__scaffold_skill with category, name, and description to create:
- Very specific: line 244
Keep under 500 lines; put deep docs in references/
- Very specific: line 255
Write the Python script in tools/ — uses argparse, prints JSON to stdout, stdlib only
- Very specific: line 256
Add the tool declaration to tools/mcp_tools.json
- Very specific: line 261
Put detailed docs in references/.
- Distinctive: line 262
Keep them focused — one file per topic, include a table of contents for files > 300 lines.
- Very specific: line 266
Write agent prompts in agents/.
- Very specific: line 278
Run meta__validate_plugin on the plugin directory.
- Very specific: line 279
All required files exist (.claude-plugin/plugin.json, .mcp.json, etc.)
- Very specific: line 282
If .mcp.json declares mcpServers, confirm the referenced command/script exists
- Very specific: line 284
If Phase 2b: verify python3 plugins/<plugin-name>/server/server.py --help runs cleanly and .mcp.json mcpServers entry uses correct …
- Very specific: line 287
Run meta__validate_skill on each skill directory.
- Very specific: line 296
Add each skill to skills/manifest.json:
- Distinctive: line 313
Add the plugin to both marketplace files:
- Distinctive: line 329
After everything is created and validated:
- Very specific: line 332
Use patterns from references/description-patterns.md.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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.
Files
Plugin Factory
You are a plugin and skill creation assistant for this repository. Work through phases sequentially. At each phase: gather input, perform work, report results, get confirmation, then advance.
Hard rules and the reasoning behind them:
- Don't overwrite existing files without explicit user confirmation — silent overwrites have destroyed in-progress work in this repo before.
- Validate before declaring done —
validate_pluginandvalidate_skillcatch missing files, malformed JSON, and broken symlinks that would only surface at install time otherwise. - Skills must include "Use when..." and "Do NOT use for..." in their description — these are the trigger signals the agent uses to pick the right skill; without them the skill under-fires.
- Tool scripts use stdlib only — no pip dependencies. The repo deliberately avoids a build step so skills work on a fresh clone without environment setup.
- Use kebab-case for skill, plugin, and directory names — required by the manifest loader and by Codex/Claude plugin discovery.
- When adding an MCP server: declare it in
.mcp.jsonand walk the user through restart — the harness reads.mcp.jsononly at startup, so editing it without restarting is invisible.
Phase 1: Discover Intent
Understand what the user wants to build:
- Domain — What area does this cover? (devops, security, data, meta, business, etc.)
- Plugin scope — What skills will this plugin bundle? (1 plugin can have multiple skills)
- Each skill's purpose — For each skill:
- What task does it accomplish?
- What triggers should activate it?
- What tools/CLIs does it need?
- What phases will it follow?
- MCP tools needed — Will the skills need Python tool scripts exposed via MCP?
- MCP server needed — Does the user want to create or integrate a standalone MCP server?
- If yes, go through Phase 2b after scaffolding the plugin.
- Clarify: new server from scratch, or wrapping an existing CLI/API?
- Clarify: transport preference (
stdiodefault,sse, orstreamable-http)?
Output a summary table before proceeding:
| Component | Name | Description |
| Plugin | <name> | ... |
| MCP Server | <name> (if any) | ... |
| Skill 1 | <name> | ... |
| Skill 2 | <name> | ... |
| Tool 1 | <category>__<name> | ... |
Phase 2: Scaffold Plugin
Run meta__scaffold_plugin with the plugin name and metadata to generate:
plugins/<plugin-name>/
├── .claude-plugin/plugin.json
├── .codex-plugin/plugin.json
├── .mcp.json
├── README.md
└── skills/
└── <skill-name> -> ../../../skills/<category>/<skill-name>Verify the output and show the user what was created.
Phase 2b: Create MCP Server (if requested)
Skip this phase if the user does not need a standalone MCP server.
2b-1. Choose server approach
| Approach | Transport | When to use |
| FastMCP (Python) | stdio | New server from scratch; rich tool/resource/prompt support |
| Wrapper script | stdio | Thin shell around an existing CLI or REST API |
Local package (uvx/npx) | stdio | User has a published package to run locally |
| Remote HTTP server | sse / streamable-http | Server already deployed at a URL; no local process |
| Inline definition | n/a | Single-file tool with no separate server process needed |
2b-2. Write the server code (local only)
Skip this step for remote or inline approaches.
For a FastMCP server, create plugins/<plugin-name>/server/server.py:
from mcp.server.fastmcp import FastMCP
mcp = FastMCP("<plugin-name>")
@mcp.tool()
def my_tool(arg: str) -> str:
"""Tool description shown to the model."""
return arg
if __name__ == "__main__":
mcp.run() # defaults to stdio transport- Keep each tool focused on one action.
- Use Python type annotations — FastMCP reflects them into the tool schema.
- Return plain values (str, dict, list); FastMCP serializes them.
- Add a
requirements.txtinserver/listingmcpand any other deps.
2b-3. Register in .mcp.json
Update the plugin's .mcp.json to declare the server under mcpServers.
Pick the block that matches the chosen approach:
Local script (stdio):
{
"mcpServers": {
"<server-name>": {
"command": "python3",
"args": ["plugins/<plugin-name>/server/server.py"],
"env": {}
}
}
}Local package via uvx or npx (stdio):
{
"mcpServers": {
"<server-name>": {
"command": "uvx",
"args": ["<package-name>"],
"env": { "API_KEY": "${API_KEY}" }
}
}
}Remote server (SSE or streamable-http):
{
"mcpServers": {
"<server-name>": {
"url": "https://<host>/mcp",
"headers": { "Authorization": "Bearer ${API_KEY}" }
}
}
}No local process is spawned; the harness connects over HTTP. Ask the user for the URL and any required auth headers/env vars.
Inline tool (no separate process):
Some harnesses support declaring lightweight tools directly in .mcp.json
without spawning a server. Use this for trivial single-tool cases:
{
"mcpServers": {
"<server-name>": {
"command": "python3",
"args": ["-c", "import sys,json; print(json.dumps({'result': sys.argv[1]}))"],
"env": {}
}
}
}Keep inline definitions to a single, short expression — anything complex belongs in a real script file.
2b-4. Guide the user through activation
After writing the files, tell the user exactly what to do based on approach:
For local scripts/packages:
- Install deps if needed:
pip install -r plugins/<plugin-name>/server/requirements.txt(oruv pip install ...if they use uv) - Restart Claude Code / the harness so it picks up the new
mcpServersentry. - Verify the server appears: run
/mcpin Claude Code and confirm the server name is listed.
For remote servers:
- Confirm the URL is reachable:
curl -I <url> - Set any required env vars (API keys, tokens) in the shell or
.env. - Restart Claude Code / the harness.
- Verify with
/mcp— the remote server should appear as connected.
Why restart is required: The harness reads
.mcp.jsonat startup. A running instance won't see changes until restarted. Guide the user explicitly — never assume they know.
2b-5. Expose server tools in skill declarations
If the plugin's skills will call tools from this MCP server, add them to requires_mcp
in each relevant SKILL.md frontmatter:
requires_mcp:
- <server-name>__<tool-name>Phase 3: Create Skills
For each skill in the plugin, repeat this sub-workflow:
3a. Scaffold the skill
Run meta__scaffold_skill with category, name, and description to create:
skills/<category>/<skill-name>/
├── SKILL.md (template with frontmatter filled in)
├── tools/ (empty, ready for scripts)
├── references/ (empty, ready for docs)
└── agents/ (empty, ready for sub-agent prompts)3b. Write the SKILL.md body
Help the user write the skill body:
- Keep under 500 lines; put deep docs in
references/ - Phases are linear — agent works through them one at a time
- Imperative form: "Run X", not "You should run X"
- Hard rules section at the top; explain the why, not just ALWAYS/NEVER
See references/skill-writing-guide.md for the full guide.
3c. Add MCP tools (if needed)
For each tool script:
- Write the Python script in
tools/— uses argparse, prints JSON to stdout, stdlib only - Add the tool declaration to
tools/mcp_tools.json - Tools are namespaced as
<category>__<tool_name>(double underscore)
3d. Add references (if needed)
Put detailed docs in references/. These are auto-exposed as MCP resources.
Keep them focused — one file per topic, include a table of contents for files > 300 lines.
3e. Add sub-agent prompts (if needed)
Write agent prompts in agents/. Each agent prompt should define:
- Role
- Inputs
- Process (numbered steps)
- Output format
Phase 4: Validate & Register
4a. Validate structure
Run meta__validate_plugin on the plugin directory. It checks:
- All required files exist (.claude-plugin/plugin.json, .mcp.json, etc.)
- JSON files are valid
- Skills symlinks resolve
- If
.mcp.jsondeclaresmcpServers, confirm the referenced command/script exists
If Phase 2b: verify python3 plugins/<plugin-name>/server/server.py --help runs cleanly
and .mcp.json mcpServers entry uses correct command/args.
Run meta__validate_skill on each skill directory. It checks:
- SKILL.md exists and has valid frontmatter
- name is kebab-case
- description includes trigger phrases and exclusions
- tools/mcp_tools.json is valid (if present)
- Referenced scripts exist
4b. Register in manifest
Add each skill to skills/manifest.json:
{
"name": "<skill-name>",
"category": "<category>",
"version": 1,
"path": "<category>/<skill-name>",
"description": "Same as SKILL.md description.",
"requires_tools": [],
"requires_mcp": [],
"tags": ["tag1", "tag2"]
}4c. Register in marketplace
Add the plugin to both marketplace files:
.claude-plugin/marketplace.json.agents/plugins/marketplace.json
4d. Final verification
python3 -c "import json; json.load(open('skills/manifest.json'))"Confirm the skill loads correctly when placed in the agent's skills directory.
Phase 5: Review & Optimize
After everything is created and validated:
- Review skill descriptions — Are they specific enough to trigger correctly?
Use patterns from
references/description-patterns.md. - Review hard rules — Are safety constraints clear and complete?
- Review tool scripts — Do they handle errors gracefully? Print useful JSON on failure?
- Suggest improvements — Based on patterns from existing skills in this repo.
Present a final summary to the user showing everything that was created.
Reference Files
references/plugin-structure.md— Complete plugin anatomy and file requirementsreferences/skill-writing-guide.md— How to write effective skillsreferences/description-patterns.md— Trigger description best practices and anti-patternsagents/skill-reviewer.md— Sub-agent for reviewing skill qualityagents/description-optimizer.md— Sub-agent for improving descriptions
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
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.

