Bash Defensive Patterns
Implements robust, fault-tolerant Bash programming techniques and safety patterns for production scripts and CI/CD pipelines.
Bash Defensive Patterns equips Claude with comprehensive best practices for writing rock-solid, production-ready shell scripts. It guides the implementation of strict execution modes, robust error trapping, input validation, structured logging, and safe temporary file handling to prevent common shell script failure modes. This skill is ideal for DevOps engineers and developers creating maintainable deployment automations, CI/CD pipelines, and cross-platform system utilities where fault tolerance and idempotency are critical.
Key Features
01Safe variable handling, quoting conventions, and defensive input validation
02Secure temporary file creation and automated cleanup traps
0339,277 GitHub stars
04Strict execution mode configuration with set -Eeuo pipefail and error trapping
05Structured logging with timestamps, levels, and dry-run execution support
06Idempotent design patterns for repeatable automation and deployments
Use Cases
01Refactoring legacy shell scripts to prevent silent failures and race conditions
02Writing production-grade system administration and maintenance utilities
03Building resilient CI/CD pipeline automation and deployment scripts