# Test

> Run the project's test suite locally (shellcheck linting + BATS tests), matching what CI does. Supports running everything, a single test file, or only linting. Use when this capability is needed.

- Skill: `tomevault-io/test-20` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/test-20`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/test-20/raw
- Safety review: pending (external: skill-scanner FAIL, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/test-20

---


## What the user will say

- "Run the tests"
- "/test"
- "/test scripts.bats"
- "/test shellcheck"

## Non-negotiable rules

1. Always run from the repository root.
2. Report failures clearly with file and line numbers.
3. If any check fails, report non-zero exit status.
4. Match CI behavior exactly (same commands as `.github/workflows/ci.yaml`).

## Full run (default: `/test`)

### Shellcheck

```bash
shellcheck setup.sh install.sh
find src/skills -name "*.sh" -type f -exec shellcheck {} \;
```

### BATS

```bash
bats tests/*.bats
```

Report: total tests, passed, failed, and any failure details.

## Single file: `/test <filename>`

```bash
bats tests/<filename>
```

If the filename doesn't end in `.bats`, append it.

## Shellcheck only: `/test shellcheck`

```bash
shellcheck setup.sh install.sh
find src/skills -name "*.sh" -type f -exec shellcheck {} \;
```

Report: number of scripts checked and any warnings/errors.

## Output format

```text
Test Results
  Shellcheck:  25 scripts checked, 0 warnings
  BATS:        130 tests, 130 passed, 0 failed

All checks passed.
```

Or on failure:

```text
Test Results
  Shellcheck:  25 scripts checked, 2 warnings
    src/skills/_shared/scripts/wt-create.sh:42: SC2086
  BATS:        130 tests, 128 passed, 2 failed
    FAIL: wt-list.sh lists worktrees in table format (scripts.bats:114)

Some checks failed.
```

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/lexthink) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-16 -->

