Agent skill · software engineering · aiskillstore

shell-scripting

Specialized knowledge of Bash and Zsh scripting, shell automation, command-line tools, and scripting best practices. Use when the user needs to write, debug, or optimize shell scripts, work with command-line tools, automate tasks with bash/zsh, or asks for shell script help.

Why this skill is useful

Provides specialized knowledge of Bash and Zsh scripting patterns and best practices that the AI wouldn't reliably generate on its own.

What it needs

About 2k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

Shell Scripting Expert Expert guidance for writing robust, maintainable Bash and Zsh scripts with best practices for automation and command-line tool usage. Script Structure Essentials Start every script with: set -e: Exit on error set -u: Error on undefined variables set -o pipefail: Catch errors in pipes IFS= \n\t': Safer word splitting Critical Best Practices 1. Always quote variables: "$variable" not $variable 2. Use [[ for conditionals (Bash): if [[ "$var" == "value" ]]; then 3. Check command existence: if command -v git &> /dev/null; then 4. Avoid parsing ls: Use globs or find instead 5. Use arrays for lists: files=("file1" "file2") not space-separated strings 6. Handle errors with traps: Common Patterns Argument Parsing Safe File Iteration User Confirmation Colored Output Modern Tool Alternatives When appropriate, suggest these modern replacements: ripgrep (rg) → faster than grep fd → faster than find fzf → interactive filtering jq → JSON processing yq → YAML processing bat → cat with syntax highlighting eza → enhanced ls Function Organization Zsh-Specific Features When user specifies Zsh: Advanced globbing: /.txt (recursive), .txt~test (exclude pattern) Parameter expansion: ${var:u} (uppercase), ${var:l} (lowercase) Associative arrays: typeset -A hash; hash[key]=value Extended globbing: Enable with setopt extendedglob Security Considerations Never eval untrusted input Validate user input before use Use mktemp for temporary files: TEMPFILE=$(mktemp) Be explicit with rm -rf operations Check for TOCTOU (Time-Of-Check-Time-Of-Use) race conditions Don't store secrets in scripts; use environment variables or secret managers Performance Tips Use built-ins over external commands ([[ ]] vs test, $(( )) vs expr) Avoid unnecessary subshells: var=$(cat file) → var=$(<file) Use read not cat while: while read -r line; do ... …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/shell-scripting--261e4b

View the source on GitHub

Browse the @skills marketplace