bash-defensive-patterns

23399 stars 2594 forks
66
D

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.

Marketplace
Also in: ci cd

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 assistants

Cursor, Aider, Copilot, Windsurf, Qwen, Kimi, and more...

View All Agents
Download Agent Skill ZIP

Extract and copy to ~/.claude/skills/ then restart Claude Desktop

1. Clone the repository:
git clone https://github.com/wshobson/agents
2. Copy the agent skill directory:
cp -r agents/plugins/shell-scripting/skills/bash-defensive-patterns ~/.claude/skills/

Need detailed installation help? Check our platform-specific guides:

Related Agentic Skills

Agentic Skill Details

Repository
agents
Stars
23399
Forks
2594
Type
Technical
Meta-Domain
cloud infrastructure
Primary Domain
linux
Market Score
66

Agent Skill Grade

D
Score: 66/100 Click to see breakdown

Score Breakdown

Spec Compliance
12/15
PDA Architecture
14/30
Ease of Use
20/25
Writing Style
7/10
Utility
15/20
Modifiers: -2

Areas to Improve

  • No Progressive Disclosure Architecture
  • Missing Table of Contents
  • Verbose Code Examples

Recommendations

  • Focus on improving Pda (currently 14/30)
  • Address 1 high-severity issues first
  • Add trigger phrases to description for discoverability

Graded: 2026-01-05

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.md to an 80-line overview that summarizes each pattern and links to the references
  • This way, the main file ...

Report Security Issue

Found a security vulnerability in this agent skill?