debug-error
Skill9 starsChanged 42 days agoMITView on GitHub
Diagnose one bug with hypotheses and runtime evidence before fixing. Use when "debug this error" or behavior is unexpected. FE↔BE mismatch → debug-fe-be-integration. Bug to PR → workflow-fix-and-ship. Sentry backlog → debug-sentry-monitor.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- kensaurus/skillsword for word, first seen Oct 1, 2026
- drafael/coding-harnesstheir own version, first seen Apr 28, 2026
Other versions2 projects use a version of this.
Word for word · 1
- kensaurus/skills★ 9100% same
Edited · 0
None found.
Wrote their own version · 1
- drafael/coding-harness★ 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 repository165 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/approved-plan-execution.mdcCursor rule
- .cursor/rules/skill-workflows.mdcCursor rule
- .cursor/rules/verification-before-completion.mdcCursor rule
- llms.txtllms.txt
- audit-accessibilitySkill
- audit-agent-speedSkill
- audit-analyticsSkill
- audit-auth-flowsSkill
- audit-backend-architectureSkill
- audit-bundle-sizeSkill
- audit-cicdSkill
- audit-codemod-safetySkill
- audit-code-qualitySkill
- audit-code-reviewSkill
- audit-db-schemaSkill
- audit-doctrineSkill
- audit-env-paritySkill
- audit-fe-apiSkill
- audit-gate-logicSkill
- audit-i18nSkill
- audit-infra-costSkill
- audit-langfuse-llmSkill
- audit-llm-securitySkill
- audit-monetization-iapSkill
- audit-payment-systemSkill
- audit-performanceSkill
- audit-realworldSkill
- audit-registry-listingSkill
- audit-resilienceSkill
- audit-responsiveSkill
- audit-securitySkill
- audit-skill-conflictsSkill
- audit-ui-statesSkill
- audit-uiux-design-systemSkill
- audit-ux-journeysSkill
- audit-uxSkill
- backend-db-performanceSkill
- backend-error-handlingSkill
- backend-observabilitySkill
- backend-patternsSkill
- backend-realtimeSkill
- burndown-fullSkill
- complete-everythingSkill
- data-pipelineSkill
- data-visualizationSkill
- debug-fe-be-integrationSkill
- debug-sentry-monitorSkill
- deploy-npmSkill
- deploy-verifySkill
- design-apiSkill
- design-canvasSkill
- design-emailSkill
- design-frontendSkill
- design-generative-artSkill
- design-mobile-firstSkill
- design-motionSkill
- design-prdSkill
- design-systemSkill
- design-themeSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 12 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
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 53
If the error is from production and Sentry is configured, fetch the full context:
- Distinctive: line 81
If data is involved, verify expectations against reality using Supabase MCP or direct queries.
- Distinctive: line 85
Before diving into debug, state:
- Distinctive: line 109
This is the skill — everything after is mechanical: Before reading code to build a theory, construct one command that goes red on *this* …
- Distinctive: line 124
If you catch yourself forming a hypothesis before this command exists, stop — that is the exact failure this phase prevents.
- Distinctive: line 146
When did it start happening?
- Distinctive: line 227
Before writing any fix, state:
- Distinctive: line 238
Do NOT apply these as the sole fix:
- Distinctive: line 248
Follow existing project conventions
- Distinctive: line 249
If the fix touches a shared function, verify all callers
- Distinctive: line 281
If the bug could recur in a different form, add monitoring:
- Distinctive: line 288
If the bug was caused by a non-obvious interaction, add a comment explaining the constraint:
≈ “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
Debug Error Skill
Degree of freedom: MIXED. Root-cause judgment [HIGH freedom]; the red
feedback loop and verify-green re-run [LOW freedom — run exactly].
Systematic approach to debugging errors and unexpected behavior. Works with any project.
How to reason
- Observe — exact symptom, stack, environment, first-seen
- Interpret — crash site vs producer; FE / BE / integration / data
- Classify — null-access / contract / env / race / unknown
- Severity — prod-wide auth break outranks a single-user edge
Worked example
Observe:
TypeError: Cannot read property 'email' of undefinedon/accountafter signup. Interpret: crash is in the profile card; API returnsnullfor incomplete onboarding. Classify: data bug — producer returns null, consumer assumes an object. Fix: handle the onboarding-null at the producer contract + UI empty state; do not?.the crash site only.
Self-critique before reporting
- Red loop first — a failing command existed before the hypothesis
- Root, not symptom — no
?./ swallowed catch as the sole fix - Green loop — the same command was re-run and passed
- Right owner — FE↔BE mismatch →
debug-fe-be-integration; Sentry backlog →debug-sentry-monitor
Pre-debug checks
Before debugging:
1. Read Relevant Documentation
README.md (project overview)
src/[domain]/@_[domain]-README.md (domain-specific behavior)
docs/ (system documentation)2. Check for Sentry Context (if production error)
If the error is from production and Sentry is configured, fetch the full context:
sentry:search_issues
{
"organizationSlug": "<ORG_SLUG>",
"query": "<error message or description>",
"projectSlugOrId": "<PROJECT_SLUG>",
"regionUrl": "<REGION_URL>",
"limit": 5
}Then get details for the matching issue:
sentry:get_sentry_resource
{
"organizationSlug": "<ORG_SLUG>",
"resourceType": "issue",
"resourceId": "<ISSUE_ID>"
}Extract: stacktrace, breadcrumbs, tags (browser, OS, URL, release), event frequency.
3. Check Database State (if data-related)
If data is involved, verify expectations against reality using Supabase MCP or direct queries.
4. Verification statement — so the diagnosis rests on what you read and fetched
Before diving into debug, state:
"Pre-debug check:
- README/docs read: [list]
- Sentry context: [YES with details / NO — not production / not configured]
- Database state verified: [YES/NO — findings]
- Backend API checked: [YES/NO — status]
- Error scope identified: [FE only / BE only / Integration / Data]"Debug Process
1. Reproduce → 2. Isolate → 3. Research → 4. Identify → 5. Fix → 6. Verify → 7. PreventPhase 1: Reproduce
Build a tight feedback loop first
This is the skill — everything after is mechanical. Before reading code to build a theory, construct one command that goes red on this bug and will go green when it's fixed (adapted from mattpocock/skills, MIT). In rough order of preference: a failing test at the nearest seam → a curl/HTTP script against the dev server → a CLI invocation with a fixture input → a headless browser script → replaying a captured trace/payload through the code path in isolation.
The loop is done when it is:
- Red-capable — asserts the user's exact symptom, not "runs without erroring"
- Deterministic — same verdict every run (flaky bugs: loop the trigger to raise the reproduction rate until debuggable)
- Fast — seconds, not minutes
- Already run once — you can paste the invocation and its red output
If you catch yourself forming a hypothesis before this command exists, stop — that is the exact failure this phase prevents. If you genuinely cannot build a loop, say so explicitly, list what you tried, and ask for a captured artifact (HAR, log dump, recording) instead of proceeding blind.
Gather Information
Error Report:
- What happened: [description]
- Expected behavior: [what should happen]
- Steps to reproduce:
1. [step]
2. [step]
- Environment: [browser/OS/Node version]
- Error message: [exact message]
- Stack trace: [if available]
- First seen: [when — correlate with deploys]Questions to Determine Scope
- Can you reproduce it consistently?
- When did it start happening? (check
git logfor recent changes) - Does it happen for all users or specific ones? (check Sentry tag distribution)
- Is it environment-specific? (dev vs staging vs production)
Phase 2: Isolate
Narrow Down the Problem
Works in: Fails in:
├─ Production? ├─ Production?
├─ Staging? ├─ Staging?
├─ Local? ├─ Local?
├─ All browsers? ├─ Specific browser?
├─ All users? ├─ Specific user?
└─ All data? └─ Specific data?Trace the Data Flow
For data-related bugs, trace the full pipeline:
User Action → Frontend Handler → API Call → Backend Controller → Database → Response → State Update → RenderIdentify where the data goes wrong by checking each boundary.
Minimise the repro
Once the feedback loop is red, shrink the repro to the smallest scenario that still goes red: cut inputs, callers, config, and data one at a time, re-running the loop after each cut. Done when every remaining element is load-bearing — removing any one makes the loop go green. A minimal repro shrinks the hypothesis space and becomes the regression test in Phase 6.
Phase 3: Research the error pattern before fixing
For non-trivial errors, research the correct fix before implementing. Recognizing the framework or the error is not knowing its current behavior — search the exact error string and read the current docs even when you think you know the fix:
firecrawl:firecrawl_search
{
"query": "<framework> <exact error message> fix best practice",
"limit": 5,
"sources": [{ "type": "web" }]
}Then scrape the most relevant result:
firecrawl:firecrawl_scrape
{
"url": "<best-result-url>",
"formats": ["markdown"],
"onlyMainContent": true
}Also check official docs via Context7 if the error relates to a library:
context7:resolve-library-id
{
"libraryName": "<library>",
"query": "<error description>"
}Trust hierarchy: Official docs > maintainer posts > engineering blogs > Stack Overflow (current year, high votes).
Phase 4: Identify Root Cause
Root Cause Formulation
Before writing any fix, state:
- What happened: The specific runtime state that caused the error
- Why it happened: The upstream reason that state was possible
- Where to fix it: The correct layer — usually NOT the crash site
Phase 5: Fix
Anti-Pattern Checklist
Do NOT apply these as the sole fix:
- Adding
?.to suppress a TypeError → fix why the value is null - Wrapping in try/catch and swallowing → fix the underlying error
- Adding
?? []fallback → handle loading/error states explicitly - Adding
ifguards at the consumer → fix the producer
Fix Principles
- Fix at the root cause layer, not the crash site (unless they're the same)
- Make invalid state unrepresentable
- Follow existing project conventions
- If the fix touches a shared function, verify all callers
- Fix this bug only. Pre-existing bugs you notice go in the report as follow-ups, not in the diff. The feedback-loop script stays out of the repo unless it becomes the Phase-6 regression test in a place the repo already keeps tests. Edit surgically; do not rewrite files.
Phase 6: Verify
Test the Fix
- Phase 1 feedback loop re-run and now green (paste the invocation + output)
- Minimised repro converted into a regression test at a correct seam — one that exercises the real bug pattern; if no correct seam exists, document that as an architectural finding instead of writing a false-confidence test
- Test suite run where one exists, output pasted
Regression Check
# Run tests
npm test
# Or framework-specific
pytest
cargo test
go test ./...Phase 7: Prevent
Add Monitoring
If the bug could recur in a different form, add monitoring:
- Custom Sentry context for the affected code path
- Breadcrumbs for key user actions
- Structured logging for data flow checkpoints
Document Non-Obvious Fixes
If the bug was caused by a non-obvious interaction, add a comment explaining the constraint:
// Profile can be null for users who haven't completed onboarding.
// The API returns null (not 404) in this case. See: ISSUE-123.Debug Checklist
## Bug Investigation: [Title]
**Pre-Debug:**
- [ ] Docs/README read
- [ ] Sentry context fetched (if applicable)
- [ ] Database state checked (if data-related)
- [ ] Error scope identified
**Investigation:**
- [ ] Can reproduce locally (or have Sentry reproduction)
- [ ] Isolated to specific component/function/layer
- [ ] Research completed (Firecrawl/Context7)
- [ ] Root cause identified and stated
**Fix:**
- [ ] Fix addresses root cause (not symptoms)
- [ ] No anti-patterns used as sole fix
- [ ] Side effects checked (other callers)
- [ ] Tests pass
**Prevention:**
- [ ] Monitoring added (if applicable)
- [ ] Documentation updated (if non-obvious)Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
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.

