system-createcli
Generate production-quality TypeScript CLIs with full documentation, error handling, and best practices. Creates deterministic, type-safe command-line tools following PAI's CLI-First Architecture. USE WHEN user says "create a CLI", "build a command-line tool", "make a CLI for X", or requests CLI generation. (user)
What this skill does
# system-createcli
**Automated CLI Generation System**
Generate production-ready TypeScript CLIs with comprehensive documentation, type safety, error handling, and PAI's CLI-First Architecture principles.
---
## ๐ฏ WORKFLOW ROUTING (SYSTEM PROMPT)
**When user requests CLI creation, follow this routing:**
### Primary Workflow: Create New CLI
**Triggers:** "create CLI", "build command-line tool", "make CLI for X", "generate CLI"
**Route to:** `workflows/create-cli.md`
**Action:** Generate complete CLI from requirements
### Extension Workflow: Add Command
**Triggers:** "add command to CLI", "extend CLI with", "add feature to existing CLI"
**Route to:** `workflows/add-command.md`
**Action:** Add new command to existing CLI
### Migration Workflow: Upgrade Complexity Tier
**Triggers:** "upgrade CLI", "migrate to Commander", "CLI needs more complexity"
**Route to:** `workflows/upgrade-tier.md`
**Action:** Migrate Tier 1 โ Tier 2 (manual โ Commander.js)
### Testing Workflow: Add Test Suite
**Triggers:** "add tests to CLI", "test scaffolding", "need CLI tests"
**Route to:** `workflows/add-testing.md`
**Action:** Generate comprehensive test suite
### Distribution Workflow: Setup Publishing
**Triggers:** "publish CLI", "distribute CLI", "make standalone binary"
**Route to:** `workflows/setup-distribution.md`
**Action:** Configure npm publishing or binary distribution
---
## ๐ 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 KAI
### Technology Stack Alignment
Generated CLIs follow PAI's 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:
- `${PAI_DIR}/bin/[cli-name]/` - Personal CLIs (like llcli)
- `~/Projects/[project-name]/` - Project-specific CLIs
- `~/Projects/PAI/examples/clis/` - Example CLIs (PUBLIC repo)
**SAFETY:** Always verify repository location before git operations
### CLI-First Architecture Principles
Every generated CLI follows:
1. **Deterministic** - Same input โ Same output
2. **Clean** - Single responsibility
3. **Composable** - JSON output pipes to other tools
4. **Documented** - Comprehensive help and examples
5. **Testable** - Predictable behavior
---
## ๐ EXTENDED CONTEXT
**For detailed information, read these files:**
### Workflow Documentation
- `workflows/create-cli.md` - Main CLI generation workflow (decision tree, 10-step process)
- `workflows/add-command.md` - Add commands to existing CLIs
- `workflows/upgrade-tier.md` - Migrate simple โ complex
- `workflows/add-testing.md` - Test suite generation
- `workflows/setup-distribution.md` - Publishing configuration
### Reference Documentation
- `framework-comparison.md` - Manual vs Commander vs oclif (with research)
- `patterns.md` - Common CLI patterns (from llcli analysis)
- `testing-strategies.md` - CLI testing approaches (Jest, Vitest, Playwright)
- `distribution.md` - Publishing strategies (npm, standalone binaries)
- `typescript-patterns.md` - Type safety patterns (from tsx, vite, bun research)
### Tools & Templates
- `tools/templates/tier1/` - llcli-style templates (default)
- `tools/templates/tier2/` - Commander.js templates (escalation)
- `tools/generators/` - Generation scripts (TypeScript)
- `tools/validators/` - Quality gates (validation)
### Examples
- `examples/api-cli/` - API client (reference: llcli)
- `examples/file-processor/` - File operations
- `examples/data-transform/` - Complex CLI (Commander.js)
---
## ๐ 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:**
```
${PAI_DIR}/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:**
```bash
ghcli repos --user danielmiessler
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:**
```
${PAI_DIR}/bin/md2html/
โโโ md2html.ts
โโโ package.json
โโโ README.md
โโโ QUICKSTART.md
```
**Usage:**
```bash
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:**
```
${PAI_DIR}/bin/data-cli/
โโโ data-cli.ts # Commander.js with subcommands
โโโ package.json
โโโ README.md
โโโ QUICKSTART.md
```
**Usage:**
```bash
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 `any` types except justified
### 2. Functionality
- โ
All commands work as specified
- โ
Error handling comprehensive
- โ
Exit codes correct (0 successRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.