shell-scripting
Shell scripting best practices for bash and other shells. Use when writing shell scripts, bash functions, or command-line automation.
When & Why to Use This Skill
This Claude skill provides expert-level guidance on shell scripting best practices, specifically tailored for Bash and other command-line shells. It empowers developers to create robust, secure, and maintainable scripts for automation and CI/CD by implementing critical standards such as ShellCheck validation, strict error handling, and proper variable scoping.
Use Cases
- Automating DevOps Pipelines: Crafting reliable shell scripts for CI/CD workflows that ensure consistent builds and deployments across various environments.
- System Administration & Automation: Developing production-ready scripts for server maintenance, automated backups, and routine IT tasks with built-in error recovery.
- Environment Configuration Management: Creating portable shell functions and scripts to automate the setup of developer workstations, cloud instances, and dotfiles.
- Script Refactoring & Quality Assurance: Auditing and improving existing shell scripts to enhance performance, readability, and security using modern best practices and ShellCheck integration.
| name | shell-scripting |
|---|---|
| description | Shell scripting best practices for bash and other shells. Use when writing shell scripts, bash functions, or command-line automation. |
Shell Scripting Skill
When to Use
- Writing bash scripts
- Creating shell functions
- Automating command-line tasks
- Setting up environment configurations
- Writing CI/CD scripts
Guidelines
Comprehensive shell scripting best practices: @general.md
Key Principles
- Use shellcheck for validation
- Handle errors with set -e and set -u
- Quote variables properly
- Use meaningful variable names
- Document complex logic
- Test scripts thoroughly