Master defensive Bash programming techniques for production-grade scripts. Use when writing robust shell scripts, CI/CD pipelines, or system utilities requiring fault tolerance and safety.
Add this skill
npx mdskills install sickn33/bash-defensive-patternsClear use cases and safety guardrails, but lacks specific implementation patterns in the main content.
1---2name: bash-defensive-patterns3description: Master defensive Bash programming techniques for production-grade scripts. Use when writing robust shell scripts, CI/CD pipelines, or system utilities requiring fault tolerance and safety.4---56# Bash Defensive Patterns78Comprehensive guidance for writing production-ready Bash scripts using defensive programming techniques, error handling, and safety best practices to prevent common pitfalls and ensure reliability.910## Use this skill when1112- Writing production automation scripts13- Building CI/CD pipeline scripts14- Creating system administration utilities15- Developing error-resilient deployment automation16- Writing scripts that must handle edge cases safely17- Building maintainable shell script libraries18- Implementing comprehensive logging and monitoring19- Creating scripts that must work across different platforms2021## Do not use this skill when2223- You need a single ad-hoc shell command, not a script24- The target environment requires strict POSIX sh only25- The task is unrelated to shell scripting or automation2627## Instructions28291. Confirm the target shell, OS, and execution environment.302. Enable strict mode and safe defaults from the start.313. Validate inputs, quote variables, and handle files safely.324. Add logging, error traps, and basic tests.3334## Safety3536- Avoid destructive commands without confirmation or dry-run flags.37- Do not run scripts as root unless strictly required.3839Refer to `resources/implementation-playbook.md` for detailed patterns, checklists, and templates.4041## Resources4243- `resources/implementation-playbook.md` for detailed patterns, checklists, and templates.44
Full transparency — inspect the skill content before installing.