What problem does it solve? Shell scripts often grow into unstructured, hard-to-debug files without error handling or logging, causing silent failures and human error in automation tasks. This Skill restructures or generates Bash scripts following standard conventions so they are readable, debuggable, and self-documenting. ## Core Features & Use Cases - Standardized Script Structure: Organizes scripts into shebang, documentation header, constants, functions, precondition checks, main execution, and summary sections. - Error Handling & Logging: Adds error_exit() with clear return codes, a unified log_message() function with timestamps, and INFO/WARNING/ERROR severity levels. - Production Conventions: Enforces naming conventions (UPPERCASE constants, lowercase functions with action verbs), signal traps, command-line parameters, progress indicators, and verbose/silent modes. - Use Case: You have a messy backup script that fails silently. Invoke this Skill with the script path to get a refactored version with dependency checks, input validation, logging, and a run summary. ## Quick Start Run /refactor-shell with the path to your .sh file or a description of the automation task you want scripted.