bash-conventions

Enforce secure, portable Bash scripting practices with ShellCheck compliance.

8|Updated Feb 9, 2026
One-click install
npx skills add https://github.com/zb-ss/opencode-workflows --skill bash-conventions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bash-conventions
Source: https://github.com/zb-ss/opencode-workflows/tree/main/skill/bash-conventions
Command: npx skills add https://github.com/zb-ss/opencode-workflows --skill bash-conventions

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide and best practices for writing secure, portable, and maintainable Bash scripts, reducing errors and improving script reliability.

Core Features & Use Cases

  • Error Handling: Implements robust error checking, traps, and safe variable handling.
  • Portability: Offers guidance on writing scripts that work across different Unix-like systems.
  • Testing: Includes examples for testing Bash scripts using BATS.
  • Use Case: Ensure your deployment scripts are safe, don't fail unexpectedly, and run consistently across development, staging, and production environments.

Quick Start

Apply the bash-conventions skill to review and improve the provided script for better error handling and portability.

Frequently Asked Questions about bash-conventions

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

FAQPage Schema
How do I write robust Bash scripts with proper error handling?

To write robust Bash scripts, implement error traps, enable safe variable handling, and validate inputs to ensure scripts fail predictably and securely without unexpected execution.

What is the best way to make shell scripts portable across Unix-like systems?

Making shell scripts portable requires following standard conventions, avoiding platform-specific syntax, and applying portability guidelines to ensure consistent execution across different Unix-like environments.

How do I test Bash scripts using BATS?

Testing Bash scripts using BATS involves writing test cases that validate script functions and command execution, ensuring maintainability and verifying behavior before deployment.

Does ShellCheck compliance improve shell scripting security?

ShellCheck compliance improves shell scripting security by identifying common pitfalls and syntax errors, enforcing best practices for secure, maintainable scripts with robust argument parsing and safe command execution.

Why do my Bash deployment scripts fail unexpectedly across different environments?

Bash deployment scripts fail unexpectedly due to poor error handling, unvalidated inputs, and platform-specific dependencies. Implementing traps, safe variables, and portability practices prevents inconsistent runtime failures.