shell-discipline
CommunityWrite shell scripts that fail safely.
Authorprapanch
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Shell scripts can accidentally cause outages or data loss due to quoting mistakes, unsafe defaults, missing error handling, and destructive commands running with bad or empty variables.
Core Features & Use Cases
- Safety preamble: Enforces
set -euo pipefailso failures stop the script, undefined variables don’t silently become empty, and pipeline errors aren’t hidden. - Variable hygiene: Applies consistent quoting rules,
${var}clarity, and required-variable checks using${VAR:?message}. - Destructive-command guardrails: Flags high-risk patterns like
rm -rf, recursivechmod/chown, dangerous redirects, and overwriting file operations, then provides safer validation patterns. - Operational script structure: Recommends
cleanupfunctions withtrap ... EXIT,readonlyconstants, validation before action, and contextual logging. - Quality control: Integrates ShellCheck into local and CI workflows, treating warnings as actionable failures to reduce real-world bugs.
Quick Start
Use the shell-discipline skill to generate a production-ready bash script by following the required safety preamble, quoting, variable validation, and ShellCheck-first practices for the task you are automating.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: shell-discipline Download link: https://github.com/prapanch/agent-coda/archive/main.zip#shell-discipline Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.