testing-shell

testing-shell is a skill for Claude Code from qte77/claude-code-plugins. It costs 48 tokens per session (1,026 once invoked), scanned B, original, Apache-2.0.

A guide for testing Bash scripts with BATS, a testing tool for shell programs. It uses small tests to check arguments, branching, exit codes, file output, and failure cases before the script is finished.

In plain words
What is it for?
Use it for hooks, continuous-integration helpers, setup scripts, and other Bash programs with meaningful logic, using fixtures and simulated commands where needed.
Why use it?
It catches broken behavior that a syntax check cannot find, including bad input and missing dependencies. Its test-first workflow helps preserve behavior while the script is refactored.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: positional $N argument; mentions Claude Code.

Part of the sh-dev plugin — 2 skills shipped together

Good fit Use it for hooks, continuous-integration helpers, setup scripts, and other Bash programs with meaningful logic, using fixtures and simulated commands where needed.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/qte77/claude-code-plugins/testing-shell
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add qte77/claude-code-plugins --skill testing-shell
Clone the repo
git clone --depth 1 https://github.com/qte77/claude-code-plugins

Made for: Claude Code.

Or install sh-dev, the plugin that ships this one along with the rest of its 2 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for testing-shell

README.md
[![agentmods](https://agentmods.dev/badge/skills/qte77/claude-code-plugins/testing-shell/github.svg)](https://agentmods.dev/skills/qte77/claude-code-plugins/testing-shell)
Your own site
<a href="https://agentmods.dev/skills/qte77/claude-code-plugins/testing-shell"><img src="https://agentmods.dev/badge/skills/qte77/claude-code-plugins/testing-shell/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for testing-shell

Your own site · 80×15
<a href="https://agentmods.dev/skills/qte77/claude-code-plugins/testing-shell"><img src="https://agentmods.dev/badge/skills/qte77/claude-code-plugins/testing-shell.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 48 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,026 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00048 $0.01026
Opus 5.5 $0.00019 $0.00410
Sonnet 5.5 $0.00010 $0.00205
Haiku 4.5 $0.00005 $0.00103

Measured 8d ago against content hash 81b02fdbfb96, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

testing-shell scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

- run: sudo apt-get install -y bats shellcheck

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

Put fake binaries first on `PATH` so the script never calls the real `gh`, `curl` or `git push`:
plugins/sh-dev/skills/testing-shell/SKILL.md · 118 lines

How it starts

The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Testing Shell Scripts (BATS)

Target: $ARGUMENTS

Writes BATS tests for Bash scripts, test-first. For the Red-Green-Refactor loop itself, see tdd-core:testing-tdd; for how the scripts under test should be written, see implementing-shell.

When to Use

  • A script has logic worth pinning down: argument handling, branching, exit codes, file output
  • Hook scripts, CI helper scripts, setup/install scripts, GitHub Action scripts/*.sh

Do Not Use

  • One-line wrappers with no branching — a ShellCheck pass is enough
  • Testing what another tool already guarantees (e.g. that jq parses JSON)

Layout

scripts/do-thing.sh
tests/unit/do-thing.bats      # one .bats file per script
tests/unit/fixtures/          # static inputs (sample JSON, config files)

Run with bats tests/unit/ (add --tap in CI if a TAP consumer reads it).

Workflow

  1. RED — write the @test blocks for the behaviour you want, including the failure paths (missing argument, bad input, missing dependency). Run them; they must fail.
  2. GREEN — implement the script until they pass.
  3. REFACTOR — tidy the script with the tests green; run ShellCheck on script and tests.

Core patterns

#!/usr/bin/env bats

setup() {
  SCRIPT="$BATS_TEST_DIRNAME/../../scripts/do-thing.sh"
  TMP="$BATS_TEST_TMPDIR"          # per-test temp dir, removed by bats
}

@test "prints usage and exits 2 without arguments" {
  run bash "$SCRIPT"
  [ "$status" -eq 2 ]
  [[ "$output" == *"Usage:"* ]]
}

@test "writes the report to the given path" {
  run bash "$SCRIPT" --out "$TMP/report.txt"
  [ "$status" -eq 0 ]
  [ -s "$TMP/report.txt" ]
}

@test "DRY_RUN=1 changes nothing" {
  DRY_RUN=1 run bash "$SCRIPT" --out "$TMP/report.txt"
  [ "$status" -eq 0 ]
  [ ! -e "$TMP/report.txt" ]
}
  • run captures $status, $output and ${lines[@]}; assert on them after run, never inside the command.
  • Feed stdin with run bash -c '"$0" < "$1"' "$SCRIPT" "$fixture" or a here-string inside bash -c; run itself does not take a redirect.
  • setup_file / teardown_file for expensive one-time setup; setup / teardown per test.

Read the full file on GitHub · 118 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago Changed 81b02fdbfb96
  2. 28d ago First seen · 118 lines · 48 tokens per session scan B 9d055d26c8e8

Subscribe to this mod's changes

testing-shell is a skill published in the GitHub repository qte77/claude-code-plugins (3 stars, last pushed today), licensed Apache-2.0. It adds 48 tokens to every session and 1,026 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-02.

Related

testing-shell compared with skills from other repositories

testing-shell next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
testing-shellqte77/claude-code-pluginsSkill3todayApache-2.0B48Claude Code
dotnet-testNikiforovAll/claude-code-rulesSkill14328d agoApache-2.0A35Claude Code
go-testingbitwise-media-group/skillsSkill3yesterdayMITA0Claude Code
python-testingbitwise-media-group/skillsSkill3yesterdayMITA178Claude Code
android-kotlin-composeand3r817/dot-claude-pluginsSkill22mo agoMITA84Claude Code
android-kotlin-coroutinesand3r817/dot-claude-pluginsSkill22mo agoMITA87Claude Code
test-qualitydecebals/claude-code-javaSkill7801mo agoMITA45Claude Code, Codex