bash-pro

Apply defensive Bash scripting practices with strict error handling and portable POSIX compatibility.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/AndyAnh174/wellness --skill bash-pro-andyanh174
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bash-pro
Source: https://github.com/AndyAnh174/wellness/tree/main/.agent/skills/bash-pro
Command: npx skills add https://github.com/AndyAnh174/wellness --skill bash-pro-andyanh174

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Defensive Bash scripting mitigates runtime failures and promotes portable, maintainable automation across environments.

Core Features & Use Cases

  • Strict error handling with set -Eeuo pipefail and trap EXIT for reliable failure reporting
  • POSIX-friendly scripting with cross-platform compatibility and portable shebangs
  • Safe argument parsing, input validation, and safe temporary resource management
  • Comprehensive logging, testability, and static analysis readiness (ShellCheck, shfmt)

Quick Start

Enable strict mode with set -Eeuo pipefail and implement safe argument parsing in your Bash scripts.

Frequently Asked Questions about bash-pro

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write a defensive Bash script for reliable CI/CD automation?

Defensive Bash scripting uses strict error handling with set -Eeuo pipefail and trap EXIT to ensure reliable CI/CD automation. This approach enforces safe parameter parsing and portable POSIX compatibility across cross-platform shell environments.

What is the best way to handle errors and failures in shell scripting?

The best way to handle errors in shell scripting is applying strict mode with set -Eeuo pipefail and implementing trap EXIT. This guarantees robust logging and reliable failure reporting for production automation without silent runtime errors.

Does defensive Bash scripting work for cross-platform POSIX compatibility?

Yes, defensive Bash scripting supports cross-platform POSIX compatibility using portable shebangs and Bash 4.x/5.x features. It ensures scripts run reliably across different system utilities and shell environments with strict error handling.

How do I make Bash scripts idempotent and ready for static analysis?

Make Bash scripts idempotent and ready for static analysis by integrating ShellCheck and shfmt. Safe temporary resource management and comprehensive logging ensure testable, maintainable scripts that pass static analysis checks reliably.

Why does my Bash automation fail silently in production pipelines?

Bash automation fails silently when strict error handling is missing. Implementing set -Eeuo pipefail alongside safe argument parsing and input validation prevents unchecked runtime failures and ensures robust logging in production pipelines.