Skip to content

Skills for Claude Code CLI such as full stack dev Cloudflare, React, Tailwind v4, and AI integrations.

feat(ux-audit): add network error detection during browsing (#54)

Jeremy Dawesc51590e99c72
diff --git a/plugins/dev-tools/skills/ux-audit/SKILL.md b/plugins/dev-tools/skills/ux-audit/SKILL.md
index 9b557909..bfde449e 100644
--- a/plugins/dev-tools/skills/ux-audit/SKILL.md
+++ b/plugins/dev-tools/skills/ux-audit/SKILL.md
@@ -191,6 +191,52 @@ On each page, read the browser console for:
- **CSP violations** — severity: Medium
- **Deprecation warnings** — severity: Low
+#### Network Error Detection (thorough + exhaustive)
+
+**Critical**: Visual browsing misses API failures that the UI hides. Data-fetching libraries (TanStack Query, SWR) swallow HTTP errors and show empty/loading states instead of error messages. A component showing "No results found" might actually be getting a 403 — but the UI looks normal.
+
+Monitor network responses throughout the entire audit session. If using Playwright, attach a response listener before browsing starts:
+
+```javascript
+// Inject into page or use Playwright's page.on('response')
+// Collect all non-2xx API responses
+const networkErrors = [];
+// After each page navigation, check for failed fetch/XHR requests
+// by reading the browser's network log or console output
+```
+
+If using Chrome MCP, use `read_network_requests` to check for failed API calls after each page visit.
+
+**What to collect**: URL, HTTP status, method, the page you were on when it happened.
+
+**Severity mapping**:
+| Status | Severity | What it usually means |
+|--------|----------|----------------------|
+| 500+ | Critical | Server error — something is broken |
+| 403 | High | Permission error OR route collision (static route shadowed by `/:param`) |
+| 404 | Medium | Missing endpoint — may be a renamed/removed API route |
+| 401 | Low | Expected for unauthenticated probes, but flag if it happens on authenticated pages |
+| CORS error | High | API endpoint missing CORS headers — feature broken in production |
+
+**What this catches that visual browsing misses**:
+- Route collisions (e.g. `GET /api/boards/users` shadowed by `GET /api/boards/:boardId`)
+- Endpoints that fail silently (TanStack Query shows empty data instead of error)
+- CORS issues only visible in production
+- Auth middleware rejecting valid sessions
+- Missing endpoints after refactoring
+
+**Report format**: Group by status code in a "Network Errors" section:
+```markdown
+## Network Errors (detected during browsing)
+
+### 403 Forbidden (2 endpoints)
+- `GET /api/boards/users` on /app/boards/123 — likely route collision with /:boardId
+- `POST /api/settings/theme` on /app/settings — permission check failing
+
+### 500 Internal Server Error (1 endpoint)
+- `GET /api/reports/summary` on /app/dashboard — server error
+```
+
### Autonomy by Depth
| Action | quick | standard | thorough |
diff --git a/plugins/dev-tools/skills/ux-audit/references/report-template.md b/plugins/dev-tools/skills/ux-audit/references/report-template.md
index a37d4da6..97506166 100644
--- a/plugins/dev-tools/skills/ux-audit/references/report-template.md
+++ b/plugins/dev-tools/skills/ux-audit/references/report-template.md
@@ -121,6 +121,12 @@ Moments where the user felt uncertain, anxious, or frustrated:
| Back button behaviour | [Pass/Fail — detail] |
| Page refresh | [Pass/Fail — detail] |
+## Network Errors (detected during browsing)
+
+| Endpoint | Status | Page | Severity | Notes |
+|----------|--------|------|----------|-------|
+| [URL] | [status] | [page you were on] | [Critical/High/Medium/Low] | [likely cause] |
+
## What Works Well
- [Positive findings — patterns to preserve and replicate]