archibate/dotfiles-opencode / skills/cli-guideline
cli-guideline
VerifiedImplement CLI tools in Python, JS/TS, Bash, or Go following clig.dev standards. Use when writing or reviewing CLI code.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 5.7 KB |
| references/High-Level Concepts.md | markdown | 1.6 KB |
| references/checklist.md | markdown | 6.2 KB |
| references/full-guidelines.md | markdown | 69.3 KB |
| references/index.md | markdown | 911 B |
references/High-Level Concepts.md
View on GitHub## High-Level Concepts
- Design for humans first: make the common path easy, and mistakes easy to recover from.
- Keep tools composable: work well with pipes, files, and other commands.
- Be consistent: names, flags, defaults, and behaviors should match across commands.
- Make it discoverable: strong --help, good examples, and clear error messages.
- Keep I/O clean: data to stdout; errors/logs/progress to stderr; meaningful exit codes.
- Be safe and predictable: sensible defaults, avoid surprise prompts, make destructive actions explicit.
- Be robust: handle non-interactive use, signals, partial failures, and change over time.
## Framework To Apply To Your Scripts
- Write the “contract” first: inputs (args/flags/config/env), outputs (human vs machine), and exit codes.
- Validate early; fail fast with one clear, actionable error message.
- Design output intentionally: default human-readable; add a machine mode like --json; keep stdout pipe-friendly.
- Define interaction rules: only prompt on TTY; support --yes/--no-input; make CI behavior stable.
- Add reliability basics: timeouts/retries where needed, atomic writes, and cleanup on Ctrl‑C.
- Treat it like a product: --help/--version, a few examples, and a small set of “golden” tests for output/help.
## Language Notes
- Python: use argparse (stdlib) or typer; write to stdout/stderr intentionally; return real exit codes.
- TypeScript: use commander/yargs; check process.stdout.isTTY; keep stdout/stderr separated; set process.exitCode.
- Bash: keep it small; use getopts, strict quoting, trap for cleanup, and avoid noisy stdout so piping stays reliable.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 321k | Updated | Claude CodeCodex | Verified | Install |