Skip to content
Back to skills

Write Bats Test

ASecurity

Add or extend a bats-core test for the shell scripts, following the tests/ convention. Use when changing setup.sh or context.sh behavior.

  • 27 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 16, 2026
developmentgoshellbashtestingdocumentation

Security analysis

A100/100

Scanned November 16, 2026

npx -y skills add DailybotHQ/deepworkplan-skill --skill write-bats-test --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Write Bats Test?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Write Bats Test
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dailybothq-write-bats-test/badge)](https://www.skillsdirectory.com/skills/dailybothq-write-bats-test)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: write-bats-test
description: Add or extend a bats-core test for the shell scripts, following the tests/ convention. Use when changing setup.sh or context.sh behavior.
version: "1.0.0"
documentation_url: https://deepworkplan.com
user-invocable: true
allowed-tools: Bash, Read, Grep, Glob, Edit, Write
---

# 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

1. Read the existing tests to match style and helpers:
   `tests/setup-sh.bats`, `tests/context-sh.bats`.
2. Add `@test` cases for the new behavior. Use a throwaway `HOME`/temp dir for
   any filesystem effect so the suite never touches the developer's `~/.claude`.
3. Keep assertions on observable contract: emitted JSON fields from
   `context.sh`, created symlink names from `setup.sh`, exit codes.
4. 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.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.