bash-script-validator

Validate Bash and POSIX sh scripts with syntax and ShellCheck analysis.

7|3|Updated May 4, 2026
One-click install
npx skills add https://github.com/nopperabbo/codebuddy2api --skill bash-script-validator-nopperabbo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bash-script-validator
Source: https://github.com/nopperabbo/codebuddy2api/tree/main/opencode-config/skills/bash-script-validator
Command: npx skills add https://github.com/nopperabbo/codebuddy2api --skill bash-script-validator-nopperabbo

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Bash scripting is prone to subtle syntax errors, unsafe patterns, and portability issues that can slip into production. This skill reduces risk by automating syntax checks, static analysis, and security patterns for Bash and POSIX shells.

Core Features & Use Cases

  • Syntax validation: verify Bash and POSIX sh with bash -n and sh -n, catching common mistakes early.
  • ShellCheck integration: run either system ShellCheck or a wrapper, surfacing warnings and fixes with clear guidance.
  • Custom quality checks: detect unsafe constructs like eval, Useless cat, improper quoting, and missing strict mode.
  • Deterministic execution: executes within the skill's own scripts directory to ensure reproducible results.
  • Use cases: integrate into CI pipelines or local tooling to enforce script quality before merge or deployment.

Quick Start

Validate a script by running the validator on your script file to see syntax, ShellCheck results, and recommended fixes.

Frequently Asked Questions about bash-script-validator

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

FAQPage Schema
How do I automate Bash script validation and linting in a CI pipeline?

Automate Bash script validation by running syntax checks with bash -n, ShellCheck static analysis, and custom security pattern detection to produce structured reports for CI pipelines. This enforces script quality and reliability before merge or deployment.

Can I validate POSIX shell scripts and not just Bash?

Yes, you can validate POSIX shell scripts alongside Bash. The skill performs multi-shell validation using sh -n for POSIX syntax checking and runs ShellCheck to catch portability issues and unsafe patterns across both shell types.

What custom security checks are included for shell script linting?

Custom security checks for shell script linting detect unsafe constructs like eval, useless cat, improper quoting, and missing strict mode. These checks surface specific vulnerabilities and quality issues beyond standard syntax validation.

Does shell script validation require installing ShellCheck separately?

Shell script validation integrates with either a system-installed ShellCheck or a wrapper, surfacing warnings with clear guidance. It executes deterministically within its own scripts directory to ensure reproducible results without requiring a specific environment setup.

What is the best way to catch unsafe patterns in shell scripts before deployment?

The best way to catch unsafe patterns in shell scripts is to combine syntax validation and static analysis. Running automated checks for syntax errors, ShellCheck warnings, and custom security patterns prevents subtle mistakes from slipping into production.