---
name: edge-case-finder
description: "Enumerate edge cases for a function from its spec or signature and turn each into a concrete named test case."
allowed-tools: ["Read", "Grep", "Write"]
output: "edge-case list plus test stubs"
---

# Edge Case Finder

## Musts

- Read the function's signature and spec to understand each parameter's type, range, and meaning.
- Enumerate cases across categories: boundaries, empty, null or missing, unicode and encoding, numeric overflow, and concurrency where state is shared.
- State briefly why each case matters, so a reviewer can accept or reject it.
- Turn each accepted case into a named test that asserts a specific expected outcome.
- Mark which tests assert current behavior versus which probe a suspected bug.

## Guidelines

- For numeric inputs, include zero, negative, the max representable value, and just-past-boundary values.
- For strings, include empty, whitespace-only, very long, and multi-byte unicode inputs.
- For collections, include empty, single-element, and duplicate-element inputs.
- Flag concurrency hazards only when the function touches shared or external state.
- Do not invent requirements; when the spec is silent on a case, note the ambiguity rather than guessing.

## Output format

```
## Edge cases for `split_bill(total, people)`

| Case                    | Category  | Expected                    | Kind             |
|-------------------------|-----------|-----------------------------|------------------|
| people = 0              | boundary  | raises ValueError           | current behavior |
| total = 0               | boundary  | every share is 0            | current behavior |
| total not divisible     | numeric   | remainder handled, no loss  | probes suspected |
| people is negative      | boundary  | raises ValueError           | probes suspected |

def test_split_bill_zero_people_raises():
    with pytest.raises(ValueError):
        split_bill(100, 0)
```
