Shell Scripting Best Practices
Enforces modern shell scripting patterns, secure coding standards, and portable Bash practices for robust automation.
This skill provides a comprehensive framework for writing high-quality shell scripts that are maintainable, secure, and portable. It guides Claude to implement strict error handling using flags like 'pipefail', ensures proper variable quoting to prevent word splitting, and offers standardized templates for complex logic such as argument parsing, logging, and cleanup traps. Whether refactoring legacy scripts or building new automation tools, this skill ensures that shell code adheres to industry-standard best practices and avoids common security pitfalls across Bash and POSIX environments.
主な機能
01Cross-platform portability guidelines for Bash and POSIX compatibility
02Robust error handling and resource cleanup with trap mechanisms
0339 GitHub stars
04Secure variable handling and quoting to prevent shell injection
05Automated 'Strict Mode' integration using set -euo pipefail
06Standardized script templates with logging and argument parsing logic
ユースケース
01Refactoring legacy .sh scripts to modern Bash and security standards
02Developing secure CI/CD automation and infrastructure-as-code deployment scripts
03Debugging complex shell execution failures and implementing standardized logging