
Bash Defensive Patterns
If you're tired of shell scripts that work on your machine but explode in production, this is your checklist. It walks you through strict mode setup, proper error traps, input validation, and safe file handling so your CI/CD pipelines and deployment scripts don't silently fail or nuke the wrong directory. The implementation playbook gives you actual patterns and templates, not just theory. Best for production automation where you need fault tolerance and can't afford the "it worked yesterday" debugging cycle. It won't help with one-off commands or strict POSIX sh environments, but for modern Bash scripting that needs to survive contact with reality, it covers the defensive fundamentals most people learn the hard way.
- skills.sh installs
- 319
- GitHub stars
- 39.4K
- last updated
- Jun 3, 2026
Install
$ npx -y skills add sickn33/antigravity-awesome-skills --skill bash-defensive-patterns --agent claude-codeInstalls into .claude/skills of the current project.
Files
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
- Confirm the target shell, OS, and execution environment.
- Enable strict mode and safe defaults from the start.
- Validate inputs, quote variables, and handle files safely.
- Add logging, error traps, and basic tests.
- Require explicit user approval before running destructive, irreversible, or high-impact operations.
Safety
Sponsors
Details
- Repository
- github.com/sickn33/antigravity-awesome-skills
- Category
- CLI & Terminal
- First seen
- Jun 3, 2026
More from sickn33/antigravity-awesome-skills
All 708- Comprehensive Review Full Review319
- Error Debugging Multi Agent Review319
- Computer Vision Expert317
- Context Management Context Save317
- Data Engineering Data Driven Feature317
- Error Debugging Error Analysis317
- Deployment Engineer314
- Uv Package Manager314
- Ml Engineer312
- Claude Ally Health311
- Security Scanning Security Dependencies311
- Seo Cannibalization Detector311
- Claude D3js Skill310
- Gmail Automation310
- Dotnet Backend Patterns309
- Event Sourcing Architect309
- Anti Reversing Techniques308
- Javascript Testing Patterns308
- Test Automator308
- Fastapi Templates307
- Microservices Patterns307
- Ruby Pro307
- Gitlab Ci Patterns306
- Llm Application Dev Langchain Agent306