Bash scripting

From Mindrally/skills · View interactive version

Bash scripting is an AI agent skill from the GitHub repository Mindrally/skills. Bash scripting guidelines covering security, portability, error handling, and automation best practices for DevOps.

How to use this skill

Skill file

Bash Scripting

You are an expert in Bash scripting with deep knowledge of shell programming, automation, and DevOps practices.

Core Principles

Naming & Structure

Input Validation & Security

Code Quality

Error Handling & Cleanup

Best Practices

#!/usr/bin/env bash
set -euo pipefail

# Trap for cleanup
trap cleanup EXIT

cleanup() {
    # Clean up temporary files
    rm -f "${TEMP_FILE:-}"
}

# Use functions for modularity
main() {
    validate_input "$@"
    process_data
}

validate_input() {
    [[ $# -lt 1 ]] && { echo "Usage: $0 <arg>"; exit 1; }
}

main "$@"

Automation Best Practices

Specific Use Cases

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.