本文へ移動
cccskills
無料GitHub で公開

cli-guideline

Implement CLI tools in Python, JS/TS, Bash, or Go following clig.dev standards. Use when writing or reviewing CLI code.

インストール方法を見る

含まれるファイル(5)

  • SKILL.md5.7 KB
  • references/checklist.md6.2 KB
  • references/full-guidelines.md69.3 KB
  • references/High-Level Concepts.md1.6 KB
  • references/index.md911 B

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

Skill: CLI Guideline

Modern CLI design principles based on clig.dev — human-first design while maintaining composability.

Core Philosophy

  1. Human-first design — CLIs are for humans, not just scripts
  2. Simple parts that work together — Composable via pipes, stdin/stdout, exit codes
  3. Consistency — Follow established conventions (flags, env vars, behavior)
  4. Say just enough — Not too verbose, not too silent
  5. Ease of discovery — Help, examples, suggestions
  6. Conversation as norm — Trial-and-error is expected; guide the user
  7. Robustness — Handle errors gracefully, feel solid
  8. Empathy — Delight users, exceed expectations

Essential Rules

I/O Streams

StreamPurposeExample
stdoutPrimary output, data, machine-readableResults, JSON, piped data
stderrMessages, logs, progress, errorsStatus, warnings, spinners
Exit 0Success
Exit ≠0Failure (map codes to failure modes)

Help

  • -h and --help show full help (exit 0, ignore other flags)
  • No args + required args → concise help (description + 1-2 examples + "use --help")
  • Lead with examples, not option lists
  • Include support path (URL, issue tracker)
  • Suggest likely fixes on typos ("Did you mean...?")
  • If expecting stdin and it's a TTY, show help immediately (don't hang)

Output

  • Human-readable by default; detect TTY for formatting
  • --plain for stable, line-based output (scripts, grep/awk)
  • --json for structured output
  • Brief success messages; verbose only when state changes
  • Suggest next commands in workflows
  • Color: intentional (not decorative); disable via NO_COLOR, TERM=dumb, --no-color
  • No animations/spinners when stdout is not TTY
  • No debug noise by default; use --debug or DEBUG=1

Errors

  • Rewrite for humans: what happened + how to fix
  • High signal-to-noise; group similar errors
  • Important info at the end (eye drawn there)
  • Unexpected errors → debug path + bug report instructions

Arguments & Flags

  • Prefer flags over positional args
  • Full-length flags for everything (--help, not just -h)
  • One-letter flags for common options only
  • Standard names: --help, --version, --dry-run, --verbose, --json, --force, --output, --quiet, --debug, --no-input
  • Sensible defaults (right thing for most users)
  • Prompt for missing input (TTY only); never require prompts
  • Confirm dangerous actions; support --dry-run
  • - for stdin/stdout when flag takes a file
  • Order-independent flags/subcommands when possible
  • Never accept secrets via flags (use --password-file or stdin)

Interactivity

  • Prompt only when stdin is TTY
  • Support --no-input to disable all prompts
  • Password prompts: don't echo
  • Ctrl-C always exits quickly

Subcommands

  • Consistent flags across subcommands
  • Consistent naming pattern (noun verb or verb noun)
  • Avoid ambiguous names (update vs upgrade)

Robustness

  • Validate input early; fail fast with clear message
  • Responsive < 100ms; show progress for long ops
  • Network calls timeout (configurable)
  • Recoverable on rerun; crash-only design
  • Handle misuse (scripts, bad networks, concurrent instances)

Future-Proofing

  • Treat interfaces as contracts (flags, env vars, config, output)
  • Additive changes preferred
  • Warn before breaking changes; deprecate gracefully
  • No catch-all subcommand (blocks future commands)
  • No arbitrary abbreviations of subcommands

Signals

  • Ctrl-C: exit immediately, acknowledge, timeout cleanup
  • Second Ctrl-C: force stop (document behavior)

Configuration

  • Precedence: flags > env > project config > user config > system config
  • Follow XDG spec (~/.config/...)
  • Never silently edit other programs' config

