Tooluck logoTooluck
SKILL.md

bash-defensive-patterns

Agent skill fromrmyndharis/antigravity-skills

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 to install bash-defensive-patterns

install bash-defensive-patterns
# install the antigravity-skills pack with the skills CLI
npx skills add rmyndharis/antigravity-skills

# or add only this skill to Claude Code: copy the folder

skills/bash-defensive-patterns/

# into

~/.claude/skills/bash-defensive-patterns/ (all projects)

.claude/skills/bash-defensive-patterns/ (one project)

skills/bash-defensive-patterns/SKILL.md

MITFull file
1# Bash Defensive Patterns
2
3Comprehensive guidance for writing production-ready Bash scripts using defensive programming techniques, error handling, and safety best practices to prevent common pitfalls and ensure reliability.
4
5## Use this skill when
6
7- Writing production automation scripts
8- Building CI/CD pipeline scripts
9- Creating system administration utilities
10- Developing error-resilient deployment automation
11- Writing scripts that must handle edge cases safely
12- Building maintainable shell script libraries
13- Implementing comprehensive logging and monitoring
14- Creating scripts that must work across different platforms
15
16## Do not use this skill when
17
18- You need a single ad-hoc shell command, not a script
19- The target environment requires strict POSIX sh only
20- The task is unrelated to shell scripting or automation
21
22## Instructions
23
241. Confirm the target shell, OS, and execution environment.
252. Enable strict mode and safe defaults from the start.
263. Validate inputs, quote variables, and handle files safely.
274. Add logging, error traps, and basic tests.
28
29## Safety
30
31- Avoid destructive commands without confirmation or dry-run flags.
32- Do not run scripts as root unless strictly required.
33
34Refer to `resources/implementation-playbook.md` for detailed patterns, checklists, and templates.
35
36## Resources
37
38- `resources/implementation-playbook.md` for detailed patterns, checklists, and templates.

Excerpt shown under the repository's MIT license.

More skills in antigravity-skills

Keep exploring

Similar skill repositories

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates