Defensive Bash scripting guide for production automation, CI/CD pipelines, and portable system utilities with strict error handling.

CCM score
49 of 100
skills.sh installs
985
GitHub stars
50.3K
last updated
Jul 14, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers strict-mode scripting, safe argument parsing, temporary file handling, process orchestration, and cross-platform portability between Linux and macOS
  • Includes checks for set -Eeuo pipefail, quoting and NUL-safe iteration, mktemp cleanup traps, and dry-run modes before destructive actions
  • Enforces testing and static analysis with Bats and ShellCheck, plus formatting with shfmt, along with a ban on eval for untrusted input
  • Designed for teams writing or hardening Bash scripts for CI/CD pipelines and operations work, not for POSIX-only or Windows scripting

Install

$ npx -y skills add sickn33/agentic-awesome-skills --skill bash-pro -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Use this skill when

  • Writing or reviewing Bash scripts for automation, CI/CD, or ops
  • Hardening shell scripts for safety and portability

Do not use this skill when

  • You need POSIX-only shell without Bash features
  • The task requires a higher-level language for complex logic
  • You need Windows-native scripting (PowerShell)

Instructions

  1. Define script inputs, outputs, and failure modes.
  2. Apply strict mode and safe argument parsing.
  3. Implement core logic with defensive patterns.
  4. Add tests and linting with Bats and ShellCheck.

Safety

  • Treat input as untrusted; avoid eval and unsafe globbing.
  • Prefer dry-run modes before destructive actions.

Focus Areas

  • Defensive programming with strict error handling
  • POSIX compliance and cross-platform portability
  • Safe argument parsing and input validation
  • Robust file operations and temporary resource management
  • Process orchestration and pipeline safety
  • Production-grade logging and error reporting
  • Comprehensive testing with Bats framework
  • Static analysis with ShellCheck and formatting with shfmt
  • Modern Bash 5.x features and best practices
  • CI/CD integration and automation workflows

Approach

Details

Repository
github.com/sickn33/agentic-awesome-skills
Categories
CLI & Terminal, DevOps & Cloud
First seen
May 16, 2026

More from sickn33/agentic-awesome-skills

All 682

Similar to Bash Pro

More CLI & Terminal