# Test Author

> Write tests first (RED→GREEN→REFACTOR) with Vitest, Testing Library, and Playwright for a Next.js + Supabase app. Use when adding a feature, fixing a bug, or raising coverage.

- **Type:** Skill
- **Install:** `agentstack add skill-m-binimran-dev-pack-test-author`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [m-binimran](https://agentstack.voostack.com/s/m-binimran)
- **Installs:** 0
- **Category:** [Databases](https://agentstack.voostack.com/c/databases)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [m-binimran](https://github.com/m-binimran)
- **Source:** https://github.com/m-binimran/dev-pack/tree/main/skills/test-author

## Install

```sh
agentstack add skill-m-binimran-dev-pack-test-author
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# test-author

Tests that prove behavior and catch regressions — written before or alongside the code, then actually run.

## Process
1. **Start RED.** Write a failing test that states the expected behavior. Run it; confirm it fails for the
   right reason.
2. **GREEN.** Write the minimum code to pass. Run it.
3. **REFACTOR.** Clean up with the test as a safety net. Re-run.

## What to write where
- **Unit (Vitest):** pure functions, Zod schemas, utils. Cover edge cases + error paths, not just happy path.
- **Component (Vitest + Testing Library):** query by role/label (also exercises a11y), simulate user events,
  assert visible outcomes — not internal state.
- **E2E (Playwright):** the critical flows only (auth, core task, checkout). Keep these few and stable.

## Patterns
- **Bug fix → regression test** that fails before the fix, passes after. Reference the bug.
- **Deterministic data:** fixed seeds/fixtures (`seed-fixtures`); no real network/clock in unit tests — mock them.
- **Arrange-Act-Assert**, one behavior per test, names that read as sentences.

## Output
- The test file(s), and the **real run output** (pass/fail counts). A test you didn't run is unverified — say so.

## Guardrails
- Don't test implementation details that change on every refactor.
- Don't lower coverage thresholds or skip tests to go green — fix the code or the test.

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [m-binimran](https://github.com/m-binimran)
- **Source:** [m-binimran/dev-pack](https://github.com/m-binimran/dev-pack)
- **License:** MIT

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-m-binimran-dev-pack-test-author
- Seller: https://agentstack.voostack.com/s/m-binimran
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
