bash-script-validator
БесплатноЗапускает вложенные скриптыНе проверенValidate, lint, audit, or fix bash/shell/.sh scripts via ShellCheck.
от akin-ozer★ 346 звёзд на GitHubОб этом скилле
Bash Script Validator
Overview
This skill validates Bash and POSIX shell scripts with layered checks:
- Syntax validation (
bash -norsh -n) - ShellCheck static analysis (system binary or wrapper fallback)
- Custom security, portability, and optimization checks
Use the default flow below, then branch to fallbacks only when the environment is constrained.
Trigger Guidance
Use this skill when the request includes script quality, linting, syntax checking, or shell portability work.
Trigger Phrases
- "Validate this bash script"
- "Lint this
.shfile" - "Find security issues in this shell script"
- "Why does this script fail ShellCheck?"
- "Make this script POSIX compliant"
- "Review this shell script before CI"
Non-Trigger Examples
- General Linux command questions with no script file
- Kubernetes, Terraform, or pipeline validation tasks that do not involve shell scripts
- Pure prose editing tasks
Deterministic Execution Model
Run commands from this skill directory:
cd devops-skills-plugin/skills/bash-script-validator
Step 1: Preflight
- Confirm target path exists and is readable.
- Confirm
bashis available. - Determine whether fixes can be applied directly (write access) or only suggested (read-only).
Step 2: Run Baseline Validation (Default Path)
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:
- Detected shell type
- Exit code (
0clean,1warnings,2errors) - All reported issue lines and ShellCheck codes (
SC####) when present
Step 3: Load Only Needed References
Progressive disclosure by issue type:
- ShellCheck code explanations:
docs/shellcheck-reference.md - General fix patterns and security mistakes:
docs/common-mistakes.md - Bash-only behavior:
docs/bash-reference.md - POSIX portability or bashism fixes:
docs/shell-reference.md - Text-processing optimization issues:
docs/grep-reference.md,docs/awk-reference.md,docs/sed-reference.md,docs/regex-reference.md(only when directly relevant)
Step 4: Provide or Apply Fixes
For each issue, include:
- Exact location from validator output (line number and snippet)
- Root cause
- Corrected code
- Why the change is safer or more portable
- Subsection-level citation (format below)
If the request includes patching files and write access is available, apply fixes in small batches grouped by issue type.
Step 5: Rerun Policy (Mandatory After Changes)
After each batch of edits, rerun the validator:
bash scripts/validate.sh <script-path>
Rerun loop rules:
- Continue until no new errors are introduced.
- If warnings remain by design, document why they are intentionally accepted.
- If constraints prevent full resolution, report unresolved items with a clear next action.
- Always report the latest rerun exit code and remaining issue count.
Fallback Behavior
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 |
Citation Guidance for Fixes
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 Bashisms
Citation rules:
- Cite the most specific section that justifies the fix.
- For ShellCheck findings, include both the
SC####code and the matching section. - If no exact subsection exists, cite the closest section and state that the fix is inferred from that guidance.
Response Template
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: `(
Установить bash-script-validator в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл bash-script-validator?
Validate, lint, audit, or fix bash/shell/.sh scripts via ShellCheck.
Как установить скилл bash-script-validator?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл bash-script-validator запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
ci-review
The scan that the plugin's GitHub Action runs.
от Anthropicazure-static-web-apps
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
от GitHubai-ready
Make any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
от GitHubaws-cdk-python-setup
Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…
от GitHub