Skip to main content
Back to registry

bash-defensive-patterns

wshobson/agents

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.

Installs3
Install command
npx skills add https://github.com/wshobson/agents --skill bash-defensive-patterns
Security audits
Gen Agent Trust HubPASS
SocketPASS
SnykWARN
About this skill
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. Key flags: Implement proper cleanup on script exit or error. Always quote variables to prevent word splitting and globbing issues. Use arrays safely for complex data handling. Use [[ ]] for Bash-specific features, [ ] for POSIX. - 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 - set -E : Inherit ERR trap in functions - set -e : Exit on any error (command returns non-zero) - set -u : Exit on undefined variable reference - set -o pipefail : Pipe fails if any command fails (not just last) - Always use strict mode - set -Eeuo pipefail - Quote all variables - "$variable" prevents word splitting - Use [[]] conditionals - More robust than [ ] - Implement error trapping - Catch and handle errors gracefully - Validate all inputs - Check file existence, permissions, formats - Use functions...

Source description provided by the upstream skill listing. Community reviews and install context appear in the sections below.

Community Reviews

Latest reviews

Sign in to review

No community reviews yet. Be the first to review.

Browse this skill in context
FAQ
What does bash-defensive-patterns do?

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.

Is bash-defensive-patterns good?

bash-defensive-patterns does not have approved reviews yet, so SkillJury cannot publish a community verdict.

What agent does bash-defensive-patterns work with?

bash-defensive-patterns currently lists compatibility with Agent compatibility has not been published yet..

What are alternatives to bash-defensive-patterns?

Skills in the same category include telegram-bot-builder, flutter-app-size, sharp-edges, iterative-retrieval.

How do I install bash-defensive-patterns?

npx skills add https://github.com/wshobson/agents --skill bash-defensive-patterns

Related skills

More from wshobson/agents

Related skills

Alternatives in Software Engineering