shellck
Run shellcheck on shell scripts after editing scripts or when debugging shell errors. Use for linting scripts in a repo (especially scripts/), catching issues like set -u with unset vars, bad subshell usage, or quoting mistakes.
When & Why to Use This Skill
The shellck skill integrates the industry-standard ShellCheck linter into the Claude environment, enabling automated static analysis for shell scripts. It proactively identifies syntax errors, shell-specific pitfalls, and POSIX compliance issues, ensuring robust and error-free automation scripts during the development and debugging phases.
Use Cases
- Automated Code Quality Checks: Scan entire script directories (like /scripts) to detect common bugs such as unquoted variables, globbing issues, and incorrect command usage.
- Rapid Debugging: Analyze failing shell scripts to pinpoint specific lines causing execution errors or unexpected behavior, such as 'set -u' failures with unset variables.
- Best Practice Enforcement: Ensure all shell scripts in a repository adhere to modern scripting standards and avoid deprecated or dangerous syntax before committing code.
| name | shellck |
|---|---|
| description | Run shellcheck on shell scripts after editing scripts or when debugging shell errors. Use for linting scripts in a repo (especially scripts/), catching issues like set -u with unset vars, bad subshell usage, or quoting mistakes. |
Shellck
Overview
Provide a fast, repeatable shellcheck pass for repo scripts. Use this skill after editing shell scripts or when a script fails unexpectedly.
Workflow
- Ensure
shellcheckis installed. - From the repo root, run the helper script.
Quick start
Run against the default scripts/ directory:
$CODEX_HOME/skills/shellck/scripts/run_shellck.sh
Run against specific files or directories:
$CODEX_HOME/skills/shellck/scripts/run_shellck.sh scripts/perf-profiler
$CODEX_HOME/skills/shellck/scripts/run_shellck.sh scripts/ other/dir/some.sh
Behavior
- If no paths are provided, it scans
scripts/for shell scripts. - If paths are provided, it accepts files or directories and filters to shell scripts by extension or shebang.
- Exits non-zero on shellcheck failures.
Resources
scripts/
run_shellck.sh: shellcheck runner with sensible defaults and directory filtering.