Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
josiahsiegel avatar

Bash Master

  • 413 installs
  • 50 repo stars
  • Updated June 18, 2026
  • josiahsiegel/claude-plugin-marketplace

bash-master is a Claude agent skill that writes, reviews, and hardens Bash shell scripts with Bash 5.3 patterns, ShellCheck validation, and Google Shell Style Guide compliance for developers automating dev and CI workflo

About

bash-master is an expert Bash scripting skill from the josiahsiegel/claude-plugin-marketplace that activates for script creation, DevOps automation, CI/CD pipelines, build scripts, and debugging across Linux, macOS, Windows Git Bash, and containers. It enforces Google Shell Style Guide formatting, ShellCheck v0.11.0 checks, POSIX portability, set -euo pipefail error handling, injection prevention, and optional BATS testing. The parent Bash Master plugin v2.0.0 bundles 10 related skills covering arrays, parallel processing, and security-first 2025 patterns. Developers reach for bash-master when converting manual commands into production shell glue, reviewing fragile scripts, or building cross-platform automation under roughly 50 lines per Google style guidance.

  • Idiomatic Bash scripts
  • Error handling patterns
  • CLI automation
  • Pipeline glue
  • Cross-tool scripting

Bash Master by the numbers

  • 413 all-time installs (skills.sh)
  • +7 installs in the week ending Aug 2, 2026 (Skillselion tracking)
  • Ranked #133 of 550 CLI & Terminal skills by installs in the Skillselion catalog
  • Data as of Aug 3, 2026 (Skillselion catalog sync)
npx skills add https://github.com/josiahsiegel/claude-plugin-marketplace --skill bash-master

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs413
repo stars50
Last updatedJune 18, 2026
Repositoryjosiahsiegel/claude-plugin-marketplace

How do you write production-safe Bash automation scripts?

Write, debug, and automate Bash scripts for local dev workflows, CI tasks, file transforms, and shell glue connecting tools during implementation.

Who is it for?

Developers writing DevOps, CI/CD, build, or local automation shell scripts who want ShellCheck-clean, portable Bash with modern 5.3 features.

Skip if: Developers building application logic in Python, Go, or Node who do not need shell glue, or teams standardized on PowerShell-only automation.

When should I use this skill?

The task mentions bash, shell, script, CI automation, deployment glue, or asks to review, debug, or convert commands into a shell script.

What you get

ShellCheck-validated Bash scripts with Google Style formatting, robust error handling, security hardening, and optional BATS test scaffolding.

  • production Bash script
  • ShellCheck-clean automation
  • optional BATS test file

By the numbers

  • Parent Bash Master plugin v2.0.0 bundles 10 related bash scripting skills
  • Targets ShellCheck v0.11.0 and Bash 5.3 feature patterns

Files

SKILL.mdMarkdownGitHub ↗

Bash Scripting Mastery

Scope and platform contract

This skill targets Bash itself, wherever Bash runs - Linux, macOS, WSL, Git Bash / MSYS2 on Windows, and Bash-based container images. It does not cover native PowerShell: a PowerShell script is a different language and should use powershell-master. On Windows, bash-master assumes the user is running Bash inside Git Bash, WSL, or a similar Bash environment, and addresses the MSYS path-translation quirks that result.

Repository conventions

Project-level conventions (Windows backslashes in tool calls, documentation discipline, etc.) live in the agent body and the windows-path-master plugin. This skill focuses on Bash content; do not duplicate that boilerplate here.

Quick reference

#!/usr/bin/env bash
set -euo pipefail  # Exit on error, undefined vars, pipe failures
IFS=$'\n\t'        # Safe word splitting
# Run shellcheck your_script.sh before deployment.
# Test on every target platform before production.

Bash-portability quick check:

# Linux/macOS:       Full bash features
# Git Bash (Windows): Most features, some system calls missing (no systemd, /proc differs)
# WSL:               Effectively Linux; /mnt/c for Windows filesystem
# Containers:        Depends on base image - alpine ships /bin/sh, not bash
# POSIX mode:        Use /bin/sh and avoid bashisms

