bash-script-validator

Validate Bash and POSIX shell scripts with syntax and security checks.

Updated Apr 15, 2026
One-click install
npx skills add https://github.com/ToanPV90/dotfiles --skill bash-script-validator-toanpv90
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bash-script-validator
Source: https://github.com/ToanPV90/dotfiles/tree/main/claude/.claude/skills/bash-script-validator
Command: npx skills add https://github.com/ToanPV90/dotfiles --skill bash-script-validator-toanpv90

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps you prevent broken and insecure shell scripts by validating syntax, running static analysis, and applying portability-focused security checks.

Core Features & Use Cases

  • Deterministic multi-stage validation: runs syntax checking, then ShellCheck (or an explicit fallback path) followed by custom security/portability/optimization checks.
  • Issue-driven remediation guidance: for each finding, it requires a precise location, root cause, corrected snippet, and justification with subsection-level citations.
  • Rerun-after-changes safety loop: mandates rerunning validation after every batch of edits to ensure fixes don’t introduce new errors.

Quick Start

Use the validator to check a script at the path you provide by running: bash scripts/validate.sh <script-path>.

Frequently Asked Questions about bash-script-validator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate Bash and POSIX shell scripts for syntax and security issues?

Validate shell scripts using a multi-stage process that combines syntax checking, ShellCheck static analysis, and custom portability security checks to detect bugs and cross-shell compatibility issues before deployment.

What is the best way to lint shell scripts for cross-shell compatibility?

Lint shell scripts for cross-shell compatibility by applying custom portability checks alongside ShellCheck static analysis, identifying POSIX sh compliance issues to ensure scripts run safely across different shell environments.

How do I fix shell script errors found during static analysis?

Fix shell script errors found during static analysis using issue-driven remediation guidance that provides precise locations, root causes, corrected snippets, and justifications, then rerun validation after edits to ensure fixes introduce no new errors.

Does ShellCheck static analysis support explicit fallback paths for script validation?

Yes, shell script validation supports explicit ShellCheck provider modes and fallback paths, enforcing deterministic validation ordering to ensure syntax checks run before static analysis and custom security portability checks execute reliably.

Why should I rerun shell script validation after applying code fixes?

Rerun shell script validation after applying code fixes because the rerun safety loop mandates rechecking scripts after every batch of edits, ensuring remediation changes do not introduce new syntax errors or security vulnerabilities.