bash-pro

Write defensive Bash scripts with strict error handling and input validation.

Updated Feb 21, 2026
One-click install
npx skills add https://github.com/HCMUTE-RTIC/fit-hcmute --skill bash-pro-hcmute-rtic
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bash-pro
Source: https://github.com/HCMUTE-RTIC/fit-hcmute/tree/main/.agent/skills/bash-pro
Command: npx skills add https://github.com/HCMUTE-RTIC/fit-hcmute --skill bash-pro-hcmute-rtic

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill empowers users to write robust, secure, and portable Bash scripts for production automation, CI/CD pipelines, and system utilities, mitigating common pitfalls.

Core Features & Use Cases

  • Defensive Scripting: Enforces strict error handling, input validation, and safe resource management.
  • Portability & Compliance: Ensures scripts work across different systems and adhere to POSIX standards where needed.
  • CI/CD Integration: Provides patterns and tools for seamless integration into automated workflows.
  • Use Case: Develop a CI/CD pipeline script that safely deploys application updates, including pre-deployment checks, rollback mechanisms, and detailed logging, ensuring reliability and security.

Quick Start

Use the bash-pro skill to generate a template for a new, defensively programmed Bash script.

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 production automation?

Defensive Bash scripting enforces strict error handling, input validation, and safe resource management to prevent common pitfalls. It ensures your production automation scripts run reliably by catching failures early and managing processes robustly.

How do I make Bash scripts portable and POSIX compliant?

Portable Bash scripts adhere to POSIX standards and avoid system-specific features where needed. This ensures scripts work across different systems and environments, maintaining consistent behavior in CI/CD pipelines and system utilities.

How do I integrate ShellCheck and bats-core into CI/CD pipelines?

You integrate ShellCheck for static analysis and bats-core for testing by adding them as pipeline steps. This validates script syntax and verifies behavior automatically, ensuring safe deployment scripts pass checks before reaching production.

What is the best way to handle errors and logging in CI/CD deployment scripts?

The best way to handle errors in CI/CD deployment scripts is implementing strict error handling, pre-deployment checks, rollback mechanisms, and detailed logging. This approach mitigates failures and ensures reliable, secure application updates.

Can I use modern Bash features while maintaining POSIX compliance for system utilities?

You can use modern Bash features while maintaining POSIX compliance by selectively applying them where portability is not required. Scripts should target POSIX standards for cross-system compatibility and use modern features only when supported by the execution environment.

Why does my Bash script fail silently in CI/CD pipelines?

Bash scripts fail silently when strict error handling is missing. Defensive scripting fixes this by enforcing settings that stop execution on errors, validating inputs, and adding detailed logging to capture exact failure points.