Bash Defensive Patterns
Defensive Bash guidance for production scripts covering strict mode, input validation, safe file handling, and logging.
- CCM score
- 43 of 100
- skills.sh installs
- 319
- GitHub stars
- 50.5K
- last updated
- Jun 3, 2026
Own this skill? Claim it
What it does
- Covers strict mode setup, quoting and input validation, safe file handling, error traps, logging, and basic script tests
- Includes a playbook at
resources/implementation-playbook.mdwith patterns, checklists, and templates for shell scripts - Requires explicit approval before destructive or irreversible actions and provides dry-run flags before modifying operations
- Designed for CI/CD pipelines, system administration utilities, and deployment automation that must tolerate edge cases
Install
$ npx -y skills add sickn33/agentic-awesome-skills --skill bash-defensive-patterns -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
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
Details
- Repository
- github.com/sickn33/agentic-awesome-skills
- Categories
- CLI & Terminal, DevOps & Cloud, Security
- First seen
- Jun 3, 2026
Questions
What does the bash-defensive-patterns skill do?
bash-defensive-patterns guides an agent in writing production-grade Bash scripts with strict mode, quoted variables, safe file handling, input validation, logging and error traps. It is meant for CI/CD pipelines, deployment automation and system utilities that must tolerate faults.
Who should use the bash-defensive-patterns skill?
bash-defensive-patterns suits developers building production automation scripts, CI/CD pipeline scripts or system administration utilities. It is not meant for a single ad-hoc shell command or for targets that require strict POSIX sh only.
How do I install the bash-defensive-patterns skill?
Run npx -y skills add sickn33/agentic-awesome-skills --skill bash-defensive-patterns -y inside your project. Once installed, the agent can apply bash-defensive-patterns when writing robust shell scripts, and it asks for approval before any destructive operation.
More from sickn33/agentic-awesome-skills
All 682- 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
- 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
- Claude Code Guide301
Similar to Bash Defensive Patterns
More CLI & Terminalbash-prosickn33/agentic-awesome-skills985 installsDefensive Bash scripting guide for production automation, CI/CD pipelines, and portable system utilities with strict error handling.
bash-scriptingsickn33/agentic-awesome-skills2.5K installsPhased workflow index for building production-ready bash scripts with defensive patterns, error handling, and testing.
shellpproenca/dot-skills717 installsShell scripting guide of 49 rules for safe, portable, and maintainable bash and POSIX sh scripts.
shellcheck-configurationwshobson/agents12.3K installsSetup and triage guide for ShellCheck static analysis, covering shell script linting, suppressions, and portability.
bash-masterjosiahsiegel/claude-plugin-marketplace467 installsExpert Bash scripting guide covering safety, portability across Linux, macOS, WSL, Git Bash, and containers.