BACK TO TEMPLATES
promptany

Edge Case and Boundary Condition Detector Prompt

Prompt template for scanning functions and algorithms for boundary conditions, off-by-one errors, and race conditions.

When to use this

Use this prompt before releasing critical algorithm logic or financial/payment calculations to detect edge cases.

The template

Analyze the target code for subtle edge cases, boundary conditions, and potential runtime failures.

Check specifically for:
1. Off-by-one errors in index loops and slice ranges.
2. Division by zero, integer overflow/underflow, and floating-point precision loss.
3. Null pointer dereferences, undefined object properties, or unhandled empty arrays.
4. Concurrent access race conditions or deadlock risks.

Target Code:
```[LANGUAGE]
[PASTE CODE HERE]
```

How to use

Paste your core logic block into the code prompt.

Last verified 2026-07-26