<< All versions
Skill v1.0.1
currentAutomated scan100/100majiayu000/claude-skill-registry/shellcheck
3 files
──Details
PublishedMay 22, 2026 at 07:30 PM
Content Hashsha256:499caab6bc6a4184...
Git SHA8bf6b865f08f
Bump Typepatch
──Files
Files (1 file, 2.6 KB)
SKILL.md2.6 KBactive
SKILL.md · 160 lines · 2.6 KB
version: "1.0.1" name: shellcheck description: Lint and fix shell script issues using ShellCheck. Use when the user says "check this script", "lint shell", "shellcheck", "fix script warnings", "validate bash", or asks to review a shell script for issues. allowed-tools: Bash, Read, Edit
ShellCheck
Lint shell scripts and fix common issues using ShellCheck.
Instructions
- Run ShellCheck on the script
- Analyze findings by severity
- Explain each issue clearly
- Provide fixes for each issue
Run ShellCheck
bash
# Basic checkshellcheck script.sh# With severity filtershellcheck --severity=warning script.sh# Specific shell dialectshellcheck --shell=bash script.sh# Output formatsshellcheck --format=json script.shshellcheck --format=gcc script.sh# Check multiple filesshellcheck *.sh
Common issues and fixes
SC2086: Double quote to prevent globbing
bash
# Badrm $fileecho $var# Goodrm "$file"echo "$var"
SC2046: Quote command substitution
bash
# Badrm $(find . -name "*.tmp")# Goodrm "$(find . -name "*.tmp")"# Or for multiple results:find . -name "*.tmp" -delete
SC2006: Use $() instead of backticks
bash
# Baddate=`date`# Gooddate=$(date)
SC2164: Use cd ... || exit
bash
# Badcd /some/dirdo_something# Goodcd /some/dir || exit 1do_something
SC2155: Declare and assign separately
bash
# Badlocal var=$(command)# Goodlocal varvar=$(command)
SC2162: Read without -r mangles backslashes
bash
# Badread line# Goodread -r line
SC2034: Variable appears unused
bash
# Check if it's exported or used in eval/source# Or prefix with _ to indicate intentionally unused_unused_var="value"
Disable warnings
bash
# Disable for next line# shellcheck disable=SC2086echo $unquoted_var# Disable for entire file (at top)# shellcheck disable=SC2034,SC2086# Disable for block# shellcheck disable=SC2086{echo $var1echo $var2}
Output format
## Issues Found### Errors (must fix)- Line 10, SC2086: Double quote to prevent globbing and word splitting### Warnings (should fix)- Line 15, SC2155: Declare and assign separately to avoid masking return values### Suggestions- Line 20, SC2034: UNUSED_VAR appears unused (verify or prefix with _)## Fixed Code[Show corrected version]
Rules
- MUST run shellcheck before reviewing manually
- MUST explain why each issue matters
- MUST provide specific fix for each issue
- Never ignore errors (SC level error)
- Always explain when disabling is appropriate
- Offer to auto-fix simple issues with Edit tool