← Back to Skills Marketplace
727155455

Frontend Doctor

by 727155455 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
724
Downloads
0
Stars
4
Active Installs
1
Versions
Install in OpenClaw
/install frontend-doctor
Description
Diagnose and fix common frontend issues — white screen, JS errors, resource loading failures, React/Vue hydration, browser extension popup, and CSS layout bugs.
README (SKILL.md)

Frontend Doctor

You are a senior frontend engineer and debugger. When the user describes a frontend problem, follow the diagnostic protocol below to identify the root cause and provide a concrete fix.

Supported Problem Types

  1. White Screen — Page renders blank with no visible content
  2. JS Errors — Runtime JavaScript exceptions crashing the page
  3. Resource Loading Failures — Scripts, stylesheets, fonts, or images fail to load (404, CORS, CSP)
  4. React / Vue Hydration Errors — SSR/SSG hydration mismatches causing client-side errors
  5. Browser Extension Popup Not Showing — Extension icon click does nothing or popup is blank
  6. CSS Layout Issues — Broken layout, overflow, z-index, flexbox/grid misalignment

Diagnostic Protocol

Step 1 — Gather Context

Ask the user for:

  • Framework / library (React, Vue, Svelte, vanilla JS, etc.)
  • Build tool (Vite, Webpack, Next.js, Nuxt, etc.)
  • Browser and version
  • The exact error message or symptom
  • Relevant code snippets (component, config, HTML)
  • Console output (errors, warnings)
  • Network tab findings (failed requests, status codes)

Step 2 — Run Targeted Diagnosis

🔲 White Screen

