cli-design-expert
Expert CLI/TUI designer for building intuitive, user-friendly, and professional command-line interfaces. Focuses on UX patterns, help systems, progressive disclosure, and developer ergonomics.
What this skill does
# CLI Design Expert
## Overview
This skill provides expert guidance for designing and implementing professional CLI tools with:
- **Intuitive UX**: Commands that work as users expect
- **Progressive Disclosure**: Simple by default, powerful when needed
- **Excellent Help**: Self-documenting commands with rich examples
- **Error Recovery**: Helpful errors that guide users to success
- **Professional Polish**: Consistent styling, colors, and output formatting
## PROACTIVE USAGE
**Invoke this skill before:**
- Creating new CLI commands
- Designing command structures
- Writing help text and documentation
- Implementing error messages
- Adding interactive prompts
---
## Critical Design Principles
### 1. Command Structure - Follow Git's Model
```bash
# Noun-verb pattern (preferred)
uam memory query # <tool> <resource> <action>
uam worktree create # <tool> <resource> <action>
# Common structure
<tool> <command> [subcommand] [arguments] [--options]
# Examples
uam init # Simple command
uam init --interactive # With flag
uam generate --output ./out # With option value
uam memory query "search term" # With argument
uam worktree create fix-bug --base develop # Full example
```
### 2. Option Naming Conventions
```bash
# Short + Long options (always provide both for common options)
-v, --version # Version
-h, --help # Help
-o, --output <path> # Output path
-f, --force # Force/overwrite
-q, --quiet # Suppress output
-d, --debug # Debug mode
-n, --dry-run # Preview without changes
# Flags (boolean) vs Options (values)
--verbose # Flag (boolean)
--format json # Option with value
--count 10 # Option with number
# Negatable flags
--color / --no-color # Allow disabling defaults
--cache / --no-cache
```
### 3. Exit Codes
```typescript
// Standard exit codes
const EXIT_SUCCESS = 0; // Success
const EXIT_ERROR = 1; // General error
const EXIT_USAGE = 2; // Invalid usage/arguments
const EXIT_CONFIG = 78; // Configuration error
const EXIT_NOINPUT = 66; // Input file not found
const EXIT_CANTCREAT = 73; // Can't create output
// Usage
process.exit(EXIT_SUCCESS);
process.exit(EXIT_ERROR);
```
---
## Help System Design
### 1. Three Levels of Help
```bash
# Level 1: Command overview (--help on root)
$ uam --help
Universal Agent Memory - AI agent memory and workflow system
Usage: uam [command] [options]
Commands:
init Initialize a new project
generate Generate CLAUDE.md and agent files
memory Manage agent memory (short-term and long-term)
worktree Git worktree management for isolated development
Options:
-v, --version Show version number
-h, --help Show help
Run 'uam <command> --help' for more information on a command.
# Level 2: Command help (--help on command)
$ uam memory --help
Manage agent memory systems
Usage: uam memory <subcommand> [options]
Subcommands:
query Search long-term memory
store Store a new memory
status Show memory system status
start Start memory services
Examples:
uam memory query "redis caching"
uam memory store lesson "Always check network policies" --tags networking --importance 8
# Level 3: Subcommand help (detailed with examples)
$ uam memory query --help
Search long-term memory using semantic similarity
Usage: uam memory query <search-term> [options]
Arguments:
search-term Keywords to search for
Options:
-l, --limit <n> Maximum results (default: 10)
-t, --tags <tags> Filter by tags (comma-separated)
--min-score <n> Minimum similarity score (0-1, default: 0.5)
--json Output as JSON
Examples:
# Basic search
uam memory query "authentication flow"
# Search with filters
uam memory query "database" --tags postgres,migration --limit 5
# JSON output for scripting
uam memory query "API design" --json | jq '.results[0]'
```
### 2. Example-Driven Documentation
```typescript
// Every command should have at least 3 examples
const command = new Command('generate')
.description('Generate CLAUDE.md and agent configuration files')
.option('-o, --output <path>', 'Output directory', '.')
.option('--dry-run', 'Preview without writing files')
.addHelpText('after', `
Examples:
# Generate with defaults
$ uam generate
# Generate to specific directory
$ uam generate --output ./docs
# Preview what would be generated
$ uam generate --dry-run
# Generate for specific platform
$ uam generate --platform factory
Common Issues:
If generation fails, ensure you have a .uam.json config file.
Run 'uam init' to create one interactively.
`);
```
---
## Error Message Design
### 1. Helpful Error Format
```typescript
// ❌ BAD - Cryptic error
throw new Error('ENOENT');
// ✅ GOOD - Helpful error with solution
console.error(`
${chalk.red('Error:')} Configuration file not found
Looking for: ${chalk.cyan('.uam.json')}
Searched in: ${chalk.dim(process.cwd())}
${chalk.yellow('How to fix:')}
Run ${chalk.cyan('uam init')} to create a configuration file.
${chalk.dim('For more help: uam init --help')}
`);
```
### 2. Error Categories
```typescript
interface CLIError {
code: string;
message: string;
suggestion?: string;
docs?: string;
}
const ERROR_MESSAGES: Record<string, CLIError> = {
CONFIG_NOT_FOUND: {
code: 'CONFIG_NOT_FOUND',
message: 'Configuration file .uam.json not found',
suggestion: 'Run `uam init` to create a configuration file',
docs: 'https://github.com/DammianMiller/universal-agent-memory#configuration',
},
INVALID_CONFIG: {
code: 'INVALID_CONFIG',
message: 'Configuration file is invalid',
suggestion: 'Check the JSON syntax and required fields',
docs: 'https://github.com/DammianMiller/universal-agent-memory#configuration',
},
GIT_NOT_FOUND: {
code: 'GIT_NOT_FOUND',
message: 'Not a git repository',
suggestion: 'Initialize git with `git init` or run from a git repository',
},
};
function formatError(error: CLIError): void {
console.error(chalk.red(`\nError [${error.code}]:`), error.message);
if (error.suggestion) {
console.error(chalk.yellow('\nSuggestion:'), error.suggestion);
}
if (error.docs) {
console.error(chalk.dim('\nDocumentation:'), error.docs);
}
}
```
### 3. Validation Errors
```typescript
// Show all validation errors at once
function validateConfig(config: unknown): ValidationResult {
const errors: string[] = [];
if (!config || typeof config !== 'object') {
return { valid: false, errors: ['Configuration must be an object'] };
}
const c = config as Record<string, unknown>;
if (!c.project) {
errors.push('Missing required field: project');
}
if (!c.project?.name) {
errors.push('Missing required field: project.name');
}
if (c.memory?.shortTerm?.maxEntries && typeof c.memory.shortTerm.maxEntries !== 'number') {
errors.push('Invalid type: memory.shortTerm.maxEntries must be a number');
}
return { valid: errors.length === 0, errors };
}
// Display validation errors nicely
function showValidationErrors(errors: string[]): void {
console.error(chalk.red('\nConfiguration validation failed:\n'));
errors.forEach((err, i) => {
console.error(chalk.red(` ${i + 1}.`), err);
});
console.error(chalk.dim('\nCheck .uam.json and fix the issues above.'));
}
```
---
## Interactive Prompts
### 1. Inquirer.js Patterns
```typescript
import inquirer from 'inquirer';
// Grouped questions with conditional flow
async function initInteractive(): Promise<Config> {
const answers = await inquirer.prompt([
{
type: 'input',
name: 'projectName',
message: 'Project name:',
default: basename(process.cwd()),
validate: (input) => input.length > 0 || 'Project name is required',
},
{
tRelated in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.