Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generate BATS test structure and fixtures for shell script testing with setup/teardown, assertions, and mocking.
.claude/skills/a5c-ai-bats-test-scaffolder/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 32% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 13% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 29% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 16% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 28% | 0% |
Generate BATS test structure for shell script testing.
Invoke this skill when you need to:
tests/
├── bats/
│ └── bats-*.bash # BATS submodules
├── test_helper/
│ ├── common-setup.bash # Common setup
│ └── mocks.bash # Mock helpers
├── fixtures/
│ ├── input.txt # Test fixtures
│ └── expected.txt
└── *.bats # Test filesbash#!/usr/bin/env bats # Load test helpers load 'test_helper/common-setup' # Setup runs before each test setup() { common_setup # Test-specific setup export TEST_DIR="$(mktemp -d)" } # Teardown runs after each test teardown() { # Cleanup rm -rf "${TEST_DIR}" } @test "script displays help with --help" { run ./script.sh --help assert_success assert_output --partial "Usage:" } @test "script fails without required argument" { run ./script.sh assert_failure assert_output --partial "Missing required argument" } @test "script processes input file" { cp fixtures/input.txt "${TEST_DIR}/" run ./script.sh "${TEST_DIR}/input.txt" assert_success assert_output --partial "Processing complete" } @test "script creates output file" { run ./script.sh -o "${TEST_DIR}/output.txt" fixtures/input.txt assert_success assert_file_exists "${TEST_DIR}/output.txt" } @test "script handles special characters in filename" { local special_file="${TEST_DIR}/file with spaces.txt" echo "test" > "${special_file}" run ./script.sh "${special_file}" assert_success }
bash#!/usr/bin/env bash # Load BATS support libraries load 'bats/bats-support/load' load 'bats/bats-assert/load' load 'bats/bats-file/load' # Common setup for all tests common_setup() { # Get the containing directory PROJECT_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)" # Add scripts to PATH PATH="${PROJECT_ROOT}/bin:${PATH}" # Set up test temp directory TEST_TEMP_DIR="$(mktemp -d)" } # Common teardown common_teardown() { rm -rf "${TEST_TEMP_DIR}" } # Custom assertion: check exit code assert_exit_code() { local expected="$1" if [[ "${status}" -ne "${expected}" ]]; then echo "Expected exit code ${expected}, got ${status}" >&2 return 1 fi } # Mock a command mock_command() { local cmd="$1" local response="$2" eval "${cmd}() { echo '${response}'; }" export -f "${cmd}" }
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 15,185 | 14,856 | -2% | 1 | 1 | 0% | 3,141 | 4,156 | +32% | 0 | 0 | — |
case-02 | fail→pass | 15,350 | 11,765 | -23% | 1 | 1 | 0% | 3,183 | 3,606 | +13% | 0 | 0 | — |
case-03 | fail→pass | 13,240 | 11,851 | -10% | 1 | 1 | 0% | 2,534 | 3,263 | +29% | 0 | 0 | — |
case-04 | pass→pass | 10,623 | 7,851 | -26% | 1 | 1 | 0% | 2,032 | 2,485 | +22% | 0 | 0 | — |
case-05 | fail→fail | 7,167 | 4,610 | -36% | 1 | 1 | 0% | 1,428 | 1,723 | +21% | 0 | 0 | — |
case-06 | fail→fail | 3,041 | 3,245 | +7% | 1 | 1 | 0% | 495 | 1,347 | +172% | 0 | 0 | — |
case-07 | fail→fail | 6,926 | 6,726 | -3% | 1 | 1 | 0% | 1,266 | 2,125 | +68% | 0 | 0 | — |
case-08 | fail→fail | 9,602 | 9,527 | -1% | 1 | 1 | 0% | 1,755 | 2,708 | +54% | 0 | 0 | — |
case-09 | fail→fail | 3,533 | 2,723 | -23% | 1 | 1 | 0% | 673 | 1,364 | +103% | 0 | 0 | — |
case-10 | fail→fail | 4,694 | 4,002 | -15% | 1 | 1 | 0% | 909 | 1,555 | +71% | 0 | 0 | — |
case-11 | fail→fail | 5,119 | 3,443 | -33% | 1 | 1 | 0% | 914 | 1,493 | +63% | 0 | 0 | — |
case-12 | fail→fail | 13,460 | 9,997 | -26% | 1 | 1 | 0% | 2,312 | 2,795 | +21% | 0 | 0 | — |
case-13 | fail→fail | 14,533 | 11,905 | -18% | 1 | 1 | 0% | 2,255 | 3,088 | +37% | 0 | 0 | — |
case-14 | fail→pass | 10,097 | 8,333 | -17% | 1 | 1 | 0% | 1,932 | 2,244 | +16% | 0 | 0 | — |
case-15 | fail→fail | 11,408 | 6,785 | -41% | 1 | 1 | 0% | 1,801 | 2,083 | +16% | 0 | 0 | — |
case-16 | fail→fail | 10,540 | 11,096 | +5% | 1 | 1 | 0% | 1,690 | 3,019 | +79% | 0 | 0 | — |
case-17 | fail→pass | 6,839 | 5,671 | -17% | 1 | 1 | 0% | 1,507 | 1,923 | +28% | 0 | 0 | — |
case-18 | fail→fail | 9,609 | 6,844 | -29% | 1 | 1 | 0% | 1,858 | 2,090 | +12% | 0 | 0 | — |
case-19 | fail→fail | 10,871 | 1,417 | -87% | 1 | 1 | 0% | 1,977 | 1,046 | -47% | 0 | 0 | — |
case-20 | fail→fail | 17,210 | 14,096 | -18% | 1 | 1 | 0% | 2,991 | 3,785 | +27% | 0 | 0 | — |
case-21 | fail→fail | 7,613 | 7,325 | -4% | 1 | 1 | 0% | 1,382 | 2,335 | +69% | 0 | 0 | — |
case-22 | fail→fail | 10,813 | 13,435 | +24% | 1 | 1 | 0% | 2,107 | 3,978 | +89% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +23 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.