---
description: Backfill unit/integration tests for an existing module.
argument-hint: <module-path>
---

# /generate-tests

## Purpose

Raise test coverage for code that lacks it, prioritizing behavior over implementation.

## Required context

- `CLAUDE.md` §testing, existing test patterns in `dotnet/tests/` + `apps/*/test/`

## Inputs

- `$1` — module or file path

## Execution steps

1. Identify untested public behavior (happy path + edge cases + error paths).
2. .NET: xUnit + FluentAssertions; integration via Testcontainers (real Postgres) — no mocking the DB.
3. Node: Jest/Vitest; component tests via Testing Library.
4. Cover validation failures + authz denials.

## Validation checklist

- [ ] New tests pass
- [ ] Cover happy + edge + error paths
- [ ] Real DB for integration (per `CLAUDE.md` — no DB mocks)
- [ ] Coverage moves toward 70% lines / 60% branches

## Expected output

New passing tests + a coverage delta note.

## Failure handling

If behavior is ambiguous, document the assumption in the test name.
