writing-clean-shell
Installation
SKILL.md
Writing Clean Shell
Purpose
Organize shell scripts so anyone can read them top to bottom, update them, and maintain them, where reading the orchestrator function equals reading the script's outline. This skill teaches organization, not syntax: it is agnostic to platform (Linux, macOS, Windows) and shell (bash, zsh, sh, PowerShell). Bash appears in the examples only because it is the reference material; translate the shapes into the target shell's idioms.
Script Anatomy
Fixed top-to-bottom layout of every script:
#!/bin/bash shebang
DAYS=30 setup: config and flag defaults
DRY_RUN=false UPPER_CASE, declared before functions
print_info() { echo "[INFO] $1"; } setup: output vocabulary, or source the repo print library
parse_arguments() { ... } argument parsing (only when the script takes parameters)