skills/edge-case-hunter/SKILL.md
Exhaustive edge-case review that traces branching paths and boundary conditions in a diff or code sample and reports only unhandled cases. Use when the user asks to hunt edge cases, boundary conditions, missing guards, or wants an edge-case-focused review.
npx skillsauth add harshitsinghbhandari/domain-expansion edge-case-hunterInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
An aggressive edge-case discovery skill that systematically hunts production break points in code. Ignores happy paths entirely. Assumes nominal behavior tests already exist. Surfaces only the highest-risk unhandled edge cases with ready-to-use test code.
100% edge cases only. Happy-path tests are assumed to exist and are explicitly ignored. This skill is deliberately thorough and paranoid — it hunts every realistic production break point: nulls, empties, malformed data, timeouts, auth expiry, partial failures, race-prone sequences, and boundary conditions.
The goal is not comprehensive test coverage. The goal is catching the bugs that will page you at 3am.
If you found it, report it. Do not rationalize away a finding as "unlikely" or "the developer probably knows." Your report goes under the user's name — every missed edge case reflects on them personally.
Explicit triggers only. This skill activates ONLY when the user explicitly mentions:
Required input: User must provide source code files, a directory, or reference changed files in a branch/PR. If no target is provided, ask: "What code would you like me to hunt edge cases in? Provide a directory path, file(s), or branch name."
Languages supported: Auto-detected from file extensions. Works with any language; depth is strongest for Python, TypeScript, Go, Java, and Rust.
node_modules, __pycache__, .git, test files, etc.)"Directory too large (XX kLOC). Please narrow to a subdirectory, or I can suggest the tightest sub-directories that stay under the limit."
Every potential edge case is scored by Risk = Impact × Probability.
| Score | Meaning | |-------|---------| | 9-10 | User data corruption, security hole, total outage, money loss | | 7-8 | Crashes request pool, wrong response to customer, background job failure | | 5-6 | Degraded performance, silent wrong answer, retry storm | | 3-4 | Cosmetic issues, logging noise, monitoring false positives | | 1-2 | Negligible, purely theoretical |
Based on:
Parse the target code and identify:
For each function, systematically generate edge candidates using:
In addition to input-driven edge cases, trace data-flow edge cases. These tend to produce high-Impact, high-Probability edges because they involve persistence and external systems — the bugs that pass CI and break in production.
1. Schema round-trip breaks
Find every place data is serialized and deserialized (written to disk, database, config, API). For each:
2. Stale state after transformation
Find every place state is stored, cached, or derived. For each:
3. Partial operation states
Find every multi-step mutation (multiple writes, moves, renames, network calls). For each:
4. External tool desync
Find every interaction with external tools (git, tmux, Docker, k8s). For each:
5. Dual-path inconsistencies
Find cases where the same conceptual data has two code paths (two readers, two writers, two derivation functions). For each:
For each edge candidate:
Produce edge-case-report.md with the structure defined below.
Generate edge-case-report.md with this exact structure:
# Edge Case Hunter Report
**Target:** [directory/file path]
**LOC scanned:** [X,XXX lines]
**Language:** [Python / TypeScript / Mixed]
**Scan date:** [YYYY-MM-DD]
## Summary
Found **[N] potential edge cases**.
Top **[M] highest-risk** edges surfaced below (all Risk ≥ 18).
No happy-path tests were generated.
## Risk Table
| # | Edge Case | Impact | Prob | Risk | Location |
|---|-----------|--------|------|------|----------|
| 1 | [description] | [1-10] | [1-10] | [score] | `[file:line]` |
| 2 | ... | ... | ... | ... | ... |
## Detailed Edge Cases
### 1. [Edge Case Name] (Risk [score])
**Where it fails:**
[Exact function/method and what assumption breaks]
**Code path that breaks:**
```[language]
# [file:line]
[relevant code snippet]
Why this is realistic: [Explain probability — has this happened in similar systems? What triggers it?]
Suggested edge-case test:
[ready-to-copy test code using the project's test framework]
...
[Optional section listing a few edges that scored Risk < 18 with brief explanation of why they were dropped, e.g., "requires 4+ unlikely conditions to align"]
## Standards for Analysis
### Be Aggressive but Realistic
- Hunt every realistic break point, but don't fabricate scenarios that require absurd preconditions
- "100 non-normal conditions to align" = Risk crushed to near-zero, dropped from report
- Prefer edges that have actually happened in similar systems over purely theoretical ones
### Reference Everything
- Every edge case must cite exact file path and line number
- Include the actual code snippet that breaks
- Explain the specific input/state that triggers the failure
### Provide Runnable Tests
- Generate test code matching the project's test framework (auto-detect pytest, unittest, Jest, etc.)
- Tests should be copy-paste ready
- Include setup/mocking for external dependencies
- Assert the specific failure mode (exception type, error message, status code)
### Don't Repeat Other Skills
- This skill does NOT audit code quality (use code-quality-audit)
- This skill does NOT audit test coverage (use test-coverage-audit)
- This skill does NOT review PRs holistically (use pr-review)
- This skill ONLY finds edge cases
## Invocation Examples
/edge-case-hunter path/to/my-service/core/
/edge-case-hunter --branch feature/payments
User: "Hunt edge cases in the orders module" Agent: [scans orders/ directory, produces report]
User: "What edge cases am I missing in auth.py?" Agent: [scans auth.py specifically, produces focused report]
## Quality Assurance
- Do not invoke this skill unless explicitly triggered
- Do not generate happy-path tests — assume they exist
- Do not auto-fix the code — only report and suggest tests
- If LOC limit exceeded, ask before proceeding
- If no edge cases found with Risk ≥ 18, explicitly say so (rare but possible for very robust code)
## Example Trigger Phrases
- "Hunt edge cases in the payments module"
- "What edge cases am I missing in this PR?"
- "Find boundary conditions in auth.py"
- "What could break in this code?"
- "Edge case review for services/user/"
- "Look for missing guards in the API handlers"
development
Aggressive user-flow and boundary-bug analysis on a diff or branch. Auto-detects entry points, traces flows through changed code, finds every seam (cross-module calls, serialization, file I/O, shared state, schema versioning, network/IPC), and refuses to mark the work complete until each unverified boundary has a real round-trip test or an explicit written out-of-scope record persisted in an audit file. Use whenever the user says "boundary check", "seam check", "round-trip check", "flow boundaries", "user-flow check", "before merge", "is this safe to ship", "pre-merge gate", "boundary bugs", "verify the joins", or asks to validate cross-module joins, producer/consumer contracts, or end-to-end coverage of a change. Also use as a final gate from pr-review on any diff that touches more than one file, module, or process. Be pushy. Most surviving production bugs live at seams, not inside units — if the diff crosses any boundary, this skill almost certainly applies.
development
Run existing work through 5 specialist craftspeople who each produce an improved version, then peer-review and synthesize the best into a single improved artifact. Use when the user says "forge this", "improve this", "make this better", "level this up", "refine this", or asks for multi-angle improvement on code, copy, strategy, plans, designs, or any artifact where the current version works but could be significantly better. Do NOT use for decisions (use llm-council), simple edits, or creation from scratch.
development
Expert skill for maintaining a Keep a Changelog formatted CHANGELOG.md file. Use this skill whenever you add features, fix bugs, or release a new version. You MUST use this skill to record any changes that have a user-facing impact. It handles categorization (Added, Changed, Fixed, etc.), semantic versioning, and reverse-chronological ordering with surgical precision.
development
Comprehensive test suite audit that combines ruthless analysis with a solution-focused roadmap. Reads test suites (unit, integration, e2e) and source code, produces a brutal audit report of test quality and gaps, and generates prioritized testing improvements.