SkillAgentSearch skills...

bash-defensive-patterns

Master defensive Bash programming techniques for production-grade scripts

Install / Use

npx skills add wshobson/agents --skill bash-defensive-patterns

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

75/100

Category

Automation

Supported Platforms

Universal

Our assessment of bash-defensive-patterns

bash-defensive-patterns scores 75/100 on our quality scale, 985th of 1,267 Automation skills we index.

Its SKILL.md is 1.9 KB long, split into 4 sections and no code examples: moderately detailed.

With 39,920 GitHub stars, it is one of the more widely adopted skills in the catalogue.

Substance
20/30
Structure
8/20
Description
12/15
Adoption
20/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated 5 days ago, so bash-defensive-patterns is actively maintained.
  • It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
  • Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

Safety scan

No issues found

Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands.

Automated pattern scan on 2026-09-25. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.

bash-defensive-patterns compared with similar skills

All 4 of these similar skills score higher than bash-defensive-patterns; compare them before choosing.

SkillScoreStarsUpdatedFormat
bash-defensive-patterns (this skill)by wshobson7539.9k5d agoSKILL.md
Agent-Reachby Panniantong10085.4k10d agoCLAUDE.md
rufloby ruvnet10073.3k1d agoCLAUDE.md
Scraplingby D4Vinci10083.7ktodayMCP Server
algorithmic-artby anthropics100177.9k3d agoSKILL.md

Frequently asked questions

How do I install bash-defensive-patterns?
Run npx skills add wshobson/agents --skill bash-defensive-patterns. The install tabs above show the steps for each supported agent.
Which AI agents does bash-defensive-patterns work with?
It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
Is bash-defensive-patterns safe to use?
Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. It is MIT-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is bash-defensive-patterns still maintained?
The repository was last updated 5 days ago, so bash-defensive-patterns is actively maintained.

name: bash-defensive-patterns description: 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.

Bash Defensive Patterns

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.

When to Use This Skill

  • Writing production automation scripts
  • Building CI/CD pipeline scripts
  • Creating system administration utilities
  • Developing error-resilient deployment automation
  • Writing scripts that must handle edge cases safely
  • Building maintainable shell script libraries
  • Implementing comprehensive logging and monitoring
  • Creating scripts that must work across different platforms

Detailed patterns and worked examples

Detailed pattern documentation lives in references/details.md. Read that file when the navigation tier above is insufficient.

Best Practices Summary

  1. Always use strict mode - set -Eeuo pipefail
  2. Quote all variables - "$variable" prevents word splitting
  3. Use [[]] conditionals - More robust than [ ]
  4. Implement error trapping - Catch and handle errors gracefully
  5. Validate all inputs - Check file existence, permissions, formats
  6. Use functions for reusability - Prefix with meaningful names
  7. Implement structured logging - Include timestamps and levels
  8. Support dry-run mode - Allow users to preview changes
  9. Handle temporary files safely - Use mktemp, cleanup with trap
  10. Design for idempotency - Scripts should be safe to rerun
  11. Document requirements - List dependencies and minimum versions
  12. Test error paths - Ensure error handling works correctly
  13. Use command -v - Safer than which for checking executables
  14. Prefer printf over echo - More predictable across systems

Related Skills

View on GitHub
GitHub Stars39.9k
CategoryAutomation
Updated5d ago
Forks4.3k

Languages

Python

Trust signals

100/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

No cautions