shell-script-validation

Run a centralized validate.sh workflow with bash, shellcheck, shfmt, bats, and jq.

1|Updated Dec 8, 2025
One-click install
npx skills add https://github.com/y-miyazaki/arc --skill shell-script-validation
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shell-script-validation
Source: https://github.com/y-miyazaki/arc/tree/main/.github/skills/shell-script-validation
Command: npx skills add https://github.com/y-miyazaki/arc --skill shell-script-validation

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires bash, shellcheck, shfmt, bats, bats-core, jq, patch, and includes scripts (resource) components.

What problem does it solve?

This Skill provides a centralized workflow to validate shell scripts across a codebase, catching syntax errors, style issues, and gaps in tests before deployment.

Core Features & Use Cases

  • Centralized validation workflow using the validate.sh script to scan all Bash scripts in the workspace.
  • Syntax checking with bash -n, static analysis with shellcheck, and formatting checks with shfmt.
  • Integrated test execution with bats to run unit tests and generate quick feedback for CI or pre-commit hooks.
  • Use cases include CI pipelines, pre-commit checks, and local debugging to ensure script quality and reliability.

Quick Start

Run the full workspace validation:

  • bash scripts/validate.sh For verbose validation and auto-fix (when possible):
  • bash scripts/validate.sh -v -f

Frequently Asked Questions about shell-script-validation

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

FAQPage Schema
How do I automate shell script validation in a CI pipeline or pre-commit hook?

You can automate shell script validation by running a centralized `validate.sh` workflow that integrates syntax checks, static analysis with shellcheck, formatting with shfmt, and tests with bats. This workflow scans all Bash scripts in your workspace to catch errors before deployment.

What tools do I need to lint and format Bash scripts for syntax errors?

To lint and format Bash scripts, you need bash for syntax checking, shellcheck for static analysis, shfmt for formatting verification, bats for unit testing, and jq for processing validation outputs. These dependencies work together within the validation workflow.

Can I automatically fix shell script formatting and style issues during validation?

Yes, you can automatically fix shell script issues by running the validation workflow with the `-f` flag. Combined with the `-v` flag for verbose output, the workflow uses shfmt and patch to apply formatting fixes and report remaining issues.

Does shellcheck work with bats to run unit tests and static analysis together?

Yes, shellcheck and bats are integrated into a single validation workflow. The workflow runs shellcheck for static analysis and security checks while simultaneously executing bats to run unit tests, providing comprehensive feedback for CI pipelines and local debugging.

What is the best way to check shell script dependencies before running a deployment?

The best way to check dependencies is using the centralized validation workflow, which includes basic dependency verification alongside syntax checks and static analysis. Running `validate.sh` ensures your Bash scripts are correct, secure, and have their dependencies verified before deployment.

Why does my shell script validation fail in CI even after passing local syntax checks?

Validation may fail in CI due to formatting issues detected by shfmt or static analysis warnings from shellcheck that local syntax checks miss. The centralized workflow catches style issues, security vulnerabilities, and test gaps that standard bash interpretation does not identify.