Bash Defensive Patterns

•
81
•

Implements robust, production-ready shell scripting techniques to ensure reliability and fault tolerance in automation tasks.

This skill equips Claude with a comprehensive framework for writing high-quality Bash scripts that are resilient to common execution pitfalls. It covers essential defensive programming practices such as strict mode enforcement, sophisticated error trapping, and safe variable handling. Whether building CI/CD pipelines, system utilities, or complex deployment automation, this skill ensures that shell scripts are maintainable, portable, and capable of handling edge cases without silent failures.

主な機能

01Strict mode enforcement using set -Eeuo pipefail for early error detection
0281 GitHub stars
03Robust command-line argument parsing with support for long and short flags
04Advanced error trapping and automated resource cleanup routines
05Idempotent script design patterns to ensure safe re-execution
06Structured logging and dry-run capabilities for safe testing and observability

ユースケース

01Developing system administration utilities that require safe file and directory operations
02Hardening CI/CD pipeline scripts to prevent silent failures during build or deployment
03Creating maintainable shell libraries for cross-platform infrastructure automation