Claude-skill-registry create
Create plugin components (commands, skills, hooks, agents, prompts) interactively
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/create" ~/.claude/skills/majiayu000-claude-skill-registry-create && rm -rf "$T"
skills/data/create/SKILL.mdCreate Plugin Component
Scaffold plugin components through iterative interviews. Works with any Claude Code plugin.
Expert Consultation
Always consult the
agent when:claude-code-guide
- Designing hook logic (exit codes, matchers, event types)
- Choosing between component types (skill vs agent vs hook)
- Validating generated content against best practices
- User asks questions about Claude Code features
task: subagent_type: claude-code-guide prompt: | User is creating a <component_type> named <name>. Validate this design against Claude Code best practices: - <design details> Flag any anti-patterns or suggest improvements.
Context
!
ls .claude-plugin/plugin.json 2>/dev/null && echo "Plugin detected" || echo "No plugin detected - will create in current directory"
Plugin Root Detection
Detect the target plugin directory:
- If
set, use it$CLAUDE_PLUGIN_ROOT - If
exists, use current directory.claude-plugin/plugin.json - Otherwise, ask user for target path or create new plugin structure
Phase 1: Component Type
Parse argument if provided (
/create command, /create skill, etc.).
If no argument or argument not recognized:
question: "What type of component do you want to create?" header: "Component" options: - label: "Command" description: "Slash command entry point (/plugin:name)" - label: "Skill" description: "Reusable workflow or knowledge" - label: "Hook" description: "Event-driven automation script" - label: "Agent" description: "Autonomous subagent definition" - label: "Prompt" description: "MCP prompt template with arguments" multiSelect: false
Phase 2: Type-Specific Interview
Based on component type, follow the detailed reference:
| Type | Reference |
|---|---|
| Command | references/command-creation.md |
| Skill | references/skill-creation.md |
| Hook | references/hook-creation.md |
| Agent | references/agent-creation.md |
| Prompt | references/prompt-creation.md |
Phase 2.5: Entity Scan
Before finalizing, scan all existing Claude entities for conflicts and integration opportunities.
Checklist
- Naming conflicts: Check all entity locations for the chosen name
- Related components: Find similar functionality for cross-referencing
- Hook opportunities: Identify potential integrations
- Expert consultation: If conflicts or complex integrations found
Check for Naming Conflicts
Use Glob to check for existing entities with the same name:
- Existing commandGlob("commands/<name>.md")
- Existing skillGlob("skills/<name>/SKILL.md")
- Existing hook scriptGlob("hooks/<name>.sh")
- Existing agentGlob("agents/<name>.md")
- Existing promptGlob("prompts/<name>.md")
Also check
hooks/hooks.json for hook registrations using the same name pattern.
Find Related Components
Use Grep to find related functionality by keywords from the new component's name/description:
- Related commandsGrep(pattern: "<keywords>", path: "commands/")
- Related skillsGrep(pattern: "<keywords>", path: "skills/")
- Related hooksGrep(pattern: "<keywords>", path: "hooks/")
- Related agentsGrep(pattern: "<keywords>", path: "agents/")
Integration Analysis
Based on component type being created:
If creating command/skill:
- Check if existing hooks could enhance it (e.g., PostToolUse notifications)
- Identify commands that should reference this in their docs
If creating hook:
- Identify commands/skills it should integrate with
- Check for related hooks that might conflict
If conflicts or complex integrations found:
- Consult claude-code-guide for naming conventions and resolution
Output
Report findings to user before Phase 3 confirmation:
## Entity Scan Results ✓ No naming conflicts (or ⚠ Conflicts: <list>) **Related Components** (if any): - commands/foo.md - Similar functionality [REVIEW] - hooks/bar.sh - Could trigger after this command [CONSIDER] **Integration Suggestions**: - Reference this from related-command.md - Consider PostToolUse hook for notifications
Phase 3: Expert Review & Confirmation
For hooks: Before showing preview, consult claude-code-guide to validate:
- Exit code usage (0=allow, 2=block)
- Defensive stdin pattern
- stop_hook_active check for Stop hooks
- Proper use of ${CLAUDE_PLUGIN_ROOT}
Before writing files, show preview:
## Component Preview **Type**: <type> **Name**: <name> **Files to create**: - <file 1> - <file 2> ### Content Preview <show generated content> Proceed with creation?
question: "Create this component?" header: "Confirm" options: - label: "Yes, create it" description: "Write files and complete setup" - label: "Edit first" description: "Make changes before creating" - label: "Cancel" description: "Don't create anything" multiSelect: false
Phase 4: Write Files
- Create necessary directories
- Write component files
- For hooks: update hooks.json
- For command hooks: make script executable
Constraints
- Consult claude-code-guide: For hooks and complex components, spawn the expert agent to validate design
- Detect plugin root: Use
or$CLAUDE_PLUGIN_ROOT.claude-plugin/plugin.json - Safe file creation: Never overwrite without asking
- Valid names: Enforce kebab-case for all names
- Executable hooks:
for shell scriptschmod +x - hooks.json merge: Preserve existing hooks when adding new ones
- Best practices: Use defensive stdin pattern, proper exit codes, ${CLAUDE_PLUGIN_ROOT} paths