debug-frontend-browser
Skill9 starsChanged 5 months agoApache-2.0View on GitHub
Diagnoses runtime UI bugs live in the browser — console/network errors, hydration mismatches, failed renders, CORS, broken interactions; used when a page misbehaves at runtime.
In this repository147 other files it gives its agents.
- second-brain/AGENTS.mdAGENTS.md
- second-brain/CLAUDE.mdCLAUDE.md
- agent-tool-mcp-builderSkill
- api-design-reviewSkill
- async-concurrency-correctnessSkill
- audit-accessibility-wcagSkill
- audit-license-complianceSkill
- audit-technical-seoSkill
- auth-jwt-sessionSkill
- author-codemodSkill
- brainstorm-designSkill
- build-audit-loggingSkill
- build-cdc-streaming-pipelineSkill
- build-cli-toolSkill
- build-data-tableSkill
- build-etl-pipelineSkill
- build-form-validationSkill
- build-native-mobile-uiSkill
- build-office-docsSkill
- build-offline-first-syncSkill
- build-react-componentSkill
- build-realtime-channelSkill
- build-spreadsheetSkill
- build-vector-searchSkill
- caching-strategySkill
- cicd-pipeline-authorSkill
- cloud-cost-optimizeSkill
- code-commentsSkill
- code-reviewSkill
- compose-local-dev-stackSkill
- configure-bundler-buildSkill
- configure-dns-tlsSkill
- configure-reverse-proxy-lbSkill
- configure-security-headers-cspSkill
- contract-testingSkill
- datetime-timezone-correctnessSkill
- db-migration-safetySkill
- debug-ci-pipeline-failureSkill
- debug-flaky-testsSkill
- debug-root-causeSkill
- defend-llm-prompt-injectionSkill
- deliver-webhooksSkill
- dependency-upgradeSkill
- deploy-releaseSkill
- design-api-paginationSkill
- design-authorization-modelSkill
- design-backup-dr-recoverySkill
- design-event-sourcing-cqrsSkill
- design-multi-tenancySkill
- design-protobuf-grpc-serviceSkill
- design-relational-schemaSkill
- design-search-index-infraSkill
- design-state-machineSkill
- design-token-systemSkill
- diff-table-paritySkill
- distributed-locks-leasesSkill
- dockerfile-optimizeSkill
- encrypt-sensitive-dataSkill
- error-messageSkill
- estimate-workSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
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 17
Not for: build/compile failures (no browser yet), pure logic bugs reproducible in a unit test, or backend-only errors.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
When to Use
The page is already rendering (or failing to) in a real browser and behaves wrong. Reach here when:
- Blank/white screen, partial render, or content flashes then disappears.
- Console error:
Hydration failed,Text content does not match server-rendered HTML,Cannot read properties of undefined, etc. - Network tab shows 4xx/5xx, a request stuck pending, or a CORS rejection.
- A click/submit/keypress does nothing or fires the wrong handler.
- "Works in dev, breaks in prod" (minified build, different env, SSR vs CSR mismatch).
Not for: build/compile failures (no browser yet), pure logic bugs reproducible in a unit test, or backend-only errors. Route those to general root-cause debugging. This skill is browser-runtime UI only and uses the chrome-devtools MCP to inspect a live page.
Steps
- Get a live page.
list_pagesto see open tabs;select_pagethe offending one, ornew_page+navigate_pageto the failing URL. Reproduce the exact state the bug needs (route, query params, logged-in session). If repro needs interaction, drive it:click/fill/press_key. Note: a freshnew_pagehas no auth cookies — reuse the existing tab when the bug is session-dependent. - Drain the console first.
list_console_messages— read everyerrorandwarning, not just the top one. The first error is usually the root; later ones are fallout. Capture the full stack trace viaget_console_messagefor the key error. Map minified frames back to source using the file:line in the trace (sourcemaps); if prod sourcemaps are absent, re-run the same flow against the dev/staging build to get readable frames. - Check failed network requests.
list_network_requests, thenget_network_requeston anything non-2xx, pending, or that the failing component depends on. Inspect: status code, response body (real error message often lives here, not the console), request/response headers. For CORS: confirm the server returnedAccess-Control-Allow-Originmatching the page origin and, for preflight, that theOPTIONSrequest succeeded with the rightAccess-Control-Allow-Methods/Headers. CORS is a server-config fix — never "fix" it by disabling browser security or proxying around it silently. - Hydration mismatch (Next.js / React). The cause is server HTML ≠ first client render. Hunt for non-deterministic-in-render values:
Date.now()/new Date()/Math.random(),window/localStorage/navigatorread during render,typeof window !== 'undefined'branches, locale/timezone-dependent formatting, and invalid DOM nesting (<div>inside<p>,<p>inside<p>). Taketake_snapshotto see the actual client DOM and compare against the SSR HTML (view the document response inget_network_request). Fix at source: gate client-only values behinduseEffect/mounted-flag ornext/dynamic({ ssr: false }). UsesuppressHydrationWarningonly for genuinely unavoidable per-render values (e.g. a timestamp) — it silences the warning, it does not fix a real divergence. - Layout / styling bug.
take_screenshotfor the visual,take_snapshotfor the structured DOM + roles.evaluate_scriptto read computed styles on the culprit node (getComputedStyle(el)), bounding box, overflow, z-index, and whether the element is actually in the DOM vsdisplay:none/zero-size. Distinguish "not rendered" (missing from snapshot) from "rendered but invisible" (present, hidden by CSS). - Broken interaction / event wiring. Confirm the handler is attached and the right element receives the event.
evaluate_scriptto inspect listeners, check for an overlay intercepting clicks (document.elementFromPoint(x,y)),pointer-events:none, disabled state, or a stale closure capturing old state. Reproduce the click withclickand re-read the console/network to see what (if anything) fired. For React state bugs, log or read the value at the moment of interaction rather than assuming. - Confirm root cause, fix at source. Tie the symptom to one concrete cause (a specific request, a specific render expression, a specific listener). Fix the source code — do not swallow the error with an empty
catch, a blankettry/catch, or by hiding the failing UI. - Verify live. Reload via
navigate_page(orreload), re-run the repro interaction, then re-check:list_console_messagesclean of the original error,list_network_requestsshows the request now 2xx,take_screenshotshows correct render. Show the before/after as evidence — do not declare fixed on code-read alone.
Common Errors
- Reading only the first console line. The headline error is often downstream; scroll the full list and trace the earliest one.
- Trusting the console over the network body. A
500shows a generic message in console but the real stack/error is in the response body — alwaysget_network_requestit. - "Fixing" CORS client-side. Adding
mode: 'no-cors', disabling web security, or routing through a hack hides it. CORS is fixed on the server's response headers (or preflight) only. - Blaming hydration on the wrong line. React points at the mismatched node, but the cause is why server and client disagree there — usually a non-deterministic value or a
windowread, not the JSX at that line. suppressHydrationWarningas a cure. It mutes the symptom. If the underlying data genuinely differs, you've shipped a silent inconsistency. Use it only for inherently dynamic content, never to paper over a real bug.- Fresh tab missing auth.
new_pagestarts with no session — a bug that needs login won't reproduce. Reuse the existing authenticated tab. - Minified prod stack with no sourcemap. Frames like
a.b is not a functionare useless; reproduce against dev/staging to get real file:line. - Stale page state. Inspecting after the error already cleared (e.g. an error boundary swapped the UI) shows the recovered state. Re-trigger the failure, then inspect immediately.
- Race / timing. Element or data not there yet — use
wait_foron the target before asserting it's missing, instead of concluding it never renders.
Verify
Fix is done only when all hold against the live page:
- Original console error/warning gone from
list_console_messagesafter reload + repro. - Previously-failed request now returns 2xx with a valid body (check
get_network_request). take_screenshotshows the page rendering correctly through the exact repro steps.- The broken interaction now fires the correct handler and produces the expected result.
- No new errors introduced, and the error is fixed at source — not suppressed, caught-and-ignored, or hidden.
- If it was a "dev-only / prod-only" bug, verified in the build that originally failed.
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.

