5.9 KiB
description, argument-hint, allowed-tools
| description | argument-hint | allowed-tools |
|---|---|---|
| Initialize new CLI tool project with framework selection | <tool-name> | Task, AskUserQuestion, Bash, Read |
🚨 EXECUTION NOTICE FOR CLAUDE
When you invoke this command via SlashCommand, 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
Goal: Orchestrate CLI project initialization by gathering requirements and delegating to the cli-setup agent for implementation.
Architectural Context:
This command follows the composition pattern:
- Commands are orchestrators - They ask questions and delegate
- Agents are workers - They do the complex implementation
- Commands invoke agents via Task tool, not implement directly
Phase 1: Load Architectural Framework Goal: Understand component composition patterns
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:
- Commands are the primitive (orchestrators)
- Agents are for complex multi-step workflows
- Proper composition: Command → Agent → Skills
- When to delegate vs when to execute directly
Phase 2: Gather Requirements Goal: Collect user preferences for the CLI project
Actions:
- Parse $ARGUMENTS for tool name
- If no tool name provided, ask user for it via AskUserQuestion
- Ask user for language preference:
- Options: TypeScript, Python, Go, Rust
- Include descriptions of each language's strengths
- Based on language selection, ask for framework:
- Python: Click (decorator-based), Typer (type-safe), argparse (stdlib), Fire (auto-generate)
- TypeScript/Node.js: Commander.js (simple), yargs (advanced), oclif (enterprise), gluegun (generators)
- Go: Cobra (production), cli (lightweight)
- Rust: clap (full-featured)
- Ask for package manager preference:
- Python: pip, poetry, pipenv
- Node.js: npm, yarn, pnpm
- Go: go modules (automatic)
- Rust: cargo (automatic)
Phase 3: Environment Validation Goal: Verify required tools are available
Actions:
- Check if selected language runtime is installed:
- Python: !{bash python3 --version 2>/dev/null || echo "Not found"}
- Node.js: !{bash node --version 2>/dev/null || echo "Not found"}
- Go: !{bash go version 2>/dev/null || echo "Not found"}
- Rust: !{bash rustc --version 2>/dev/null || echo "Not found"}
- Check if selected package manager is available
- If any tools missing, inform user and provide installation instructions
- If critical tools missing, stop and ask user to install them first
Phase 4: Delegate to CLI Setup Agent Goal: Hand off implementation to specialized agent
Actions:
Invoke the cli-setup agent to perform the actual implementation:
Task( description="Initialize CLI project with chosen framework", subagent_type="cli-tool-builder:cli-setup", prompt="You are the cli-setup agent. Initialize a new CLI tool project with the specifications provided.
Project Details:
- Tool Name: {tool_name from Phase 2}
- Language: {language from Phase 2}
- Framework: {framework from Phase 2}
- Package Manager: {package_manager from Phase 2}
User Requirements: Create a complete CLI tool project with:
- Proper directory structure for the chosen framework
- Entry point file with correct shebang
- Package configuration (package.json, setup.py, Cargo.toml, or go.mod)
- Executable bin/entry point configuration
- Dependencies installation for chosen framework
- Basic command structure following framework conventions
- README with usage instructions
- LICENSE file (MIT)
- .gitignore for the language
- Git repository initialization
Skills Available:
- Use Skill(cli-tool-builder:{framework}-patterns) for framework-specific patterns
- Example: Skill(cli-tool-builder:click-patterns) for Python Click
- Example: Skill(cli-tool-builder:commander-patterns) for Commander.js
Implementation: Follow the phased approach in your agent definition:
- Discovery: Confirm requirements
- Analysis: Determine exact dependencies and structure
- Planning: Design directory layout and files
- Implementation: Create all files and install dependencies
- Verification: Test that CLI works and passes validation
Deliverable: Complete working CLI project in ./{tool_name}/ directory" )
Wait for agent to complete. Agent will use framework-specific skills and create the complete project.
Phase 5: Verification Goal: Confirm project was created successfully
Actions:
- Check that project directory exists: !{bash ls -la {tool_name}/}
- Verify key files were created:
- Entry point file
- Package configuration
- README
- LICENSE
- .gitignore
- Display project structure to user
Phase 6: Summary Goal: Report success and provide next steps
Actions:
- Display project creation summary:
- Tool name
- Language and framework
- Project location
- Entry point file
- Show next steps:
- cd {tool_name}
- Test CLI: ./{tool_name} --help (or appropriate command)
- Add subcommands: /cli-tool-builder:add-subcommand
- Add features: /cli-tool-builder:add-interactive, /cli-tool-builder:add-output-formatting
- Package for distribution: /cli-tool-builder:add-package
- Encourage user to explore the generated code and customize it