Migrate existing plugins to proper Claude Code format. Use when converting flat skill files, adding missing frontmatter, restructuring plugin directories, or upgrading plugin structure.
/plugin marketplace add astoeffer/plugin-marketplace/plugin install plugin-builder@astoeffer-dev-pluginsThis skill is limited to using the following tools:
patterns.mdThis skill provides procedures for migrating plugins to the correct Claude Code format.
Before:
skills/
├── my-skill.md
└── another-skill.md
After:
skills/
├── my-skill/
│ └── SKILL.md
└── another-skill/
└── SKILL.md
Migration Steps:
For each skills/*.md file:
# Create directory
mkdir -p skills/skill-name
# Move and rename
mv skills/skill-name.md skills/skill-name/SKILL.md
Add frontmatter if missing:
---
name: skill-name
description: [extracted from content or prompted]
---
Skills without frontmatter:
Check if file starts with ---. If not, add:
---
name: [derive from filename, lowercase, hyphens]
description: [extract first paragraph or prompt user]
allowed-tools: [analyze content for tool usage]
---
[existing content]
Agents without frontmatter:
---
name: [derive from filename]
description: [extract purpose from content]
tools: [analyze for tool references]
model: sonnet
---
[existing content]
Issue: Directories inside .claude-plugin/
Before:
.claude-plugin/
├── plugin.json
├── commands/
├── agents/
└── skills/
After:
.claude-plugin/
└── plugin.json
commands/
agents/
skills/
Migration:
# Move directories to root
mv .claude-plugin/commands ./commands
mv .claude-plugin/agents ./agents
mv .claude-plugin/skills ./skills
Check for and remove empty directories:
# Find empty directories
find . -type d -empty
# Remove specific empty dirs
rmdir agents/ # if empty
rmdir commands/ # if empty
Look for description in order:
# headingExample:
# My Skill
This skill helps with X, Y, and Z.
## Instructions
...
Extract: "This skill helps with X, Y, and Z."
| Filename | Derived Name |
|---|---|
my-skill.md | my-skill |
MySkill.md | myskill |
my_skill.md | my-skill |
My Skill.md | my-skill |
Rules:
Scan content for tool references:
| Pattern | Tool |
|---|---|
| "read file", "Read tool" | Read |
| "search", "grep", "find text" | Grep |
| "find files", "glob" | Glob |
| "run command", "bash", "execute" | Bash |
| "write", "create file" | Write |
| "edit", "modify" | Edit |
/pb:validate on migrated plugin/helpIf skill has associated files:
Before:
skills/
├── api-reference.md
└── api-reference-data.json
After:
skills/
└── api-reference/
├── SKILL.md
└── data.json
Preserve namespace structure:
Before:
commands/
└── git/
├── commit.md
└── push.md
After: (no change needed - already correct)
commands/
└── git/
├── commit.md → /git:commit
└── push.md → /git:push
Move all related files to skill directory:
skills/
└── complex-skill/
├── SKILL.md
├── reference.md
├── examples.md
└── templates/
└── template.json
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.