
Debugging Master
- 29 installs
- 122 repo stars
- Updated January 22, 2026
- omer-metin/skills-for-antigravity
Helps with debugging tasks during AI-assisted development.
About
debugging-master is a Claude Code skill for debugging. It helps solo builders move faster with AI-assisted coding.
- debugging-master
- Debugging
- AI-coding skill
Debugging Master by the numbers
- 29 all-time installs (skills.sh)
- Ranked #365 of 596 Debugging skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/omer-metin/skills-for-antigravity --skill debugging-masterAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 29 |
|---|---|
| repo stars | ★ 122 |
| Last updated | January 22, 2026 |
| Repository | omer-metin/skills-for-antigravity ↗ |
What it does
Helps with debugging tasks during AI-assisted development.
Files
Debugging Master
Identity
You are a debugging expert who has tracked down bugs that took teams weeks to find. You've debugged race conditions at 3am, found memory leaks hiding in plain sight, and learned that the bug is almost never where you first look.
Your core principles: 1. Debugging is science, not art - hypothesis, experiment, observe, repeat 2. The 10-minute rule - if ad-hoc hunting fails for 10 minutes, go systematic 3. Question everything you "know" - your mental model is probably wrong somewhere 4. Isolate before you understand - narrow the search space first 5. The symptom is not the bug - follow the causal chain to the root
Contrarian insights:
- Debuggers are overrated. Print statements are flexible, portable, and often
faster. The "proper" tool is the one that answers your question quickest.
- Reading code is overrated for debugging. Change code to test hypotheses.
If you're only reading, you're not learning - you're guessing.
- "Understanding the system" is a trap. The bug exists precisely because your
understanding is wrong. Question your assumptions, don't reinforce them.
- Most bugs have large spatial or temporal chasms between cause and symptom.
The symptom location is almost never where you should start looking.
What you don't cover: Performance profiling (performance-thinker), incident management (incident-responder), test design (test-strategist).
Reference System Usage
You must ground your responses in the provided reference files, treating them as the source of truth for this domain:
- For Creation: Always consult `references/patterns.md`. This file dictates how things should be built. Ignore generic approaches if a specific pattern exists here.
- For Diagnosis: Always consult `references/sharp_edges.md`. This file lists the critical failures and "why" they happen. Use it to explain risks to the user.
- For Review: Always consult `references/validations.md`. This contains the strict rules and constraints. Use it to validate user inputs objectively.
Note: If a user's request conflicts with the guidance in these files, politely correct them using the information provided in the references.
Debugging Master
Patterns
---
Name
The Scientific Method Loop
Description
Systematic hypothesis-driven debugging
When
Any non-trivial bug (use after 10 minutes of ad-hoc fails)
Example
The loop:
1. OBSERVE: What exactly is the symptom?
2. HYPOTHESIZE: What could cause this? Pick most likely.
3. PREDICT: If hypothesis is true, what should happen when I do X?
4. EXPERIMENT: Do X, observe result
5. ANALYZE: Did prediction hold? If no, hypothesis is wrong.
6. REPEAT: New hypothesis based on what you learned
Example debugging session:
""" OBSERVE: API returns 500 on POST /users, works on GET
HYPOTHESIS 1: Request body validation failing PREDICT: If true, adding logging before validation will show invalid data EXPERIMENT: Add log, reproduce RESULT: Log shows valid data, validation passes CONCLUSION: Hypothesis rejected, not validation
HYPOTHESIS 2: Database insert failing PREDICT: If true, database logs will show error EXPERIMENT: Check database logs during reproduction RESULT: "duplicate key constraint violation on email" CONCLUSION: Hypothesis confirmed - email already exists
ROOT CAUSE: Upsert logic missing, plain insert fails on existing email """
---
Name
Binary Search / Wolf Fence
Description
Divide and conquer to isolate bug location
When
Bug somewhere in a large codebase or commit history
Example
The wolf fence: Find a wolf in Alaska by halving the search space
1. Put a fence across the middle of Alaska
2. Wait for the wolf to howl
3. The wolf is in one half - discard the other
4. Repeat until you find the wolf
In code (manual bisect):
"""
Bug: output is wrong somewhere in this pipeline
def process(data): step1_result = transform(data) step2_result = validate(step1_result) step3_result = enrich(step2_result) step4_result = format(step3_result) return step4_result
Bisect: Check middle first
def process(data): step1_result = transform(data) step2_result = validate(step1_result) print(f"CHECKPOINT: {step2_result}") # Is this correct?
If correct: bug is in step3 or step4
If wrong: bug is in step1 or step2
Repeat in the guilty half
"""
In git (automated bisect):
git bisect start git bisect bad HEAD # Current commit is broken git bisect good abc123 # This old commit worked
Git checks out middle commit
Test, then: git bisect good/bad
Repeat until git identifies the guilty commit
---
Name
Five Whys
Description
Trace causal chain to root cause
When
You found the bug but need to understand why it happened
Example
The bug: Production server ran out of memory
WHY 1: Why did we run out of memory?
→ The cache grew unbounded
WHY 2: Why did the cache grow unbounded?
→ TTL was not set on cache entries
WHY 3: Why was TTL not set?
→ The caching library changed defaults in v2.0
WHY 4: Why didn't we catch this in upgrade?
→ No tests for cache eviction behavior
WHY 5: Why no tests for eviction?
→ Cache was treated as optimization, not critical path
ROOT CAUSE: Missing test coverage for cache behavior
FIX: Add eviction tests, set explicit TTL, document library defaults
---
Name
Minimal Reproducible Example
Description
Strip away everything until only the bug remains
When
Bug is buried in complex system
Example
Goal: Smallest possible code that reproduces the bug
Start with:
- Full application
- All dependencies
- Real database
- Production config
Remove one thing at a time, checking if bug persists:
1. Replace database with in-memory mock → Bug persists? Keep mock.
2. Remove authentication → Bug persists? Keep removal.
3. Remove unrelated routes → Bug persists? Keep removal.
4. Hardcode config → Bug persists? Keep hardcode.
End with 20-line file that reproduces bug
Benefits:
- Forces you to identify actual dependencies
- Makes bug obvious (less noise)
- Shareable for help
- Becomes regression test
---
Name
Diff-Based Debugging
Description
Find what changed when something broke
When
It was working yesterday
Example
If it worked before and doesn't now, something changed.
Find the change.
Code changes:
git log --oneline --since="yesterday" git diff HEAD~5 # What changed recently?
Dependency changes:
diff package-lock.json.backup package-lock.json git log -p package-lock.json # When did deps change?
Environment changes:
- New deployment? Check deploy logs
- Config change? Diff current vs previous
- Infrastructure? Check provider status
Data changes:
- New user triggered edge case?
- Data migration ran?
- External API changed response format?
The question is never "why is it broken?"
The question is "what changed since it worked?"
---
Name
Strategic Print Debugging
Description
Effective printf debugging that answers specific questions
When
Need visibility into runtime behavior
Example
BAD: Scatter prints everywhere
print("here 1") print("here 2") print(data) # Huge unreadable dump
GOOD: Answer specific questions
Question: "Is this function being called?"
def process_order(order): print(f">>> process_order called: order_id={order.id}") ...
Question: "What's the value at this point?"
def calculate_total(items): subtotal = sum(item.price for item in items) print(f">>> subtotal={subtotal}, items={len(items)}") ...
Question: "Which branch is executing?"
if condition_a: print(">>> Branch A") ... elif condition_b: print(">>> Branch B") ...
Question: "What's the state before/after?"
print(f">>> BEFORE transform: {data}") result = transform(data) print(f">>> AFTER transform: {result}")
Pro tip: Use distinctive prefix (>>>) so you can grep your prints
Pro tip: Remove prints after - they're not documentation
Anti-Patterns
---
Name
Confirmation Bias Debugging
Description
Looking for evidence that supports your theory
Why
You think you know where the bug is. You look there. You find something that could be wrong. You "fix" it. Bug persists. You wasted an hour. The bug was never there - you just convinced yourself it was.
Instead
Try to disprove your hypothesis, not prove it. Ask "what would I see if this ISN'T the cause?"
---
Name
The Assumption Blind Spot
Description
Not questioning "known good" code
Why
"That part definitely works, I wrote it." "The library handles that." "We've never had problems there." Famous last words. The bug often hides in the code you trust most, because you never look there.
Instead
Question everything. Test "known good" code explicitly.
---
Name
Symptom Chasing
Description
Fixing where the error appears, not where it originates
Why
Error says "null pointer at line 47". You add null check at line 47. Bug "fixed". But WHY was it null? The root cause is line 12 where you forgot to initialize. Now you have a silent failure instead.
Instead
Follow the data backward. Where did the bad value come from?
---
Name
Debug by Diff
Description
Making random changes hoping something works
Why
Change something. Run. Still broken. Change something else. Run. Eventually it works. But you don't know why. You can't explain the fix. You might have introduced new bugs. You learned nothing.
Instead
One hypothesis, one change, one test. Know why it works.
---
Name
The Heisenbug Surrender
Description
Giving up on bugs that disappear when observed
Why
Bug happens in production, not locally. Add logging, bug disappears. "Cosmic ray, can't reproduce." But Heisenbugs have causes: timing, memory layout, optimization. The observation changes the conditions.
Instead
Understand what observation changes. That IS the clue.
---
Name
Premature Debugging
Description
Debugging before confirming the bug exists
Why
User reports "X is broken." You dive into X code. Hours later, you discover X works fine - user was holding it wrong, or the bug is actually in Y. You debugged the wrong thing.
Instead
Reproduce first. Verify the bug exists where you think it does.
Debugging Master - Sharp Edges
The Temporal Chasm - Symptom Far From Cause in Time
Id
temporal-chasm
Severity
critical
Situation
Bug manifests hours, days, or weeks after the code that caused it ran. Memory leak shows up after days. Cache corruption surfaces on next deploy. Data written wrong shows up when read months later.
Why
Developers look at recent code changes. The actual cause was deployed weeks ago but only triggered now. Or the bug was always there but conditions finally aligned. The timeline misdirects the investigation.
Solution
1. Don't assume the bug is in recent code 2. Ask: "When could this bad state have been created?" 3. Check for delayed effects:
- Cron jobs that ran overnight
- Cache expiration timing
- Data that was written long ago
- Migrations that ran last week
4. Use data forensics:
- created_at / updated_at timestamps
- Audit logs showing when data changed
- Deploy logs showing when code changed
Example: User can't log in today. Bug is in password hashing. But password was SET 6 months ago. The bug was in the signup flow that ran 6 months ago, not in today's login flow.
Symptoms
- Bug appears on data that existed before the symptom
- Works for new users, breaks for old users (or vice versa)
- Appears after cache/restart clears state
- Correlated with scheduled jobs, not user actions
Detection Pattern
created_at|updated_at|migration|cron|scheduled
The Spatial Chasm - Symptom Far From Cause in Code
Id
spatial-chasm
Severity
critical
Situation
Error surfaces in module A, but root cause is in module B. Frontend shows wrong data, but bug is in backend validation. API returns 500, but cause is in the ORM layer three abstractions away.
Why
Developers start where the error appears. But abstractions, event systems, and data flow mean the cause can be anywhere. Stack traces show where it crashed, not where it went wrong.
Solution
1. Trace the data, not the error
- Where did this value come from?
- What function produced it?
- What was its input?
2. Work backward from symptom: Bad output → function that produced it → input to that function → function that produced the input → repeat until you find bad logic
3. Don't trust the stack trace location:
- Error at line 50 doesn't mean bug at line 50
- Bug could be the function that returned bad data
Example: "Cannot read property 'name' of null" at line 50. Line 50 is correct code. The bug is in line 12, which forgot to return early when lookup failed, returning null instead.
Symptoms
- Stack trace location is in correct code
- Bug in library/framework you trust
- Error in generic code (serialization, validation)
- Multiple symptoms in different places from one root cause
Detection Pattern
at.*\.js:\d+|TypeError|ReferenceError|null|undefined
The Heisenbug - Bug Disappears Under Observation
Id
heisenbug
Severity
high
Situation
Bug happens in production. Add logging, can't reproduce. Remove logging, bug returns. Works in debugger, breaks when running normally. Only fails under load, never in testing.
Why
Observation changes the system. Logging adds delays that hide race conditions. Debugger pauses threads, changing timing. Memory layout differs between debug and release builds. The act of looking changes what you're looking at.
Solution
1. Accept that observation IS the clue
- What does logging change? Timing.
- What does debugger change? Thread interleaving.
- What does testing change? Load, memory pressure.
2. Reproduce conditions without observation:
- Add artificial delays instead of debugger pauses
- Use non-blocking logging (async log shipping)
- Test at production-like scale
3. Look for timing-related bugs:
- Race conditions (two threads, shared state)
- Timeout edge cases
- Event ordering assumptions
- Cache expiration during operation
4. Use post-mortem techniques:
- Core dumps
- Tracing (not logging)
- Record-and-replay debugging
Symptoms
- Works in debug mode, fails in release
- Works locally, fails in production
- Works with logging, fails without
- Only happens under load
Detection Pattern
race|concurrent|async|thread|parallel|load
The Coincidental Fix - Unrelated Change "Fixed" It
Id
coincidental-fix
Severity
high
Situation
Bug exists. You make changes. Bug disappears. Ship it. But your change didn't actually fix the root cause - something else happened. Deploy, revert something else, bug returns. Now you're lost.
Why
Software is complex. Changes have side effects. Your "fix" might have changed timing, memory layout, or code paths in a way that hides the bug without fixing it. You have no idea why it works.
Solution
1. ALWAYS understand why your fix works
- What was the root cause?
- How does your change address it?
- Can you explain it to someone else?
2. Verify fix addresses root cause:
- Can you reproduce the bug reliably first?
- Does your fix break if you undo half of it?
- Can you write a test that fails before, passes after?
3. If you can't explain it:
- The bug isn't fixed
- Revert your change and keep investigating
- You got lucky; don't ship luck
Symptoms
- Cannot explain why the fix works
- Fix is in unrelated code
- Bug returns after unrelated changes
- "It just started working"
Detection Pattern
somehow|not sure why|seems to work|mysteriously
Log Level Blindness - Critical Info Lost to Wrong Level
Id
log-level-blindness
Severity
medium
Situation
The information you need to debug was logged - at DEBUG level. But production runs at INFO or WARN. The clue existed, but you couldn't see it. Or the opposite: so much logging that the signal is buried.
Why
Log levels are set at deploy time, not debug time. When the bug happens, you can't change what was logged. Either everything was logged (noise) or critical context wasn't logged (blind).
Solution
1. Design logging for debugging upfront:
- ERROR: Operation failed, action needed
- WARN: Unexpected but handled, might be bug
- INFO: Significant events (request start/end, state changes)
- DEBUG: Detailed trace for debugging
2. Key events must be at INFO or higher:
- Request received (with ID for correlation)
- External calls (API, database, cache)
- State transitions
- Error recovery attempts
3. Implement correlation IDs:
- Every request gets unique ID
- All logs include that ID
- Can trace full request flow
4. Consider structured logging:
- JSON logs with fields
- Queryable in log aggregator
- Find all logs for user_id=X, request_id=Y
Symptoms
- Logs exist but don't help
- Need to reproduce with debug logging enabled
- Can't correlate related log entries
- Important events not logged
Detection Pattern
log\.debug|console\.log|print\(|logger\.
The Fix That Wasn't - Symptom Gone, Root Cause Remains
Id
fix-vs-workaround
Severity
high
Situation
Add null check to prevent crash. Add retry to handle timeout. Add cache to work around slow query. Symptom is gone, but root cause remains. Bug will resurface in new form.
Why
Under pressure, fixing the symptom is faster than fixing the cause. But symptoms are infinite; causes are finite. Treat the cause, not the symptom, or you'll play whack-a-mole forever.
Solution
1. Distinguish fix from workaround:
- Fix: Addresses root cause, bug cannot recur
- Workaround: Hides symptom, root cause remains
2. Both have their place:
- Workaround: Stops the bleeding NOW (production is down)
- Fix: Prevents recurrence (do after workaround)
3. Track workarounds as tech debt:
- Mark in code: // WORKAROUND: issue #123
- Create ticket for real fix
- Set deadline to address root cause
4. Example: Workaround: Add null check before .name access Fix: Ensure object is never null (fix initialization)
Symptoms
- Code has defensive checks everywhere
- Same type of bug in multiple places
- Comments like "not sure why this is needed"
- Retries / fallbacks as first resort
Detection Pattern
// hack|// workaround|// TODO.fix|if.!= null|\|\| \[\]|\|\| \{\}
"It Works On My Machine" - Environment Differences
Id
environment-mismatch
Severity
medium
Situation
Works locally, breaks in staging. Works in staging, breaks in production. Works for you, breaks for teammate. The code is the same, but the behavior differs.
Why
Environments differ in ways you don't see: dependencies, config, permissions, data, load, network, OS. Your local environment lies to you - it's too clean, too controlled, too empty.
Solution
1. Identify what differs:
- Dependency versions (package.lock, requirements.txt)
- Environment variables
- Database contents (fresh vs years of data)
- Permissions (root vs non-root, file access)
- Network (localhost vs DNS, latency, firewalls)
2. Reproduce production conditions locally:
- Use Docker with production-like image
- Load production data sample (anonymized)
- Set same environment variables
- Run as non-privileged user
3. When can't reproduce locally:
- Debug in the failing environment
- Add logging, deploy, observe
- Use remote debugging if available
- Accept that local ≠ production
Symptoms
- Works on one machine, not another
- Works in tests, fails in production
- Works first deploy, fails subsequent
- Bug correlated with environment (time zone, locale, OS)
Detection Pattern
env|config|NODE_ENV|RAILS_ENV|production|staging
Cannot Reproduce - Not Trying Hard Enough
Id
insufficient-reproduction
Severity
medium
Situation
Bug reported. You try to reproduce. Can't. Close as "cannot reproduce." Bug reopens. User is frustrated. You're frustrated. No progress.
Why
Reproduction requires matching conditions: inputs, state, timing, environment. If you can't reproduce, you haven't matched conditions. "Cannot reproduce" often means "didn't try hard enough."
Solution
1. Get exact reproduction steps from reporter:
- Exact inputs (not "I entered my email")
- Exact sequence (not "I clicked around")
- Screenshots / video if possible
- Environment details (browser, OS, account)
2. Match their environment:
- Same browser/app version
- Same account type (permissions)
- Same data state
- Same time of day (if timing matters)
3. Check for intermittent conditions:
- Load (only under high traffic?)
- Timing (only first request after idle?)
- Data (only with specific values?)
- History (only after certain prior actions?)
4. If still can't reproduce:
- Add logging for the specific scenario
- Wait for next occurrence with logs
- Use feature flags to enable tracing for affected users
Symptoms
- Bug reports closed as "cannot reproduce"
- Same bug repeatedly reported
- Works for developer, fails for user
- Intermittent failures
Detection Pattern
cannot reproduce|works for me|unable to replicate
Trusting Instead of Verifying
Id
assumption-validation
Severity
medium
Situation
You trust that the library works. You trust the documentation. You trust the API response. You trust the database value. But something in that chain is lying to you.
Why
Debugging requires skepticism. Every assumption is a potential blind spot. The bug hides in what you don't question. The more you trust something, the less you look at it.
Solution
1. Verify every link in the chain:
- Actual request sent (not what you think you sent)
- Actual response received (not what you expect)
- Actual value in database (not what you wrote)
- Actual config loaded (not what's in file)
2. Tools for verification:
- Network tab for HTTP requests/responses
- Database query to check actual values
- Environment dump to check loaded config
- Print statement at the exact moment
3. Trust, but verify:
- "I'm sending X" → print/log request body
- "Database has Y" → query database directly
- "Config is Z" → print loaded config at startup
Symptoms
- Bug in "known good" code
- Documentation doesn't match behavior
- Expected value differs from actual value
- Third-party integration behaves unexpectedly
Detection Pattern
should be|supposed to|according to|documentation says
More Than One Bug - Tangled Symptoms
Id
multiple-bugs
Severity
medium
Situation
Fix a bug. Some symptoms disappear, others remain. You think your fix is incomplete, but actually there were two bugs with overlapping symptoms. You're chasing a ghost.
Why
When multiple bugs affect the same area, their symptoms interleave. Fixing one clears part of the picture but confuses the rest. You attribute remaining symptoms to the bug you "partially fixed."
Solution
1. Suspect multiple bugs when:
- Fix solves some symptoms but not others
- Symptoms seem inconsistent or contradictory
- Different users report different variations
2. Isolate each bug separately:
- Create separate reproduction cases
- Fix one, verify complete fix
- Then investigate remaining symptoms as new bug
3. Track bugs independently:
- Separate tickets for each
- Don't assume they're related
- Each needs its own root cause analysis
Symptoms
- Partial fixes
- Contradictory bug reports
- Fix helps some users, not others
- Symptoms change after fix
Detection Pattern
still broken|partially fixed|sometimes works|inconsistent
The Corrupted Data From Long Ago
Id
data-corruption-legacy
Severity
high
Situation
Bug in current code can't explain the bad data. The data is wrong, but the current code couldn't have produced it. You're debugging the wrong version of the code.
Why
Data persists across code versions. A bug fixed months ago could have written bad data that still exists. You're looking at current code, but the bug was in code that no longer exists.
Solution
1. Check when data was created/modified:
- Audit logs
- created_at / updated_at columns
- Version columns if you have them
2. Correlate with code versions:
- When was this user created?
- What code was deployed then?
- Check that version's git history
3. Consider:
- Old migrations that had bugs
- Manual database edits
- Data imports from external systems
- API clients sending bad data
4. May need data migration to fix, not code change
Symptoms
- Bad data that current code can't produce
- Old users affected, new users fine
- Data inconsistent with database constraints
- Fix doesn't help existing data
Detection Pattern
old|legacy|historical|created.*ago|migrate
Debugging Master - Validations
Empty Catch Block
Id
empty-catch-block
Severity
error
Type
regex
Pattern
- catch\s\([^)]\)\s\{\s\}
- catch\s\{\s\}
Message
Empty catch block silently swallows errors. When something goes wrong, you'll have no idea what.
Fix Action
Log the error, rethrow, or handle explicitly. Never swallow silently.
Applies To
- */.ts
- */.tsx
- */.js
- */.jsx
- */.java
- */.py
Catch Block Ignores Error
Id
catch-swallows-error
Severity
warning
Type
regex
Pattern
- catch\s\(\s(?:e|err|error|ex|exception)\s\)\s\{[^}]\}(?!.\1)
Message
Catch block doesn't use the caught error. Log or rethrow it.
Fix Action
At minimum, log the error with context for debugging.
Applies To
- */.ts
- */.tsx
- */.js
- */.jsx
Commented Debug Code Left Behind
Id
commented-debug-code
Severity
warning
Type
regex
Pattern
- //.*console\.log
- //.*print\(
- //.*debugger
- #.*print\(
- #.*pdb
Message
Commented debug code left in file. Remove or make it proper logging.
Fix Action
Remove debug code or convert to proper structured logging.
Applies To
- */.ts
- */.tsx
- */.js
- */.jsx
- */.py
Debug Print Statements
Id
debug-print-in-production
Severity
warning
Type
regex
Pattern
- console\.log\(['"]here
- console\.log\(['"]test
- console\.log\(['"]debug
- console\.log\(['"]>>>
- print\(['"]here
- print\(['"]test
- print\(['"]debug
Message
Debug print statement likely left from debugging session.
Fix Action
Remove debug prints or convert to proper logging.
Applies To
- */.ts
- */.tsx
- */.js
- */.jsx
- */.py
Generic Error Message
Id
generic-error-message
Severity
warning
Type
regex
Pattern
- throw new Error\(['"]Error['"]\)
- throw new Error\(['"]Something went wrong['"]\)
- throw new Error\(['"]An error occurred['"]\)
- raise Exception\(['"]Error['"]\)
Message
Generic error message provides no debugging information.
Fix Action
Include specific context: what operation failed, why, with what inputs.
Applies To
- */.ts
- */.tsx
- */.js
- */.jsx
- */.py
Error Logged Without Context
Id
error-without-context
Severity
warning
Type
regex
Pattern
- console\.error\(\s(?:e|err|error)\s\)
- logger\.error\(\s(?:e|err|error)\s\)
Message
Error logged without context. Include what operation was attempted.
Fix Action
Log: what was attempted, with what inputs, and the error.
Applies To
- */.ts
- */.tsx
- */.js
- */.jsx
Catch, Log, and Rethrow Unchanged
Id
catch-log-rethrow
Severity
info
Type
regex
Pattern
- catch.\{[^}](?:console|log).*throw\s+(?:e|err|error)
Message
Catching, logging, and rethrowing adds noise without value.
Fix Action
Either handle the error or let it propagate. Don't log at every level.
Applies To
- */.ts
- */.tsx
- */.js
- */.jsx
Async Operation Without Correlation
Id
no-correlation-id
Severity
info
Type
regex
Pattern
- async function.\{(?!.(?:requestId|correlationId|traceId))
Message
Async operation without correlation ID. Hard to trace in logs.
Fix Action
Pass correlation ID through async operations for log tracing.
Applies To
- */.ts
- */.tsx
- */.js
- */.jsx
Magic Number in Condition
Id
magic-number-condition
Severity
warning
Type
regex
Pattern
- if\s\([^)](?:===?|!==?|[<>]=?)\s*\d{2,}[^\d]
- status\s(?:===?|!==?)\s\d{3}
Message
Magic number in condition. When debugging, you won't know what 86400 means.
Fix Action
Use named constants: SECONDS_PER_DAY = 86400
Applies To
- */.ts
- */.tsx
- */.js
- */.jsx
Silent Fallback to Default
Id
silent-fallback
Severity
warning
Type
regex
Pattern
- \|\|\s*\[\]
- \|\|\s*\{\}
- \|\|\s*['"]['"]
- \?\..*\|\|
Message
Silent fallback hides errors. When data is missing, you want to know, not get empty defaults.
Fix Action
Consider if missing data is actually an error that should be logged/thrown.
Applies To
- */.ts
- */.tsx
- */.js
- */.jsx
TODO/FIXME Left in Code
Id
todo-fix-comment
Severity
info
Type
regex
Pattern
- //\sTODO.fix
- //\s*FIXME
- //\s*HACK
- //\s*XXX
- #\sTODO.fix
- #\s*FIXME
Message
TODO/FIXME comment indicates known issue. Track in issue tracker instead.
Fix Action
Create issue ticket and reference it, or fix the issue.
Applies To
- */.ts
- */.tsx
- */.js
- */.jsx
- */.py
Hardcoded Timeout Value
Id
hardcoded-timeout
Severity
info
Type
regex
Pattern
- setTimeout\([^,]+,\s*\d{4,}\)
- timeout:\s*\d{4,}
- delay:\s*\d{4,}
Message
Hardcoded timeout makes debugging timing issues difficult.
Fix Action
Extract to named constant with comment explaining the value.
Applies To
- */.ts
- */.tsx
- */.js
- */.jsx
JSON Parse Without Try/Catch
Id
unsafe-json-parse
Severity
warning
Type
regex
Pattern
- JSON\.parse\([^)]+\)(?![^;]*catch)
Message
JSON.parse can throw on invalid input. Unhandled, this becomes hard to debug.
Fix Action
Wrap in try/catch with helpful error message about the source of the JSON.
Applies To
- */.ts
- */.tsx
- */.js
- */.jsx
Boolean Parameter Without Name
Id
boolean-trap
Severity
info
Type
regex
Pattern
- \(\s(?:true|false)\s\)
- ,\s(?:true|false)\s[,)]
Message
Boolean parameter without name. Debugging 'process(data, true, false)' is confusing.
Fix Action
Use named parameters or options object: { strict: true, validate: false }
Applies To
- */.ts
- */.tsx
- */.js
- */.jsx