edge-cases
Skill0 starsChanged 3 months agoMITView on GitHub
Use when implementing a feature or bugfix, and before declaring done. Enumerate inputs/states/failure modes before coding, defend boundaries while coding, adversarially self-review the diff after. Prevents happy-path-only code.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- SprocketLab/slop-code-benchtheir own version, first seen Oct 9, 2026
- morshed272/claude-build-workflowtheir own version, first seen Jan 18, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- SprocketLab/slop-code-bench★ 288same name
- morshed272/claude-build-workflow★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository110 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/project-bootstrap/templates/agents.mdAGENTS.md
- a11y-auditSkill
- agentic-ragSkill
- agent-reachSkill
- ai3d-genSkill
- ai-coding-dictionarySkill
- ai-toolsSkill
- animation-directionSkill
- api-specSkill
- architecture-diagramsSkill
- architectureSkill
- ascii-artSkill
- ask-bundleSkill
- binary-triageSkill
- bragSkill
- brag-slimSkill
- career-opsSkill
- code-reviewSkill
- computer-useSkill
- context7Skill
- context-hygieneSkill
- creative-engineeringSkill
- cu-realtimeSkill
- data-analystSkill
- databaseSkill
- dead-wireSkill
- debuggingSkill
- deploySkill
- devin-configSkill
- dispatching-parallel-agentsSkill
- dmaSkill
- dockerSkill
- drift-reportSkill
- e2e-testingSkill
- executionSkill
- fact-checkSkill
- finishing-a-development-branchSkill
- firmware-probeSkill
- frontend-designSkill
- gatesSkill
- ghidraSkill
- ghSkill
- github-actionsSkill
- git-workflowsSkill
- grillingSkill
- handoffSkill
- humanizerSkill
- hyperframesSkill
- i18nSkill
- image-forensicsSkill
- impeccableSkill
- implement-layaSkill
- intakeSkill
- jiraSkill
- knowledge-modelingSkill
- laya-orchestratorSkill
- learn-modeSkill
- mcp-governanceSkill
- media-toolsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 14
Before implementing a feature or a function that takes external input.
- Distinctive: line 15
Before fixing a bug (the bug proves an edge case existed.
- Distinctive: line 16
After writing code, before claiming done.
- Distinctive: line 32
If the list comes out empty, you have not thought enough.
- Distinctive: line 90
Do not mutate what is not yours: no mutating parameters without documenting.
- Distinctive: line 91
Reversible before irreversible: write temp file and rename > truncate the original.
- Distinctive: line 104
Do logs/errors leak secrets or personal data?
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Edge Cases
Models write the happy path by default. Production bugs live at the edges: empty input, index -1, timeout, duplicates, wrong encoding, half-finished state. Enumerate, defend, verify instead of trusting instinct.
When to use
- Before implementing a feature or a function that takes external input.
- Before fixing a bug (the bug proves an edge case existed; fixing it and checking its neighbors is the minimum).
- After writing code, before claiming done.
- During code review (self or via the
reviewersubagent).
Core principle
"Works" only counts after the unhappy path has actually been executed. Reading the code and believing it is not enough: run the edge case and read the output.
Step 1 (before coding): enumerate
For each function/task, list in text (not in your head):
- Inputs: what comes in? from where? who controls it?
- States: what states can the system be in when this runs?
- Dependencies: what can fail outside my control (network, FS, DB)?
- How does it break?: for each input/state/dependency, write "if X is Y, this breaks because Z".
If the list comes out empty, you have not thought enough. Every function has at least one edge case.
Edge case taxonomy (checklist)
Input
- empty / null / undefined / whitespace-only string
- unicode, emoji, accents, RTL, surrogate pairs
- too long / too short / exactly at the limit
- wrong type (string where a number was expected, object where an array)
- malformed: broken JSON, invalid date, path traversal
- injection: quotes,
<script>,--,; DROP,\nin a header field
Numbers and boundaries
- 0, -1, negative, MAX_INT, overflow
- off-by-one: first/last element,
i <= nvsi < n - division by zero, modulo of negative
- float: precision, NaN, Infinity,
0.1 + 0.2
Collections
- empty, single element, duplicates
- assumed order vs guaranteed order (do not confuse)
- modification during iteration
- pagination: first/last page, page beyond the end
State and concurrency
- uninitialized / partially initialized object
- operation already done (idempotency): is retry safe?
- race: two simultaneous requests, double-submit
- partial failure: half the work done, inconsistent state
- lock: who holds, who releases, deadlock
Time
- timezone, DST, leap year
- clock skew between machines
- epoch, pre-1970 dates, ms vs s timestamps
- timeout vs duration (do not confuse)
Resources
- full disk, memory, quota
- network down, DNS failure, high latency
- closed file handle, permissions
- rate limit, circuit breaker
Environment
- path with space/unicode,
/vs\separator - filesystem case sensitivity (Windows vs Linux)
- locale:
1.000,50vs1,000.50 - encoding: UTF-8 vs Latin-1 vs BOM
Step 2 (while coding): defend
For each enumerated edge, choose deliberately:
- Validate at the boundary: external input is validated on entry, not trusted downstream. After validation, everything inside is typed.
- Fail loud and early: a clear error at the source beats silence.
throw new Error("invalid email: missing @")> magic null. - No silent catch: empty
catch {}is forbidden. If you catch, log or re-throw or document why it is safe to ignore. - Defaults must not hide bugs: a default that masks bad input creates a silent bug. Defaults only for legitimate fallback.
- Explicit bounds check:
arr[i]only after provingifits. - Do not mutate what is not yours: no mutating parameters without documenting; no writing global state without thinking about concurrency.
- Reversible before irreversible: write temp file and rename > truncate the original.
Step 3 (after coding): adversarial self-review
Re-read your own diff asking "how would I break this?":
- Does every
ifhave itselseconsidered? (even if "else = nothing, correct because...") - Does every
parse/json/awaithave a failure path? - Does every loop terminate, including with pathological input?
- Is every opened resource closed on all paths (including errors)?
- Are magic numbers constants/comments or obvious?
- What happens if this runs twice in a row? (idempotency)
- What happens in two tabs/threads at once?
- Do logs/errors leak secrets or personal data?
For changes > 3 files or with non-obvious risk, dispatch the reviewer subagent with diff + context.
Verification: run the unhappy path
- For each edge case from Step 1, run a real test (
testingskill if infra exists; otherwise a disposable script under.devin/scratch/, graduating it to the real test dir if it proves value). - Report: edge case, what was run, actual observed result.
- "I looked and it seems right" is NOT verification.
Definition of done
- Happy path executed and observed
- Every enumerated edge case handled (code or explicit decision)
- Error paths actually executed
- Adversarial self-review done on the diff
- No empty catch, no debug leftovers, no skipped validation
Anti-patterns
- "Works on my test" = happy path only. Does not count.
- Enumerating edge cases and handling none.
- Handling edge cases with infinite retry or magic defaults.
- Copying the edge case that caused the bug and forgetting its neighbors.
- Marking TODO without telling the user.
- Claiming "tested" without running.
Cascade
research: understand the contextedge-cases(this): enumerate and defend during implementationtesting: run the edge cases for realreviewersubagent: second read of the diffgit-workflows: clean commit
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