When to use this skill

Always activate for:

  • Writing or modifying any bash/shell script
  • Reviewing or refactoring existing scripts
  • Debugging shell script failures
  • DevOps automation, CI/CD pipelines, system administration
  • Cross-environment Bash portability (Linux <-> macOS <-> WSL <-> Git Bash <-> container)

Do not use this skill for:

  • PowerShell scripts - use powershell-master
  • Batch (.cmd/.bat) scripting
  • Generic command help unrelated to scripting

Core principles

1. Safety first

Every script should open with the safety preamble:

#!/usr/bin/env bash
set -e            # Exit on any error
set -u            # Exit on undefined variable
set -o pipefail   # Catch failures mid-pipeline
set -E            # Inherit ERR trap into functions
IFS=$'\n\t'       # Avoid word splitting on spaces

readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
readonly SCRIPT_NAME="$(basename "${BASH_SOURCE[0]}")"

2. POSIX vs Bash

Need to run on any UNIX sh#!/bin/sh, no [[ ]], no arrays, no process substitution
Modern Linux/macOS with Bash#!/usr/bin/env bash, prefer [[ ]], arrays, regex
Alpine/minimal containersEither install bash explicitly or write POSIX-compliant sh

3. Quoting

# Always quote expansions
process "$file_path"        # correct
process $file_path          # word-splitting bug

# Arrays
files=("file 1.txt" "file 2.txt")
process "${files[@]}"       # each element kept separate
process "${files[*]}"       # joined as one string - usually wrong

4. ShellCheck

Run shellcheck on every script. Only disable warnings with a justification comment: # shellcheck disable=SC2086 reason: intentional word splitting.

See references/best_practices.md for the full quoting/style table and references/patterns_antipatterns.md for the common pitfalls.

Platform-specific considerations

Git Bash / MSYS2 (Windows)

Git Bash auto-converts Unix-style arguments to Windows paths. This is the largest single source of cross-platform Bash bugs on Windows.

# The conversion: /foo becomes C:/Program Files/Git/usr/foo
# Disable per-command:
MSYS_NO_PATHCONV=1 command /path/that/should/stay/unix

# Manual conversion
unix_path=$(cygpath -u "C:\Windows\System32")
win_path=$(cygpath -w "/c/Users/username")

# Detect Git Bash
if [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "mingw"* ]]; then
    : # Git Bash
fi
case "${MSYSTEM:-}" in
    MINGW64|MINGW32|MSYS) : ;;  # MSYS2 / Git Bash environment
esac

# Flags that look like paths
command //e //s   # double-slash to suppress conversion
command -e -s     # or use dash-options

Full Git Bash + Windows path notes live in references/windows-git-bash-paths.md.

Linux

GNU coreutils, /proc, systemd integration. Detect via [[ "$OSTYPE" == "linux-gnu"* ]].

macOS

BSD utilities behave differently from GNU. Most common gotchas: sed -i '' (empty string required), date flags differ, readlink -f not available on stock macOS.

if command -v gsed >/dev/null; then SED=gsed; else SED=sed; fi

WSL

Effectively Linux. The Windows filesystem is mounted at /mnt/c/. Detect via grep -qi microsoft /proc/version.

Containers

Alpine images ship only /bin/sh (BusyBox). Write POSIX-compliant scripts or apk add bash. Container init quirks: PID 1 must reap children and handle signals. Detect via [ -f /.dockerenv ] or [ -n "$KUBERNETES_SERVICE_HOST" ].

Portable platform-detection template

detect_platform() {
    case "$OSTYPE" in
        linux-gnu*)    echo "linux" ;;
        darwin*)       echo "macos" ;;
        msys*|cygwin*) echo "windows" ;;
        *)             echo "unknown" ;;
    esac
}

Full per-platform tables (BSD-vs-GNU coreutils flags, WSL networking, container init patterns) live in references/platform_specifics.md.

