Initial commit
This commit is contained in:
216
commands/agents-create.md
Normal file
216
commands/agents-create.md
Normal file
@@ -0,0 +1,216 @@
|
||||
---
|
||||
description: Create agent(s) using templates - supports parallel creation for 3+ agents
|
||||
argument-hint: <agent-name> "<description>" [--marketplace] | <agent-1> "<desc-1>" <agent-2> "<desc-2>" ... [--marketplace]
|
||||
allowed-tools: Task, Read, Write, Edit, Bash, Glob, Grep, TodoWrite
|
||||
---
|
||||
|
||||
---
|
||||
🚨 **EXECUTION NOTICE FOR CLAUDE**
|
||||
|
||||
When you invoke this command via `SlashCommand(/domain-plugin-builder:agents-create ...)`, the system returns THESE INSTRUCTIONS below.
|
||||
|
||||
**YOU are the executor. This is NOT an autonomous subprocess.**
|
||||
|
||||
- ✅ The phases below are YOUR execution checklist
|
||||
- ✅ YOU must run each phase immediately using tools (Bash, Read, Write, Edit, TodoWrite)
|
||||
- ✅ Complete ALL phases before considering this command done
|
||||
- ❌ DON'T wait for "the command to complete" - YOU complete it by executing the phases
|
||||
- ❌ DON'T treat this as status output - it IS your instruction set
|
||||
|
||||
**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.
|
||||
|
||||
---
|
||||
|
||||
**Arguments**: $ARGUMENTS
|
||||
|
||||
**Security**: Follow @~/.claude/plugins/marketplaces/dev-lifecycle-marketplace/docs/security/SECURITY-RULES.md (never hardcode API keys)
|
||||
|
||||
**Framework**: Load @component-decision-framework.md and @dans-composition-pattern.md
|
||||
|
||||
**Goal**: Create properly structured agent file(s). For 3+ agents, use parallel execution.
|
||||
|
||||
**EXECUTE each phase immediately** using actual tools (Bash, Read, Write, Task, TodoWrite). Complete all phases in order.
|
||||
|
||||
Phase 0: Create Todo List
|
||||
|
||||
Create todo list for all phases below.
|
||||
|
||||
Phase 1: Parse Arguments, Determine Mode & Count Agents
|
||||
Goal: Extract agent specifications, determine mode, and execution strategy
|
||||
|
||||
Actions:
|
||||
|
||||
Parse $ARGUMENTS to extract:
|
||||
- Agent names and descriptions
|
||||
- Plugin name (from context or pwd)
|
||||
- Marketplace mode (check for --marketplace flag)
|
||||
|
||||
If plugin not specified:
|
||||
|
||||
!{bash basename $(pwd)}
|
||||
|
||||
Determine base path - check if already in a plugin directory:
|
||||
|
||||
!{bash test -f .claude-plugin/plugin.json && echo "." || (echo "$ARGUMENTS" | grep -q "\-\-marketplace" && echo "plugins/$(basename $(pwd))" || echo ".")}
|
||||
|
||||
Store as $BASE_PATH:
|
||||
- If .claude-plugin/plugin.json exists: BASE_PATH="." (already in plugin directory)
|
||||
- Else if --marketplace present: BASE_PATH="plugins/$PLUGIN_NAME"
|
||||
- Else: BASE_PATH="." (standalone plugin mode)
|
||||
|
||||
All subsequent file operations use $BASE_PATH instead of hardcoded "plugins/$PLUGIN_NAME"
|
||||
|
||||
Use bash to parse $ARGUMENTS and count how many agents are being requested:
|
||||
|
||||
!{bash echo "$ARGUMENTS" | grep -oE '<[^>]+>' | wc -l}
|
||||
|
||||
Store the count. Then extract each agent specification:
|
||||
- If count = 1: Single agent mode - extract <agent-name> and "<description>"
|
||||
- If count = 2: Two agents mode - extract both <agent-N> "<desc-N>" sets
|
||||
- If count >= 3: Multiple agents mode - extract all <agent-N> "<desc-N>" sets
|
||||
|
||||
All agents use Task tool - whether creating 1 or 10 agents.
|
||||
|
||||
**Note:** Agents inherit tools from parent - no need to specify tools field.
|
||||
|
||||
Phase 2: Load Templates
|
||||
Goal: Study framework patterns
|
||||
|
||||
Actions:
|
||||
|
||||
Load agent template immediately:
|
||||
!{Read @agent-with-phased-webfetch.md}
|
||||
|
||||
Determine plugin location from context (default: domain-plugin-builder)
|
||||
|
||||
Phase 3: Create Agent(s)
|
||||
Goal: Generate agent file(s) efficiently
|
||||
|
||||
Actions:
|
||||
|
||||
**Decision: 1-2 agents = build directly, 3+ agents = use Task() for parallel**
|
||||
|
||||
**For 1-2 Agents:**
|
||||
|
||||
Build directly - execute these steps immediately:
|
||||
|
||||
1. Load template:
|
||||
!{Read @agent-with-phased-webfetch.md}
|
||||
|
||||
2. Load color decision framework:
|
||||
!{Read @agent-color-decision.md}
|
||||
|
||||
3. For each agent, create the file:
|
||||
!{Write $BASE_PATH/agents/$AGENT_NAME.md}
|
||||
|
||||
Include:
|
||||
- Frontmatter with name, description, model: inherit, color (from decision framework)
|
||||
- **NO tools field** - agents inherit tools from parent
|
||||
- "Available Tools & Resources" section specifying:
|
||||
- MCP servers (e.g., mcp__github, mcp__supabase)
|
||||
- Skills (e.g., Skill(plugin:skill-name))
|
||||
- Slash commands (e.g., SlashCommand(/plugin:command-name))
|
||||
- Progressive WebFetch for documentation
|
||||
- Keep under 300 lines
|
||||
|
||||
4. Validate:
|
||||
!{Bash ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/scripts/validate-agent.sh $BASE_PATH/agents/$AGENT_NAME.md}
|
||||
|
||||
No need for Task() overhead when building 1-2 agents
|
||||
|
||||
**For 3+ Agents:**
|
||||
|
||||
**CRITICAL: Send ALL Task() calls in a SINGLE MESSAGE for parallel execution!**
|
||||
|
||||
For each agent, create a Task() call with subagent_type="domain-plugin-builder:agents-builder" that includes:
|
||||
- Agent name and description
|
||||
- Instructions to load templates from build-assistant/templates/agents/
|
||||
- File path: $BASE_PATH/agents/{agent-name}.md
|
||||
- Frontmatter: name, description, model: inherit, color (from agent-color-decision.md)
|
||||
- **NO tools field** - agents inherit from parent
|
||||
- Available Tools & Resources section (MCP servers, skills, slash commands)
|
||||
- Progressive WebFetch for docs
|
||||
- Keep under 300 lines
|
||||
- Validate with validation script
|
||||
|
||||
**Send ALL Task() calls together in ONE message - they will execute in parallel!**
|
||||
|
||||
Only proceed to Phase 4 after all Task() calls complete.
|
||||
|
||||
Phase 4: Validation and Registration
|
||||
|
||||
**Validate all created agents:**
|
||||
|
||||
For each agent:
|
||||
!{bash ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/scripts/validate-agent.sh $BASE_PATH/agents/$AGENT_NAME.md}
|
||||
|
||||
If validation fails, read errors and fix issues.
|
||||
|
||||
**Note:** Agents don't need settings.json registration (only commands do).
|
||||
|
||||
Phase 5: Git Commit and Push
|
||||
Goal: Save work immediately
|
||||
|
||||
Actions:
|
||||
- Add all agent files to git: !{bash git add plugins/*/agents/*.md}
|
||||
- Commit with message:
|
||||
!{bash git commit -m "$(cat <<'EOF'
|
||||
feat: Add agent(s) - AGENT_NAMES
|
||||
|
||||
Complete agent structure with framework compliance.
|
||||
|
||||
🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
||||
|
||||
Co-Authored-By: Claude <noreply@anthropic.com>
|
||||
EOF
|
||||
)"}
|
||||
- Push to GitHub: !{bash git push origin master}
|
||||
|
||||
Phase 6: Sync to Airtable
|
||||
Goal: Sync ALL created agents to Airtable in bulk
|
||||
|
||||
Actions:
|
||||
|
||||
**Use bulk sync script for efficiency:**
|
||||
|
||||
Bash: python ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/scripts/bulk-sync-airtable.py --plugin={plugin-name} --marketplace={marketplace-name} --type=agents
|
||||
|
||||
This syncs ALL agents in parallel instead of one at a time.
|
||||
|
||||
**DO NOT skip this phase!** Airtable sync is critical for marketplace integration.
|
||||
|
||||
Phase 7: 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-agent.sh $BASE_PATH/agents/*.md}
|
||||
|
||||
Mark all todos complete if validation passes.
|
||||
|
||||
Phase 8: Summary
|
||||
Goal: Report results
|
||||
|
||||
Actions:
|
||||
|
||||
Display results:
|
||||
|
||||
**Agents Created:** <count>
|
||||
**Plugin:** $PLUGIN_NAME
|
||||
**Mode:** $BASE_PATH (marketplace mode if "plugins/", standalone if ".")
|
||||
**Location:** $BASE_PATH/agents/
|
||||
|
||||
**Files:**
|
||||
- $AGENT_1.md - $DESC_1 ✅
|
||||
- $AGENT_2.md - $DESC_2 ✅
|
||||
- etc.
|
||||
|
||||
**Validation:** All passed ✅
|
||||
**Git Status:** Committed and pushed ✅
|
||||
**Airtable Sync:** Attempted ✅
|
||||
|
||||
**Next Steps:**
|
||||
- Invoke agents via Task tool: Task(subagent_type="$PLUGIN_NAME:$AGENT_NAME")
|
||||
- Use in commands and skills
|
||||
- Test agent capabilities
|
||||
244
commands/hooks-create.md
Normal file
244
commands/hooks-create.md
Normal file
@@ -0,0 +1,244 @@
|
||||
---
|
||||
description: Create hook(s) following standardized structure - supports parallel creation for 3+ hooks
|
||||
argument-hint: <hook-name> <event-type> "<action>" [--plugin=name] [--marketplace] | <hook-1> <event-1> ... [--plugin=name] [--marketplace]
|
||||
---
|
||||
|
||||
---
|
||||
🚨 **EXECUTION NOTICE FOR CLAUDE**
|
||||
|
||||
When you invoke this command via `SlashCommand(/domain-plugin-builder:hooks-create ...)`, the system returns THESE INSTRUCTIONS below.
|
||||
|
||||
**YOU are the executor. This is NOT an autonomous subprocess.**
|
||||
|
||||
- ✅ The phases below are YOUR execution checklist
|
||||
- ✅ YOU must run each phase immediately using tools (Bash, Read, Write, Edit, TodoWrite)
|
||||
- ✅ Complete ALL phases before considering this command done
|
||||
- ❌ DON'T wait for "the command to complete" - YOU complete it by executing the phases
|
||||
- ❌ DON'T treat this as status output - it IS your instruction set
|
||||
|
||||
**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.
|
||||
|
||||
---
|
||||
|
||||
## Security Requirements
|
||||
|
||||
**CRITICAL:** All generated files must follow security rules:
|
||||
|
||||
@~/.claude/plugins/marketplaces/dev-lifecycle-marketplace/docs/security/SECURITY-RULES.md
|
||||
|
||||
**Key requirements:**
|
||||
- Never hardcode API keys or secrets
|
||||
- Use placeholders: `your_service_key_here`
|
||||
- Protect `.env` files with `.gitignore`
|
||||
- Create `.env.example` with placeholders only
|
||||
- Document key acquisition for users
|
||||
|
||||
**Arguments**: $ARGUMENTS
|
||||
|
||||
Goal: Create properly structured hooks. For 3+ hooks, creates them in parallel for faster execution.
|
||||
|
||||
**CRITICAL EXECUTION INSTRUCTIONS:**
|
||||
- DO NOT wait for phases to run automatically
|
||||
- DO NOT just explain what the phases do
|
||||
- EXECUTE each phase immediately using the actual tools (Bash, Read, Write, Edit, TodoWrite, Task)
|
||||
- The `!{tool command}` syntax shows you WHAT to execute - use the real tool to DO IT
|
||||
- Complete all phases in order before finishing
|
||||
|
||||
Phase 0: Create Todo List
|
||||
|
||||
Create todo list for all phases below.
|
||||
|
||||
Phase 1: Load Architectural Framework
|
||||
|
||||
Actions:
|
||||
- Load component decision guidance:
|
||||
!{Read ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/docs/frameworks/claude/reference/component-decision-framework.md}
|
||||
- Load composition patterns:
|
||||
!{Read ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/docs/frameworks/claude/reference/dans-composition-pattern.md}
|
||||
- These provide critical understanding of:
|
||||
- Hooks are for event-driven automation
|
||||
- When to use hooks vs commands
|
||||
- Hook boundaries and responsibilities
|
||||
- How hooks integrate with plugin ecosystem
|
||||
- Anti-patterns to avoid
|
||||
|
||||
Phase 2: Parse Arguments and Determine Plugin & Mode
|
||||
|
||||
Parse $ARGUMENTS to extract:
|
||||
- Hook names and event types
|
||||
- Plugin name (from --plugin=name or detect from pwd)
|
||||
- Marketplace mode (check for --marketplace flag)
|
||||
|
||||
If plugin not specified:
|
||||
|
||||
!{bash basename $(pwd)}
|
||||
|
||||
Determine base path - check if already in a plugin directory:
|
||||
|
||||
!{bash test -f .claude-plugin/plugin.json && echo "." || (echo "$ARGUMENTS" | grep -q "\-\-marketplace" && echo "plugins/$(basename $(pwd))" || echo ".")}
|
||||
|
||||
Store as $BASE_PATH:
|
||||
- If .claude-plugin/plugin.json exists: BASE_PATH="." (already in plugin directory)
|
||||
- Else if --marketplace present: BASE_PATH="plugins/$PLUGIN_NAME"
|
||||
- Else: BASE_PATH="." (standalone plugin mode)
|
||||
|
||||
All subsequent file operations use $BASE_PATH instead of hardcoded "plugins/$PLUGIN_NAME"
|
||||
|
||||
Phase 3: Load Hooks Documentation
|
||||
|
||||
WebFetch: https://docs.claude.com/en/docs/claude-code/hooks-guide
|
||||
|
||||
This provides context on:
|
||||
- Available event types and when they trigger
|
||||
- Hook configuration structure
|
||||
- Script patterns and best practices
|
||||
|
||||
Phase 4: Parse Arguments & Determine Mode
|
||||
|
||||
Actions:
|
||||
|
||||
Use bash to parse $ARGUMENTS and count how many hooks are being requested:
|
||||
|
||||
!{bash echo "$ARGUMENTS" | grep -oE '<[^>]+>' | wc -l}
|
||||
|
||||
Store the count. Then extract each hook specification:
|
||||
- If count = 1: Single hook mode - extract <hook-name>, <event-type>, and "<action>"
|
||||
- If count = 2: Two hooks mode - extract both sets
|
||||
- If count >= 3: Multiple hooks mode - extract all sets
|
||||
|
||||
Execution modes:
|
||||
- 1 hook: Direct creation
|
||||
- 2 hooks: Sequential creation
|
||||
- 3+ hooks: Parallel creation (invoke multiple hooks-builder agents)
|
||||
|
||||
Phase 5: Create Hooks
|
||||
|
||||
**Mode 1: Single Hook (1 hook)**
|
||||
|
||||
Task(description="Create hook", subagent_type="domain-plugin-builder:hooks-builder", prompt="You are the hooks-builder agent. Create a complete hook.
|
||||
|
||||
Hook name: <name-from-args>
|
||||
Event type: <event-from-args>
|
||||
Action: <action-from-args>
|
||||
Plugin: <plugin-name>
|
||||
|
||||
Create hook configuration and script:
|
||||
- Executable script in $BASE_PATH/scripts/
|
||||
- Hook entry in $BASE_PATH/hooks/hooks.json
|
||||
- Documentation in $BASE_PATH/docs/hooks.md
|
||||
- Use ${CLAUDE_PLUGIN_ROOT} for paths
|
||||
- Validate hook structure
|
||||
|
||||
Deliverable: Complete hook with script, config, and documentation")
|
||||
|
||||
**Mode 2: Sequential (2 hooks)**
|
||||
|
||||
For each hook sequentially:
|
||||
Task(description="Create hook N", subagent_type="domain-plugin-builder:hooks-builder", prompt="<same structure>")
|
||||
|
||||
Wait for completion, then create next hook.
|
||||
|
||||
**Mode 3: Parallel (3+ hooks)**
|
||||
|
||||
Create TODO list:
|
||||
|
||||
TodoWrite with list of all hooks to create.
|
||||
|
||||
Launch ALL hooks-builder agents IN PARALLEL (all at once):
|
||||
|
||||
Task(description="Create hook 1", subagent_type="domain-plugin-builder:hooks-builder", prompt="You are the hooks-builder agent. Create a complete hook.
|
||||
|
||||
Hook name: $HOOK_1
|
||||
Event type: $EVENT_1
|
||||
Action: $ACTION_1
|
||||
Plugin: $PLUGIN_NAME
|
||||
|
||||
Create:
|
||||
- Script: $BASE_PATH/scripts/$HOOK_1.sh
|
||||
- Config: Update $BASE_PATH/hooks/hooks.json
|
||||
- Docs: Update $BASE_PATH/docs/hooks.md
|
||||
- Use ${CLAUDE_PLUGIN_ROOT} for all paths
|
||||
|
||||
Deliverable: Complete hook")
|
||||
|
||||
Task(description="Create hook 2", subagent_type="domain-plugin-builder:hooks-builder", prompt="Create hook: $HOOK_2 - Event: $EVENT_2 [same prompt structure as hook 1 above]")
|
||||
|
||||
Task(description="Create hook 3", subagent_type="domain-plugin-builder:hooks-builder", prompt="Create hook: $HOOK_3 - Event: $EVENT_3 [same prompt structure as hook 1 above]")
|
||||
|
||||
[Continue for all N hooks requested]
|
||||
|
||||
Each Task() call happens in parallel. Parse $ARGUMENTS to determine how many Task() calls to make.
|
||||
|
||||
Wait for ALL agents to complete before proceeding.
|
||||
|
||||
Update TodoWrite as each completes.
|
||||
|
||||
Phase 5.5: Git Commit and Push
|
||||
Goal: Save work immediately
|
||||
|
||||
Actions:
|
||||
- Add all hook files to git:
|
||||
!{bash git add $BASE_PATH/hooks/ $BASE_PATH/scripts/ $BASE_PATH/docs/hooks.md}
|
||||
- Commit with message:
|
||||
!{bash git commit -m "$(cat <<'EOF'
|
||||
feat: Add hook(s) - HOOK_NAMES
|
||||
|
||||
Complete hook structure with scripts, config, and documentation.
|
||||
|
||||
🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
||||
|
||||
Co-Authored-By: Claude <noreply@anthropic.com>
|
||||
EOF
|
||||
)"}
|
||||
- Push to GitHub: !{bash git push origin master}
|
||||
|
||||
Phase 5.6: Sync to Airtable
|
||||
Goal: Sync ALL created hooks to Airtable in bulk
|
||||
|
||||
Actions:
|
||||
|
||||
**Use bulk sync script for efficiency:**
|
||||
|
||||
Bash: python ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/scripts/bulk-sync-airtable.py --plugin={plugin-name} --marketplace={marketplace-name} --type=hooks
|
||||
|
||||
This syncs ALL hooks in parallel instead of one at a time.
|
||||
|
||||
**Environment Requirement:**
|
||||
- Requires AIRTABLE_TOKEN environment variable
|
||||
- If not set, displays error message with instructions
|
||||
|
||||
Phase 6: Self-Validation
|
||||
|
||||
Run validation checks to verify all work completed:
|
||||
|
||||
!{bash test -f $BASE_PATH/hooks/hooks.json && echo "✅ hooks.json exists" || echo "❌ hooks.json MISSING"}
|
||||
!{bash test -d $BASE_PATH/scripts && echo "✅ scripts/ exists" || echo "❌ scripts/ MISSING"}
|
||||
|
||||
Mark all todos complete if validation passes.
|
||||
|
||||
Phase 7: Summary
|
||||
Goal: Report results
|
||||
|
||||
Actions:
|
||||
- Display results:
|
||||
|
||||
**Hooks Created:** <count>
|
||||
**Plugin:** <plugin-name>
|
||||
**Mode:** $BASE_PATH (marketplace mode if "plugins/", standalone if ".")
|
||||
**Location:** $BASE_PATH/hooks/
|
||||
|
||||
**Hooks:**
|
||||
- <hook-1-name> (Event: <event-1>) - <action-1> ✅
|
||||
- <hook-2-name> (Event: <event-2>) - <action-2> ✅
|
||||
- etc.
|
||||
|
||||
**Validation:** All passed ✅
|
||||
**Git Status:** Committed and pushed ✅
|
||||
**Airtable Sync:** Attempted ✅
|
||||
|
||||
**Next Steps:**
|
||||
- Test hooks by triggering events
|
||||
- Review scripts for correctness
|
||||
- Monitor hook execution in logs
|
||||
190
commands/plugin-create.md
Normal file
190
commands/plugin-create.md
Normal file
@@ -0,0 +1,190 @@
|
||||
---
|
||||
description: Create basic plugin directory structure and manifest
|
||||
argument-hint: <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.**
|
||||
|
||||
- ✅ The phases below are YOUR execution checklist
|
||||
- ✅ YOU must run each phase immediately using tools (Bash, Read, Write, Edit, TodoWrite)
|
||||
- ✅ Complete ALL phases before considering this command done
|
||||
- ❌ DON'T wait for "the command to complete" - YOU complete it by executing the phases
|
||||
- ❌ DON'T treat this as status output - it IS your instruction set
|
||||
|
||||
**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.
|
||||
|
||||
---
|
||||
|
||||
## Security Requirements
|
||||
|
||||
**CRITICAL:** All generated files must follow security rules:
|
||||
|
||||
@~/.claude/plugins/marketplaces/dev-lifecycle-marketplace/docs/security/SECURITY-RULES.md
|
||||
|
||||
**Key requirements:**
|
||||
- Never hardcode API keys or secrets
|
||||
- Use placeholders: `your_service_key_here`
|
||||
- Protect `.env` files with `.gitignore`
|
||||
- Create `.env.example` with placeholders only
|
||||
- Document key acquisition for users
|
||||
|
||||
**Arguments**: $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:**
|
||||
- DO NOT wait for phases to run automatically
|
||||
- DO NOT just explain what the phases do
|
||||
- EXECUTE each phase immediately using the actual tools (Bash, Read, Write, Edit, TodoWrite, AskUserQuestion)
|
||||
- The `!{tool command}` syntax shows you WHAT to execute - use the real tool to DO IT
|
||||
- Complete all phases in order before finishing
|
||||
|
||||
Phase 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:
|
||||
- Plugin description (one sentence)
|
||||
- Plugin type (SDK, Framework, Custom)
|
||||
- Author name (default: "Plugin Developer")
|
||||
- Author email (default: "noreply@example.com")
|
||||
- License (default: "MIT")
|
||||
- Repository URL (default: "https://github.com/username/{{PLUGIN_NAME}}")
|
||||
- Homepage URL (default: "https://github.com/username/{{PLUGIN_NAME}}")
|
||||
|
||||
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:
|
||||
- Marketplace root: `$PLUGIN_NAME/.claude-plugin/`
|
||||
- Plugin: `$PLUGIN_NAME/plugins/$PLUGIN_NAME/`
|
||||
|
||||
Phase 4: Create Marketplace and Plugin Files from Templates
|
||||
|
||||
Set template variables:
|
||||
- PLUGIN_NAME=<from Phase 1>
|
||||
- DESCRIPTION=<from Phase 2>
|
||||
- AUTHOR_NAME=<from Phase 2>
|
||||
- AUTHOR_EMAIL=<from Phase 2>
|
||||
- LICENSE=<from Phase 2>
|
||||
- REPOSITORY_URL=<from Phase 2>
|
||||
- HOMEPAGE_URL=<from Phase 2>
|
||||
- VERSION="1.0.0"
|
||||
- KEYWORDS='["plugin", "claude-code"]'
|
||||
- DATE=$(date +%Y-%m-%d)
|
||||
|
||||
**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:
|
||||
- Plugin created: $PLUGIN_NAME ✅
|
||||
- Mode: $BASE_PATH (marketplace mode if "plugins/", standalone if ".")
|
||||
- Location: $BASE_PATH
|
||||
- Files created:
|
||||
- .claude-plugin/plugin.json ✅
|
||||
- hooks/hooks.json ✅
|
||||
- .gitignore ✅
|
||||
- .mcp.json ✅
|
||||
- LICENSE ✅
|
||||
- CHANGELOG.md ✅
|
||||
- README.md ✅
|
||||
- Directory structure: Complete ✅
|
||||
- Validation: Passed ✅
|
||||
- Next steps:
|
||||
- Build components in this order:
|
||||
1. Agents first: /domain-plugin-builder:agents-create <agent-name> "description"
|
||||
2. Commands second: /domain-plugin-builder:slash-commands-create <cmd-name> "description"
|
||||
3. Skills third: /domain-plugin-builder:skills-create <skill-name> "description"
|
||||
4. Hooks last: /domain-plugin-builder:hooks-create <hook-name> <event> "action"
|
||||
- Why agents first? Commands often invoke agents, so agents must exist first
|
||||
- Validate when done: /domain-plugin-builder:validate $PLUGIN_NAME
|
||||
254
commands/skills-create.md
Normal file
254
commands/skills-create.md
Normal file
@@ -0,0 +1,254 @@
|
||||
---
|
||||
description: Create new skill(s) using skills-builder agent - analyzes plugin structure or accepts direct specifications (supports parallel creation)
|
||||
argument-hint: [--analyze <plugin-name>] | [<skill-name> "<description>"] | [<skill-1> "<desc-1>" <skill-2> "<desc-2>" ...] [--marketplace]
|
||||
---
|
||||
|
||||
---
|
||||
🚨 **EXECUTION NOTICE FOR CLAUDE**
|
||||
|
||||
When you invoke this command via `SlashCommand(/domain-plugin-builder:skills-create ...)`, the system returns THESE INSTRUCTIONS below.
|
||||
|
||||
**YOU are the executor. This is NOT an autonomous subprocess.**
|
||||
|
||||
- ✅ The phases below are YOUR execution checklist
|
||||
- ✅ YOU must run each phase immediately using tools (Bash, Read, Write, Edit, TodoWrite)
|
||||
- ✅ Complete ALL phases before considering this command done
|
||||
- ❌ DON'T wait for "the command to complete" - YOU complete it by executing the phases
|
||||
- ❌ DON'T treat this as status output - it IS your instruction set
|
||||
|
||||
**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.
|
||||
|
||||
---
|
||||
|
||||
## Security Requirements
|
||||
|
||||
**CRITICAL:** All generated files must follow security rules:
|
||||
|
||||
@~/.claude/plugins/marketplaces/dev-lifecycle-marketplace/docs/security/SECURITY-RULES.md
|
||||
|
||||
**Key requirements:**
|
||||
- Never hardcode API keys or secrets
|
||||
- Use placeholders: `your_service_key_here`
|
||||
- Protect `.env` files with `.gitignore`
|
||||
- Create `.env.example` with placeholders only
|
||||
- Document key acquisition for users
|
||||
|
||||
**Arguments**: $ARGUMENTS
|
||||
|
||||
Goal: Create properly structured skill(s) by launching the skills-builder agent
|
||||
|
||||
**CRITICAL EXECUTION INSTRUCTIONS:**
|
||||
- DO NOT wait for phases to run automatically
|
||||
- DO NOT just explain what the phases do
|
||||
- EXECUTE each phase immediately using the actual tools (Bash, Read, Write, Edit, TodoWrite, Task)
|
||||
- The `!{tool command}` syntax shows you WHAT to execute - use the real tool to DO IT
|
||||
- Complete all phases in order before finishing
|
||||
|
||||
Phase 0: Create Todo List
|
||||
|
||||
Create todo list for all phases below.
|
||||
|
||||
Phase 1: Discovery & Architecture Decision Framework
|
||||
Goal: Load comprehensive component decision framework to understand WHEN to use skills vs commands vs agents vs hooks vs MCP
|
||||
|
||||
Actions:
|
||||
- Load the complete component decision framework:
|
||||
!{Read ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/docs/frameworks/claude/reference/component-decision-framework.md}
|
||||
- This provides critical understanding of:
|
||||
- 🚨 START WITH COMMANDS FIRST (not skills!)
|
||||
- Commands are the primitive (closest to prompts)
|
||||
- Skills are for MANAGING multiple related commands
|
||||
- The "One-Off vs Management" test
|
||||
- When NOT to create a skill
|
||||
- Real composition hierarchy (skills use commands, not vice versa)
|
||||
- Complete decision tree with real examples
|
||||
- Anti-patterns to avoid
|
||||
- This architectural decision-making context will be passed to the skills-builder agent
|
||||
- Agent will understand when the requested functionality should be a COMMAND instead of a skill
|
||||
|
||||
Phase 2: Parse Arguments & Determine Mode
|
||||
|
||||
Actions:
|
||||
|
||||
Parse $ARGUMENTS to extract:
|
||||
- Skill names and descriptions
|
||||
- Plugin name (from --plugin=name or detect from pwd)
|
||||
- Marketplace mode (check for --marketplace flag)
|
||||
|
||||
If plugin not specified:
|
||||
|
||||
!{bash basename $(pwd)}
|
||||
|
||||
Determine base path - check if already in a plugin directory:
|
||||
|
||||
!{bash test -f .claude-plugin/plugin.json && echo "." || (echo "$ARGUMENTS" | grep -q "\-\-marketplace" && echo "plugins/$(basename $(pwd))" || echo ".")}
|
||||
|
||||
Store as $BASE_PATH:
|
||||
- If .claude-plugin/plugin.json exists: BASE_PATH="." (already in plugin directory)
|
||||
- Else if --marketplace present: BASE_PATH="plugins/$PLUGIN_NAME"
|
||||
- Else: BASE_PATH="." (standalone plugin mode)
|
||||
|
||||
All subsequent file operations use $BASE_PATH instead of hardcoded "plugins/$PLUGIN_NAME"
|
||||
|
||||
Use bash to parse $ARGUMENTS and count how many skills are being requested:
|
||||
|
||||
!{bash echo "$ARGUMENTS" | grep -oE '<[^>]+>' | wc -l}
|
||||
|
||||
Store the count. Then extract each skill specification:
|
||||
- If count = 0 and --analyze present: Set mode to "analyze", extract plugin name
|
||||
- If count = 1: Single skill mode - extract <skill-name> and "<description>"
|
||||
- If count >= 2: Multiple skills mode - extract all <skill-N> "<desc-N>" pairs
|
||||
|
||||
Phase 3: Launch Skills Builder Agent(s)
|
||||
|
||||
Actions:
|
||||
|
||||
**For --analyze mode:**
|
||||
|
||||
Task(description="Analyze plugin for needed skills", subagent_type="domain-plugin-builder:skills-builder", prompt="You are the skills-builder agent. Analyze the plugin structure at $BASE_PATH to determine what skills are needed.
|
||||
|
||||
Architectural context from component-decision-framework.md:
|
||||
@~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/docs/frameworks/claude/component-decision-framework.md
|
||||
|
||||
Tasks:
|
||||
1. Read detailed skills documentation via WebFetch:
|
||||
- https://docs.claude.com/en/docs/agents-and-tools/agent-skills/quickstart
|
||||
- https://docs.claude.com/en/docs/agents-and-tools/agent-skills/best-practices
|
||||
- https://docs.claude.com/en/docs/claude-code/skills
|
||||
- https://docs.claude.com/en/docs/claude-code/slash-commands#skills-vs-slash-commands
|
||||
- https://github.com/anthropics/claude-cookbooks/tree/main/skills
|
||||
- https://www.anthropic.com/engineering/equipping-agents-for-the-real-world-with-agent-skills
|
||||
2. Analyze plugin commands and agents
|
||||
3. Identify what reusable capabilities are needed
|
||||
4. Report recommended skills to create
|
||||
|
||||
Plugin: $BASE_PATH
|
||||
Deliverable: List of recommended skills with descriptions")
|
||||
|
||||
**Decision: 1-2 skills = build directly, 3+ skills = use Task() for parallel**
|
||||
|
||||
**For 1-2 Skills:**
|
||||
|
||||
Build directly - execute these steps immediately:
|
||||
|
||||
1. Load decision framework:
|
||||
!{Read @component-decision-framework.md}
|
||||
|
||||
2. Load skill template:
|
||||
!{Read @SKILL.md.template}
|
||||
|
||||
3. For each skill:
|
||||
!{Bash mkdir -p $BASE_PATH/skills/$SKILL_NAME/{scripts,templates,examples}}
|
||||
|
||||
!{Write $BASE_PATH/skills/$SKILL_NAME/SKILL.md}
|
||||
|
||||
Create scripts, templates, and examples as needed.
|
||||
|
||||
4. Validate:
|
||||
!{Bash ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/scripts/validate-skill.sh $BASE_PATH/skills/$SKILL_NAME}
|
||||
|
||||
No need for Task() overhead when building 1-2 skills
|
||||
|
||||
**For 3+ Skills:**
|
||||
|
||||
Launch multiple skills-builder agents IN PARALLEL (all at once) using multiple Task() calls in ONE response:
|
||||
|
||||
Task(description="Create skill 1", subagent_type="domain-plugin-builder:skills-builder", prompt="Create skill: $SKILL_1 - $DESC_1 [same prompt structure as single skill above]")
|
||||
|
||||
Task(description="Create skill 2", subagent_type="domain-plugin-builder:skills-builder", prompt="Create skill: $SKILL_2 - $DESC_2 [same prompt structure as single skill above]")
|
||||
|
||||
Task(description="Create skill 3", subagent_type="domain-plugin-builder:skills-builder", prompt="Create skill: $SKILL_3 - $DESC_3 [same prompt structure as single skill above]")
|
||||
|
||||
[Continue for all N skills requested]
|
||||
|
||||
Each Task() call happens in parallel. Parse $ARGUMENTS to determine how many Task() calls to make.
|
||||
|
||||
Wait for ALL agents to complete before proceeding to Phase 4.
|
||||
|
||||
Phase 4: Validation
|
||||
|
||||
**Validate all created skills:**
|
||||
|
||||
For each skill:
|
||||
!{bash ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/scripts/validate-skill.sh $BASE_PATH/skills/$SKILL_NAME}
|
||||
|
||||
If validation fails, read errors and fix issues.
|
||||
|
||||
Phase 5: Sync to Airtable
|
||||
|
||||
**Use bulk sync script for efficiency:**
|
||||
|
||||
Bash: python ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/scripts/bulk-sync-airtable.py --plugin={plugin-name} --marketplace={marketplace-name} --type=skills
|
||||
|
||||
This syncs ALL skills in parallel instead of one at a time.
|
||||
|
||||
**Environment Requirement:**
|
||||
- Requires AIRTABLE_TOKEN environment variable
|
||||
- If not set, displays error message with instructions
|
||||
|
||||
Phase 6: Register Skills in Settings
|
||||
|
||||
**CRITICAL: Skills must be registered to be usable!**
|
||||
|
||||
Register all created skills in ~/.claude/settings.json:
|
||||
|
||||
!{bash ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/scripts/register-skills-in-settings.sh $PLUGIN_NAME}
|
||||
|
||||
This registers entries like:
|
||||
- Skill($PLUGIN_NAME:$SKILL_1)
|
||||
- Skill($PLUGIN_NAME:$SKILL_2)
|
||||
- etc.
|
||||
|
||||
Verify skills are accessible with Skill tool.
|
||||
|
||||
Phase 7: Git Commit and Push
|
||||
|
||||
Actions:
|
||||
- Add all created skill directories to git:
|
||||
!{bash git add plugins/*/skills/*}
|
||||
- Commit with descriptive message:
|
||||
!{bash git commit -m "$(cat <<'EOF'
|
||||
feat: Add skill(s) - SKILL_NAMES
|
||||
|
||||
Complete skill structure with scripts, templates, and examples.
|
||||
|
||||
🤖 Generated with [Claude Code](https://claude.com/claude-code)
|
||||
|
||||
Co-Authored-By: Claude <noreply@anthropic.com>
|
||||
EOF
|
||||
)"}
|
||||
- Push to GitHub: !{bash git push origin master}
|
||||
|
||||
Phase 8: 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-skill.sh $BASE_PATH/skills/*}
|
||||
|
||||
Mark all todos complete if validation passes.
|
||||
|
||||
Phase 9: Summary
|
||||
|
||||
Display results:
|
||||
|
||||
**Skills Created:** <count>
|
||||
**Plugin:** $PLUGIN_NAME
|
||||
**Mode:** $BASE_PATH (marketplace mode if "plugins/", standalone if ".")
|
||||
**Location:** $BASE_PATH/skills/
|
||||
|
||||
**Files:**
|
||||
- $SKILL_1/ - $DESC_1 ✅
|
||||
- $SKILL_2/ - $DESC_2 ✅
|
||||
- etc.
|
||||
|
||||
**Validation:** All passed ✅
|
||||
**Registration:** Complete ✅
|
||||
**Airtable Sync:** Attempted ✅
|
||||
**Git:** Committed and pushed ✅
|
||||
|
||||
**Next Steps:**
|
||||
- Invoke skills: Skill($PLUGIN_NAME:$SKILL_NAME)
|
||||
- Test skill functionality
|
||||
- Update documentation
|
||||
241
commands/slash-commands-create.md
Normal file
241
commands/slash-commands-create.md
Normal file
@@ -0,0 +1,241 @@
|
||||
---
|
||||
description: Create slash command(s) following standardized structure - supports parallel creation for 3+ commands
|
||||
argument-hint: <command-name> "<description>" [--plugin=name] | <cmd-1> "<desc-1>" <cmd-2> "<desc-2>" ... [--plugin=name]
|
||||
---
|
||||
|
||||
---
|
||||
🚨 **EXECUTION NOTICE FOR CLAUDE**
|
||||
|
||||
When you invoke this command via `SlashCommand(/domain-plugin-builder:slash-commands-create ...)`, the system returns THESE INSTRUCTIONS below.
|
||||
|
||||
**YOU are the executor. This is NOT an autonomous subprocess.**
|
||||
|
||||
- ✅ The phases below are YOUR execution checklist
|
||||
- ✅ YOU must run each phase immediately using tools (Bash, Read, Write, Edit, TodoWrite)
|
||||
- ✅ Complete ALL phases before considering this command done
|
||||
- ❌ DON'T wait for "the command to complete" - YOU complete it by executing the phases
|
||||
- ❌ DON'T treat this as status output - it IS your instruction set
|
||||
|
||||
**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.
|
||||
|
||||
---
|
||||
|
||||
## Security Requirements
|
||||
|
||||
**CRITICAL:** All generated files must follow security rules:
|
||||
|
||||
@~/.claude/plugins/marketplaces/dev-lifecycle-marketplace/docs/security/SECURITY-RULES.md
|
||||
|
||||
**Key requirements:**
|
||||
- Never hardcode API keys or secrets
|
||||
- Use placeholders: `your_service_key_here`
|
||||
- Protect `.env` files with `.gitignore`
|
||||
- Create `.env.example` with placeholders only
|
||||
- Document key acquisition for users
|
||||
|
||||
**Arguments**: $ARGUMENTS
|
||||
|
||||
Goal: Create properly structured slash command(s). For 3+ commands, creates them in parallel for faster execution.
|
||||
|
||||
**CRITICAL EXECUTION INSTRUCTIONS:**
|
||||
- DO NOT wait for phases to run automatically
|
||||
- DO NOT just explain what the phases do
|
||||
- EXECUTE each phase immediately using the actual tools (Bash, Read, Write, Edit, TodoWrite)
|
||||
- The `!{tool command}` syntax shows you WHAT to execute - use the real tool to DO IT
|
||||
- Complete all phases in order before finishing
|
||||
|
||||
Phase 0: Create Todo List
|
||||
|
||||
Create todo list for all phases below.
|
||||
|
||||
Phase 1: Load Architectural Framework
|
||||
|
||||
Actions:
|
||||
- Load component decision guidance:
|
||||
!{Read ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/docs/frameworks/claude/reference/component-decision-framework.md}
|
||||
- Load composition patterns:
|
||||
!{Read ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/docs/frameworks/claude/reference/dans-composition-pattern.md}
|
||||
- These provide critical understanding of:
|
||||
- Commands are the primitive (start here!)
|
||||
- When to use commands vs skills vs agents vs hooks
|
||||
- Skills compose commands (not vice versa)
|
||||
- Composition hierarchies and patterns
|
||||
- Anti-patterns to avoid
|
||||
|
||||
Phase 2: Parse Arguments and Determine Plugin
|
||||
|
||||
Parse $ARGUMENTS to extract:
|
||||
- Command names and descriptions
|
||||
- Plugin name (from --plugin=name or detect from pwd)
|
||||
|
||||
If plugin not specified:
|
||||
|
||||
!{bash basename $(pwd)}
|
||||
|
||||
Store plugin name for Phase 3.
|
||||
|
||||
Phase 3: Load Templates
|
||||
|
||||
Load command template for reference:
|
||||
|
||||
!{Read ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/templates/commands/template-command-patterns.md}
|
||||
|
||||
Phase 4: Parse Arguments & Determine Mode
|
||||
|
||||
Actions:
|
||||
|
||||
Use bash to parse $ARGUMENTS and count how many commands are being requested:
|
||||
|
||||
!{bash echo "$ARGUMENTS" | grep -oE '<[^>]+>' | wc -l}
|
||||
|
||||
Store the count. Then extract each command specification:
|
||||
- If count = 1: Single command mode - extract <command-name> and "<description>"
|
||||
- If count = 2: Two commands mode - extract both <cmd-N> "<desc-N>" pairs
|
||||
- If count >= 3: Multiple commands mode - extract all <cmd-N> "<desc-N>" pairs
|
||||
|
||||
Phase 5: Create Commands
|
||||
|
||||
Actions:
|
||||
|
||||
**Decision: 1-2 commands = build directly, 3+ commands = use Task() for parallel**
|
||||
|
||||
**For 1-2 Commands:**
|
||||
|
||||
Build directly - execute these steps immediately:
|
||||
|
||||
1. **List existing agents (to use correct names in Task() calls):**
|
||||
!{ls plugins/$PLUGIN_NAME/agents/*.md 2>/dev/null}
|
||||
|
||||
2. Load template:
|
||||
!{Read ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/templates/commands/template-command-patterns.md}
|
||||
|
||||
3. For each command, create the file:
|
||||
!{Write plugins/$PLUGIN_NAME/commands/$CMD_NAME.md}
|
||||
|
||||
Include:
|
||||
- Frontmatter with description, argument-hint, allowed-tools
|
||||
- Use Goal → Actions → Phase pattern
|
||||
- Keep under 150 lines
|
||||
- **CRITICAL:** If command invokes agents via Task(), use ACTUAL agent names from step 1!
|
||||
- Format: subagent_type="$PLUGIN_NAME:agent-name"
|
||||
- Example: If agents/security-scanner.md exists, use subagent_type="my-plugin:security-scanner"
|
||||
- NEVER use placeholder names - use REAL agent file names!
|
||||
|
||||
4. Validate:
|
||||
!{Bash ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/scripts/validate-command.sh plugins/$PLUGIN_NAME/commands/$CMD_NAME.md}
|
||||
|
||||
No need for Task() overhead when building 1-2 commands
|
||||
|
||||
**For 3+ Commands:**
|
||||
|
||||
**CRITICAL: Send ALL Task() calls in a SINGLE MESSAGE for parallel execution!**
|
||||
|
||||
Example for 3 commands - send all at once:
|
||||
|
||||
```
|
||||
Task(description="Create command 1", subagent_type="domain-plugin-builder:slash-commands-builder", prompt="You are the slash-commands-builder agent. Create a complete slash command.
|
||||
|
||||
Command name: $CMD_1_NAME
|
||||
Description: $CMD_1_DESC
|
||||
Plugin: $PLUGIN_NAME
|
||||
|
||||
**CRITICAL: Use ACTUAL Agent Names**
|
||||
BEFORE creating the command, list existing agents:
|
||||
!{ls plugins/$PLUGIN_NAME/agents/*.md 2>/dev/null}
|
||||
|
||||
If the command needs to invoke an agent via Task(), use the ACTUAL agent names from the list above!
|
||||
- Format: subagent_type=\"$PLUGIN_NAME:agent-name\"
|
||||
- Example: If agents/security-scanner.md exists, use subagent_type=\"$PLUGIN_NAME:security-scanner\"
|
||||
- NEVER use placeholder names like \"agent1\" or \"scanner\" - use the REAL agent file names!
|
||||
|
||||
Load template: plugins/domain-plugin-builder/skills/build-assistant/templates/commands/template-command-patterns.md
|
||||
|
||||
Create command file at: plugins/$PLUGIN_NAME/commands/$CMD_1_NAME.md
|
||||
|
||||
Follow framework structure:
|
||||
- Frontmatter with description, argument-hint, allowed-tools
|
||||
- Goal → Actions → Phase pattern
|
||||
- Keep under 150 lines
|
||||
- Use $ARGUMENTS for all argument references
|
||||
- Use ACTUAL agent names in Task() calls (subagent_type field)
|
||||
- Validate with validation script
|
||||
|
||||
Deliverable: Complete validated command file with correct agent references")
|
||||
|
||||
Task(description="Create command 2", subagent_type="domain-plugin-builder:slash-commands-builder", prompt="[Same structure with $CMD_2_NAME, $CMD_2_DESC]")
|
||||
|
||||
Task(description="Create command 3", subagent_type="domain-plugin-builder:slash-commands-builder", prompt="[Same structure with $CMD_3_NAME, $CMD_3_DESC]")
|
||||
|
||||
[Continue for all N commands from $ARGUMENTS]
|
||||
```
|
||||
|
||||
**DO NOT wait between Task() calls - send them ALL together in one response!**
|
||||
|
||||
The agents will run in parallel automatically. Only proceed to Phase 6 after all Task() calls complete.
|
||||
|
||||
Phase 6: Validation
|
||||
|
||||
For each created command:
|
||||
|
||||
!{bash ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/scripts/validate-command.sh plugins/$PLUGIN_NAME/commands/$CMD_NAME.md}
|
||||
|
||||
If validation fails, read errors and fix issues.
|
||||
|
||||
Phase 7: Sync to Airtable
|
||||
|
||||
**Use bulk sync script for efficiency:**
|
||||
|
||||
Bash: python ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/scripts/bulk-sync-airtable.py --plugin={plugin-name} --marketplace={marketplace-name} --type=commands
|
||||
|
||||
This syncs ALL commands in parallel instead of one at a time.
|
||||
|
||||
**Environment Requirement:**
|
||||
- Requires AIRTABLE_TOKEN environment variable
|
||||
- If not set, displays error message with instructions
|
||||
|
||||
Phase 8: Register in Settings
|
||||
|
||||
**CRITICAL: Commands must be registered to be usable!**
|
||||
|
||||
Run registration script to add all created commands to ~/.claude/settings.json:
|
||||
|
||||
!{bash ~/.claude/plugins/marketplaces/domain-plugin-builder/plugins/domain-plugin-builder/skills/build-assistant/scripts/register-commands-in-settings.sh $PLUGIN_NAME}
|
||||
|
||||
This registers entries like:
|
||||
- SlashCommand(/$PLUGIN_NAME:$CMD_1)
|
||||
- SlashCommand(/$PLUGIN_NAME:$CMD_2)
|
||||
- etc.
|
||||
|
||||
Verify registration by checking settings.json contains the new commands.
|
||||
|
||||
Phase 9: 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-command.sh plugins/$PLUGIN_NAME/commands/*.md}
|
||||
|
||||
Mark all todos complete if validation passes.
|
||||
|
||||
Phase 10: Summary
|
||||
|
||||
Display results:
|
||||
|
||||
**Commands Created:** <count>
|
||||
**Plugin:** $PLUGIN_NAME
|
||||
**Location:** plugins/$PLUGIN_NAME/commands/
|
||||
|
||||
**Files:**
|
||||
- $CMD_1.md - $DESC_1 ✅
|
||||
- $CMD_2.md - $DESC_2 ✅
|
||||
- etc.
|
||||
|
||||
**Validation:** All passed ✅
|
||||
**Registration:** Complete ✅
|
||||
**Airtable Sync:** Attempted ✅
|
||||
|
||||
**Next Steps:**
|
||||
- Test commands: /$PLUGIN_NAME:$CMD_NAME
|
||||
- Add to build workflow
|
||||
- Commit to git
|
||||
114
commands/validate.md
Normal file
114
commands/validate.md
Normal file
@@ -0,0 +1,114 @@
|
||||
---
|
||||
description: Validate plugin structure and compliance using plugin-validator agent
|
||||
argument-hint: <plugin-name>
|
||||
---
|
||||
|
||||
---
|
||||
🚨 **EXECUTION NOTICE FOR CLAUDE**
|
||||
|
||||
When you invoke this command via `SlashCommand(/domain-plugin-builder:validate ...)`, the system returns THESE INSTRUCTIONS below.
|
||||
|
||||
**YOU are the executor. This is NOT an autonomous subprocess.**
|
||||
|
||||
- ✅ The phases below are YOUR execution checklist
|
||||
- ✅ YOU must run each phase immediately using tools (Bash, Read, Write, Edit, TodoWrite)
|
||||
- ✅ Complete ALL phases before considering this command done
|
||||
- ❌ DON'T wait for "the command to complete" - YOU complete it by executing the phases
|
||||
- ❌ DON'T treat this as status output - it IS your instruction set
|
||||
|
||||
**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.
|
||||
|
||||
---
|
||||
|
||||
## Security Requirements
|
||||
|
||||
**CRITICAL:** All generated files must follow security rules:
|
||||
|
||||
@~/.claude/plugins/marketplaces/dev-lifecycle-marketplace/docs/security/SECURITY-RULES.md
|
||||
|
||||
**Key requirements:**
|
||||
- Never hardcode API keys or secrets
|
||||
- Use placeholders: `your_service_key_here`
|
||||
- Protect `.env` files with `.gitignore`
|
||||
- Create `.env.example` with placeholders only
|
||||
- Document key acquisition for users
|
||||
|
||||
**Arguments**: $ARGUMENTS
|
||||
|
||||
Goal: Validate that a Claude Code plugin is properly structured, follows framework conventions, and is ready for deployment.
|
||||
|
||||
**CRITICAL EXECUTION INSTRUCTIONS:**
|
||||
- DO NOT wait for phases to run automatically
|
||||
- DO NOT just explain what the phases do
|
||||
- EXECUTE each phase immediately using the actual tools (Bash, TodoWrite, Task)
|
||||
- The `!{tool command}` syntax shows you WHAT to execute - use the real tool to DO IT
|
||||
- Complete all phases in order before finishing
|
||||
|
||||
Core Principles:
|
||||
- Invoke plugin-validator agent for comprehensive validation
|
||||
- Agent runs all validation scripts internally
|
||||
- Report validation results clearly
|
||||
|
||||
Phase 0: Create Todo List
|
||||
|
||||
Create todo list for all phases below.
|
||||
|
||||
Phase 1: Verify Plugin Exists and Determine Mode
|
||||
|
||||
Check if we're in a plugin directory or need to look in plugins/:
|
||||
|
||||
!{bash test -f .claude-plugin/plugin.json && echo "standalone" || (test -d "plugins/$ARGUMENTS" && echo "marketplace" || echo "not-found")}
|
||||
|
||||
Store mode:
|
||||
- If "standalone": PLUGIN_PATH="." (current directory is the plugin)
|
||||
- If "marketplace": PLUGIN_PATH="plugins/$ARGUMENTS"
|
||||
- If "not-found": Display error and exit
|
||||
|
||||
If not found, display error:
|
||||
- "Plugin not found. Either:"
|
||||
- " 1. Run from inside plugin directory (with .claude-plugin/plugin.json)"
|
||||
- " 2. Run from marketplace root with plugin name as argument"
|
||||
|
||||
Phase 2: Invoke Plugin Validator Agent
|
||||
|
||||
Launch the plugin-validator agent to perform comprehensive validation:
|
||||
|
||||
Task(description="Validate plugin structure and compliance", subagent_type="domain-plugin-builder:plugin-validator", prompt="You are the plugin-validator agent. Perform comprehensive validation on $PLUGIN_PATH.
|
||||
|
||||
Run all validation scripts:
|
||||
- validate-plugin.sh for structure
|
||||
- validate-command.sh for each command
|
||||
- validate-agent.sh for each agent
|
||||
- validate-plugin-manifest.sh for plugin.json
|
||||
|
||||
Verify:
|
||||
- Directory structure compliance
|
||||
- All agents follow framework conventions
|
||||
- All commands follow pattern templates
|
||||
- All skills have required directories
|
||||
- Tool formatting (no JSON arrays, no wildcards)
|
||||
- Line count limits (agents <300, commands <150)
|
||||
- Plugin manifest correctness
|
||||
- Documentation completeness
|
||||
|
||||
Deliverable: Complete validation report with pass/fail status, critical issues, warnings, and recommendations.")
|
||||
|
||||
Phase 3: Summary
|
||||
|
||||
Display validation completion message:
|
||||
|
||||
**Validation Complete for:** $ARGUMENTS
|
||||
|
||||
See detailed report above from plugin-validator agent.
|
||||
|
||||
If validation passed, next steps:
|
||||
- Plugin is ready for use
|
||||
- Commit changes if modifications were made
|
||||
- Push to GitHub: !{bash git push origin master}
|
||||
|
||||
If validation failed:
|
||||
- Review critical issues in report
|
||||
- Fix issues identified
|
||||
- Re-run validation: /domain-plugin-builder:validate $ARGUMENTS
|
||||
Reference in New Issue
Block a user