bash-defensive-patterns
/bash-defensive-patterns
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.
- Author
- rootcastleco ↗
- Repository
- rei-skills ↗
- Licence
- MIT
- Last repository change
- 27.10.2026
Assessment and security
- Files in this package
- 2
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 1
No signals detected. Repository changed on 27.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
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.
Original author description
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.
How it works
- Use this skill when
- Do not use this skill when
- Instructions
- Safety
- Resources
SKILL.md preview
--- name: bash-defensive-patterns description: "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." risk: unknown source: rootcastle-rei --- # Bash Defensive Patterns Comprehensive guidance for writing production-ready Bash scripts using defensive programming techniques, error handling, and safety best practices to prevent common pitfalls and ensure reliability. ## Use this skill when - Writing production automation scripts - Building CI/CD pipeline scripts - Creating system administration utilities - Developing error-resilient deployment automation - Writing scripts that must handle edge cases safely - Building maintainable shell script libraries - Implementing comprehensive logging and monitoring - Creating scripts that must work across different platforms ## Do not use this skill when - You need a single ad-hoc shell command, not a script - The target environment requires strict POSIX sh only - The task is unrelated to shell scripting or automation ## Instructions 1. Confirm the target shell, OS, and execution environment. 2. Enable strict mode and safe defaults from the start. 3. Validate inputs, quote variables, and handle files safely. 4. Add logging, error traps, and basic tests. ## Safety - Avoid destructive commands without confirmation or dry-run flags. - Do not run scripts as root unless strictly required. Refer to `resources/implementation-playbook.md` for detailed patterns, checklists, and templates. ## Resources - `resources/implementation-playbook.md` for detailed patterns, checklists, and templates. --- > 🏰 **Rei Skills** — Curated by [Rootcastle Engineering & Innovation](https://www.rootcastle.com) | Batuhan Ayrıbaş > Engineering Beyond Boundaries | admin@rootcastle.com
Files in this package (2)
- SKILL.md 2 KB
- resources/implementation-playbook.md 11 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · rootcastleco/rei-skills | 90 | MIT |
| wshobson/agents | 100 | MIT |
| HermeticOrmus/LibreUIUX-Claude-Code | 95 | MIT |
| ricneves-ai/flowgrammers-skills | 95 | MIT |
| wesleyegberto/software-engineering-skills | 95 | MIT |
| FrancoStino/opencode-skills-collection | 90 | MIT |
| rmyndharis/antigravity-skills | 90 | MIT |
Database snapshot: 13.11.2026 · package version 49af13b117e8 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100scripting-bash
Master defensive Bash scripting for production automation, CI/CD pipelines, and system utilities. Expert in safe, portable, and testable shell scripts with POSIX compliance, modern Bash 5.x features, and comprehensive error handling. Use when writing shell scripts, bash… - 100linux-bash-scripting
Defensive Bash scripting for Linux: safe foundations, argument parsing, production patterns, ShellCheck compliance. Use when writing bash scripts, shell scripts, cron jobs, or CLI tools in bash. - 95bats-testing-patterns
Master Bash Automated Testing System (Bats) for comprehensive shell script testing. Use when writing tests for shell scripts, CI/CD pipelines, or requiring test-driven development of shell utilities. - 92write-script-bash
MUST use when writing Bash scripts. - 100linux-bash-scripting
Defensive Bash scripting for Linux: safe foundations, argument parsing, production patterns, ShellCheck compliance. Use when writing "bash script", "shell script", "linux automation", "system script", "cron job", "deployment script", "CLI tool in bash", or "automate with bash". - 100bats-testing-patterns
Master Bash Automated Testing System (Bats) for comprehensive shell script testing. Use when writing tests for shell scripts, CI/CD pipelines, or requiring test-driven development of shell utilities.