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.
86
Quality
81%
Does it follow best practices?
Impact
96%
1.09xAverage score across 3 eval scenarios
Passed
No known issues
Strict mode and error trapping
Strict mode present
66%
100%
ERR trap
100%
100%
EXIT trap with cleanup
100%
100%
mktemp for temp dir
100%
100%
Required var validation
80%
100%
Variables quoted
100%
100%
Command substitution style
100%
100%
Double-bracket conditionals
100%
100%
No root requirement
100%
100%
Error messages to stderr
100%
100%
Shebang line
75%
100%
Without context: $0.4116 · 1m 39s · 18 turns · 18 in / 5,774 out tokens
With context: $0.8099 · 2m 50s · 29 turns · 909 in / 10,335 out tokens
Argument parsing and structured logging
Strict mode present
66%
100%
while/case arg parsing
90%
100%
Short and long flags
100%
100%
usage() function
100%
100%
Dry-run wrapper
58%
100%
DRY_RUN default value
100%
100%
Structured logging functions
100%
100%
Logging to stderr
100%
50%
Dependency check function
100%
100%
Uses command -v
100%
100%
Missing required arg error
100%
100%
Without context: $0.7557 · 3m 10s · 25 turns · 74 in / 12,162 out tokens
With context: $0.7633 · 2m 14s · 32 turns · 78 in / 8,395 out tokens
Safe file iteration and idempotent design
Strict mode present
66%
100%
NUL-safe find iteration
100%
100%
Atomic report write
100%
100%
Idempotent skip logic
100%
100%
Double-bracket conditionals
100%
100%
Function naming prefix
100%
100%
local -r variables
0%
100%
Array usage
0%
0%
Variables consistently quoted
100%
100%
EXIT trap cleanup
100%
100%
Rerun safety demonstrated
100%
100%
Without context: $0.2602 · 1m 5s · 11 turns · 12 in / 3,893 out tokens
With context: $0.8777 · 3m 23s · 31 turns · 152 in / 12,281 out tokens
9c177eb
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.