write-bats-test
Skill23 starsChanged 5 months agoMITView on GitHub
Add or extend a bats-core test for the shell scripts, following the tests/ convention. Use when changing setup.sh or context.sh behavior.
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ai-diff-reviewerSkill
- dailybotSkill
- deepworkplanSkill
- fix-frontmatterSkill
- shellcheck-fixSkill
- deepworkplan-authorSkill
- deepworkplan-createSkill
- deepworkplan-executeSkill
- deepworkplan-onboardSkill
- deepworkplan-refineSkill
- deepworkplan-resumeSkill
- deepworkplanSkill
- deepworkplan-statusSkill
- deepworkplan-upgradeSkill
- deepworkplan-verifySkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 0 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
When setup.sh or skills/deepworkplan/shared/context.sh gains or changes behavior (a new flag, a new detection branch, a new output field).
- Very specific: line 24
Read the existing tests to match style and helpers: tests/setup-sh.bats, tests/context-sh.bats.
- Very specific: line 26
Add @test cases for the new behavior.
- Very specific: line 28
Keep assertions on observable contract: emitted JSON fields from context.sh, created symlink names from setup.sh, exit codes.
- Very specific: line 30
Run bats tests/ and iterate until green.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Write Bats Test
Goal
Cover new or changed shell behavior with a bats-core test that matches the
existing convention in tests/.
When to use
When setup.sh or skills/deepworkplan/shared/context.sh gains or changes
behavior (a new flag, a new detection branch, a new output field).
Steps
- Read the existing tests to match style and helpers:
tests/setup-sh.bats,tests/context-sh.bats. - Add
@testcases for the new behavior. Use a throwawayHOME/temp dir for any filesystem effect so the suite never touches the developer's~/.claude. - Keep assertions on observable contract: emitted JSON fields from
context.sh, created symlink names fromsetup.sh, exit codes. - Run
bats tests/and iterate until green.
Validation
bats tests/ passes, including the new cases, and the suite leaves no artifacts
outside its temp dirs.
Notes
Tests must run on bash 3.2. Prefer testing the public contract (flags, symlink names, JSON keys) over internal implementation so refactors don't churn the suite.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