Environment Variables

  • Names: UPPERCASE_WITH_UNDERSCORES (no leading digit)
  • Single-line values preferred
  • Respect: NO_COLOR, FORCE_COLOR, DEBUG, EDITOR, HTTP_PROXY, PAGER, HOME, TMPDIR
  • Read .env for project context (not as full config)
  • Never read secrets from env vars (use files/stdin)

Naming

  • Simple, memorable, lowercase
  • Dashes only if needed; short but not cryptic
  • Easy to type

Distribution

  • Single binary when possible
  • Easy uninstall (document it)

Analytics

  • No telemetry without consent (opt-in preferred)
  • Transparent collection; consider alternatives

Quick Reference

For detailed stress-testing checklist, see references/checklist.md.

For complete guidelines with examples, see references/full-guidelines.md.

Language-Specific Notes

Python

  • Use argparse, click, or typer
  • Return exit codes from main(); use raise SystemExit(main())
  • No tracebacks for expected errors; --debug for unexpected
  • Handle Ctrl-C cleanly (exit 130, no traceback)
  • Separate TTY detection for stdout vs stderr

TypeScript/Node

  • Use commander, yargs, oclif, or node:util parseArgs
  • Separate stdout/stderr; handle async failures
  • --debug for stack traces
  • Avoid premature process.exit(); prefer process.exitCode

Bash

  • Shebang matches features (#!/usr/bin/env bash for Bash-only)
  • Robust flag parsing; handle quotes/whitespace
  • trap for cleanup; mktemp for temp files
  • Lint with shellcheck
  • use skill: shellck

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Browser automation CLI for AI agents. Use when needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. TRIGGER when user requests to "open a website", "fill out a form", "click a button", "take a screenshot", "debug this in browser", "scrape data from a page", "test this web app", "login to a site", "frontend UI/UX aesthetics", "automate browser actions", or any task requiring programmatic web interaction.

日本語の概要は準備中です。原文の説明を表示しています。

archibate/dotfiles-opencode1082026年4月29日 更新

Review common AI slops of defensive programming patterns, avoid silent errors. TRIGGER when reviewing code for defensive anti-patterns, writing fail-fast code, or auditing error handling quality.

日本語の概要は準備中です。原文の説明を表示しています。

archibate/dotfiles-opencode1082026年4月29日 更新

ast-grep

無料

Guide for writing ast-grep rules to perform structural code search and analysis. This skill should be used when users need to search codebases using Abstract Syntax Tree (AST) patterns, find specific code structures, or perform complex code queries that go beyond simple text search, or when a simple grep/glob search is insufficient for structural code pattern matching.

日本語の概要は準備中です。原文の説明を表示しています。

archibate/dotfiles-opencode1082026年4月29日 更新

Best practices for AI-driven English-to-Chinese translation. This skill should be used when the user asks to "translate to Chinese", "update the Chinese translation", "improve Chinese translation", "fix translation quality", "review Chinese translation", or when translating any English text into Chinese. Also applies when polishing an existing Chinese translation of English content.

日本語の概要は準備中です。原文の説明を表示しています。

archibate/dotfiles-opencode1082026年4月29日 更新

This skill should be used when the user asks to "use bilibili API", "download bilibili video", "get bilibili user info", "list bilibili favorites", "send bilibili danmaku", "upload video to bilibili", "monitor bilibili live room", "search bilibili", "get bilibili comments", or needs guidance on the bilibili_api Python library usage, authentication, API endpoints, or workflow patterns.

日本語の概要は準備中です。原文の説明を表示しています。

archibate/dotfiles-opencode1082026年4月29日 更新

This skill should be used when sending images, files, or notifications back to the user via messaging platforms (Discord, Feishu, Telegram, etc.) through cc-connect. TRIGGER when agent generates a plot/chart/screenshot and wants to show the user; agent creates a report/PDF/file the user should receive; agent needs to proactively notify the user (e.g. task completed, alert, reminder); user asks to "send image", "show me the chart", "notify me", "send the file", "send to Telegram", "show plot in Discord".

日本語の概要は準備中です。原文の説明を表示しています。

archibate/dotfiles-opencode1082026年4月29日 更新

archibate のスキルをすべて見る

このスキルの問題を報告する