本文へスキップ
Skillpedia
一般的なプログラミング7.4k · #13230

create-cli

できること

このスキルは、コマンドラインツールを作る前に、コマンド、オプション、出力、エラーコードを含めて、どのように動くべきかを計画します。新しいターミナルツールを作る開発者向けです。

使う場面

  • ✓新しいコマンドラインツールを設計するとき。
  • ✓読みやすい出力、JSON の出力、終了コードのどれを使うか決めたいとき。
  • ✓コマンドに、ドライランや確認プロンプトなどの安全なオプションが必要なとき。

スキルのリンク

https://github.com/steipete/agent-scripts/blob/main/skills/create-cli/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/steipete/agent-scripts/blob/main/skills/create-cli/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“自分のノートを書き出すコマンドラインツールを作りたいです。コマンドとフラグの設計を手伝ってください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは、インターフェースを確定するのに必要な質問だけをします。そのうえで、コマンドの木構造、オプション、出力の規則、エラーコード、安全のためのオプションを含む、簡潔な仕様書を書きます。公開されているコマンドラインの指針に従います。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Create CLI

Design CLI surface area (syntax + behavior), human-first, script-friendly.

Do This First

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/--help always shows help and ignores other args.
  • --version prints version to stdout.
  • Primary data to stdout; diagnostics/errors to stderr.
  • Add --json for machine output; consider --plain for stable line-based text.
  • Prompts only when stdin is a TTY; --no-input disables prompts.
  • Destructive operations: interactive confirmation + non-interactive requires --force or 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:

  1. Name: mycmd
  2. One-liner: ...
  3. USAGE:
    • mycmd [global flags] <subcommand> [args]
  4. Subcommands:
    • mycmd init ...
    • mycmd run ...
  5. Global flags:
    • -h, --help
    • --version
    • -q, --quiet / -v, --verbose (define exactly)
    • --json / --plain (if applicable)
  6. I/O contract:
    • stdout:
    • stderr:
  7. Exit codes:
    • 0 success
    • 1 generic failure
    • 2 invalid usage (parse/validation)
    • (add command-specific codes only when actually useful)
  8. Env/config:
    • env vars:
    • config file path + precedence:
  9. 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.
よくある質問

エージェントが完成したツールを書きますか?

いいえ。あなたや開発者が実装できる、簡潔な仕様書を作ります。

秘密情報はフラグで渡すべきですか?

いいえ。秘密情報をフラグで渡すことは決してすべきではないと、スキルは述べています。

どの指針に従いますか?

clig.dev で公開されている、コマンドラインの指針に基づく同梱の参考資料です。

詳細

作者による元の説明

CLI UX/spec: args, flags, help, output, errors, config, dry-run.

repo: steipete/agent-scripts

人気

GitHubのスター
7.4k
ランキング
#13230
ライセンス
MIT
更新日
2026/10/30

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル