| name | bash-coding-standards |
| description | Bash coding standards for production-grade scripts. Use whenever writing, reviewing, or refactoring Bash scripts/functions; whenever conducting a Bash code review; or whenever bash coding standards are referenced. |
Bash Coding Standards
Production-grade standards for Bash 4+ scripts, split into concern-specific
reference documents. Load the reference(s) relevant to the task instead of
reading everything.
How to use this skill
- Implementing Bash — start with
references/script-setup.md, then pull the
reference matching what you're building (parsing args → argument-parsing.md,
etc.).
- Reviewing Bash — walk the Review checklist below and
open the reference for any category that has issues.
- Referencing the standards — cite the relevant bucket below.
Reference map
- script-setup.md - Starting any script; strict mode, shebang, script-dir detection
- variable-safety.md - Quoting, arrays,
[[ ]], command substitution
- input-validation.md - Checking files, dirs, required vars, dependencies
- error-handling.md - Traps, cleanup, exit safety
- logging.md - Structured, leveled log output
- argument-parsing.md - CLI flags, usage text, named parameters
- file-operations.md - Safe move/remove, atomic writes, temp files
- function-design.md - Function templates
- idempotency-and-dry-run.md - Safe-to-rerun scripts, preview mode
- process-orchestration.md - Background jobs, signal handling
- linting.md - Running shellcheck; justifying disables
Review checklist