bash
Conventions and defensive patterns for writing, reviewing, and modifying Bash scripts, shell libraries, and BATS tests. Defines a short floor every script owes, then a triage gate that names which further features the script has actually earned: error handling, quoting, portability, path and JSON safety, logging, signal handling, CLI structure, and testing. Use when authoring or changing a shell script, shell function, or BATS test file, even if the user doesn't explicitly mention "conventions" or "style guide".
- Compatibility
- Requires shellcheck and shfmt, plus bats-core for tests. Patterns assume GNU coreutils, with documented preflight probes for BSD and macOS.
Pinned to revision 4f42cd2bb742, so it is the text this page describes rather than whatever the author pushed since.
Files
- skills/bash/SKILL.md
- skills/bash/references/cli.md
- skills/bash/references/config.md
- skills/bash/references/helpers.md
- skills/bash/references/json.md
- skills/bash/references/library.md
- skills/bash/references/logging.md
- skills/bash/references/portability.md
- skills/bash/references/signals.md
- skills/bash/references/testing.md
Every link opens the file at its source, pinned to the revision this page describes.