bash-defensive-patterns
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.
Third-Party Agent Skill: Review the code before installing. Agent skills execute in your AI assistant's environment and can access your files. Learn more about security
Installation for Agentic Skill
View all platforms →skilz install wshobson/agents/bash-defensive-patterns skilz install wshobson/agents/bash-defensive-patterns --agent opencode skilz install wshobson/agents/bash-defensive-patterns --agent codex skilz install wshobson/agents/bash-defensive-patterns --agent gemini
First time? Install Skilz: pip install skilz
Works with 22+ AI coding agents
Cursor, Aider, Copilot, Windsurf, Qwen, Kimi, and more...
Extract and copy to ~/.claude/skills/ then restart Claude Desktop
git clone https://github.com/wshobson/agents cp -r agents/plugins/shell-scripting/skills/bash-defensive-patterns ~/.claude/skills/ Need detailed installation help? Check our platform-specific guides:
Related Agentic Skills
shell-scripting-fundamentals
by TheBushidoCollectiveUse when writing or modifying Bash/shell scripts. Covers script structure, variables, quoting, conditionals, and loops with modern best practices.
shell-scripting
by sammcjPractical bash scripting guidance emphasising defensive programming, ShellCheck compliance, and simplicity. Use when writing shell scripts that need t...
search
by memorysaverThis skill should be used when the user needs to search for information, find files,look up content online, or retrieve data without providing input f...
shell-scripting
by einverneSpecialized knowledge of Bash and Zsh scripting, shell automation, command-line tools, and scripting best practices. Use when the user needs to write,...
Agentic Skill Details
- Repository
- agents
- Type
- Technical
- Meta-Domain
- cloud infrastructure
- Primary Domain
- linux
- Market Score
- 66.0
Agent Skill Grade
D
Score: 66/100
Click to see breakdown
Score Breakdown
Areas to Improve
- 534-line monolithic file loads entirely on every activation; defensive patterns could be extracted to on-demand references
- File exceeds 100 lines but has no TOC for navigation
- Each pattern includes full 20-40 line script; repetitive boilerplate (set -Eeuo pipefail, trap) in every example
Recommendations
- Focus on improving Pda (currently 14/30)
- Address 1 high-severity issues first
- Add trigger phrases to description for discoverability
Graded: 1/5/2026
Developer Feedback
I took a look at your bash-defensive-patterns skill and wanted to share some thoughts.
Links:
The TL;DR
You're at 66/100, which puts you in D territory. This is evaluated against Anthropic's best practices for agentic skills. Your strongest area is Spec Compliance (12/15) — the metadata and naming are solid. But Progressive Disclosure Architecture (14/30) is where you're losing the most points. The skill's a flat 534-line file that loads entirely every time, which isn't efficient for how agentic systems work.
What's Working Well
- Solid metadata: Your triggers ('production-grade scripts', 'CI/CD pipelines', 'fault tolerance') are specific and searchable. The skill name follows conventions perfectly.
- Comprehensive coverage: You actually cover the critical patterns — strict mode, error trapping, signal handling. This addresses a real gap in defensive Bash practices.
- Clear organization: Numbered patterns and section headers make manual navigation reasonable, even if it could be better.
- Practical scope: Good balance between providing complete patterns and letting users adapt them to their needs.
The Big One: Progressive Disclosure Architecture
This is your biggest opportunity. Right now, all 10 patterns plus advanced techniques live in one massive file. Users get everything whether they need it or not.
Here's the fix: Break it into a layered structure:
- Create a
references/directory with pattern-specific files:strict-mode.md,error-trapping.md,argument-parsing.md,cleanup-patterns.md, etc. - Reduce
SKILL.mdto an 80-line overview that summarizes each pattern and links to the references - This way, the main file loads fast, but users can dive into specific patterns on demand
Why this matters: Agentic systems load skill content for every activation. A 534-line file means you're burning tokens every single time, even when someone just needs one pattern. Splitting it up gets you +10 points and makes your skill way more efficient.
Other Things Worth Fixing
Add a table of contents — Files over 100 lines should have one. Just add a quick
## Contentswith links to your main sections after the frontmatter. (+1 point, takes 30 seconds)Cut the boilerplate in examples — Patterns 1-10 each show full 20-40 line scripts with repeated
set -Eeuo pipefailand trap setup. Reference a shared defensive template instead and show just the diff. This cuts verbosity in half and scores better on writing conciseness. (+2 points)Add validation workflow — No feedback loop currently. Add a "Verify Your Script" section with actual commands:
shellcheck -x script.shandbash -n script.sh. Users need to know how to test what they built. (+2 points)Include a quick-start template — At the end, provide one minimal script combining core patterns (strict mode + logging + arg parsing + cleanup). Users shouldn't have to mentally assemble pieces. (+1 point)
Quick Wins
- Split into references — Biggest impact, biggest effort. Gets you 10 points toward closing that PDA gap.
- Add TOC + cut example boilerplate — Easy wins, 3 points combined, takes maybe 20 minutes.
- Validation section + starter template — Another 3 points, rounds out the skill nicely.
You've got solid foundational content here. The main issue is packaging — make it lean, make it layered, and make it easy to verify. Fix these and you're looking at 80-85 range territory.
Checkout your skill here: SkillzWave.ai | SpillWave We have an agentic skill installer that install skills in 14+ coding agent platforms. Check out this guide on how to improve your agentic skills.
Browse Category
More cloud infrastructure Agentic SkillsReport Security Issue
Found a security vulnerability in this agent skill?