Sign in
Explore
Prompts · RulesEveryday codingReviewed

shell

Shell scripting best practices and conventions for bash, sh, zsh and other shells.

Kind
Rules
Works with
GitHub Copilot
Languages
Shell
Source
Awesome Copilot @ d85f762d6e52
Path
instructions/shell.instructions.md
Jobs
Implementation

Credit

Made by
github
Original
github.com/github/awesome-copilot/blob/d85f762d6e521abf5fe167…
License
MIT

Listed by Skill Manifest; not made by us.

InstallCopy it from the source repository, or sign in and let the assistant adapt it for your project.
Install factsScanned 3 Nov 2026
Adds
  • Text to merge into your CLAUDE.md or AGENTS.md (no new files)
Runs scripts
Yes
  • shell block in the text
Uses the network
None found
Needs secrets
None found
Reads environment variables
  • TEMP_DIR
  • SCRIPT_NAME
  • RESOURCE_GROUP
Source revision
d85f762d6e52
Licence
MIT
Last activity
25 Nov 2026
Source changed after the scan
Yes
  • Last push 25 Nov 2026, scanned 3 Nov 2026; read it again before you rely on this scan
Review
Reviewed

Found by a static scan of the stored text; nothing is run. “None found” is not a guarantee, so read what you install before you run it.

# Shell Scripting Guidelines

Instructions for writing clean, safe, and maintainable shell scripts for bash, sh, zsh, and other shells.

## General Principles

- Generate code that is clean, simple, and concise
- Ensure scripts are easily readable and understandable
- Add comments where helpful for understanding how the script works
- Generate concise and simple echo outputs to provide execution status
- Avoid unnecessary echo output and excessive logging
- Use shellcheck for static analysis when available
- Assume scripts are for automation and testing rather than production systems unless specified otherwise
- Prefer safe expansions: double-quote variable references (`"$var"`), use `${var}` for clarity, and avoid `eval`
- Use modern Bash features (`[[ ]]`, `local`, arrays) when portability requirements allow; fall back to POSIX constructs only when needed
- Choose reliable parsers for structured data instead of ad-hoc text processing

## Error Handling & Safety

- Always enable `set -euo pipefail` to fail fast on errors, catch unset variables, and surface pipeline failures
- Validate all required parameters before execution
- Provide clear error messages with context
…