🛠️ Create CLI
コマンドラインインターフェース(CLI)の引数やフラグ、ヘルプ表示、出力形式などを設計し、使いやすく一貫性のあるCLI仕様を作成・改善するSkill。
📺 まず動画で見る(YouTube)
▶ 【衝撃】最強のAIエージェント「Claude Code」の最新機能・使い方・プログラミングをAIで効率化する超実践術を解説! ↗
※ jpskill.com 編集部が参考用に選んだ動画です。動画の内容と Skill の挙動は厳密には一致しないことがあります。
📜 元の英語説明(参考)
Design command-line interface parameters and UX: arguments, flags, subcommands, help text, output formats, error messages, exit codes, prompts, config/env precedence, and safe/dry-run behavior. Use when you’re designing a CLI spec (before implementation) or refactoring an existing CLI’s surface area for consistency, composability, and discoverability.
🇯🇵 日本人クリエイター向け解説
コマンドラインインターフェース(CLI)の引数やフラグ、ヘルプ表示、出力形式などを設計し、使いやすく一貫性のあるCLI仕様を作成・改善するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o create-cli.zip https://jpskill.com/download/4640.zip && unzip -o create-cli.zip && rm create-cli.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/4640.zip -OutFile "$d\create-cli.zip"; Expand-Archive "$d\create-cli.zip" -DestinationPath $d -Force; ri "$d\create-cli.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
create-cli.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
create-cliフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-17
- 取得日時
- 2026-05-18
- 同梱ファイル
- 2
💬 こう話しかけるだけ — サンプルプロンプト
- › Create CLI を使って、最小構成のサンプルコードを示して
- › Create CLI の主な使い方と注意点を教えて
- › Create CLI を既存プロジェクトに組み込む方法を教えて
これをClaude Code に貼るだけで、このSkillが自動発動します。
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
CLIの作成
CLIの表面領域(構文と動作)を、人間中心で、スクリプトに優しいように設計します。
まずこれを行ってください
agent-scripts/skills/create-cli/references/cli-guidelines.mdを読み、デフォルトの基準として適用してください。- 上流/完全なガイドライン: https://clig.dev/ (変更を提案する: https://github.com/cli-guidelines/cli-guidelines)
- インターフェースを確定するために必要な最小限の質問のみをしてください。
明確化(迅速に)
質問し、ユーザーが不明な場合は最善の推測によるデフォルトで進めてください。
- コマンド名と一文の目的。
- 主要ユーザー: 人間、スクリプト、またはその両方。
- 入力元: 引数 vs 標準入力; ファイル vs URL; シークレット(フラグ経由では決して渡さない)。
- 出力契約: 人間が読むテキスト、
--json、--plain、終了コード。 - 対話性: プロンプトは許可されますか?
--no-inputが必要ですか?破壊的な操作に対する確認は? - 設定モデル: フラグ/環境変数/設定ファイル; 優先順位; XDG vs リポジトリローカル。
- プラットフォーム/ランタイムの制約: macOS/Linux/Windows; シングルバイナリ vs ランタイム。
成果物(出力するもの)
CLIを設計する際は、ユーザーが実装できるコンパクトな仕様を作成してください。
- コマンドツリーと USAGE 概要。
- 引数/フラグの表(型、デフォルト、必須/オプション、例)。
- サブコマンドのセマンティクス(それぞれの機能; 冪等性; 状態変更)。
- 出力ルール: 標準出力 vs 標準エラー出力; TTY検出;
--json/--plain;--quiet/--verbose。 - エラーと終了コードのマップ(主要な失敗モード)。
- 安全ルール:
--dry-run、確認、--force、--no-input。 - 設定/環境ルールと優先順位(フラグ > 環境変数 > プロジェクト設定 > ユーザー設定 > システム)。
- シェル補完のストーリー(関連する場合): インストール/発見可能性; 生成コマンドまたはバンドルされたスクリプト。
- 5〜10個の呼び出し例(一般的なフロー; パイプ/標準入力の例を含む)。
デフォルトの慣例(ユーザーが特に指定しない限り)
-h/--helpは常にヘルプを表示し、他の引数を無視します。--versionはバージョンを標準出力に出力します。- 主要なデータは標準出力へ; 診断/エラーは標準エラー出力へ。
- 機械出力には
--jsonを追加します; 安定した行ベースのテキストには--plainを検討します。 - プロンプトは標準入力がTTYの場合のみ;
--no-inputはプロンプトを無効にします。 - 破壊的な操作: 対話的な確認 + 非対話的な場合は
--forceまたは明示的な--confirm=...が必要です。 NO_COLOR、TERM=dumbを尊重します;--no-colorを提供します。- Ctrl-C の処理: 迅速に終了; 範囲を限定したクリーンアップ; 可能な限りクラッシュオンリーにします。
テンプレート(回答にコピーしてください)
CLI仕様の骨格
これらのセクションを埋め、不要なものは削除してください。
- 名前:
mycmd - ワンライナー:
... - USAGE:
mycmd [global flags] <subcommand> [args]
- サブコマンド:
mycmd init ...mycmd run ...
- グローバルフラグ:
-h, --help--version-q, --quiet/-v, --verbose(正確に定義する)--json/--plain(該当する場合)
- I/O契約:
- 標準出力:
- 標準エラー出力:
- 終了コード:
0成功1一般的な失敗2無効な使用法(解析/検証)- (実際に役立つ場合にのみコマンド固有のコードを追加する)
- 環境変数/設定:
- 環境変数:
- 設定ファイルのパスと優先順位:
- 例:
- …
注意事項
- 解析ライブラリ(言語固有のもの)を推奨するのは、尋ねられた場合のみにしてください。それ以外の場合は、このスキルを言語に依存しないものとしてください。
- リクエストが「パラメーターの設計」である場合、実装に踏み込まないでください。
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
Create CLI
Design CLI surface area (syntax + behavior), human-first, script-friendly.
Do This First
- Read
agent-scripts/skills/create-cli/references/cli-guidelines.mdand apply it as the default rubric. - Upstream/full guidelines: https://clig.dev/ (propose changes: https://github.com/cli-guidelines/cli-guidelines)
- Ask only the minimum clarifying questions needed to lock the interface.
Clarify (fast)
Ask, then proceed with best-guess defaults if user is unsure:
- Command name + one-sentence purpose.
- Primary user: humans, scripts, or both.
- Input sources: args vs stdin; files vs URLs; secrets (never via flags).
- Output contract: human text,
--json,--plain, exit codes. - Interactivity: prompts allowed? need
--no-input? confirmations for destructive ops? - Config model: flags/env/config-file; precedence; XDG vs repo-local.
- Platform/runtime constraints: macOS/Linux/Windows; single binary vs runtime.
Deliverables (what to output)
When designing a CLI, produce a compact spec the user can implement:
- Command tree + USAGE synopsis.
- Args/flags table (types, defaults, required/optional, examples).
- Subcommand semantics (what each does; idempotence; state changes).
- Output rules: stdout vs stderr; TTY detection;
--json/--plain;--quiet/--verbose. - Error + exit code map (top failure modes).
- Safety rules:
--dry-run, confirmations,--force,--no-input. - Config/env rules + precedence (flags > env > project config > user config > system).
- Shell completion story (if relevant): install/discoverability; generation command or bundled scripts.
- 5–10 example invocations (common flows; include piped/stdin examples).
Default Conventions (unless user says otherwise)
-h/--helpalways shows help and ignores other args.--versionprints version to stdout.- Primary data to stdout; diagnostics/errors to stderr.
- Add
--jsonfor machine output; consider--plainfor stable line-based text. - Prompts only when stdin is a TTY;
--no-inputdisables prompts. - Destructive operations: interactive confirmation + non-interactive requires
--forceor explicit--confirm=.... - Respect
NO_COLOR,TERM=dumb; provide--no-color. - Handle Ctrl-C: exit fast; bounded cleanup; be crash-only when possible.
Templates (copy into your answer)
CLI spec skeleton
Fill these sections, drop anything irrelevant:
- Name:
mycmd - One-liner:
... - USAGE:
mycmd [global flags] <subcommand> [args]
- Subcommands:
mycmd init ...mycmd run ...
- Global flags:
-h, --help--version-q, --quiet/-v, --verbose(define exactly)--json/--plain(if applicable)
- I/O contract:
- stdout:
- stderr:
- Exit codes:
0success1generic failure2invalid usage (parse/validation)- (add command-specific codes only when actually useful)
- Env/config:
- env vars:
- config file path + precedence:
- Examples:
- …
Notes
- Prefer recommending a parsing library (language-specific) only when asked; otherwise keep this skill language-agnostic.
- If the request is “design parameters”, do not drift into implementation.
同梱ファイル
※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。
- 📄 SKILL.md (3,649 bytes)
- 📎 references/cli-guidelines.md (9,116 bytes)