agentsclimarketplace

Shell

Skill posidoni/shell-skill/skills/shell

Load before running or writing ANY shell — including throwaway one-liners you intend to run yourself, not just scripts you save. Trigger on the act, not the request: you are about to type awk, sed, cut, or a second pipe; you are parsing du/ps/ls/find output; a command needs a loop, a conditional, or arithmetic; you are writing $(...) inside another $(...); you need a file list, sizes, or process info; you are choosing a shebang or an interpreter; a command exceeds one line or will outlive this session; output must be machine-read, or must separate data from diagnostics; you are editing a Makefile recipe, Dockerfile RUN, CI run: block, cron entry, or .env; or you are reviewing or debugging shell someone else wrote. Answers "should this be shell at all?" first — usually jq, yq, sd, nu, Python or bun — then applies the Bash/Zsh/POSIX/Nushell safety rules to whatever survives that question.From its SKILL.md

Install
npx -y skills add posidoni/shell-skill --skill shell

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

6.0 KB, ~1.5k tokens by cl100k_base, as published. Nobody here has run it

Shell

Most "shell problems" are solved by not writing shell. This skill decides that first, then enforces the rules for the parts that genuinely are shell.

1. Pick the tool before writing a line

The taskUseNot
JSON in, JSON outjqgrep/sed on JSON
YAML / TOML / XMLyqany regex
Substitute text in filessdsed -i (delimiter escaping, BSD-vs-GNU -i)
Find filesfdfind with -exec chains
Search contentsrggrep -r
Query the OS for structured facts (sizes, processes, files)nudu/ps + awk
String case/encoding transformssttrtr/awk
SQLitesqlite3 or a bun scriptshelling out per row
Anything with a data structure, two stages of logic, or arithmeticPython or a bun .ts filea pipeline

Hard stop: if a pipeline needs three or more stages, or any awk beyond {print $1}, stop and write a script file. A three-stage awk/sed/cut chain is unreadable, unportable (BSD vs GNU), and silently wrong on unusual input.

See reference/pipelines.md for the replacement table, BSD-vs-GNU traps, and worked rewrites.

1b. Do not invoke a tool from memory — check it

A recalled flag is a guess. Model memory for CLI flags is stale, version-skewed, and confidently wrong. Checking costs one command; guessing costs a silent wrong answer, which is worse than an error because nothing tells you.

Escalate in this order, stopping as soon as you know:

  1. <cmd> --help — always first. Fast, offline, matches the installed version. Modern Rust tools (sd, rg, fd) have excellent --help.
  2. man <cmd> — when --help is a summary and you need semantics. Not every tool ships one (nu and sttr do not; sd, rg, fd, jq, yq do — check with man -w <cmd>).
  3. <cmd> --version + context7 — for a library or a tool with real documentation, when behaviour differs across versions. Pin the answer to the installed version.
  4. Web search — last, for "why does X do Y" questions no reference answers.

Then run it once on a known input before trusting it in a pipeline.

Cached essentials and the gotchas that bite — reference/cli-cheatsheets.md.

2. Pick the interpreter deliberately

Never write bare bash and hope. On macOS /bin/bash is 3.2 (2007, frozen over GPLv3) — no mapfile, no associative arrays, no ${var^^}. Homebrew's bash 5.x lives at /opt/homebrew/bin/bash.

  • Portable script → #!/usr/bin/env bash and stay inside 3.2 features, or assert the version at the top.
  • Need bash 4+/5 features → require it explicitly, do not assume env finds it.
  • Interactive-shell config → that is Zsh on macOS, not bash.
  • Structured data → Nushell.

Details and the env -S flag trick: reference/shebang.md.

3. The non-negotiables (Bash)

#RuleEnforced by
1set -euo pipefail first line of every scriptstyle
2Quote every expansion: "$var", "$(cmd)"SC2086
3read -r, never bare readSC2162
4Declare local, then assign — local x="$(cmd)" hides the exit statusSC2155
5Arrays for lists; expand "${arr[@]}"SC2206
6[[ ... ]], not [ ... ]SC2292
7return in helpers; exit only in mainstyle
8trap '...' EXIT for cleanupstyle
9printf, never echo — builtins disagree on -n, -e, backslashesSC2028/SC2059
10${var} bracesSC2250
11readonly constants; command -v, not whichstyle
12Never parse ls; use a globSC2045
13No nested $( $( ) ) — assign an intermediate variablereadability

Full rationale and citations: reference/shell-standards.md.

4. Then the shell-specific reference

Load only the one you are actually writing:

  • Bashpipefail semantics, trap ERR, BSD-vs-GNU coreutils, bash-3.2 traps → reference/bash.md
  • Zshemulate -L zsh, no automatic word-splitting, glob qualifiers, startup files → reference/zsh.md
  • POSIX sh — no local, no arrays, [ ] only, set -eu without pipefailreference/posix-sh.md
  • Nushell — parse-time vs runtime, const for source, structured pipelines, save not >, ^cmd | completereference/nushell.md
  • Streams — stdout is data, stderr is diagnostics, exit codes, signals → reference/streams.md

5. Verify before claiming it works

shellcheck script.sh          # default severity — CI's --severity=warning hides SC2086
shfmt -d script.sh            # layout, and rewrites backticks
nu --ide-check script.nu      # parse + type errors for Nushell

task lint runs these across the repo. A script that has not been shellcheck'd at default severity has not been checked.

What ships with it: 1 file

337 B alongside SKILL.md

agents/

Keep looking

Skills are one crate of 326,645. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.