clean-shell

Solid

Defensive Bash and shell script quality: strict-mode `set` flags, traps, idempotent mutation of live systems (deploy, firewall/sshd/sudoers edits, systemd units, ssh remote-exec), ShellCheck rc-file and `# shellcheck disable=` discipline, bats-core tests (`.bats`, `run`, PATH-stub mocking). Use when writing, hardening, reviewing, or testing shell scripts, or wiring shellcheck/bats into CI.

Testing & QA 5 stars 0 forks Updated today MIT

Install

View on GitHub

Quality Score: 78/100

Stars 20%
26
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
84
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Clean Shell Shell-specific conventions for writing, hardening, reviewing, and testing scripts. The core rules below always apply. Load the one reference file matching the task; don't load them all. | Task touches | File | |---|---| | Scripts that mutate live systems: deploy/apply, firewall/sshd/sudoers edits, systemd oneshot+timer units, ssh remote-exec, rollback, cleanup traps, idempotency | `references/defensive.md` | | `.shellcheckrc`, `# shellcheck disable=` directives, severity floors, exit codes, CI gating | `references/shellcheck.md` | | Bats tests: `.bats` files, `run`, `setup`/`teardown`, PATH-stub mocking, parallel jobs | `references/bats.md` | ## Core Rules - Pick `set` flags by intent and comment the reason next to them: `set -euo pipefail` for orchestration where any failure aborts; drop `-e` when steps may fail without aborting; `set -u` alone for long-running loops. A thin wrapper sets no flags and ends with `exec`. - Quote every expansion (`"$var"`, `"${arr[@]}"`, `"$(cmd)"`); `--` end-of-options guard before untrusted operands. - Validate input at the boundary into a checked value (`"${1:?msg}"`, a `case` integer guard); no call site re-tests a raw string. - Every `mktemp` gets an EXIT trap right after creation. Traps are best-effort: SIGKILL, OOM-kill, and power loss skip them. - Anything that mutates system state is check-then-act idempotent; add `flock` where concurrent runs are possible. - Never echo a generated secret; `set -x` tracing and `ps`/`/p...

Details

Author
uwuclxdy
Repository
uwuclxdy/agenticat
Created
5 months ago
Last Updated
today
Language
TypeScript
License
MIT

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category