Agent skill

Testing Bash Scripts

by agntcy in agntcy/coffeeAgntcy

Writes unit tests (for lib/.sh-style helpers) or mocked end-to-end tests (for executable scripts) using bats, and runs task tests:bash/tests:coverage.

Apache-2.0Auto-check passedTesting & QA

Install Testing Bash Scripts

skills CLI
$ npx skills add agntcy/coffeeAgntcy --skill testing-bash-scripts -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install agntcy/coffeeAgntcy testing-bash-scripts --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/agntcy/coffeeAgntcy.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/quality-checks/testing-bash-scripts .claude/skills/testing-bash-scripts && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
testing-bash-scripts
GitHub stars
112
Token cost
~1.1k tokens
SKILL.md length
359 words
Files
1
Skills in repo
16
Repo updated
First seen
Licence
Apache-2.0

At a glance

Writes unit tests (for lib/.sh-style helpers) or mocked end-to-end tests (for executable scripts) using bats, and runs task tests:bash/tests:coverage.

  • Adding a new bash script anywhere in the repository
  • SKILL.md covers What this skill does, Workflow and Notes
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Audit test coverage for one

What it does

Testing Bash Scripts is an agent skill from agntcy/coffeeAgntcy. Writes unit tests (for lib/.sh-style helpers) or mocked end-to-end tests (for executable scripts) using bats, and runs task tests:bash/tests:coverage. Use whenever adding a new bash script anywhere in the repository, or when asked to test, mock, or audit test coverage for one.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Testing & QA, covering Shell scripting, Unit testing and Test coverage. It works with Bash. The repository describes itself as: End-to-end reference application for AGNTCY Components. The licence is Apache-2.0.

When your agent uses it

  • Adding a new bash script anywhere in the repository
  • Audit test coverage for one

Example prompts

  • “Use the testing-bash-scripts skill to write unit tests (for lib/.sh-style helpers) or mocked end-to-end tests (for executable scripts) using bats…”
  • “/testing-bash-scripts”

Requirements

  • Docker

What it can do on your machine

Read from SKILL.md and the folder at commit 36f1923. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Testing Bash Scripts loads about 1.1k tokens when it runs. Until then it costs about 75 tokens; SKILL.md has 359 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~75
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from agntcy/coffeeAgntcy at commit 36f1923, republished under its Apache-2.0 licence (© agntcy). 359 words, ~1,077 tokens.

