[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B1XA9MZB91EYFKPB3815QP":3,"skill-same:01M7B1XA9MZB91EYFKPB3815QP":46},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7B1XA9MZB91EYFKPB3815QP","cli-design",null,"Unix-composable CLI design patterns. Use when building CLI tools, designing command trees, implementing output layers, or testing CLI behavior. Covers stream separation (stdout\u002Fstderr), format flags (--json\u002F--plain), exit codes, TTY detection, composability, and error design. Language-agnostic principles; TypeScript implementation patterns in resources\u002F. For API design (REST, HTTP), see api-design.","Yabuku-xD\u002Fomfx","Yabuku-xD","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F78594762?v=4","01M7B1X88FX04Z53K2S2P3N2Z9","Shyamalan Kannan","01M7B1X89G34W3D025T1F4KNKF",0,"MIT","https:\u002F\u002Fgithub.com\u002FYabuku-xD\u002Fomfx\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcli-design\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: cli-design\ndescription: Unix-composable CLI design patterns. Use when building CLI tools, designing command trees, implementing output layers, or testing CLI behavior. Covers stream separation (stdout\u002Fstderr), format flags (--json\u002F--plain), exit codes, TTY detection, composability, and error design. Language-agnostic principles; TypeScript implementation patterns in resources\u002F. For API design (REST, HTTP), see api-design.\n---\n\n# CLI Design: Unix-Composable Command-Line Interfaces\n\nThis skill covers **language-agnostic** CLI design principles. The rules about stream separation, exit codes, format flags, and composability apply regardless of implementation language.\n\nThis bundle adapts the CC BY-SA 4.0 [Command Line Interface Guidelines](https:\u002F\u002Fclig.dev\u002F).\nPinned provenance, modification notes, and license scope are recorded in\n[`resources\u002Fsource-notes.md`](resources\u002Fsource-notes.md) and [`LICENSE`](LICENSE).\n\nFor API contract stability and Hyrum's Law, see the `api-design` skill. For config, env vars, and graceful shutdown, see the `twelve-factor` skill.\n\n**TypeScript implementation patterns** are in the `resources\u002F` directory. Load them on demand when building a CLI in TypeScript:\n\n| Resource | Load when... |\n|----------|-------------|\n| `output-architecture.md` | Implementing Result types, entry point wiring, formatters, logger, JSON envelope schemas |\n| `testing-cli.md` | Writing Vitest tests for CLI behavior (streams, exit codes, pipes, contract tests) |\n| `stream-contracts.md` | Understanding Node.js buffering, NDJSON, signal handling, crash-only design |\n| `composability.md` | Designing or testing pipe behavior — worked shell examples (jq filtering, NDJSON streaming, stdin, chaining, `--fields`, parallel `xargs`) |\n\n---\n\n## When to Use\n\n- Building any command-line tool (any language)\n- Designing command tree, flags, and I\u002FO contracts\n- Implementing the output layer (format detection, stream routing)\n- Testing CLI behavior (stdout\u002Fstderr separation, exit codes)\n- Reviewing a CLI for Unix composability\n\n---\n\n## Core Principle\n\n**stdout is for DATA only — the product the user asked for.**\n**stderr is for EVERYTHING ELSE — diagnostics, progress, spinners, warnings, errors.**\n\nThis separation is what makes `mycli --json | jq ...` work. One spinner character on stdout breaks every downstream pipe.\n\n> \"Whatever software you're building, you can be absolutely certain that people will use it in ways you didn't anticipate. Your software will become a part in a larger system — your only choice is over whether it will be a well-behaved part.\" — clig.dev\n\n---\n\n## The Unix Stream Contract\n\n| Content | Stream | Why |\n|---------|--------|-----|\n| Primary output (data, results, JSON) | stdout | Pipeable, buffered for throughput |\n| Progress bars, spinners, status | stderr | Not data — must not corrupt pipes |\n| Warnings, errors, diagnostics | stderr | Visible to user even when stdout is piped |\n| Debug\u002Fverbose output | stderr | Diagnostic, never data |\n\n**Stream behavior:**\n\n- Check stdout and stderr independently; stdout being piped does not mean stderr is piped\n- Do not assume C stdio's line\u002Fblock\u002Funbuffered rules describe every language runtime\n- In Node.js, sync\u002Fasync process-stream behavior varies by operating system and destination; always respect `.write()` backpressure for high-volume output\n\nWhen stdout is piped, the user doesn't want your status messages in their data. All non-data output must go to stderr.\n\nFor a deep dive on buffering behavior and performance implications, see `resources\u002Fstream-contracts.md`.\n\n---\n\n## Keep Handlers Pure\n\nThe practical rule: **functions that do the work should return data, not write to stdout.** The CLI entry point handles all I\u002FO.\n\n```\nEntry point (CLI main)              Your logic (handlers)\n─────────────────────               ─────────────────────\nparse args                          (input) → structured result\ndetect format (json\u002Fplain\u002Fhuman)    no printing to stdout\ncall handler                        no writing to stderr\nformat the result                   no calling exit\nwrite to correct stream             just returns data\nset exit code\n```\n\nThis isn't an architecture mandate — it's just clean function design. The benefits are concrete:\n\n- **Testable without subprocess spawning** — call the handler, assert on the returned value\n- **Format flexibility for free** — same data renders as JSON, plain text, or coloured tables by swapping one function\n- **Reusable** — the same handler works from a CLI, MCP server, HTTP API, or programmatic import\n\nFor simple CLIs where the \"handler\" is just calling a library, this separation already exists naturally — your library returns data, your CLI formats it. No extra layers needed.\n\nIf your project uses hexagonal architecture, the mapping is direct: the CLI entry point is a **driving adapter**, and the handler is a **use case** that returns a result through a port. See the `hexagonal-architecture` skill — the patterns reinforce each other, but hex arch is not required to benefit from keeping handlers pure.\n\nFor TypeScript implementation patterns (Result types, entry point wiring, formatters, logger interfaces), see `resources\u002Foutput-architecture.md`.\n\n---\n\n## Selecting a TypeScript Stack\n\nPrefer the command and prompt libraries the repository already owns when they can satisfy the contracts in this skill. For a new material dependency, inspect current versions and project constraints and use `evaluate-existing-solutions`; do not select from remembered popularity or stale package characteristics.\n\nStricli can fit typed, injected command handlers, and `@clack\u002Fprompts` can fit optional TTY-gated interactivity. Treat them as candidates, not defaults. Compare them with the existing stack and alternatives on handler testability, type safety, startup cost measured in the target runtime, maintenance, dependency weight, non-interactive behavior, and migration cost.\n\n---\n\n## Format Flag Contract\n\nThree-tier output hierarchy:\n\n### Default: Human-Readable\n\n- Colors, tables, formatted text\n- Progress bars and spinners on **stderr**\n- Output tailored for terminal width\n- May change between versions — this is **not** a contract\n\n### `--plain`: Grep\u002FAwk-Friendly\n\n- One record per line, no formatting, no colors\n- Stable between minor versions — this **is** a contract\n- Flat table rows, no borders, no grouped sections\n- Enables: `mycli list --plain | grep error | wc -l`\n\n> \"Encourage your users to use `--plain` or `--json` in scripts to keep output stable.\" — clig.dev\n\n### `--json`: Structured Data\n\n- On success, stdout contains **ONLY** valid JSON — no spinners, no color, no progress\n- On failure, stdout stays empty and the final non-empty stderr line is the\n  structured JSON error envelope\n- Other diagnostics may precede that final stderr line and never contaminate stdout;\n  consumers parse the final non-empty line rather than the entire diagnostic stream\n- Schema is versioned — breaking changes to JSON output are breaking changes to the CLI\n- `--json` implies non-interactive regardless of TTY\n\n**Consistent envelopes:**\n\nSuccess on stdout:\n```json\n{ \"ok\": true, \"data\": { ... } }\n```\n\nFailure on stderr:\n```json\n{ \"ok\": false, \"error\": { \"code\": \"CONFIG_MISSING\", \"message\": \"...\", \"fix\": \"...\" } }\n```\n\n### NDJSON for Streaming\n\nFor large datasets, use NDJSON (one JSON text per record, terminated by `\\n`):\n\n- Each line is independently parseable\n- Any JSON value is valid NDJSON syntax; the application's decoder owns its schema\n- The examples in this skill use an optional local event profile with a `type`\n  discriminator and an optional final summary record; neither is required by NDJSON\n- Document whether readers ignore or reject empty lines\n- Enables: `mycli run --format ndjson | while read -r line; do ...; done`\n\nFor NDJSON specification details, see `resources\u002Fstream-contracts.md`.\n\n---\n\n## Exit Codes\n\n| Code | Meaning | When |\n|------|---------|------|\n| 0 | Success | Operation completed as expected |\n| 1 | Domain failure | Tool-specific failure (e.g. quality threshold not met) |\n| 2 | Invalid usage | Bad flags, missing required args, validation error |\n| 78 | Configuration error | Invalid config file, missing required config |\n| 75 | Temporary, retry-safe failure | Failure occurred before dispatch, or the operation is documented and demonstrably safe to retry |\n| 130 | SIGINT | User pressed Ctrl-C (128 + 2) |\n| 143 | SIGTERM-style status | Optional documented status when preserving signal termination (128 + 15); a handled graceful shutdown may instead return 0 |\n\n**Rules:**\n\n- Non-zero exit code **MUST** have a stderr explanation\n- Document exit codes in `--help`\n- Never use codes above 125 for application errors (reserved for signals: 128 + signal number)\n- Use exit 75 only when no mutation was dispatched or retry safety is established\n  through idempotency\u002Freconciliation; a merely transient cause is not enough\n- If a mutating request may have reached its destination, report an ambiguous\n  outcome and direct the user to `status`\u002Freconcile instead of inviting a blind retry\n- A handled SIGTERM may finish with 0 or a documented application status such as\n  143; Docker and Kubernetes do not require 143 for graceful shutdown\n- Map non-zero codes to the most important failure modes for your tool\n\n---\n\n## TTY Detection\n\nCheck priority order (first match wins):\n\n| Priority | Condition | Effect |\n|----------|-----------|--------|\n| 1 | `--format json` or `--json` flag | Non-interactive, no color, no animation |\n| 2 | `--no-color` flag | Disable color (output may still be interactive) |\n| 3 | `FORCE_COLOR` env | Empty, `1`, `2`, `3`, or `true` enables color; every other value (including `0`) disables it. Supported values override `NO_COLOR` and `NODE_DISABLE_COLORS` |\n| 4 | `NO_COLOR` (non-empty) or `NODE_DISABLE_COLORS` (defined), with `FORCE_COLOR` unset | Disable color |\n| 5 | `TERM=dumb` | Disable color and animations |\n| 6 | `CI=true` | No interactive prompts |\n| 7 | stdout is not a TTY (`!isatty(stdout)`) | Plain output, no animations on stdout |\n| 8 | Default | Full interactive with colors |\n\n**Check stdout and stderr independently.** When stdout is piped but stderr is a TTY, you can still show spinners on stderr while keeping stdout clean for the pipe consumer.\n\n**Gate prompts on stdin independently.** Prompt only when stdin and the prompt's\noutput stream are TTYs; stdout TTY status controls data formatting, not whether\ninput is safe to request.\n\nOptionally support `MYCLI_NO_COLOR` for app-specific color override.\n\n---\n\n## Input Design\n\n### Flags Over Arguments\n\n- **1 positional arg**: acceptable (the \"main thing\")\n- **2 positional args**: suspicious — consider flags instead\n- **3+ positional args**: prefer named flags unless a familiar command grammar\n  makes the positions obvious\n- **Exception**: variadic args of the same type are fine (`rm a.txt b.txt c.txt`), as are universal idioms (`cp source dest`)\n\nFlags are self-documenting, order-independent, and future-proof.\n\n```bash\n# Bad — which is source, which is destination?\nmycli copy myapp backup\n\n# Good — explicit\nmycli copy --from myapp --to backup\n```\n\n### Standard Flags\n\nAlways provide long forms. Short flags only for the most common operations.\n\n| Flag | Meaning |\n|------|---------|\n| `-h`, `--help` | Show help (this should only mean help) |\n| `--version` | Print version to stdout |\n| `-q`, `--quiet` | Suppress non-essential output |\n| `-v`, `--verbose` | More detail in human output |\n| `-d`, `--debug` | Diagnostic output to stderr |\n| `-f`, `--force` | Skip confirmation prompts |\n| `-n`, `--dry-run` | Show what would happen without doing it |\n| `--json` | Structured JSON output |\n| `--plain` | Stable, grep-friendly plain text |\n| `--no-color` | Disable color output |\n| `--no-input` | Disable all prompts\u002Finteractivity |\n| `-o`, `--output` | Output file |\n| `--fields` | Select output columns |\n\n### Prompts and Interactivity\n\n- **All prompts MUST be bypassable** via flags for scriptability\n- Confirmation → `--yes` or `--force`\n- Selection → `--type=value`\n- Text input → `--name=value`\n- Passwords → `--password-file=path` or stdin pipe\n- If stdin is not a TTY, never prompt — fail with a clear error or use defaults\n- **Secrets: never via flag values** (leak to `ps` output and shell history). Prefer, in order: OS keychain or a `0600` credential file (`~\u002F.config\u002Fmycli\u002Fcredentials`), then stdin (`mycli login --with-token \u003C token.txt`), then env vars **only where the platform injects them** (CI secret stores) — env leaks to child processes and crash reports, so never make it the primary documented path\n- **Scale confirmation to severity**: mild → `y\u002FN` prompt with `--yes` bypass; moderate → prompt plus suggest `--dry-run` first; severe\u002Firreversible (delete a database, overwrite production) → require typing the resource name to confirm\n\n### Conventions\n\n- Support `--` to stop flag parsing: `mycli run -- --flag-for-child-process`\n- Support `-` for stdin\u002Fstdout file arguments: `curl ... | mycli process -`\n- Accept both `--flag=value` and `--flag value`\n- If stdin is expected but is an interactive terminal, display help immediately (don't hang like `cat`)\n\n---\n\n## Config Precedence\n\nHighest to lowest priority:\n\n1. **Flags** — per-invocation overrides\n2. **Environment variables** — `MYCLI_*` prefix, per-session\n3. **Project config** — `.myclirc`, `mycli.config.ts`, or in `package.json`\n4. **User config** — `~\u002F.config\u002Fmycli\u002F` (follow XDG spec)\n5. **Defaults** — sensible built-in values\n\n**Rules:**\n\n- Follow the [XDG Base Directory Specification](https:\u002F\u002Fspecifications.freedesktop.org\u002Fbasedir-spec\u002Fbasedir-spec-latest.html) for config file locations\n- Env var naming: `MYCLI_*` prefix, uppercase letters + digits + underscores; keep values single-line; don't commandeer POSIX names\n- Respect the general-purpose env vars where relevant: `NO_COLOR`, `FORCE_COLOR`, `DEBUG`, `EDITOR`, `PAGER`, `HTTP_PROXY`\u002F`HTTPS_PROXY`\u002F`NO_PROXY`, `TMPDIR`, `TERM`, `LINES`\u002F`COLUMNS`\n- Never accept secrets via flags; prefer keychain\u002Fcredential files or stdin, env vars only when platform-injected (CI) — see \"Prompts and Interactivity\"\n- Read `.env` where appropriate, but don't use it as a substitute for proper config\n- If you modify configuration that belongs to another program, ask consent first\n\n---\n\n## Error Design\n\nEvery error needs:\n\n1. **Machine-readable code** — `UPPER_SNAKE_CASE` (e.g. `CONFIG_MISSING`, `AUTH_EXPIRED`)\n2. **What went wrong** — context: which resource, operation, input\n3. **How to fix it** — exact command or action the user should take\n4. **Reference** — docs URL or `mycli help \u003Ctopic>` (optional)\n\n### Human Mode\n\n```\nError: CONFIG_MISSING — Configuration file not found\nNo configuration file found at .\u002Fmycli.config.ts or ~\u002F.config\u002Fmycli\u002Fconfig.ts\n\nFix: Run `mycli init` to create a default configuration file\nDocs: https:\u002F\u002Fmycli.dev\u002Fdocs\u002Fconfiguration\n```\n\n- Put the most important information **last** (the eye is drawn to the end)\n- Use red sparingly and intentionally\n- Suggest corrections for typos (\"Did you mean 'deploy'?\")\n- Group similar errors under one header — don't repeat 50 similar-looking lines\n- Write debug logs to a file, not the terminal (unless `--debug`)\n\n### JSON Mode\n\nErrors are structured too — not just success responses:\n\n```json\n{\n  \"ok\": false,\n  \"error\": {\n    \"code\": \"CONFIG_MISSING\",\n    \"message\": \"No configuration file found at .\u002Fmycli.config.ts\",\n    \"fix\": \"Run `mycli init` to create a default configuration file\",\n    \"transient\": false\n  }\n}\n```\n\nThe `transient` boolean says the cause may clear. It does not by itself authorize\na retry: callers also need exit code 75 or an explicit retry-safe contract.\n\n---\n\n## State Changes and Transparency\n\n- **Confirm state changes** — say what changed and show (or point to) the resulting state; traditionally-silent commands look broken to humans\n- **Make current state easy to see** — a `status`-style command for anything with complex state (the `git status` pattern)\n- **Make hidden actions explicit** — if you read\u002Fwrite files not passed as arguments or talk to remote servers, say so (stderr in human mode)\n- **Resolve ambiguous mutations** — if transport fails after dispatch, tell the\n  user how to inspect or reconcile state; do not label the result retry-safe\n- **Page long output** through `$PAGER` only when stdout is a TTY, never when\n  piped; do not execute the value through a shell, and document whether it is an\n  executable token or parsed by a reviewed shell-word parser\n\n---\n\n## Robustness\n\n- **Validate input early** — fail before any side effects, with a clear message\n- **Responsiveness for ongoing human work** — in interactive human mode, unless\n  `--quiet`, show progress on stderr if an operation is still running after roughly\n  100ms; keep machine modes quiet unless their protocol explicitly defines progress,\n  and include time estimates when interactive progress can stall\n- **Timeouts on all network operations** — configurable; use exit 75 only before\n  dispatch or when retry safety\u002Fidempotency is established\n- **Recoverable operations** — re-running may resume only when safe; ambiguous\n  mutation outcomes need an explicit status or reconciliation path\n- **Crash-only design** — exit fast on failure, defer cleanup to the next run;\n  distinguish visibility-atomic replacement from crash-durable persistence, and\n  keep bounded-cleanup timers referenced so Ctrl-C cannot bypass the bound — see\n  `resources\u002Fstream-contracts.md`\n- **Expect misuse** — script wrapping, bad connections, concurrent instances, environments you never tested\n\n---\n\n## Composability Patterns\n\nDesign for real-world pipes: filtering with `jq`, streaming NDJSON line-by-line, feeding stdin, chaining commands through emitted identifiers, selecting columns with `--fields`, and fanning out with `xargs -P`.\n\nSee `resources\u002Fcomposability.md` for the worked shell examples covering each of these patterns.\n\n**Key patterns:**\n\n- Create commands output identifiers so subsequent commands can chain\n- List commands support `--fields` for column selection (reduces output size, critical for agent efficiency)\n- `--quiet` for CI scripts that only care about the exit code\n- NDJSON for streaming large datasets without buffering everything in memory\n- `--dry-run` with `--json` outputs planned changes as structured data\n\n---\n\n## Subcommand Design\n\n- **noun verb** pattern is most common: `mycli config set`, `mycli report generate`\n- Be consistent across all subcommands — same flag names for same things\n- No ambiguous pairs (`update` vs `upgrade` is confusing)\n- No catch-all subcommands (you can never add subcommands with conflicting names)\n- No arbitrary abbreviations — aliases must be explicit and stable\n- With no args: list subcommands (multi-command CLI) or show help (single-command CLI)\n\n### Help\n\n- `mycli --help` — top-level help\n- `mycli help \u003Csubcommand>` — subcommand help\n- `mycli \u003Csubcommand> --help` — same as above\n- If run with missing required args, show concise help + 1-2 examples + \"use --help for more\"\n- **Examples are the most-read section** — lead with them\n- Include flag types, defaults, and allowed values for finite sets\n- Include a support\u002Fbug-report link in top-level help; pre-populate issue URLs with diagnostics where possible\n- Suggest the likely command on obvious typos (\"Did you mean 'deploy'?\") — ask, never auto-execute\n\n---\n\n## Output Stability Contract\n\n**Stdout is a public API.** Breaking changes to stdout format are breaking changes to the CLI.\n\n| Change | Impact |\n|--------|--------|\n| Adding new optional JSON fields | Safe (additive) |\n| Adding new subcommands | Safe |\n| Adding new flags with preserving defaults | Safe |\n| Removing or renaming flags | **Breaking** |\n| Removing or renaming JSON fields | **Breaking** |\n| Changing exit codes | **Breaking** |\n| Changing default behavior | **Breaking** |\n| Changing human-readable output | Usually OK (not a contract) |\n\nWhen in doubt, add alongside — don't modify. Deprecate with stderr warnings before removing — and once you can detect that users have migrated, stop warning.\n\n---\n\n## Naming, Distribution, Telemetry\n\n- **Name**: short, memorable, lowercase, easy to type; not so generic it collides with existing commands\n- **Distribution**: prefer a single binary; language-ecosystem tools (npm, pip) may reasonably assume their interpreter. Make uninstalling easy and documented\n- **Telemetry**: never collect usage\u002Fcrash data without explicit consent — opt-in, stating what, why, and retention. Instrumented web docs or download counts are usually enough\n\n---\n\n## Anti-Patterns\n\n| # | Anti-Pattern | Why It's Wrong |\n|---|-------------|----------------|\n| 1 | Mixing data and diagnostics on stdout | Breaks every pipe: `mycli list \\| jq .` fails if warnings are on stdout |\n| 2 | Colors\u002FANSI in piped output | ANSI sequences corrupt downstream parsing. Check `isatty(stdout)` + `NO_COLOR` |\n| 3 | Interactive prompts with no flag bypass | Agents can't type 'y'. Every prompt needs `--yes`\u002F`--force`. Non-TTY without bypass = hang |\n| 4 | Printing nothing on success | Silence is ambiguous — show brief confirmation. Offer `-q` for scripts that want silence |\n| 5 | Designing for humans OR machines, not both | Detect context (TTY vs pipe), adapt automatically |\n| 6 | Output that doesn't guide the next action | Every output is a signpost: success = next command, failure = fix command |\n| 7 | Breaking existing CLI contracts | Flag names, exit codes, output shape are contracts. Add alongside, never modify |\n| 8 | `console.log` anywhere except the CLI adapter | Handlers must return data; only the presentation layer writes to streams |\n| 9 | Handlers that exit the process directly | Let the entry point decide. Handlers return errors as data |\n| 10 | Non-zero exit without stderr explanation | Scripts need both the code and the reason |\n| 11 | Verbose default output | A single test run can generate 419KB. Support `--fields`, `--quiet`, `--json` |\n\n---\n\n## Verification Checklist\n\nAfter designing or reviewing a CLI:\n\n- [ ] stdout has ONLY data; stderr has everything else\n- [ ] Every command supports `--json` with success data on stdout and structured failures on stderr\n- [ ] Exit codes are semantic and documented in `--help`\n- [ ] Every prompt has a `--yes`\u002F`--force`\u002F`--flag` bypass\n- [ ] Errors include: code, message, fix suggestion\n- [ ] `--dry-run` available for mutating commands\n- [ ] Progress\u002Fspinners go to stderr, never stdout\n- [ ] `NO_COLOR`, `TERM=dumb`, and `--no-color` respected\n- [ ] Piped output contains zero ANSI escape codes\n- [ ] Success output includes next-action guidance\n- [ ] Existing flags, exit codes, output fields never removed or renamed\n- [ ] JSON schema is versioned (additions safe, removals breaking)\n- [ ] Config follows flags > env > project > user > defaults\n- [ ] Secrets never via flags; keychain\u002Fcredential-file\u002Fstdin preferred, env only when platform-injected (CI)\n- [ ] Severe destructive actions require typed confirmation (resource name), not just y\u002FN\n- [ ] Network operations have configurable timeouts; exit 75 is reserved for\n      pre-dispatch or demonstrably retry-safe failures\n- [ ] Interactive human operations still running after roughly 100ms show progress\n      on stderr unless `--quiet`; machine-mode protocols stay clean\n- [ ] Ctrl-C exits fast with bounded cleanup\n- [ ] `--help` includes 2-3 realistic examples\n- [ ] Human output is grep-parseable (flat rows, no table borders)\n\n---\n\n## Quick Reference\n\nStream routing, exit codes, and standard flags are tabled in the body — see \"The Unix Stream Contract\", \"Exit Codes\", and \"Standard Flags\" above.\n\n### Format Hierarchy\n\n```\nDefault (TTY)     → colors, tables, formatted text\n--plain           → one record per line, stable, grep-friendly\n--json            → structured JSON, versioned schema\n--format ndjson   → streaming, one JSON object per line\n```\n\n### Config Precedence\n\n```\nflags > env vars > project config > user config > defaults\n```\n","# CLI Design: Unix-Composable Command-Line Interfaces\n\nThis skill covers **language-agnostic** CLI design principles. The rules about stream separation, exit codes, format flags, and composability apply regardless of implementation language.\n\nThis bundle adapts the CC BY-SA 4.0 [Command Line Interface Guidelines](https:\u002F\u002Fclig.dev\u002F).\nPinned provenance, modification notes, and license scope are recorded in\n[`resources\u002Fsource-notes.md`](resources\u002Fsource-notes.md) and [`LICENSE`](LICENSE).\n\nFor API contract stability and Hyrum's Law, see the `api-design` skill. For config, env vars, and graceful shutdown, see the `twelve-factor` skill.\n\n**TypeScript implementation patterns** are in the `resources\u002F` directory. Load them on demand when building a CLI in TypeScript:\n\n| Resource | Load when... |\n|----------|-------------|\n| `output-architecture.md` | Implementing Result types, entry point wiring, formatters, logger, JSON envelope schemas |\n| `testing-cli.md` | Writing Vitest tests for CLI behavior (streams, exit codes, pipes, contract tests) |\n| `stream-contracts.md` | Understanding Node.js buffering, NDJSON, signal handling, crash-only design |\n| `composability.md` | Designing or testing pipe behavior — worked shell examples (jq filtering, NDJSON streaming, stdin, chaining, `--fields`, parallel `xargs`) |\n\n---\n\n## When to Use\n\n- Building any command-line tool (any language)\n- Designing command tree, flags, and I\u002FO contracts\n- Implementing the output layer (format detection, stream routing)\n- Testing CLI behavior (stdout\u002Fstderr separation, exit codes)\n- Reviewing a CLI for Unix composability\n\n---\n\n## Core Principle\n\n**stdout is for DATA only — the product the user asked for.**\n**stderr is for EVERYTHING ELSE — diagnostics, progress, spinners, warnings, errors.**\n\nThis separation is what makes `mycli --json | jq ...` work. One spinner character on stdout breaks every downstream pipe.\n\n> \"Whatever software you're building, you can be absolutely certain that people will use it in ways you didn't anticipate. Your software will become a part in a larger system — your only choice is over whether it will be a well-behaved part.\" — clig.dev\n\n---\n\n## The Unix Stream Contract\n\n| Content | Stream | Why |\n|---------|--------|-----|\n| Primary output (data, results, JSON) | stdout | Pipeable, buffered for throughput |\n| Progress bars, spinners, status | stderr | Not data — must not corrupt pipes |\n| Warnings, errors, diagnostics | stderr | Visible to user even when stdout is piped |\n| Debug\u002Fverbose output | stderr | Diagnostic, never data |\n\n**Stream behavior:**\n\n- Check stdout and stderr independently; stdout being piped does not mean stderr is piped\n- Do not assume C stdio's line\u002Fblock\u002Funbuffered rules describe every language runtime\n- In Node.js, sync\u002Fasync process-stream behavior varies by operating system and destination; always respect `.write()` backpressure for high-volume output\n\nWhen stdout is piped, the user doesn't want your status messages in their data. All non-data output must go to stderr.\n\nFor a deep dive on buffering behavior and performance implications, see `resources\u002Fstream-contracts.md`.\n\n---\n\n## Keep Handlers Pure\n\nThe practical rule: **functions that do the work should return data, not write to stdout.** The CLI entry point handles all I\u002FO.\n\n```\nEntry point (CLI main)              Your logic (handlers)\n─────────────────────               ─────────────────────\nparse args                          (input) → structured result\ndetect format (json\u002Fplain\u002Fhuman)    no printing to stdout\ncall handler                        no writing to stderr\nformat the result                   no calling exit\nwrite to correct stream             just returns data\nset exit code\n```\n\nThis isn't an architecture mandate — it's just clean function design. The benefits are concrete:\n\n- **Testable without subprocess spawning** — call the handler, assert on the returned value\n- **Format flexibility for free** — same data renders as JSON, plain text, or coloured tables by swapping one function\n- **Reusable** — the same handler works from a CLI, MCP server, HTTP API, or programmatic import\n\nFor simple CLIs where the \"handler\" is just calling a library, this separation already exists naturally — your library returns data, your CLI formats it. No extra layers needed.\n\nIf your project uses hexagonal architecture, the mapping is direct: the CLI entry point is a **driving adapter**, and the handler is a **use case** that returns a result through a port. See the `hexagonal-architecture` skill — the patterns reinforce each other, but hex arch is not required to benefit from keeping handlers pure.\n\nFor TypeScript implementation patterns (Result types, entry point wiring, formatters, logger interfaces), see `resources\u002Foutput-architecture.md`.\n\n---\n\n## Selecting a TypeScript Stack\n\nPrefer the command and prompt libraries the repository already owns when they can satisfy the contracts in this skill. For a new material dependency, inspect current versions and project constraints and use `evaluate-existing-solutions`; do not select from remembered popularity or stale package characteristics.\n\nStricli can fit typed, injected command handlers, and `@clack\u002Fprompts` can fit optional TTY-gated interactivity. Treat them as candidates, not defaults. Compare them with the existing stack and alternatives on handler testability, type safety, startup cost measured in the target runtime, maintenance, dependency weight, non-interactive behavior, and migration cost.\n\n---\n\n## Format Flag Contract\n\nThree-tier output hierarchy:\n\n### Default: Human-Readable\n\n- Colors, tables, formatted text\n- Progress bars and spinners on **stderr**\n- Output tailored for terminal width\n- May change between versions — this is **not** a contract\n\n### `--plain`: Grep\u002FAwk-Friendly\n\n- One record per line, no formatting, no colors\n- Stable between minor versions — this **is** a contract\n- Flat table rows, no borders, no grouped sections\n- Enables: `mycli list --plain | grep error | wc -l`\n\n> \"Encourage your users to use `--plain` or `--json` in scripts to keep output stable.\" — clig.dev\n\n### `--json`: Structured Data\n\n- On success, stdout contains **ONLY** valid JSON — no spinners, no color, no progress\n- On failure, stdout stays empty and the final non-empty stderr line is the\n  structured JSON error envelope\n- Other diagnostics may precede that final stderr line and never contaminate stdout;\n  consumers parse the final non-empty line rather than the entire diagnostic stream\n- Schema is versioned — breaking changes to JSON output are breaking changes to the CLI\n- `--json` implies non-interactive regardless of TTY\n\n**Consistent envelopes:**\n\nSuccess on stdout:\n```json\n{ \"ok\": true, \"data\": { ... } }\n```\n\nFailure on stderr:\n```json\n{ \"ok\": false, \"error\": { \"code\": \"CONFIG_MISSING\", \"message\": \"...\", \"fix\": \"...\" } }\n```\n\n### NDJSON for Streaming\n\nFor large datasets, use NDJSON (one JSON text per record, terminated by `\\n`):\n\n- Each line is independently parseable\n- Any JSON value is valid NDJSON syntax; the application's decoder owns its schema\n- The examples in this skill use an optional local event profile with a `type`\n  discriminator and an optional final summary record; neither is required by NDJSON\n- Document whether readers ignore or reject empty lines\n- Enables: `mycli run --format ndjson | while read -r line; do ...; done`\n\nFor NDJSON specification details, see `resources\u002Fstream-contracts.md`.\n\n---\n\n## Exit Codes\n\n| Code | Meaning | When |\n|------|---------|------|\n| 0 | Success | Operation completed as expected |\n| 1 | Domain failure | Tool-specific failure (e.g. quality threshold not met) |\n| 2 | Invalid usage | Bad flags, missing required args, validation error |\n| 78 | Configuration error | Invalid config file, missing required config |\n| 75 | Temporary, retry-safe failure | Failure occurred before dispatch, or the operation is documented and demonstrably safe to retry |\n| 130 | SIGINT | User pressed Ctrl-C (128 + 2) |\n| 143 | SIGTERM-style status | Optional documented status when preserving signal termination (128 + 15); a handled graceful shutdown may instead return 0 |\n\n**Rules:**\n\n- Non-zero exit code **MUST** have a stderr explanation\n- Document exit codes in `--help`\n- Never use codes above 125 for application errors (reserved for signals: 128 + signal number)\n- Use exit 75 only when no mutation was dispatched or retry safety is established\n  through idempotency\u002Freconciliation; a merely transient cause is not enough\n- If a mutating request may have reached its destination, report an ambiguous\n  outcome and direct the user to `status`\u002Freconcile instead of inviting a blind retry\n- A handled SIGTERM may finish with 0 or a documented application status such as\n  143; Docker and Kubernetes do not require 143 for graceful shutdown\n- Map non-zero codes to the most important failure modes for your tool\n\n---\n\n## TTY Detection\n\nCheck priority order (first match wins):\n\n| Priority | Condition | Effect |\n|----------|-----------|--------|\n| 1 | `--format json` or `--json` flag | Non-interactive, no color, no animation |\n| 2 | `--no-color` flag | Disable color (output may still be interactive) |\n| 3 | `FORCE_COLOR` env | Empty, `1`, `2`, `3`, or `true` enables color; every other value (including `0`) disables it. Supported values override `NO_COLOR` and `NODE_DISABLE_COLORS` |\n| 4 | `NO_COLOR` (non-empty) or `NODE_DISABLE_COLORS` (defined), with `FORCE_COLOR` unset | Disable color |\n| 5 | `TERM=dumb` | Disable color and animations |\n| 6 | `CI=true` | No interactive prompts |\n| 7 | stdout is not a TTY (`!isatty(stdout)`) | Plain output, no animations on stdout |\n| 8 | Default | Full interactive with colors |\n\n**Check stdout and stderr independently.** When stdout is piped but stderr is a TTY, you can still show spinners on stderr while keeping stdout clean for the pipe consumer.\n\n**Gate prompts on stdin independently.** Prompt only when stdin and the prompt's\noutput stream are TTYs; stdout TTY status controls data formatting, not whether\ninput is safe to request.\n\nOptionally support `MYCLI_NO_COLOR` for app-specific color override.\n\n---\n\n## Input Design\n\n### Flags Over Arguments\n\n- **1 positional arg**: acceptable (the \"main thing\")\n- **2 positional args**: suspicious — consider flags instead\n- **3+ positional args**: prefer named flags unless a familiar command grammar\n  makes the positions obvious\n- **Exception**: variadic args of the same type are fine (`rm a.txt b.txt c.txt`), as are universal idioms (`cp source dest`)\n\nFlags are self-documenting, order-independent, and future-proof.\n\n```bash\n# Bad — which is source, which is destination?\nmycli copy myapp backup\n\n# Good — explicit\nmycli copy --from myapp --to backup\n```\n\n### Standard Flags\n\nAlways provide long forms. Short flags only for the most common operations.\n\n| Flag | Meaning |\n|------|---------|\n| `-h`, `--help` | Show help (this should only mean help) |\n| `--version` | Print version to stdout |\n| `-q`, `--quiet` | Suppress non-essential output |\n| `-v`, `--verbose` | More detail in human output |\n| `-d`, `--debug` | Diagnostic output to stderr |\n| `-f`, `--force` | Skip confirmation prompts |\n| `-n`, `--dry-run` | Show what would happen without doing it |\n| `--json` | Structured JSON output |\n| `--plain` | Stable, grep-friendly plain text |\n| `--no-color` | Disable color output |\n| `--no-input` | Disable all prompts\u002Finteractivity |\n| `-o`, `--output` | Output file |\n| `--fields` | Select output columns |\n\n### Prompts and Interactivity\n\n- **All prompts MUST be bypassable** via flags for scriptability\n- Confirmation → `--yes` or `--force`\n- Selection → `--type=value`\n- Text input → `--name=value`\n- Passwords → `--password-file=path` or stdin pipe\n- If stdin is not a TTY, never prompt — fail with a clear error or use defaults\n- **Secrets: never via flag values** (leak to `ps` output and shell history). Prefer, in order: OS keychain or a `0600` credential file (`~\u002F.config\u002Fmycli\u002Fcredentials`), then stdin (`mycli login --with-token \u003C token.txt`), then env vars **only where the platform injects them** (CI secret stores) — env leaks to child processes and crash reports, so never make it the primary documented path\n- **Scale confirmation to severity**: mild → `y\u002FN` prompt with `--yes` bypass; moderate → prompt plus suggest `--dry-run` first; severe\u002Firreversible (delete a database, overwrite production) → require typing the resource name to confirm\n\n### Conventions\n\n- Support `--` to stop flag parsing: `mycli run -- --flag-for-child-process`\n- Support `-` for stdin\u002Fstdout file arguments: `curl ... | mycli process -`\n- Accept both `--flag=value` and `--flag value`\n- If stdin is expected but is an interactive terminal, display help immediately (don't hang like `cat`)\n\n---\n\n## Config Precedence\n\nHighest to lowest priority:\n\n1. **Flags** — per-invocation overrides\n2. **Environment variables** — `MYCLI_*` prefix, per-session\n3. **Project config** — `.myclirc`, `mycli.config.ts`, or in `package.json`\n4. **User config** — `~\u002F.config\u002Fmycli\u002F` (follow XDG spec)\n5. **Defaults** — sensible built-in values\n\n**Rules:**\n\n- Follow the [XDG Base Directory Specification](https:\u002F\u002Fspecifications.freedesktop.org\u002Fbasedir-spec\u002Fbasedir-spec-latest.html) for config file locations\n- Env var naming: `MYCLI_*` prefix, uppercase letters + digits + underscores; keep values single-line; don't commandeer POSIX names\n- Respect the general-purpose env vars where relevant: `NO_COLOR`, `FORCE_COLOR`, `DEBUG`, `EDITOR`, `PAGER`, `HTTP_PROXY`\u002F`HTTPS_PROXY`\u002F`NO_PROXY`, `TMPDIR`, `TERM`, `LINES`\u002F`COLUMNS`\n- Never accept secrets via flags; prefer keychain\u002Fcredential files or stdin, env vars only when platform-injected (CI) — see \"Prompts and Interactivity\"\n- Read `.env` where appropriate, but don't use it as a substitute for proper config\n- If you modify configuration that belongs to another program, ask consent first\n\n---\n\n## Error Design\n\nEvery error needs:\n\n1. **Machine-readable code** — `UPPER_SNAKE_CASE` (e.g. `CONFIG_MISSING`, `AUTH_EXPIRED`)\n2. **What went wrong** — context: which resource, operation, input\n3. **How to fix it** — exact command or action the user should take\n4. **Reference** — docs URL or `mycli help \u003Ctopic>` (optional)\n\n### Human Mode\n\n```\nError: CONFIG_MISSING — Configuration file not found\nNo configuration file found at .\u002Fmycli.config.ts or ~\u002F.config\u002Fmycli\u002Fconfig.ts\n\nFix: Run `mycli init` to create a default configuration file\nDocs: https:\u002F\u002Fmycli.dev\u002Fdocs\u002Fconfiguration\n```\n\n- Put the most important information **last** (the eye is drawn to the end)\n- Use red sparingly and intentionally\n- Suggest corrections for typos (\"Did you mean 'deploy'?\")\n- Group similar errors under one header — don't repeat 50 similar-looking lines\n- Write debug logs to a file, not the terminal (unless `--debug`)\n\n### JSON Mode\n\nErrors are structured too — not just success responses:\n\n```json\n{\n  \"ok\": false,\n  \"error\": {\n    \"code\": \"CONFIG_MISSING\",\n    \"message\": \"No configuration file found at .\u002Fmycli.config.ts\",\n    \"fix\": \"Run `mycli init` to create a default configuration file\",\n    \"transient\": false\n  }\n}\n```\n\nThe `transient` boolean says the cause may clear. It does not by itself authorize\na retry: callers also need exit code 75 or an explicit retry-safe contract.\n\n---\n\n## State Changes and Transparency\n\n- **Confirm state changes** — say what changed and show (or point to) the resulting state; traditionally-silent commands look broken to humans\n- **Make current state easy to see** — a `status`-style command for anything with complex state (the `git status` pattern)\n- **Make hidden actions explicit** — if you read\u002Fwrite files not passed as arguments or talk to remote servers, say so (stderr in human mode)\n- **Resolve ambiguous mutations** — if transport fails after dispatch, tell the\n  user how to inspect or reconcile state; do not label the result retry-safe\n- **Page long output** through `$PAGER` only when stdout is a TTY, never when\n  piped; do not execute the value through a shell, and document whether it is an\n  executable token or parsed by a reviewed shell-word parser\n\n---\n\n## Robustness\n\n- **Validate input early** — fail before any side effects, with a clear message\n- **Responsiveness for ongoing human work** — in interactive human mode, unless\n  `--quiet`, show progress on stderr if an operation is still running after roughly\n  100ms; keep machine modes quiet unless their protocol explicitly defines progress,\n  and include time estimates when interactive progress can stall\n- **Timeouts on all network operations** — configurable; use exit 75 only before\n  dispatch or when retry safety\u002Fidempotency is established\n- **Recoverable operations** — re-running may resume only when safe; ambiguous\n  mutation outcomes need an explicit status or reconciliation path\n- **Crash-only design** — exit fast on failure, defer cleanup to the next run;\n  distinguish visibility-atomic replacement from crash-durable persistence, and\n  keep bounded-cleanup timers referenced so Ctrl-C cannot bypass the bound — see\n  `resources\u002Fstream-contracts.md`\n- **Expect misuse** — script wrapping, bad connections, concurrent instances, environments you never tested\n\n---\n\n## Composability Patterns\n\nDesign for real-world pipes: filtering with `jq`, streaming NDJSON line-by-line, feeding stdin, chaining commands through emitted identifiers, selecting columns with `--fields`, and fanning out with `xargs -P`.\n\nSee `resources\u002Fcomposability.md` for the worked shell examples covering each of these patterns.\n\n**Key patterns:**\n\n- Create commands output identifiers so subsequent commands can chain\n- List commands support `--fields` for column selection (reduces output size, critical for agent efficiency)\n- `--quiet` for CI scripts that only care about the exit code\n- NDJSON for streaming large datasets without buffering everything in memory\n- `--dry-run` with `--json` outputs planned changes as structured data\n\n---\n\n## Subcommand Design\n\n- **noun verb** pattern is most common: `mycli config set`, `mycli report generate`\n- Be consistent across all subcommands — same flag names for same things\n- No ambiguous pairs (`update` vs `upgrade` is confusing)\n- No catch-all subcommands (you can never add subcommands with conflicting names)\n- No arbitrary abbreviations — aliases must be explicit and stable\n- With no args: list subcommands (multi-command CLI) or show help (single-command CLI)\n\n### Help\n\n- `mycli --help` — top-level help\n- `mycli help \u003Csubcommand>` — subcommand help\n- `mycli \u003Csubcommand> --help` — same as above\n- If run with missing required args, show concise help + 1-2 examples + \"use --help for more\"\n- **Examples are the most-read section** — lead with them\n- Include flag types, defaults, and allowed values for finite sets\n- Include a support\u002Fbug-report link in top-level help; pre-populate issue URLs with diagnostics where possible\n- Suggest the likely command on obvious typos (\"Did you mean 'deploy'?\") — ask, never auto-execute\n\n---\n\n## Output Stability Contract\n\n**Stdout is a public API.** Breaking changes to stdout format are breaking changes to the CLI.\n\n| Change | Impact |\n|--------|--------|\n| Adding new optional JSON fields | Safe (additive) |\n| Adding new subcommands | Safe |\n| Adding new flags with preserving defaults | Safe |\n| Removing or renaming flags | **Breaking** |\n| Removing or renaming JSON fields | **Breaking** |\n| Changing exit codes | **Breaking** |\n| Changing default behavior | **Breaking** |\n| Changing human-readable output | Usually OK (not a contract) |\n\nWhen in doubt, add alongside — don't modify. Deprecate with stderr warnings before removing — and once you can detect that users have migrated, stop warning.\n\n---\n\n## Naming, Distribution, Telemetry\n\n- **Name**: short, memorable, lowercase, easy to type; not so generic it collides with existing commands\n- **Distribution**: prefer a single binary; language-ecosystem tools (npm, pip) may reasonably assume their interpreter. Make uninstalling easy and documented\n- **Telemetry**: never collect usage\u002Fcrash data without explicit consent — opt-in, stating what, why, and retention. Instrumented web docs or download counts are usually enough\n\n---\n\n## Anti-Patterns\n\n| # | Anti-Pattern | Why It's Wrong |\n|---|-------------|----------------|\n| 1 | Mixing data and diagnostics on stdout | Breaks every pipe: `mycli list \\| jq .` fails if warnings are on stdout |\n| 2 | Colors\u002FANSI in piped output | ANSI sequences corrupt downstream parsing. Check `isatty(stdout)` + `NO_COLOR` |\n| 3 | Interactive prompts with no flag bypass | Agents can't type 'y'. Every prompt needs `--yes`\u002F`--force`. Non-TTY without bypass = hang |\n| 4 | Printing nothing on success | Silence is ambiguous — show brief confirmation. Offer `-q` for scripts that want silence |\n| 5 | Designing for humans OR machines, not both | Detect context (TTY vs pipe), adapt automatically |\n| 6 | Output that doesn't guide the next action | Every output is a signpost: success = next command, failure = fix command |\n| 7 | Breaking existing CLI contracts | Flag names, exit codes, output shape are contracts. Add alongside, never modify |\n| 8 | `console.log` anywhere except the CLI adapter | Handlers must return data; only the presentation layer writes to streams |\n| 9 | Handlers that exit the process directly | Let the entry point decide. Handlers return errors as data |\n| 10 | Non-zero exit without stderr explanation | Scripts need both the code and the reason |\n| 11 | Verbose default output | A single test run can generate 419KB. Support `--fields`, `--quiet`, `--json` |\n\n---\n\n## Verification Checklist\n\nAfter designing or reviewing a CLI:\n\n- [ ] stdout has ONLY data; stderr has everything else\n- [ ] Every command supports `--json` with success data on stdout and structured failures on stderr\n- [ ] Exit codes are semantic and documented in `--help`\n- [ ] Every prompt has a `--yes`\u002F`--force`\u002F`--flag` bypass\n- [ ] Errors include: code, message, fix suggestion\n- [ ] `--dry-run` available for mutating commands\n- [ ] Progress\u002Fspinners go to stderr, never stdout\n- [ ] `NO_COLOR`, `TERM=dumb`, and `--no-color` respected\n- [ ] Piped output contains zero ANSI escape codes\n- [ ] Success output includes next-action guidance\n- [ ] Existing flags, exit codes, output fields never removed or renamed\n- [ ] JSON schema is versioned (additions safe, removals breaking)\n- [ ] Config follows flags > env > project > user > defaults\n- [ ] Secrets never via flags; keychain\u002Fcredential-file\u002Fstdin preferred, env only when platform-injected (CI)\n- [ ] Severe destructive actions require typed confirmation (resource name), not just y\u002FN\n- [ ] Network operations have configurable timeouts; exit 75 is reserved for\n      pre-dispatch or demonstrably retry-safe failures\n- [ ] Interactive human operations still running after roughly 100ms show progress\n      on stderr unless `--quiet`; machine-mode protocols stay clean\n- [ ] Ctrl-C exits fast with bounded cleanup\n- [ ] `--help` includes 2-3 realistic examples\n- [ ] Human output is grep-parseable (flat rows, no table borders)\n\n---\n\n## Quick Reference\n\nStream routing, exit codes, and standard flags are tabled in the body — see \"The Unix Stream Contract\", \"Exit Codes\", and \"Standard Flags\" above.\n\n### Format Hierarchy\n\n```\nDefault (TTY)     → colors, tables, formatted text\n--plain           → one record per line, stable, grep-friendly\n--json            → structured JSON, versioned schema\n--format ndjson   → streaming, one JSON object per line\n```\n\n### Config Precedence\n\n```\nflags > env vars > project config > user config > defaults\n```\n",{"name":5,"description":7},"main","ebe6483a57ceac5b9da32b4a23fa4ba2fa7ac170",".agents\u002Fskills\u002Fcli-design","https:\u002F\u002Fgithub.com\u002FYabuku-xD\u002Fomfx","https:\u002F\u002Fgithub.com\u002FYabuku-xD","shyamalankannan.com","😳 Indie-head with a versatile knowledge in development and modeling.","2026-11-13 04:46:29",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add Yabuku-xD\u002Fomfx --skill cli-design",{"tool":38,"command":39},"bunx","bunx skills add Yabuku-xD\u002Fomfx --skill cli-design",{"tool":41,"command":42},"pnpm","pnpm dlx skills add Yabuku-xD\u002Fomfx --skill cli-design","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FYabuku-xD\u002Fomfx\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fcli-design\u002FSKILL.md",true,[],[47,54,61,68,74,81],{"skillNo":48,"name":49,"nameZh":6,"description":50,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":51,"categories":52,"keywords":53,"publishedAt":19},"01M7B1ZQXR4F45F34W3A9DH795","hello-omfx","Example skill. Use when testing omfx skill discovery.","https:\u002F\u002Fgithub.com\u002FYabuku-xD\u002Fomfx\u002Fblob\u002Fmain\u002Fskills\u002Fhello-omfx\u002FSKILL.md",[],[],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7B1ZJ19F0WDTZKD05EMGS5V","zig-tiger-style","TigerStyle Zig coding guidelines — distilled from TigerBeetle's production codebase. Use this skill whenever the user is writing, reviewing, or refactoring Zig code, asking about Zig idioms, best practices, assertions, memory layout, naming conventions, or code style. Also trigger when the user asks how to structure Zig structs, handle errors, write safe loops, or design Zig APIs. Even if the user just says \"write me some Zig\" or pastes Zig code for review, consult this skill first.","https:\u002F\u002Fgithub.com\u002FYabuku-xD\u002Fomfx\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fzig-tiger-style\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":64,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":65,"categories":66,"keywords":67,"publishedAt":19},"01M7B1ZFD4G462R79S6GYFXZBM","zig-testing","Zig 测试与调试技能。涉及 std.testing 的断言、测试组织、内存泄漏检测、以及 std.debug 的日志、堆栈回溯。在需要编写测试、调试代码、诊断问题时调用。","https:\u002F\u002Fgithub.com\u002FYabuku-xD\u002Fomfx\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fzig-testing\u002FSKILL.md",[],[],{"skillNo":69,"name":63,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M7B1Z9K5AWQ89KBWSVK7Q9KM","Zig testing skill for writing and running tests. Use when using zig build test, writing comptime tests, using test filters, working with test allocators to detect leaks, or using Zig's built-in fuzz testing (0.14+). Activates on queries about Zig tests, zig test, zig build test, comptime testing, test allocators, Zig fuzz testing, or detecting memory leaks in Zig tests.","https:\u002F\u002Fgithub.com\u002FYabuku-xD\u002Fomfx\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fzig-testing-lowlevel\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7B1Z52KAWNN9PPKMX9FP06N","zig-project-structure","Zig 项目结构全生命周期管理。创建项目骨架（exe\u002Flib\u002F多模块\u002F带依赖）或检查已有项目的目录结构、文件命名、构建配置合规性，输出结构化报告。","https:\u002F\u002Fgithub.com\u002FYabuku-xD\u002Fomfx\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fzig-project-structure\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M7B1YXXZMP87C8DDYPM213N8","zig-memory-patterns","This skill should be used when the user asks questions like \"how do allocators work in Zig\", \"explain Zig memory management\", \"when to use arena allocator\", \"how does Zig compare to Rust ownership\", \"how to manage memory in Zig\", or asks about memory allocation patterns for programmers coming from C, C++, Rust, or garbage-collected languages.","https:\u002F\u002Fgithub.com\u002FYabuku-xD\u002Fomfx\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fzig-memory-patterns\u002FSKILL.md",[],[]]