Common causes:

  • JS bundle fails to load or throws before mount
  • Root element (#app, #root) missing in HTML
  • Router misconfiguration (SPA 404 on refresh)
  • Environment variable missing at build time
  • Async component or lazy import throws silently

Checklist:

□ Open DevTools → Console: any uncaught errors?
□ Open DevTools → Network: is main bundle (main.js / chunk.js) returning 200?
□ Check HTML source: does \x3Cdiv id="root"> or \x3Cdiv id="app"> exist?
□ Check if window.__INITIAL_STATE__ or similar SSR data is missing
□ Add error boundary (React) or errorCaptured (Vue) to catch silent throws
□ Verify VITE_* / NEXT_PUBLIC_* env vars are set in production build

Quick fixes:

// React: Add error boundary at root
class ErrorBoundary extends React.Component {
  state = { error: null }
  componentDidCatch(error) { this.setState({ error }) }
  render() {
    if (this.state.error) return \x3Cpre>{this.state.error.message}\x3C/pre>
    return this.props.children
  }
}
// Vite SPA: fix 404 on refresh — configure server fallback
// vite.config.ts
export default { server: { historyApiFallback: true } }
// For nginx: try_files $uri $uri/ /index.html;

⚠️ JS Errors

Common causes:

  • Cannot read properties of undefined/null
  • Module not found / import path wrong
  • Async race condition (component unmounted before fetch resolves)
  • Third-party script conflict
  • TypeScript compiled to wrong target

Checklist:

□ Read the full stack trace — find YOUR file, not node_modules
□ Check if the error is in an async callback (add try/catch)
□ Verify all imports resolve (check tsconfig paths, aliases)
□ Check if optional chaining (?.) is needed
□ Look for useEffect cleanup missing (React)

Quick fixes:

// Safe optional chaining
const name = user?.profile?.name ?? 'Anonymous'

// React: cancel async on unmount
useEffect(() => {
  let cancelled = false
  fetchData().then(data => { if (!cancelled) setData(data) })
  return () => { cancelled = true }
}, [])

📦 Resource Loading Failures

Common causes:

  • Wrong publicPath / base in build config
  • CORS headers missing on CDN/API
  • Content Security Policy blocking scripts
  • Asset hash mismatch after deploy (stale cache)
  • Font/image path wrong in CSS

Checklist:

□ Network tab: check exact URL being requested vs actual file location
□ Check response headers for CORS: Access-Control-Allow-Origin
□ Check browser console for CSP violations
□ Verify base URL in vite.config.ts / next.config.js / webpack output.publicPath
□ Hard refresh (Cmd+Shift+R) to rule out cache

Quick fixes:

// vite.config.ts — fix base path for subdirectory deploy
export default defineConfig({ base: '/my-app/' })

// next.config.js — fix asset prefix
module.exports = { assetPrefix: 'https://cdn.example.com' }
# nginx CORS for fonts/assets
location ~* \.(woff2?|ttf|eot|svg)$ {
  add_header Access-Control-Allow-Origin *;
}

⚛️ React / Vue Hydration Errors

Common causes:

  • Server HTML doesn't match client render (date, random ID, window check)
  • Using typeof window !== 'undefined' incorrectly in render
  • Third-party component not SSR-safe
  • Mismatched whitespace in HTML

React checklist:

□ Error: "Hydration failed because the initial UI does not match"
□ Find component that reads browser-only APIs (localStorage, window, Date.now())
□ Wrap browser-only code in useEffect or dynamic import with ssr: false

Quick fixes:

// Next.js: disable SSR for a component
import dynamic from 'next/dynamic'
const BrowserOnlyChart = dynamic(() => import('./Chart'), { ssr: false })

// React 18: suppress hydration warning for intentional mismatch
\x3Ctime suppressHydrationWarning>{new Date().toLocaleString()}\x3C/time>

Vue / Nuxt checklist:

□ Error: "Hydration node mismatch"
□ Use \x3CClientOnly> wrapper for browser-only components
□ Avoid v-if based on window/document in SSR context
\x3C!-- Nuxt: wrap browser-only content -->
\x3CClientOnly>
  \x3CBrowserOnlyComponent />
\x3C/ClientOnly>

🧩 Browser Extension Popup Not Showing

Common causes:

  • popup.html not declared in manifest.json
  • Content Security Policy blocking inline scripts in popup
  • JS error in popup script crashes before render
  • Manifest V3: service worker not registered
  • Hot reload dev server URL used instead of extension URL

Checklist:

□ Check manifest.json → action.default_popup points to correct HTML file
□ Open chrome://extensions → click "Errors" button on your extension
□ Right-click extension icon → "Inspect popup" → check Console
□ Verify popup.html has \x3Cscript src="popup.js"> (no inline scripts in MV3)
□ Check that popup.js is listed in web_accessible_resources if needed

Quick fixes:

// manifest.json (MV3)
{
  "manifest_version": 3,
  "action": {
    "default_popup": "popup.html",
    "default_icon": "icon.png"
  },
  "content_security_policy": {
    "extension_pages": "script-src 'self'; object-src 'self'"
  }
}
\x3C!-- popup.html — no inline scripts allowed in MV3 -->
\x3C!DOCTYPE html>
\x3Chtml>
  \x3Cbody>
    \x3Cdiv id="root">\x3C/div>
    \x3Cscript src="popup.js">\x3C/script>
  \x3C/body>
\x3C/html>

🎨 CSS Layout Issues

Common causes:

  • Flexbox/Grid child overflow not handled
  • z-index not working (stacking context issue)
  • position: absolute escaping wrong parent
  • 100vh broken on mobile (address bar)
  • Margin collapse unexpected behavior
  • CSS specificity conflict

Checklist:

□ Open DevTools → Elements → Computed styles: check display, position, overflow
□ Use DevTools Layout panel to visualize flex/grid
□ Check if z-index parent has position set (required for z-index to work)
□ Check if overflow: hidden on parent clips child
□ Use outline: 1px solid red on elements to debug box model

Quick fixes:

/* Fix z-index not working — parent needs a stacking context */
.parent {
  position: relative; /* or absolute/fixed/sticky */
  z-index: 0;
}

/* Fix 100vh on mobile */
.full-height {
  height: 100vh;
  height: 100dvh; /* dynamic viewport height */
}

/* Fix flex child overflow */
.flex-child {
  min-width: 0; /* allows text truncation inside flex */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Debug layout quickly */
* { outline: 1px solid rgba(255, 0, 0, 0.2); }

Step 3 — Provide Fix

After diagnosis, provide:

  1. Root cause — one clear sentence
  2. Fix — minimal code change with before/after if applicable
  3. Verification — how to confirm the fix worked
  4. Prevention — one tip to avoid recurrence

Usage Examples

/frontend-doctor my Next.js page is white screen in production but works locally
/frontend-doctor React hydration error: "did not match. Server: 'div' Client: 'span'"
/frontend-doctor Chrome extension popup blank after clicking icon
/frontend-doctor flexbox items overflowing container on mobile
/frontend-doctor CORS error loading fonts from CDN
Usage Guidance
This skill appears to be a local static diagnostic tool: it will read files in the project directory you point it at (source files, package.json, manifest.json, configs) and print findings. It does not request credentials or contact external servers. If you plan to run it, (1) run it on a copy or in a controlled project if you are concerned about exposing proprietary source snippets in console output, (2) inspect the small JS files yourself if you want extra assurance, and (3) avoid running it from a parent directory that would scan more projects than intended. Overall the package is coherent with its stated purpose.
Capability Analysis
Type: OpenClaw Skill Name: frontend-doctor Version: 1.0.0 The bundle is a static analysis tool designed to diagnose common frontend development issues such as React hydration mismatches, CSS layout bugs, and misconfigured browser extension manifests. The code (src/diagnostics/*.js) uses simple regex-based scanning (grep) of local project files to identify problematic patterns and suggests fixes. There is no evidence of network activity, data exfiltration, or malicious execution logic.
Capability Assessment
Purpose & Capability
Name/description (frontend diagnostics) align with the actual code: the package provides a CLI that scans project files (HTML, JS/TS, CSS, package.json, manifest.json, configs) and emits diagnostic findings. The only declared runtime requirement is 'node', which is appropriate.
Instruction Scope
SKILL.md instructs the agent to ask the user for context (framework, errors, console/network output) and to follow a diagnostic checklist. The bundled code likewise reads project files under the supplied cwd and checks for patterns; it does not instruct or attempt to read unrelated system artifacts or to transmit data externally. The agent/CLI does read files from the provided project directory (package.json, manifest.json, config files, source files) which is expected for this tool.
Install Mechanism
There is no install spec that downloads arbitrary code at runtime. The package is node-based with local JS files included. No external URLs, archive extracts, or runtime downloads are present in the package files provided.
Credentials
The skill declares no required environment variables or credentials. The code checks for .env existence and inspects package.json and source files; it does not request or require secrets, nor does it read or exfiltrate environment variables or credentials.
Persistence & Privilege
always:false and no requests to modify agent/system-wide settings. The skill runs as a CLI-like local analyzer and does not write to other skill configurations or assert permanent presence.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install frontend-doctor
  3. After installation, invoke the skill by name or use /frontend-doctor
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Frontend Doctor v1.0.0 - Initial release providing a diagnostic protocol for solving common frontend issues. - Supports white screens, JS errors, resource loading failures, React/Vue hydration errors, extension popup issues, and CSS layout bugs. - Includes step-by-step context gathering and targeted troubleshooting checklists for each problem type. - Supplies concrete quick fixes and code/config snippets for rapid problem resolution.
Metadata
Slug frontend-doctor
Version 1.0.0
License MIT-0
All-time Installs 4
Active Installs 4
Total Versions 1
Frequently Asked Questions

What is Frontend Doctor?

Diagnose and fix common frontend issues — white screen, JS errors, resource loading failures, React/Vue hydration, browser extension popup, and CSS layout bugs. It is an AI Agent Skill for Claude Code / OpenClaw, with 724 downloads so far.

How do I install Frontend Doctor?

Run "/install frontend-doctor" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Frontend Doctor free?

Yes, Frontend Doctor is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Frontend Doctor support?

Frontend Doctor is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Frontend Doctor?

It is built and maintained by 727155455 (@727155455); the current version is v1.0.0.

💬 Comments