No slash command · from tools-plugin
Guides styling of human-facing terminal output: colour gating (TTY, NO_COLOR, FORCE_COLOR), semantic palette, and layout patterns for CLIs, scripts, and TUIs.
Ships in tools-plugin. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
How to style output that a person reads in a terminal — shell scripts, CLIs, dev tools, interactive prompts, TUIs — so it scans quickly on a terminal and stays plain text everywhere else.
| Use this skill when… | Use instead when… |
|---|---|
| A person reads the output in a terminal: progress, summaries, prompts, error lines | An agent or orchestrating script parses it — emit === SECTION === / KEY=VALUE / STATUS= with no colour (this marketplace's structured-script-output contract) |
| Deciding when to emit colour and which colour means what | Writing the script itself: quoting, traps, portability — tools-plugin:shell-expert |
| Laying out blocks, aligned fields, prompts and a closing tally | Exposing a module through CLI subcommands and smoke-testing it — tools-plugin:cli-smoke-recipes |
One script can serve both readers: style for the TTY, and keep the piped form plain so tests, logs and agents read it unchanged.
| Condition | Colour | Source |
|---|---|---|
NO_COLOR set and non-empty | off — wins over FORCE_COLOR / CLICOLOR_FORCE | no-color.org |
Explicit flag (--color=always|never) | as requested — no-color.org lets per-invocation flags override NO_COLOR | no-color.org |
FORCE_COLOR or CLICOLOR_FORCE set (non-empty / non-0) | on, even when piped | de-facto convention |
stdout is a TTY ([ -t 1 ]) | on | default |
| otherwise (pipe, file, CI log) | off | default |
[ -t 2 ]) when error lines go there:
cmd 2>err.log leaves stdout on the terminal but stderr in a file.TERM=dumb is a reasonable extra "off" signal; several libraries check it.grep, tests and agents never see \033[.One meaning per colour, and every colour paired with a symbol and a word, so the line still reads with colour off and for colour-blind readers.
| Colour | Meaning | Paired marker |
|---|---|---|
| green | success, applied | ✓ applied |
| red (on stderr) | error, failed | ✗ error: |
| yellow | needs attention, warning, pending, skipped | → skipped, 3 pending |
| dim | metadata: links, dates, trace info, declined | – declined |
| bold | headings, prompt keys, tally label | ▸ item, Done: |
| cyan | identifiers: names, IDs, paths in headings | ▸ 2026-11-30-cleanup |
Use the 8 basic ANSI colours (30–37) so the user's terminal theme picks the
shade; 256-colour and truecolor codes ignore it.
| Element | Pattern |
|---|---|
| Block per item | blank line, then a bold heading (▸ name) |
| Body | indented under the heading (3 spaces) |
| Label/value rows | padded label column: printf ' %-8s %s\n' "$label" "$value" |
| Position in an interactive loop | [n/total] dimmed after the heading |
| Prompt | bold question, each key bold in its outcome's colour: Apply? y yes n no s skip › |
| Closing line | one-line tally: Done: 1 applied · 0 declined · 1 skipped |
Rendered (colour off):
▸ 2026-11-30-uninstall-foo [1/2]
Uninstall the global foo tool, now installed per project.
found foo 1.2.3 (uv tool)
commit https://github.com/owner/repo/commit/abc1234
expires 2027-05-30
Apply? y yes n no, never ask again s skip for now › y
✓ applied
Done: 1 applied · 0 declined · 1 skipped
Define the colour variables once; when colour is off they are empty strings, so call sites never branch.
if [ -z "${NO_COLOR:-}" ] && { [ -n "${FORCE_COLOR:-}" ] || [ -t 1 ]; }; then
C_BOLD=$'\033[1m' C_DIM=$'\033[2m' C_RED=$'\033[31m' C_GREEN=$'\033[32m'
C_YELLOW=$'\033[33m' C_CYAN=$'\033[36m' C_RESET=$'\033[0m'
else
C_BOLD='' C_DIM='' C_RED='' C_GREEN='' C_YELLOW='' C_CYAN='' C_RESET=''
fi
ok() { printf '%s✓%s %s\n' "$C_GREEN" "$C_RESET" "$*"; }
err() { printf '%s✗ error:%s %s\n' "$C_RED" "$C_RESET" "$*" >&2; }
field() { printf ' %s%-8s%s %s\n' "${3:-$C_DIM}" "$1" "$C_RESET" "$2"; }
| Practice | Why |
|---|---|
$'\033[…m' ANSI-C quoting | Stores the real escape byte; works in bash 3.2 (macOS /bin/bash) |
printf '%s…' "$C_X", never echo -e | echo -e differs across shells and sh; printf is portable and keeps data out of the format string |
Pass colours as %s arguments | A % in user data cannot corrupt the format |
Padding with %-8s on the label only | Escape codes count toward printf width; keep them outside the padded field |
tput setaf only when terminfo lookup matters | Exotic terminals; it forks a process per call and fails under TERM=dumb or no TERM |
CLICOLOR_FORCE | Add a [ -n "${CLICOLOR_FORCE:-}" ] alternative beside the FORCE_COLOR test if your users set it |
Prefer the ecosystem library over hand-written escapes. Their environment
handling differs — check the column before relying on NO_COLOR alone.
| Language | Library | Env handling (from docs/source, 2026-11) |
|---|---|---|
| Python | rich | Strips codes when not a terminal; NO_COLOR disables colour (bold/underline remain) and wins over FORCE_COLOR |
| Go | lipgloss (v2, via charmbracelet/colorprofile) | Strips colour when not a TTY; reads NO_COLOR, CLICOLOR, CLICOLOR_FORCE as booleans (NO_COLOR=yes does not parse); NO_COLOR beats CLICOLOR_FORCE only on a TTY; FORCE_COLOR not read |
| Shell | gum (Charm) | Styled prompts/choosers for scripts; verify its colour env handling for your version |
| Rust | anstream (AutoStream) | NO_COLOR → never, then CLICOLOR_FORCE → always, CLICOLOR=0 → never, else TTY + capable terminal |
| Rust | owo-colors | Colours unconditionally; TTY + NO_COLOR/FORCE_COLOR only through the supports-colors feature and if_supports_color |
| Rust | console | TTY + not dumb + NO_COLOR unset; CLICOLOR_FORCE overrides all of it, including NO_COLOR |
| JS/TS | picocolors | NO_COLOR / --no-color win; then FORCE_COLOR, --color, TTY with TERM≠dumb, or CI |
| JS/TS | node:util styleText | Validates process.stdout (pass { stream: process.stderr } for errors); honours NO_COLOR, NODE_DISABLE_COLORS, FORCE_COLOR since v22.8.0 / v20.18.0. On v26 NO_COLOR beat FORCE_COLOR (tested), even set empty |
Capture output through a pipe (out=$(cmd)), which makes stdout a non-TTY.
| Assertion | Shape |
|---|---|
| Piped output is plain | out=$(cmd); ! grep -q $'\033\[' <<<"$out" |
FORCE_COLOR colours piped output | out=$(FORCE_COLOR=1 cmd); grep -q $'\033\[' <<<"$out" |
NO_COLOR beats FORCE_COLOR | out=$(NO_COLOR=1 FORCE_COLOR=1 cmd); ! grep -q $'\033\[' <<<"$out" |
| stderr gated separately (if applicable) | err=$(cmd 2>&1 >/dev/null) and the same three checks |
Use here-strings (<<<"$out"), not printf … | grep -q, under pipefail.
Teeth check. Mutate the colour condition and confirm the matching tests fail — read which tests fail, not the count:
| Mutant | Expected failures |
|---|---|
condition → if false; then (always off) | the FORCE_COLOR test |
condition → if true; then (always on) | the piped-plain test and the NO_COLOR test |
grep -c the condition first so the substitution hits exactly one site, and
run the unmutated control alongside so pre-existing failures are not
attributed to the mutant.
The per-machine migration runner in laurigates/dotfiles PR
#676 applies every section of
this skill: the colour block and ok/err in migrations/lib.sh;
describe (block per item, [n/total]), field (padded label rows),
summary and the y/n/s prompt with its Done: tally in
migrations/migrate.sh; and the three colour assertions in
tests/test-migrations.sh. On a copy of that branch, the always-off mutant
failed only the FORCE_COLOR test and the always-on mutant failed the
piped-plain and NO_COLOR tests.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub laurigates/claude-plugins --plugin tools-plugin18 skills in this plugin
/apptainerApptainer: run OCI images as rootless batch jobs with --nv GPU passthrough and digest-pinned SIFs. Use when running a CUDA tool without Docker, podman lacks GPU support, or a pull fills root./binary-analysisBinary analysis: strings, binwalk, hexdump, xxd, file, objdump. Use when identifying unknown files, extracting strings, hunting credentials, or entropy analysis./cli-smoke-recipesCLI smoke recipes: expose pure-function modules via subcommands with a bulk-smoke justfile recipe. Use when designing data-transform modules or authoring smoke tests./d2-diagramsGenerate diagrams from text using D2 with automatic layouts and themes. Use when creating architecture diagrams, flowcharts, decision trees, sequence flows, or ERDs./deps-installDeps install: auto-detect package manager (uv, bun, npm, yarn, pnpm, cargo, go) and run the right install. Use when installing deps or syncing lockfiles./fd-file-findingfd fast file finding: smart defaults, gitignore-aware, parallel. Use when searching for files by name, extension, or pattern across directories.Other plugins' skills for the same job