What problem does it solve? Shell operations frequently fail due to quoting errors, heredoc expansion, word splitting, and interpreter-boundary mismatches, especially when generating files or remote scripts. This Skill provides decision rules and validation steps that prevent these failures before they happen. ## Core Features & Use Cases - Safe File Generation: Routes file edits through apply_patch or validated temp scripts instead of fragile inline heredocs, protecting Markdown with backticks and dollar signs. - Script Validation Workflow: Enforces bash -n or zsh -n syntax checks on generated scripts before execution, plus git diff --check before commits. - Remote Shell Boundary Handling: Separates POSIX-safe outer wrappers from staged Bash inner scripts for SSM RunShellScript, cloud-init, CI, and SSH payloads, with checksum and dual-layer syntax validation. - Use Case: When generating an SSM RunShellScript payload containing Bash arrays and process substitution, this Skill ensures the outer wrapper stays POSIX-safe and the inner script is validated with /usr/bin/bash -n before execution. ## Quick Start Use the safe-shell-ops skill before writing this deployment script through the shell to make sure quoting and heredoc handling are correct.