Best practices (summary)

The full patterns - function design, error handling, input validation, argument parsing, logging - live in references/in-depth-patterns.md. The headline rules:

  • One concern per function; locals declared first; validate input; return non-zero on error.
  • Constants UPPER_CASE; locals lower_case; mark immutable values readonly.
  • Always check exit codes (if ! cmd, ||, traps, or a central error_exit helper).
  • Validate every external input - empty, format, length, charset.
  • Use getopts or a case-based argument parser; print usage and exit 1 on bad input.
  • Use a leveled logger that writes to stderr.

Security, performance, testing, debugging, advanced patterns

These each have dedicated sections in references/in-depth-patterns.md:

TopicWhat it covers
SecurityCommand-injection prevention, path-traversal guards, privilege management, secure temp files
PerformanceAvoiding subshells, bash built-ins vs externals, process substitution, array ops
TestingBATS unit tests, integration test patterns, CI/CD wiring
Debuggingset -x, PS4, conditional debug helpers, tracing and profiling
Advanced patternsSafe config parsing, parallel processing, signal handling, retries with backoff

Read that reference any time you need the canonical code template for one of those topics.

Reference files

  • `references/platform_specifics.md` - Detailed platform differences and workarounds
  • `references/best_practices.md` - Comprehensive industry standards and guidelines
  • `references/patterns_antipatterns.md` - Common patterns and pitfalls with solutions
  • `references/windows-git-bash-paths.md` - Git Bash / MSYS path-translation reference
  • `references/in-depth-patterns.md` - Function design, security, performance, testing, debugging, advanced patterns
  • `references/resources.md` - Official docs, style guides, tooling, and learning links

Success criteria

A Bash script written with this skill should:

1. Pass shellcheck with no warnings 2. Begin with set -euo pipefail 3. Quote every variable expansion 4. Print usage on -h/--help 5. Decompose into testable functions 6. Handle empty input, missing files, and unexpected arguments 7. Run on every target platform (Linux/macOS/WSL/Git Bash/container) where it claims support 8. Match the Google Shell Style Guide 9. Clean up on exit (trap EXIT) 10. Be unit-tested with BATS where logic is non-trivial

# Pre-deployment checklist
shellcheck script.sh
bash -n script.sh
bats test/script.bats
./script.sh --help
DEBUG=true ./script.sh

Troubleshooting

Script fails on a different platform

  • checkbashisms script.sh to surface non-portable constructs.
  • command -v tool to verify a required tool is installed.
  • Diff command flags between GNU and BSD (sed --version etc.).

ShellCheck warnings

  • Read the rule explanation (shellcheck -W SC2086).
  • Fix the underlying issue; only disable a rule with a justification comment.

Works interactively but fails in cron

  • Cron has a minimal PATH - set PATH explicitly.
  • Use absolute paths.
  • Redirect stdout/stderr: ./script.sh >> /tmp/cron.log 2>&1.

Performance issues

  • Profile with time.
  • Enable set -x to find slow steps.
  • Replace external invocations with Bash built-ins where possible.

Related skills

How it compares

Use bash-master over generic shell help when you need ShellCheck-enforced, style-guide-compliant scripts for CI/CD and cross-platform DevOps automation.

FAQ

When should bash-master activate?

bash-master activates for any Bash or shell script task, including system automation, DevOps and CI/CD pipelines, build and deployment scripts, script review or debugging, and converting manual commands into reusable shell glue across platforms.

What quality standards does bash-master enforce?

bash-master enforces Google Shell Style Guide formatting, ShellCheck v0.11.0 validation, POSIX portability where needed, set -euo pipefail error handling, command-injection prevention, and optional BATS unit tests for production-ready scripts.

Does bash-master support Windows environments?

bash-master explicitly covers cross-platform compatibility for Linux, macOS, Windows Git Bash and WSL, and containerized environments, including Git Bash path conversion patterns documented in the broader Bash Master plugin.

CLI & Terminaldevopsbackend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.