Create basic plugin directory structure and manifest
Creates a complete Claude Code plugin scaffold with marketplace structure. Use this first when building new plugins to establish the proper directory layout and manifest files.
/plugin marketplace add vanman2024/domain-plugin-builder/plugin install domain-plugin-builder@ai-dev-marketplace<plugin-name> [--marketplace]šØ EXECUTION NOTICE FOR CLAUDE
When you invoke this command via SlashCommand(/domain-plugin-builder:plugin-create ...), the system returns THESE INSTRUCTIONS below.
YOU are the executor. This is NOT an autonomous subprocess.
Immediately after SlashCommand returns, start executing Phase 0, then Phase 1, etc.
See @CLAUDE.md section "SlashCommand Execution - YOU Are The Executor" for detailed explanation.
CRITICAL: All generated files must follow security rules:
@~/.claude/plugins/marketplaces/dev-lifecycle-marketplace/docs/security/SECURITY-RULES.md
Key requirements:
your_service_key_here.env files with .gitignore.env.example with placeholders onlyArguments: $ARGUMENTS
Goal: Create the basic directory structure and plugin.json manifest for a new Claude Code plugin.
This is a simple command focused on creating the scaffold. Use /domain-plugin-builder:build-plugin for complete orchestration.
CRITICAL EXECUTION INSTRUCTIONS:
!{tool command} syntax shows you WHAT to execute - use the real tool to DO ITPhase 0: Create Todo List using TodoWrite tool
Create todo list for all phases below.
Phase 0.5: Load Template Files
Read the template files to understand what variables need to be replaced:
!{Read ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/templates/plugins/marketplace.json.template}
!{Read ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/templates/plugins/plugin.json.template}
!{Read ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/templates/plugins/README.md.template}
This shows exactly what template variables exist and need to be replaced in Phase 4.
Phase 1: Parse Arguments and Setup Structure
Parse $ARGUMENTS to extract plugin name:
!{bash echo "$ARGUMENTS" | sed 's/--marketplace//g' | xargs}
Store as $PLUGIN_NAME.
CRITICAL: Always create marketplace structure
Structure to create:
$PLUGIN_NAME/
āāā .claude-plugin/
ā āāā marketplace.json ā Marketplace manifest
āāā plugins/
āāā $PLUGIN_NAME/
āāā .claude-plugin/
ā āāā plugin.json ā Plugin manifest
āāā commands/
āāā agents/
āāā skills/
āāā ...
This matches domain-plugin-builder's structure exactly.
Phase 2: Gather Basic Info
Use AskUserQuestion to get:
Store these values for Phase 4.
Phase 3: Create Marketplace and Plugin Directory Structure
Create marketplace root structure:
!{bash mkdir -p $PLUGIN_NAME/.claude-plugin}
Create plugin subdirectory structure:
!{bash mkdir -p $PLUGIN_NAME/plugins/$PLUGIN_NAME/.claude-plugin $PLUGIN_NAME/plugins/$PLUGIN_NAME/commands $PLUGIN_NAME/plugins/$PLUGIN_NAME/agents $PLUGIN_NAME/plugins/$PLUGIN_NAME/skills $PLUGIN_NAME/plugins/$PLUGIN_NAME/hooks $PLUGIN_NAME/plugins/$PLUGIN_NAME/scripts $PLUGIN_NAME/plugins/$PLUGIN_NAME/docs}
Result:
$PLUGIN_NAME/.claude-plugin/$PLUGIN_NAME/plugins/$PLUGIN_NAME/Phase 4: Create Marketplace and Plugin Files from Templates
Set template variables:
Create marketplace.json at root:
!{bash sed "s/{{PLUGIN_NAME}}/$PLUGIN_NAME/g; s/{{DESCRIPTION}}/$DESCRIPTION/g" ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/templates/plugins/marketplace.json.template > $PLUGIN_NAME/.claude-plugin/marketplace.json}
Create plugin.json in plugins subdirectory:
Replace ALL template variables in plugin.json:
!{bash sed "s/{{PLUGIN_NAME}}/$PLUGIN_NAME/g; s/{{VERSION}}/$VERSION/g; s/{{DESCRIPTION}}/$DESCRIPTION/g; s/{{AUTHOR_NAME}}/$AUTHOR_NAME/g; s/{{AUTHOR_EMAIL}}/$AUTHOR_EMAIL/g; s/{{HOMEPAGE_URL}}/$HOMEPAGE_URL/g; s/{{REPOSITORY_URL}}/$REPOSITORY_URL/g; s/{{LICENSE}}/$LICENSE/g; s/{{KEYWORDS}}/$KEYWORDS/g" ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/templates/plugins/plugin.json.template > $PLUGIN_NAME/plugins/$PLUGIN_NAME/.claude-plugin/plugin.json}
Create plugin files:
!{bash sed "s/{{PLUGIN_NAME}}/$PLUGIN_NAME/g; s/{{DESCRIPTION}}/$DESCRIPTION/g" ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/templates/plugins/README.md.template > $PLUGIN_NAME/plugins/$PLUGIN_NAME/README.md}
!{bash sed "s/{{DATE}}/$DATE/g" ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/templates/plugins/CHANGELOG.md.template > $PLUGIN_NAME/plugins/$PLUGIN_NAME/CHANGELOG.md}
!{bash cp ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/templates/plugins/hooks.json.template $PLUGIN_NAME/plugins/$PLUGIN_NAME/hooks/hooks.json}
!{bash cp ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/templates/plugins/.gitignore.template $PLUGIN_NAME/plugins/$PLUGIN_NAME/.gitignore}
!{bash cp ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/templates/plugins/mcp.json.template $PLUGIN_NAME/plugins/$PLUGIN_NAME/.mcp.json}
!{bash cp ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/templates/plugins/LICENSE.template $PLUGIN_NAME/plugins/$PLUGIN_NAME/LICENSE}
Phase 5: Self-Validation
Run validation script to verify all work completed:
!{bash ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/scripts/validate-plugin.sh $BASE_PATH}
Mark all todos complete if validation passes.
Phase 6: Summary
Display: