CreateCLI
Customization
Before executing, check for user customizations at:
~/.claude/PAI/USER/SKILLCUSTOMIZATIONS/CreateCLI/
If this directory exists, load and apply any PREFERENCES.md, configurations, or resources found there. These override default behavior. If the directory does not exist, proceed with skill defaults.
🚨 MANDATORY: Voice Notification (REQUIRED BEFORE ANY ACTION)
You MUST send this notification BEFORE doing anything else when this skill is invoked.
-
Send voice notification:
curl -s -X POST http://localhost:31337/notify \ -H "Content-Type: application/json" \ -d '{"message": "Running the WORKFLOWNAME workflow in the CreateCLI skill to ACTION"}' \ > /dev/null 2>&1 & -
Output text notification:
Running the **WorkflowName** workflow in the **CreateCLI** skill to ACTION...
This is not optional. Execute this curl command immediately upon skill invocation.
CreateCLI
Automated CLI Generation System
Generate production-ready TypeScript CLIs with comprehensive documentation, type safety, error handling, and CLI-First Architecture principles.
Workflow Routing
Route to the appropriate workflow based on the request.
When executing a workflow, output this notification directly:
Running the **WorkflowName** workflow in the **CreateCLI** skill to ACTION...
- Create a new CLI tool from scratch →
Workflows/CreateCli.md - Add a new command to existing CLI →
Workflows/AddCommand.md - Upgrade CLI to higher tier →
Workflows/UpgradeTier.md
🚀 WHEN TO ACTIVATE THIS SKILL
Activate when you see these patterns:
Direct Requests
- "Create a CLI for [API/service/tool]"
- "Build a command-line interface for X"
- "Make a CLI that does Y"
- "Generate a TypeScript CLI"
- "I need a CLI tool for Z"
Context Clues
- User describes repetitive API calls → Suggest CLI
- User mentions "I keep typing this command" → Suggest CLI wrapper
- User has bash script doing complex work → Suggest TypeScript CLI replacement
- User working with API that lacks official CLI → Suggest creating one
Examples
- ✅ "Create a CLI for the GitHub API"
- ✅ "Build a command-line tool to process CSV files"
- ✅ "Make a CLI for my database migrations"
- ✅ "Generate a CLI that wraps this API"
- ✅ "I need a tool like llcli but for Notion API"
💡 CORE CAPABILITIES
Three-Tier Template System
Tier 1: llcli-Style (DEFAULT - 80% of use cases)
- Manual argument parsing (process.argv)
- Zero framework dependencies
- Bun + TypeScript
- Type-safe interfaces
- ~300-400 lines total
- Perfect for: API clients, data transformers, simple automation
When to use Tier 1:
- ✅ 2-10 commands
- ✅ Simple arguments (flags, values)
- ✅ JSON output
- ✅ No subcommands
- ✅ Fast development
Tier 2: Commander.js (ESCALATION - 15% of use cases)
- Framework-based parsing
- Subcommands + nested options
- Auto-generated help
- Plugin-ready
- Perfect for: Complex multi-command tools
When to use Tier 2:
- ❌ 10+ commands needing grouping
- ❌ Complex nested options
- ❌ Plugin architecture
- ❌ Multiple output formats
Tier 3: oclif (REFERENCE ONLY - 5% of use cases)
- Documentation only (no templates)
- Enterprise-grade plugin systems
- Perfect for: Heroku CLI, Salesforce CLI scale (rare)
What Every Generated CLI Includes
1. Complete Implementation
- TypeScript source with full type safety
- All commands functional and tested
- Error handling with proper exit codes
- Configuration management
2. Comprehensive Documentation
- README.md with philosophy, usage, examples
- QUICKSTART.md for common patterns
- Inline help text (--help)
- API response documentation
3. Development Setup
- package.json (Bun configuration)
- tsconfig.json (strict mode)
- .env.example (configuration template)
- File permissions configured
4. Quality Standards
- Type-safe throughout
- Deterministic output (JSON)
- Composable (pipes to jq, grep)
- Error messages with context
- Exit code compliance
🏗️ INTEGRATION WITH PAI
Technology Stack Alignment
Generated CLIs follow PAI standards:
- ✅ Runtime: Bun (NOT Node.js)
- ✅ Language: TypeScript (NOT JavaScript or Python)
- ✅ Package Manager: Bun (NOT npm/yarn/pnpm)
- ✅ Testing: Vitest (when tests added)
- ✅ Output: Deterministic JSON (composable)
- ✅ Documentation: README + QUICKSTART (llcli pattern)
Repository Placement
Generated CLIs go to:
~/.claude/Bin/[cli-name]/- Personal CLIs (like llcli)~/Projects/[project-name]/- Project-specific CLIs${PROJECTS_DIR}/PAI/Examples/clis/- Example CLIs (PUBLIC repo)
SAFETY: Always verify repository location before git operations
CLI-First Architecture Principles
Every generated CLI follows:
- Deterministic - Same input → Same output
- Clean - Single responsibility
- Composable - JSON output pipes to other tools
- Documented - Comprehensive help and examples
- Testable - Predictable behavior
📚 EXTENDED CONTEXT
For detailed information, read these files:
Workflow Documentation
Workflows/CreateCli.md- Main CLI generation workflow (decision tree, 10-step process)Workflows/AddCommand.md- Add commands to existing CLIsWorkflows/UpgradeTier.md- Migrate simple → complex
Reference Documentation
FrameworkComparison.md- Manual vs Commander vs oclif (with research)Patterns.md- Common CLI patterns (from llcli analysis)TypescriptPatterns.md- Type safety patterns (from tsx, vite, bun research)
📖 EXAMPLES
Example 1: API Client CLI (Tier 1)
User Request: "Create a CLI for the GitHub API that can list repos, create issues, and search code"
Generated Structure:
~/.claude/Bin/ghcli/
├── ghcli.ts # 350 lines, complete implementation
├── package.json # Bun + TypeScript
├── tsconfig.json # Strict mode
├── .env.example # GITHUB_TOKEN=your_token
├── README.md # Full documentation
└── QUICKSTART.md # Common use cases
Usage:
ghcli repos --user exampleuser
ghcli issues create --repo pai --title "Bug fix"
ghcli search "typescript CLI"
ghcli --help
Example 2: File Processor (Tier 1)
User Request: "Build a CLI to convert markdown files to HTML with frontmatter extraction"
Generated Structure:
~/.claude/Bin/md2html/
├── md2html.ts
├── package.json
├── README.md
└── QUICKSTART.md
Usage:
md2html convert input.md output.html
md2html batch *.md output/
md2html extract-frontmatter post.md
Example 3: Data Pipeline (Tier 2)
User Request: "Create a CLI for data transformation with multiple formats, validation, and analysis commands"
Generated Structure:
~/.claude/Bin/data-cli/
├── data-cli.ts # Commander.js with subcommands
├── package.json
├── README.md
└── QUICKSTART.md
Usage:
data-cli convert json csv input.json
data-cli validate schema data.json
data-cli analyze stats data.csv
data-cli transform filter --column=status --value=active
✅ QUALITY STANDARDS
Every generated CLI must pass these gates:
1. Compilation
- ✅ TypeScript compiles with zero errors
- ✅ Strict mode enabled
- ✅ No
anytypes except justified
2. Functionality
- ✅ All commands work as specified
- ✅ Error handling comprehensive
- ✅ Exit codes correct (0 success, 1 error)
3. Documentation
- ✅ README explains philosophy and usage
- ✅ QUICKSTART has common examples
- ✅ --help text comprehensive
- ✅ All flags/options documented
4. Code Quality
- ✅ Type-safe throughout
- ✅ Clean function separation
- ✅ Error messages actionable
- ✅ Configuration externalized
5. Integration
- ✅ Follows PAI tech stack (Bun, TypeScript)
- ✅ CLI-First Architecture principles
- ✅ Deterministic output (JSON)
- ✅ Composable with other tools
🎯 PHILOSOPHY
Why This Skill Exists
Developers repeatedly create CLIs for APIs and tools. Each time:
- Starts with bash script
- Realizes it needs error handling
- Realizes it needs help text
- Realizes it needs type safety
- Rewrites in TypeScript
- Adds documentation
- Now has production CLI
This skill automates steps 1-7.
The llcli Pattern
The llcli CLI (Limitless.ai API) proves this pattern works:
- 327 lines of TypeScript
- Zero dependencies (no framework)
- Complete error handling
- Comprehensive documentation
- Production-ready immediately
This skill replicates that success.
Design Principles
- Start Simple - Default to Tier 1 (llcli-style)
- Escalate When Needed - Tier 2 only when justified
- Complete, Not Scaffold - Every CLI is production-ready
- Documentation First - README explains "why" not just "how"
- Type Safety - TypeScript strict mode always
🔗 RELATED SKILLS
- development - For complex feature development (not CLI-specific)
- mcp - For web scraping CLIs (Bright Data, Apify wrappers)
- lifelog - Example of skill using llcli
This skill turns "I need a CLI for X" into production-ready tools in minutes, following proven patterns from llcli and CLI-First Architecture.
Gotchas
- Always use bun, never npm/npx. Zero exceptions per system prompt.
- TypeScript only. Never generate Python CLIs unless the user explicitly approves.
- 3-tier system: Start with the simplest tier that fits. Don't over-engineer a Tier 3 CLI when Tier 1 suffices.
Execution Log
After completing any workflow, append a single JSONL entry:
echo '{"ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","skill":"CreateCLI","workflow":"WORKFLOW_USED","input":"8_WORD_SUMMARY","status":"ok|error","duration_s":SECONDS}' >> ~/.claude/PAI/MEMORY/SKILLS/execution.jsonl
Replace WORKFLOW_USED with the workflow executed, 8_WORD_SUMMARY with a brief input description, and SECONDS with approximate wall-clock time. Log status: "error" if the workflow failed.
More from danielmiessler/personal_ai_infrastructure
osint
Structured OSINT investigations — people lookup, company intel, investment due diligence, entity/threat intel, domain recon, organization research using public sources with ethical authorization framework. USE WHEN OSINT, due diligence, background check, research person, company intel, investigate, company lookup, domain lookup, entity lookup, organization lookup, threat intel, discover OSINT sources.
259firstprinciples
Physics-based reasoning framework (Musk/Elon methodology) that deconstructs problems to irreducible fundamental truths rather than reasoning by analogy. Three-step structure: DECONSTRUCT (break to constituent parts and actual values), CHALLENGE (classify every element as hard constraint / soft constraint / unvalidated assumption — only physics is truly immutable), RECONSTRUCT (build optimal solution from fundamentals alone, ignoring inherited form). Outputs: constituent-parts breakdown, constraint classification table, and reconstructed solution with key insight. Three workflows: Deconstruct.md, Challenge.md, Reconstruct.md. Integrates with RedTeam (attack assumptions before deploying adversarial agents), Security (decompose threat model), Architecture (challenge design constraints), and Pentesters (decompose assumed security boundaries). Other skills invoke via: Challenge on all stated constraints → classify as hard/soft/assumption. Cross-domain synthesis: solutions from unrelated fields often apply once the fundamental truths are exposed. NOT FOR incident investigation and causal chains (use RootCauseAnalysis). NOT FOR structural feedback loops (use SystemsThinking). USE WHEN first principles, fundamental truths, challenge assumptions, is this a real constraint, rebuild from scratch, what are we actually paying for, what is this really made of, start over, physics first, question everything, reasoning by analogy, is this really necessary.
160documents
Read, write, convert, and analyze documents — routes to PDF, DOCX, XLSX, PPTX sub-skills for creation, editing, extraction, and format conversion. USE WHEN document, process file, create document, convert format, extract text, PDF, DOCX, XLSX, PPTX, Word, Excel, spreadsheet, PowerPoint, presentation, slides, consulting report, large PDF, merge PDF, fill form, tracked changes, redlining.
114council
Multi-agent collaborative debate that produces visible round-by-round transcripts with genuine intellectual friction. All council members are custom-composed via ComposeAgent (Agents skill) with domain expertise, unique voice, and personality tailored to the specific topic — never built-in generic types. ComposeAgent invoked as: bun run ~/.claude/skills/Agents/Tools/ComposeAgent.ts. Two workflows: DEBATE (3 rounds, full transcript + synthesis, parallel execution within rounds, 40-90 seconds total) and QUICK (1 round, fast perspective check). Context files: CouncilMembers.md (agent composition instructions), RoundStructure.md (three-round structure and timing), OutputFormat.md (transcript format templates). Agents are designed per debate topic to create real disagreement; 4-6 well-composed agents outperform 12 generic ones. Council is collaborative-adversarial (debate to find best path); for pure adversarial attack on an idea, use RedTeam instead. NOT FOR parallel task execution across agents (use Delegation skill). USE WHEN council, debate, multiple perspectives, weigh options, deliberate, get different views, multi-agent discussion, what would experts say, is there consensus, pros and cons from multiple angles.
112privateinvestigator
Ethical people-finding using 15 parallel research agents (45 search threads) across public records, social media, reverse lookups. Public data only, no pretexting. USE WHEN find person, locate, reconnect, people search, skip trace, reverse lookup, social media search, public records search, verify identity.
112redteam
Military-grade adversarial analysis that deploys 32 parallel expert agents (engineers, architects, pentesters, interns) to stress-test ideas, strategies, and plans — not systems or infrastructure. Two workflows: ParallelAnalysis (5-phase: decompose into 24 atomic claims → 32-agent parallel attack → synthesis → steelman → counter-argument, each 8 points) and AdversarialValidation (competing proposals synthesized into best solution). Context files: Philosophy.md (core principles, success criteria, agent types), Integration.md (how to combine with FirstPrinciples, Council, and other skills; output format). Targets arguments, not network vulnerabilities. Findings ranked by severity; goal is to strengthen, not destroy — weaknesses delivered with remediation paths. Collaborates with FirstPrinciples (decompose assumptions before attacking) and Council (Council debates to find paths; RedTeam attacks whatever survives). Also invoked internally by Ideate (TEST phase) and WorldThreatModel (horizon stress-testing). NOT FOR AI instruction set auditing (use BitterPillEngineering). NOT FOR network/system vulnerability testing (use a security assessment skill). USE WHEN red team, attack idea, counterarguments, critique, stress test, devil's advocate, find weaknesses, break this, poke holes, what could go wrong, strongest objection, adversarial validation, battle of bots.
112