Install any skill in seconds. Free to start, no credit card required.
Get Started Free →dicklesworthstone/bash-defensive-patterns
Master defensive Bash programming techniques for production-grade scripts.
Passed 22 of 22 test cases with the skill, and 15 of 22 without it.
and 6 more in the full report
7 fixed15 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 7 test cases the skill fixed. Same model, same prompt, with and without the skill.
Write a Bash script snippet to determine the directory where the current script resides, handling physical paths correctly.
| Checked | Without skill | With skill |
|---|---|---|
| References the script path using BASH_SOURCE[0]. | Passed | Passed |
| Uses pwd -P to resolve physical directory paths. | Missed | Passed |
The instructions your model reads when the skill loads.
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.
Enable bash strict mode at the start of every script to catch errors early.
#!/bin/bash
set -Eeuo pipefail # Exit on error, unset variables, pipe failures
Key flags:
set -E: Inherit ERR trap in functionsset -e: Exit on any error (command returns non-zero)set -u: Exit on undefined variable referenceset -o pipefail: Pipe fails if any command fails (not just last)Implement proper cleanup on script exit or error.
#!/bin/bash
set -Eeuo pipefail
test cases passed, vs 15 / 22 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.