| name | piggy-test |
| description | Generate the smallest runnable test that would fail if the lazy solution broke — one check, no framework or fixtures unless the repo already uses one. Use when the user says "test this", "piggy test", "/piggy-test", or "write a check for this".
|
Piggy Test
Write the smallest test that fails if the lazy solution breaks. This mirrors
the README's rule that non-trivial logic leaves one runnable check behind —
this skill is that check, on demand.
Rules
- One test per behavior, not a suite. Cover the happy path and the one edge
case that would actually bite (empty input, boundary value, the thing the
ticket was about) — not every theoretical edge case.
- Use whatever the repo already uses (
assert, the installed test runner).
Don't introduce a new test framework or fixture library for one check.
- Trivial one-liners (a stdlib call, a native feature) need no test — say so
and stop rather than manufacture one.
- No mocks, no setup/teardown scaffolding, unless the function under test
genuinely can't run without them.
Output
## Test
<the minimal runnable check>
## Covers
<one line: what breaking would look like if this failed>
Example
const isValidEmail = (s) => /\S+@\S+\.\S+/.test(s);
## Test
console.assert(isValidEmail('a@b.com') === true, 'valid email rejected');
console.assert(isValidEmail('not-an-email') === false, 'invalid email accepted');
## Covers
regex stops matching real addresses, or starts matching garbage.
Boundaries
One check, not coverage. For a fuller suite the user should say so
explicitly — this skill's default is the minimum, not the maximum.
"stop piggy-test" or "normal mode" to revert.