sickn33 avatar

Bash Defensive Patterns

If you're tired of shell scripts that work on your machine but explode in production, this is your checklist. It walks you through strict mode setup, proper error traps, input validation, and safe file handling so your CI/CD pipelines and deployment scripts don't silently fail or nuke the wrong directory. The implementation playbook gives you actual patterns and templates, not just theory. Best for production automation where you need fault tolerance and can't afford the "it worked yesterday" debugging cycle. It won't help with one-off commands or strict POSIX sh environments, but for modern Bash scripting that needs to survive contact with reality, it covers the defensive fundamentals most people learn the hard way.

skills.sh installs
319
GitHub stars
39.4K
last updated
Jun 3, 2026

Install

$ npx -y skills add sickn33/antigravity-awesome-skills --skill bash-defensive-patterns --agent claude-code

Installs into .claude/skills of the current project.

Files

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.

Use this skill when

  • 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

Do not use this skill when

  • You need a single ad-hoc shell command, not a script
  • The target environment requires strict POSIX sh only
  • The task is unrelated to shell scripting or automation

Instructions

  1. Confirm the target shell, OS, and execution environment.
  2. Enable strict mode and safe defaults from the start.
  3. Validate inputs, quote variables, and handle files safely.
  4. Add logging, error traps, and basic tests.
  5. Require explicit user approval before running destructive, irreversible, or high-impact operations.

Safety

Sponsors

Details

Repository
github.com/sickn33/antigravity-awesome-skills
Category
CLI & Terminal
First seen
Jun 3, 2026

More from sickn33/antigravity-awesome-skills

All 708
1paulrberg avatarcli-castpaulrberg/agent-skillsUse for Foundry cast/on-chain actions: prepare, simulate, sign, or broadcast transactions; call contracts; sign messages; encode/decode ABI/calldata; or make RP308skills.sh installs
2airtable avatarairtable-cliairtable/skillsLists bases, reads and writes records, manages tables and fields, filters and searches data in Airtable via the airtable-mcp CLI. Use when the task involves Air263skills.sh installs
3sickn33 avatarposix-shell-prosickn33/antigravity-awesome-skillsposix shell pro250skills.sh installs
4huggingface avatarhugging-face-clihuggingface/skillsExecute Hugging Face Hub operations using the `hf` CLI. Use when the user needs to download models/datasets/spaces, upload files to Hub repositories, create rep249skills.sh installs
5glebis avatarllm-cliglebis/claude-skillsProcess textual and multimedia files with various LLM providers using the llm CLI. Supports both non-interactive and interactive modes with model selection, con234skills.sh installs
6n8n-io avatarn8n-clin8n-io/n8nUse the n8n CLI to manage workflows, credentials, executions, and more on an n8n instance. Use when the user asks to interact with n8n, automate workflows, mana209skills.sh installs