From devops-skills
Validates, lints, audits, and fixes Bash/POSIX shell scripts using ShellCheck, syntax checks, and custom security/portability/optimization rules.
npx claudepluginhub akin-ozer/cc-devops-skills --plugin devops-skillsThis skill uses the workspace's default tool permissions.
This skill validates Bash and POSIX shell scripts with layered checks:
docs/awk-reference.mddocs/bash-reference.mddocs/common-mistakes.mddocs/grep-reference.mddocs/regex-reference.mddocs/sed-reference.mddocs/shell-reference.mddocs/shellcheck-reference.mdexamples/bad-bash.shexamples/bad-shell.shexamples/good-bash.shexamples/good-shell.shscripts/run_ci_checks.shscripts/shellcheck_wrapper.shscripts/test_validate.shscripts/validate.shSearches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
This skill validates Bash and POSIX shell scripts with layered checks:
bash -n or sh -n)Use the default flow below, then branch to fallbacks only when the environment is constrained.
Use this skill when the request includes script quality, linting, syntax checking, or shell portability work.
.sh file"Run commands from this skill directory:
cd devops-skills-plugin/skills/bash-script-validator
bash is available.bash scripts/validate.sh <script-path>
For deterministic stage behavior, set the ShellCheck provider explicitly:
# Modes: auto (default), system, wrapper, disabled
VALIDATOR_SHELLCHECK_MODE=system bash scripts/validate.sh <script-path>
Record:
0 clean, 1 warnings, 2 errors)SC####) when presentProgressive disclosure by issue type:
docs/shellcheck-reference.mddocs/common-mistakes.mddocs/bash-reference.mddocs/shell-reference.mddocs/grep-reference.md, docs/awk-reference.md, docs/sed-reference.md, docs/regex-reference.md (only when directly relevant)For each issue, include:
If the request includes patching files and write access is available, apply fixes in small batches grouped by issue type.
After each batch of edits, rerun the validator:
bash scripts/validate.sh <script-path>
Rerun loop rules:
Use these branches only when the default flow cannot run as-is.
| Constraint | Fallback action | Reporting requirement |
|---|---|---|
shellcheck missing, wrapper available | Let scripts/validate.sh use scripts/shellcheck_wrapper.sh --cache automatically | State that wrapper mode was used |
shellcheck and wrapper unavailable | Run syntax + custom checks only (validator does this) | Explicitly call out reduced coverage and missing ShellCheck analysis |
| Python unavailable for wrapper | Skip wrapper path, keep syntax + custom checks | State why ShellCheck could not run |
| Target file is read-only | Provide precise patch suggestions without editing | Mark response as "advisory only" |
| Target file missing or unreadable | Stop and request a valid file path | Do not fabricate results |
| Binary/non-text input | Stop validation | Report unsupported input type |
Use subsection-level citations for every non-trivial fix.
Required citation format:
Reference: docs/<file>.md -> <Section> -> <Subsection>
Examples:
Reference: docs/common-mistakes.md -> 1. Unquoted Variables -> SolutionReference: docs/shellcheck-reference.md -> SC2164: Use || exit After cdReference: docs/shell-reference.md -> POSIX Best Practices -> 5. Avoid BashismsCitation rules:
SC#### code and the matching section.Use this structure for deterministic output:
Validation ResultsCommand: bash scripts/validate.sh <script-path>Detected shell: <shell>Exit code: <code>Summary: <errors> errors, <warnings> warnings, <info> infoIssue: <short label> (Line <n>)Problem:
<problematic snippet>
Fix:
<corrected snippet>
Why: <short explanation>Reference: docs/<file>.md -> <Section> -> <Subsection>Rerun command: bash scripts/validate.sh <script-path>Exit code after fixes: <code>Remaining issues: <count or none># 1) Baseline validation
bash scripts/validate.sh examples/bad-bash.sh
# 2) Apply fixes to target script
# 3) Rerun validation
bash scripts/validate.sh examples/bad-bash.sh
Expected behavior: full syntax + ShellCheck + custom-check coverage, with iterative reruns until stable.
# Requires a system shellcheck binary.
bash scripts/run_ci_checks.sh
This runner enforces VALIDATOR_REQUIRE_SHELLCHECK=1 and VALIDATOR_SHELLCHECK_MODE=system
so CI fails if the ShellCheck stage is skipped or unavailable.
# shellcheck unavailable and wrapper cannot run
bash scripts/validate.sh examples/bad-shell.sh
Expected behavior: syntax + custom checks still run. Report reduced coverage and list what must be revalidated once ShellCheck is available.
scripts/validate.sh: primary validator entrypointscripts/shellcheck_wrapper.sh: optional ShellCheck fallback using a cached Python virtual environmentValidation order in scripts/validate.sh:
0: no issues found1: warnings found2: errors foundLoad only what is needed:
docs/bash-reference.mddocs/shell-reference.mddocs/shellcheck-reference.mddocs/common-mistakes.mddocs/grep-reference.mddocs/awk-reference.mddocs/sed-reference.mddocs/regex-reference.mdThis skill update is complete when all are true: