---
name: myai-dev-test
description: Write and run tests, analyse coverage, and report real results
---

Generate tests and run them.

Invoke the `myaidev-tester` skill for the full pipeline — strategy, generation, execution,
coverage analysis. For direct test writing, invoke the `dev-tester` agent.

## Usage

```bash
/myai-dev-test "Cover the payment retry path"
/myai-dev-test --tdd "Rate limiting on the login route"
/myai-dev-test --coverage-threshold 90
```

## Options

| Option | Description | Default |
|--------|-------------|---------|
| `--tdd` | Write failing tests first, as the spec for implementation | `false` |
| `--style` | `london` (mock-heavy) or `chicago` (state-based) | `chicago` |
| `--coverage-threshold` | Minimum coverage percentage | `80` |

## What It Does

1. Detects the runner, test location, naming, and assertion style already in use
2. Writes tests against observable behaviour through the public interface
3. Covers boundaries and failure paths, not only the happy path
4. **Runs them** and reports actual output
5. Analyses coverage and reports the gaps that carry real risk

In TDD mode it confirms the tests fail first — a test that passes against no
implementation is testing nothing.

## Output

Test files, plus `{session_dir}/test-results.md` with pass/fail counts, real coverage from
the tool, and a diagnosis of each failure saying whether the test or the code is wrong.
