shell-script-quality

Lint shell scripts with ShellCheck and run BATS test suites.

13|1|Updated Oct 22, 2025
One-click install
npx skills add https://github.com/d-oit/gemini-search-plugin --skill shell-script-quality
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: shell-script-quality
Source: https://github.com/d-oit/gemini-search-plugin/tree/main/.claude/skills/shell-script-quality
Command: npx skills add https://github.com/d-oit/gemini-search-plugin --skill shell-script-quality

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill ensures the reliability and maintainability of shell scripts by providing tools and best practices for linting and testing. It helps developers catch bugs early, enforce coding standards, and build robust, production-ready automation.

Core Features & Use Cases

  • ShellCheck Integration: Guides on setting up and using ShellCheck for static analysis, identifying common issues, and configuring .shellcheckrc.
  • BATS Testing Framework: Provides comprehensive instructions for writing automated tests for Bash scripts, including setup/teardown, assertions, and mocking.
  • CI/CD Automation: Integrates quality checks into GitHub Actions, GitLab CI, and pre-commit hooks to enforce standards automatically.
  • Use Case: A developer maintains several critical Bash scripts for system automation. This skill helps them implement a testing suite and linting checks to prevent regressions and ensure high-quality, production-ready scripts.

Quick Start

Install ShellCheck

brew install shellcheck

Lint your script

shellcheck scripts/example.sh

Install BATS

brew install bats-core

Run tests

bats tests/

Frequently Asked Questions about shell-script-quality

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

FAQPage Schema
How do I lint and test Bash scripts to catch bugs early?

Linting and testing shell scripts identifies quality defects before production. Use ShellCheck for static analysis to find common issues, and BATS to write automated test suites with assertions and mocking. Integrate both into CI/CD pipelines to enforce standards automatically across your codebase.

What is ShellCheck and how does it improve shell script quality?

ShellCheck is a static analysis tool that detects bugs, style issues, and anti-patterns in Bash and shell scripts. It reads your code without executing it, identifies warnings configurable via `.shellcheckrc`, and helps enforce consistent coding standards before scripts reach production.

Can I automate shell script linting and testing in CI/CD pipelines?

Yes. Integrate ShellCheck and BATS into GitHub Actions, GitLab CI, or pre-commit hooks to automatically validate code quality and run tests on every commit. This enforces standards without manual intervention and catches regressions early.

How do I write tests for Bash scripts using BATS?

BATS is a testing framework for Bash that lets you write automated tests with setup/teardown functions, assertions, and mocking capabilities. Write test files with `.bats` extension, organize tests in a `tests/` directory, and run them with the `bats` command to validate script behavior.

Do I need both linting and testing for shell script quality?

Both serve different purposes. Linting catches style issues and common mistakes statically without running code; testing validates actual behavior and catches logic errors. Together they provide comprehensive coverage—linting prevents defects early, testing ensures scripts work as intended.