{"id":"cli-developer","name":"cli-developer","summary":"CLIツールの作成、引数解析の実装、インタラクティブなプロンプトの追加などに活用します。","body":"# CLI Developer\n\n## Core Workflow\n\n1. **Analyze UX** — Identify user workflows, command hierarchy, common tasks. Validate by listing all commands and their expected `--help` output before writing code.\n2. **Design commands** — Plan subcommands, flags, arguments, configuration. Confirm flag naming is consistent and no existing signatures are broken.\n3. **Implement** — Build with the appropriate CLI framework for the language (see Reference Guide below). After wiring up commands, run `<cli> --help` to verify help text renders correctly and `<cli> --version` to confirm version output.\n4. **Polish** — Add completions, help text, error messages, progress indicators. Verify TTY detection for color output and graceful SIGINT handling.\n5. **Test** — Run cross-platform smoke tests; benchmark startup time (target: <50ms).\n\n## Reference Guide\n\nLoad detailed guidance based on context:\n\n| Topic | Reference | Load When |\n|-------|-----------|-----------|\n| Design Patterns | `references/design-patterns.md` | Subcommands, flags, config, architecture |\n| Node.js CLIs | `references/node-cli.md` | commander, yargs, inquirer, chalk |\n| Python CLIs | `references/python-cli.md` | click, typer, argparse, rich |\n| Go CLIs | `references/go-cli.md` | cobra, viper, bubbletea |\n| UX Patterns | `references/ux-patterns.md` | Progress bars, colors, help text |\n\n## Quick-Start Example\n\n### Node.js (commander)\n\n```js\n#!/usr/bin/env node\n// npm install commander\nconst { program } = require('commander');\n\nprogram\n  .name('mytool')\n  .description('Example CLI')\n  .version('1.0.0');\n\nprogram\n  .command('greet <name>')\n  .description('Greet a user')\n  .option('-l, --loud', 'uppercase the greeting')\n  .action((name, opts) => {\n    const msg = `Hello, ${name}!`;\n    console.log(opts.loud ? msg.toUpperCase() : msg);\n  });\n\nprogram.parse();\n```\n\nFor Python (click/typer) and Go (cobra) quick-start examples, see `references/python-cli.md` and `references/go-cli.md`.\n\n## Constraints\n\n### MUST DO\n- Keep startup time under 50ms\n- Provide clear, actionable error messages\n- Support `--help` and `--version` flags\n- Use consistent flag naming conventions\n- Handle SIGINT (Ctrl+C) gracefully\n- Validate user input early\n- Support both interactive and non-interactive modes\n- Test on Windows, macOS, and Linux\n\n### MUST NOT DO\n\n- **Block on synchronous I/O unnecessarily** — use async reads or stream processing instead.\n- **Print to stdout when output will be piped** — write logs/diagnostics to stderr.\n- **Use colors when output is not a TTY** — detect before applying color:\n  ```js\n  // Node.js\n  const useColor = process.stdout.isTTY;\n  ```\n  ```python\n  # Python\n  import sys\n  use_color = sys.stdout.isatty()\n  ```\n  ```go\n  // Go\n  import \"golang.org/x/term\"\n  useColor := term.IsTerminal(int(os.Stdout.Fd()))\n  ```\n- **Break existing command signatures** — treat flag/subcommand renames as breaking changes.\n- **Require interactive input in CI/CD environments** — always provide non-interactive fallbacks via flags or env vars.\n- **Hardcode paths or platform-specific logic** — use `os.homedir()` / `os.UserHomeDir()` / `Path.home()` instead.\n- **Ship without shell completions** — all three frameworks above have built-in completion generation.\n\n## Output Templates\n\nWhen implementing CLI features, provide:\n1. Command structure (main entry point, subcommands)\n2. Configuration handling (files, env vars, flags)\n3. Core implementation with error handling\n4. Shell completion scripts if applicable\n5. Brief explanation of UX decisions\n\n## Knowledge Reference\n\nCLI frameworks (commander, yargs, oclif, click, typer, argparse, cobra, viper), terminal UI (chalk, inquirer, rich, bubbletea), testing (snapshot testing, E2E), distribution (npm, pip, homebrew, releases), performance optimization\n\n[Documentation](https://jeffallan.github.io/claude-skills/skills/devops/cli-developer/)","author":"@Jeffallan","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/Jeffallan/claude-skills/tree/main/skills/cli-developer","license":"MIT","category":"writing","lang":"en","tokens":942,"stars":0,"calls30d":1,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[{"path":"references/design-patterns.md","size":5249,"sha256":"5bc272f8eac73856a4ad4eb7baf0e0151227908cceeab871bd161f896e831fc7"},{"path":"references/go-cli.md","size":10971,"sha256":"19f1ca6e66a92c4f25fb22d2a597a74c6a53ca8f6684ae03771fb2f70667524f"},{"path":"references/node-cli.md","size":8443,"sha256":"2a3d45cdca05c7a7ff9f072c5a9506b1ff3f092020a3bb59a67ceaca026f3a39"},{"path":"references/python-cli.md","size":10437,"sha256":"8d743189666a01b8a490bba84d6c02e265ff6d07e29441ab2c15a8dc86355dd3"},{"path":"references/ux-patterns.md","size":10115,"sha256":"5c57db089d4e4bb3d8a503e76122cdfce8aac49fb2bd10d675ca281bcb778a25"}],"requires":{"mcp":[],"tools":[]},"safety":{"flags":[],"scannedAt":"2026-08-22","hasScripts":false,"networkEndpoints":["app.example.com","docs.mycli.dev","jeffallan.github.io","no-color.org"]}}