tailtest hunt
Run an adversarial pass on a specific file -- explicitly try to break the source code with R15 adversarial scenarios. Forces an adversarial-biased pass regardless of project depth setting.
Trigger phrases
/tailtest hunt <file>
tailtest hunt <file>
hunt for bugs in <file>
adversarial test <file>
Behavior
- Read the source file at the named path
- Generate 8-12 adversarial test scenarios from the R15 categories in
rules/tailtest.mdc:
- Boundary inputs (
MAX_INT, MIN_INT, empty, single-element, unicode, null bytes, malformed UTF-8)
- Format / injection (path traversal
.., regex specials, shell metacharacters, SQL fragments)
- Type confusion (wrong type passed)
- Concurrent state (race conditions, shared mutable state)
- Time / locale edges (DST, leap year, timezone)
- Error handling under partial failures (network mid-call fail, disk full, EINTR)
- Resource exhaustion (very large input, deeply nested input)
- Off-by-one logic (boundary indices, fence-post errors)
- Pick categories that genuinely apply; skip any that do not (state which were skipped and why)
- Output a SCENARIO PLAN with each scenario labeled
[adversarial: <category>]
- Write to a SEPARATE hunt test file (NOT the regular test file)
- Run the hunt test file
- Apply R12 classification on any failures (real_bug / environment / test_bug)
- Report failing scenarios with classification, e.g.
[adversarial: type-confusion] real_bug -- function returns None on int input where str expected.
- If all pass:
tailtest hunt: {N} adversarial scenarios on {file}, all passed.
Where to write the hunt test file
| Source file |
Hunt test file |
services/billing.py |
tests/test_billing_hunt.py |
app/Http/Controllers/OrderController.php |
tests/Feature/OrderControllerHuntTest.php |
internal/handler.go |
internal/handler_hunt_test.go |
components/Button.tsx |
__tests__/Button_hunt.test.tsx |
The separate hunt file does not contaminate the main test suite. User decides whether to keep, merge into the main test file, or discard after review.
Bypass behavior
This skill bypasses depth from .tailtest/config.json. Even at depth: simple (which normally generates 0 adversarial scenarios per R15), /tailtest hunt runs the full 8-12 adversarial pass on the named file.
Constraints
- Do not auto-fix. Always ask before fixing any
real_bug found by hunt.
- No update-existing-tests behavior. Hunt always writes to the separate hunt test file. If the hunt file already exists, replace its contents (the user is asking for a fresh hunt).
- Treat the named file as
new-file regardless of git status.
- Update
.cursor/hooks/state/tailtest.json generated_tests to record the hunt test file mapping (source -> hunt test file).
1---2name: tailtest-hunt3description: tailtest hunt4---5# tailtest hunt67Run an adversarial pass on a specific file -- explicitly try to break the source code with R15 adversarial scenarios. Forces an adversarial-biased pass regardless of project depth setting.89## Trigger phrases1011- `/tailtest hunt <file>`12- `tailtest hunt <file>`13- `hunt for bugs in <file>`14- `adversarial test <file>`1516## Behavior17181. Read the source file at the named path192. Generate 8-12 adversarial test scenarios from the R15 categories in `rules/tailtest.mdc`:20 - Boundary inputs (`MAX_INT`, `MIN_INT`, empty, single-element, unicode, null bytes, malformed UTF-8)21 - Format / injection (path traversal `..`, regex specials, shell metacharacters, SQL fragments)22 - Type confusion (wrong type passed)23 - Concurrent state (race conditions, shared mutable state)24 - Time / locale edges (DST, leap year, timezone)25 - Error handling under partial failures (network mid-call fail, disk full, EINTR)26 - Resource exhaustion (very large input, deeply nested input)27 - Off-by-one logic (boundary indices, fence-post errors)283. Pick categories that genuinely apply; skip any that do not (state which were skipped and why)294. Output a SCENARIO PLAN with each scenario labeled `[adversarial: <category>]`305. Write to a SEPARATE hunt test file (NOT the regular test file)316. Run the hunt test file327. Apply R12 classification on any failures (real_bug / environment / test_bug)338. Report failing scenarios with classification, e.g. `[adversarial: type-confusion] real_bug -- function returns None on int input where str expected.`349. If all pass: `tailtest hunt: {N} adversarial scenarios on {file}, all passed.`3536## Where to write the hunt test file3738| Source file | Hunt test file |39|---|---|40| `services/billing.py` | `tests/test_billing_hunt.py` |41| `app/Http/Controllers/OrderController.php` | `tests/Feature/OrderControllerHuntTest.php` |42| `internal/handler.go` | `internal/handler_hunt_test.go` |43| `components/Button.tsx` | `__tests__/Button_hunt.test.tsx` |4445The separate hunt file does not contaminate the main test suite. User decides whether to keep, merge into the main test file, or discard after review.4647## Bypass behavior4849This skill bypasses `depth` from `.tailtest/config.json`. Even at `depth: simple` (which normally generates 0 adversarial scenarios per R15), `/tailtest hunt` runs the full 8-12 adversarial pass on the named file.5051## Constraints5253- **Do not auto-fix.** Always ask before fixing any `real_bug` found by hunt.54- **No update-existing-tests behavior.** Hunt always writes to the separate hunt test file. If the hunt file already exists, replace its contents (the user is asking for a fresh hunt).55- Treat the named file as `new-file` regardless of git status.56- Update `.cursor/hooks/state/tailtest.json` `generated_tests` to record the hunt test file mapping (source -> hunt test file).