From c3
Systematic bug hunting workflow for finding edge cases and hidden bugs. Use after implementing features, before releases, or when asked to find bugs, probe for holes, or stress-test code. Examples: "hunt for edge cases", "what could go wrong", "stress-test config parsing".
How this skill is triggered — by the user, by Claude, or both
Slash command
/c3:bug-huntingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Systematic workflow for finding edge cases and hidden bugs before they reach production.
Systematic workflow for finding edge cases and hidden bugs before they reach production.
| Capability | Description |
|---|---|
| Architecture analysis | Understand codebase structure before hunting |
| Edge case generation | Systematically probe for boundary conditions |
| Test-driven fixing | Write tests before implementing fixes |
| Severity prioritization | Rank bugs by impact and fix effort |
| Real-world validation | Test against actual project schemas |
Use this skill when:
Before hunting, understand what you're hunting in:
1. Read Core Documentation:
CLAUDE.md - Project conventions and patternsAGENTS.md - Best practices and testing patternsREADME.md - Usage examples and common patterns2. Identify Key Data Flows:
3. Map Critical Paths:
4. Document Assumptions:
Example from Clevis session:
Architecture Understanding:
- Core: @configclass decorator transforms dataclasses into config loaders
- Flow: TOML file → extract section → resolve defaults → validate types → instantiate
- Key boundaries: Decorator application, TOML extraction, type coercion
- Assumptions: TOML sections exist, types match, field names don't conflict
Systematically find existing bugs:
1. Trace Critical Operations:
# For each critical operation:
def critical_operation(data):
# Trace: What does this assume?
# Trace: What could go wrong?
# Trace: What edge cases exist?
2. Check Error Handling:
3. Validate Assumptions:
4. Test Boundary Conditions:
Example bug found in Clevis:
# Assumption: TOML section for subcommand exists
# Reality: Section might be missing, code crashed
# Bug: Silent failure when TOML section not found
# Found by asking: "What if subcommand config is missing from TOML?"
CRITICAL: Write tests BEFORE fixing bugs.
1. Create Failing Test:
def test_bug_name():
"""Bug: [Description of bug]
Expected: [What should happen]
Actual: [What currently happens]
"""
# Arrange - Set up minimal reproduction
config_data = {...}
# Act - Trigger the bug
result = operation(config_data)
# Assert - Current behavior (test passes, proving bug exists)
assert result.has_issue # Documents current broken behavior
2. Verify Test Reproduces Bug:
pytest tests/test_bug.py -v
# Should PASS (proving bug exists)
3. Implement Minimal Fix:
4. Update Test to Expect Correct Behavior:
def test_bug_name():
# ... arrange and act same as before
# Assert - Expected behavior (test should now pass)
assert result.is_correct # Expects fixed behavior
5. Verify Fix:
pytest tests/test_bug.py -v
# Should PASS (proving fix works)
Test Stub Workflow (when working with testing-engineer):
tests/test_{module}_{feature}.py ← Created by testing-engineer (FAILING)
↓
You read stubs to understand expected behavior
↓
You implement the feature
↓
You UPDATE stubs to real test assertions
↓
All tests transition from FAIL → PASS
After fixing known bugs, hunt for unknown ones:
Categories of Edge Cases:
[], {}, "", None)[x], {k: v}, "a")Systematic Hunting Process:
For each category:
1. Generate test cases for each edge case
2. Run tests
3. Document failures
4. Prioritize by severity
5. Fix in order of priority
Edge Case Generation Techniques:
Equivalence Partitioning:
Boundary Value Analysis:
Decision Table Testing:
State Transition Testing:
Error Guessing:
Prioritization Framework:
| Severity | Criteria | Action |
|---|---|---|
| Critical | Data loss, security vulnerability, crash | Fix immediately |
| High | Feature broken, no workaround | Fix before release |
| Medium | Feature impaired, workaround exists | Fix soon |
| Low | Minor issue, cosmetic | Document as known issue |
Fix Process:
Document the Bug:
## Bug: [Title]
### Severity
[Critical/High/Medium/Low]
### Description
[What's wrong]
### Reproduction
[Steps to reproduce]
### Expected Behavior
[What should happen]
### Actual Behavior
[What actually happens]
### Root Cause
[Why it happens]
### Fix
[How to fix it]
### Test Coverage
[What tests were added]
Write Test (Phase 3)
Implement Fix:
Run Full Test Suite:
make test # Must pass
make lint # Must pass
make typecheck # Must pass
Create Regression Tests:
Real-World Validation:
See patterns/advanced-techniques.md for:
See patterns/integration-workflow.md for:
See templates/bug-report.md for the bug report template.
See patterns/edge-case-categories.md for comprehensive list of edge case categories organized by:
See patterns/bug-severity.md for detailed severity classification:
See examples/clevis-session.md for a complete example of systematic bug hunting on a real project, including:
npx claudepluginhub christophevg/marketplace --plugin c3Creates, edits, and verifies skills using a test-driven development approach with pressure scenarios and subagents.