Skip to content
sickn33 avatar

Bats Testing Patterns

Test shell scripts with Bats for exit codes, output, and side effects, including TDD and CI use.

CCM score
45 of 100
skills.sh installs
206
GitHub stars
50.5K
last updated
Jun 3, 2026
View on GitHub

Own this skill? Claim it

What it does

  • Covers writing unit tests for shell scripts, with fixtures, helpers, setup and teardown, and edge-case and error-condition coverage
  • Guides confirming target shell dialects and environments before structuring a test directory with shared helpers and fixtures
  • Directs tests toward exit codes, stdout and stderr, and side effects, and notes it is not a substitute for environment validation
  • Designed for TDD of shell utilities and automated Bats runs in CI/CD pipelines; points to resources/implementation-playbook.md for detailed examples

Install

$ npx -y skills add sickn33/agentic-awesome-skills --skill bats-testing-patterns -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Bats Testing Patterns

Comprehensive guidance for writing comprehensive unit tests for shell scripts using Bats (Bash Automated Testing System), including test patterns, fixtures, and best practices for production-grade shell testing.

Use this skill when

  • Writing unit tests for shell scripts
  • Implementing TDD for scripts
  • Setting up automated testing in CI/CD pipelines
  • Testing edge cases and error conditions
  • Validating behavior across shell environments

Do not use this skill when

  • The project does not use shell scripts
  • You need integration tests beyond shell behavior
  • The goal is only linting or formatting

Instructions

  • Confirm shell dialects and supported environments.
  • Set up a test structure with helpers and fixtures.
  • Write tests for exit codes, output, and side effects.
  • Add setup/teardown and run tests in CI.
  • If detailed examples are required, open resources/implementation-playbook.md.

Resources

  • resources/implementation-playbook.md for detailed patterns and examples.

Details

Repository
github.com/sickn33/agentic-awesome-skills
Categories
Testing & QA, CLI & Terminal
First seen
Jun 3, 2026

Questions

What does the bats-testing-patterns skill help with?

The bats-testing-patterns skill guides you in writing unit tests for shell scripts with Bats, the Bash Automated Testing System. It covers test structure, helpers, fixtures, exit codes, output checks and setup and teardown for production-grade shell testing.

When should I use bats-testing-patterns instead of other testing skills?

Use bats-testing-patterns when your project has shell scripts that need tests, such as CI/CD pipelines or shell utilities built test-first. It does not fit projects without shell scripts or work that only needs linting or formatting.

How do I install bats-testing-patterns?

Run npx -y skills add sickn33/agentic-awesome-skills --skill bats-testing-patterns -y in your project. After that, the agent can write Bats tests with edge cases, error conditions and CI integration for your shell scripts.

Where does bats-testing-patterns sit among other Testing & QA skills?

bats-testing-patterns is in the Testing & QA category, next to tdd, test-driven-development, webapp-testing and break-ui. Its own focus is shell script testing with Bats rather than general test-driven development or web app testing.

More from sickn33/agentic-awesome-skills

All 682

Similar to Bats Testing Patterns

More Testing & QA