Download SKILL.mdSave it as .claude/skills/testing-bash-scripts/SKILL.md (or your agent's skills folder).
name
testing-bash-scripts
description
Writes unit tests (for lib/*.sh-style helpers) or mocked end-to-end tests (for executable scripts) using bats, and runs task tests:bash/tests:coverage. Use whenever adding a new bash script anywhere in the repository, or when asked to test, mock, or audit test coverage for one.

Testing bash scripts

What this skill does

Writes a .bats test for a new bash script anywhere in the repository, using bats (bootstrapped by task setup) and this repo's shared mocking helper (scripts/lib/testing.sh), then runs task tests:bash (the whole suite) and task tests:coverage (the audit that a test exists at all). Both run as part of task check:all in checks.yaml. See .agents/rules/quality/bash-script-testing.md for the underlying rule.

Workflow

- [ ] 1. Decide which shape applies: a shared helper under a lib/*.sh-style directory
        gets unit tests (source it, call its functions directly); an
        executable script anywhere else gets a mocked end-to-end test
        (run it as a subprocess with `run`).
- [ ] 2. Create <the script's own directory>/tests/<name>.bats.
- [ ] 3. At the top: `load '<relative path>/lib/testing.sh'` for
        mock_setup/mock_command/mock_teardown, plus (unit tests only)
        `load '<relative path>/<the file being tested>.sh'`.
- [ ] 4. For each external command the code under test invokes (gh,
        docker, uname, git, ...), call `mock_command <name> '<stub body>'`
        in the test that needs it, instead of letting the real binary
        run.
- [ ] 5. Write one @test per meaningful behavior - the happy path, every
        real branch, and every error path - not just one smoke test.
- [ ] 6. Run: task tests:bash (or `bats path/to/the.bats` directly while
        iterating, for a faster loop).
- [ ] 7. Run: task tests:coverage - confirms the new script is no longer
        flagged as untested. There's no exceptions list: every script,
        with no exceptions, needs one.

Notes

  • Unit vs. mocked end-to-end is decided by what kind of file it is, not by choice: scripts/lib/*.sh files are already always sourced, never executed directly, so they're naturally unit-testable with zero code change; executable scripts are already invoked as their own subprocess by a Taskfile task or CI, so they're naturally end-to-end-testable with run and zero code change either. Neither needs a main() guard or any other restructuring first.
  • mock_command <name> '<body>' writes an executable stub named <name> ahead of the real command on PATH for the rest of that one test - the body runs as a real shell script, with $@/$1/etc. bound to whatever arguments the real command would have received, so a stub can branch on its arguments when a test needs different responses for different calls.
  • A passing end-to-end test that quietly depended on a real installed tool or a real network call isn't actually mocked - if a test would fail differently (or not run at all) on a machine without that tool installed or without network access, something wasn't mocked that should have been.
  • See scripts/lib/tests/platform.bats for a worked unit-test example (mocking uname to exercise every OS/arch branch) and scripts/ci-gate/tests/wait-for-sibling-runs.bats for a worked mocked end-to-end example (mocking gh).
  • If task tests:coverage flags a script, write it a test - there's no exceptions list to add it to instead.
  • For a test that needs a real command to be genuinely absent (not just hopefully-shadowed by pointing PATH at a directory guessed not to contain it - that guess can fail across OSes, e.g. Debian/Ubuntu's merged-usr layout makes bare /bin reach everything /usr/bin has), use mock_isolate_path <tool> ... (also in scripts/lib/testing.sh): it symlinks each named tool from the real PATH into the mock bin directory, then restricts PATH to only that directory.

© agntcy, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/quality-checks/testing-bash-scripts of agntcy/coffeeAgntcy.

Open the folder on GitHubat commit 36f1923

Compare with similar skills

Testing Bash Scripts next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Testing Bash Scripts compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Testing Bash Scripts this skillagntcy/coffeeAgntcy112—~1.1kAutomated safety check: PassApache-2.0
Bats Shell Testing Patternswshobson/agents40k11 repos~1.3kAutomated safety check: PassMIT
Test Writing WorkflowiOfficeAI/AionUi33k1 repos~1.2kAutomated safety check: PassApache-2.0
OpenROAD Module Test AdderThe-OpenROAD-Project/OpenROAD3.2k—~1.8kAutomated safety check: PassBSD-3-Clause
CI FixFastLED/FastLED7.5k—~897Automated safety check: PassMIT
Testing iOS Codebitwarden/ios694—~1.8kAutomated safety check: PassGPL-3.0

Similar skills

  • Writes unit tests for shell scripts with Bats: error-condition tests, fixtures and mocks, cross-shell checks, parallel runs, helper files and CI integration.

    40k GitHub starsUsed in 11 repos~1.3k tokens
    Testing & QAAuto-check passed
  • Test Writing Workflow

    iOfficeAI/AionUi

    Sets the test-writing workflow for the repository: risk-first scenario lists, behavior-focused Vitest tests, a full run before each commit and a coverage target.

    33k GitHub starsUsed in 1 repo~1.2k tokens
    Testing & QAAuto-check passed
  • OpenROAD Module Test Adder

    The-OpenROAD-Project/OpenROAD

    Adds integration or unit tests to an OpenROAD module: writes the Tcl test, generates golden files and registers it in both CMake and Bazel.

    3.2k GitHub stars~1.8k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • CI Fix

    FastLED/FastLED

    Scan all CI builds and tests, find failures, fetch error logs, and fix the code.

    7.5k GitHub stars~897 tokensUpdated today
    Testing & QAAuto-check passed
  • Testing iOS Code

    bitwarden/ios

    Official

    Write tests, add test coverage, unit test, or add missing tests for Bitwarden iOS.

    694 GitHub stars~1.8k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Caliber Testing

    caliber-ai-org/ai-setup

    Writes Vitest tests following project patterns: tests/ directories, vi.mock() for module mocking with vi.hoisted() for test-time factories, global LLM mock from src/test/setup.ts, environment…

    1.3k GitHub stars~3.2k tokensUpdated 13 days ago
    Testing & QAAuto-check passed

More from agntcy/coffeeAgntcy

All 16 skills in this repo
  • A2a Protocol

    agntcy/coffeeAgntcy

    A skill your agent uses when the user asks about A2A (Agent-to-Agent) protocol communication, OASF record formats, AGNTCY directory operations, agent card parsing, or dirctl CLI usage.

    112 GitHub stars~1k tokensUpdated yesterday
    Auto-check passed
  • Add Repo Operation

    agntcy/coffeeAgntcy

    Guides adding a new repository operation (a check, validation, or piece of tooling) through this repo's standard script - Taskfile task - skill - CI enforcement - rule pipeline.

    112 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Authors and maintains the human-facing Agentic Workflows API documentation for the lungo subproject at coffeeAGNTCY/coffeeagents/lungo/docs/workflow-instanceapi.md.

    112 GitHub stars~2.6k tokensUpdated yesterday
    Auto-check passed
  • Checking Pinned References

    agntcy/coffeeAgntcy

    Runs task pins:check to find any third-party GitHub Action, reusable-workflow, or image reference that isn't pinned to an immutable SHA/digest, and pins each one it finds.

    112 GitHub stars~578 tokensUpdated yesterday
    Auto-check passed
  • Runs task workflows:check-permissions to find any GitHub Actions workflow file with a write-all grant or no declared permissions, and scopes it down to least privilege.

    112 GitHub stars~513 tokensUpdated yesterday
    Auto-check passed
  • Generate Release Notes

    agntcy/coffeeAgntcy

    Generates coffeeAgntcy CHANGELOG release notes and README Built With updates from PRs and dependency lockfiles since the previous release tag.

    112 GitHub stars~535 tokensUpdated yesterday
    Auto-check passed

Works with

Categories

Questions about Testing Bash Scripts

What does Testing Bash Scripts do?

Writes unit tests (for lib/.sh-style helpers) or mocked end-to-end tests (for executable scripts) using bats, and runs task tests:bash/tests:coverage. Testing Bash Scripts is an agent skill from agntcy/coffeeAgntcy.sh-style helpers) or mocked end-to-end tests (for executable scripts) using bats, and runs task tests:bash/tests:coverage.

When should I use Testing Bash Scripts?

Testing Bash Scripts fits situations like: adding a new bash script anywhere in the repository; audit test coverage for one.

How do I install Testing Bash Scripts in Claude Code?

Run `npx skills add agntcy/coffeeAgntcy --skill testing-bash-scripts -a claude-code`. Or copy the skill folder (.agents/skills/quality-checks/testing-bash-scripts in agntcy/coffeeAgntcy) into .claude/skills/testing-bash-scripts in your project. Claude Code loads it when a task matches its description.

How do I install Testing Bash Scripts in Codex?

Run `npx skills add agntcy/coffeeAgntcy --skill testing-bash-scripts -a codex`. Or copy the skill folder (.agents/skills/quality-checks/testing-bash-scripts in agntcy/coffeeAgntcy) into .agents/skills/testing-bash-scripts in your project. Codex loads it when a task matches its description.

Can I use Testing Bash Scripts in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add agntcy/coffeeAgntcy --skill testing-bash-scripts -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/testing-bash-scripts, .gemini/skills/testing-bash-scripts, .github/skills/testing-bash-scripts and .opencode/skills/testing-bash-scripts in your project.

What does Testing Bash Scripts need to run?

SKILL.md names no scripts, command-line tools or credentials: Testing Bash Scripts is instructions for the agent only. Our summary lists: Docker.

Does Testing Bash Scripts access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Testing Bash Scripts safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Testing Bash Scripts use?

Testing Bash Scripts is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Testing Bash Scripts use?

About 1.1k tokens (SKILL.md is roughly 4.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Testing Bash Scripts?

Skills that share tags, products or a category with Testing Bash Scripts: Bats Shell Testing Patterns (wshobson/agents, 40k stars), Test Writing Workflow (iOfficeAI/AionUi, 33k stars), OpenROAD Module Test Adder (The-OpenROAD-Project/OpenROAD, 3.2k stars) and CI Fix (FastLED/FastLED, 7.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Testing Bash Scripts?

agntcy (a GitHub organization) maintains it in agntcy/coffeeAgntcy, which has 112 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on October 6, 2026.

Source: agntcy/coffeeAgntcy on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.