Skip to content

Commit f95f2cb

Browse files
committed
docs(skill): align debug/design prompts with shipped browser commands + changeset
Only reference implemented browser verbs (open/eval/snapshot/screenshot/ grab); flag console/network/audit as upcoming. Adds the changeset.
1 parent 750b2b6 commit f95f2cb

3 files changed

Lines changed: 21 additions & 7 deletions

File tree

.changeset/react-skill-umbrella.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"react-doctor": minor
3+
---
4+
5+
Expand the agent skill into a routing umbrella (`/react-doctor`): ten always-on React baseline rules plus prose routing across doctor (static scan), perf (the DevTools profiling harness), debug, design, and grab. Adds an in-house browser core (`@react-doctor/browser`) that attaches to a running Chrome over CDP (launching one only as a fallback) and a `react-doctor browser` command (open/eval/snapshot/screenshot/grab) that backs the debug, design, and grab jobs. The browser core loads lazily, so playwright never bundles into the CLI's hot path.

skills/react-doctor/references/debug.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ npx react-doctor browser eval "document.querySelector('[data-testid=cart]')?.tex
3434
2. **Observe.** Pull the runtime signals around the failure:
3535

3636
```bash
37-
npx react-doctor browser console --errors # console errors + warnings
38-
npx react-doctor browser network --failed # 4xx/5xx and failed requests
39-
npx react-doctor browser snapshot # accessibility tree + React component tree
37+
npx react-doctor browser snapshot # what actually rendered
38+
npx react-doctor browser eval "window.__lastError?.stack" # read state/DOM at the failure
4039
```
4140

41+
Dedicated `console` and `network` capture commands (errors, 4xx/5xx, failed
42+
requests) are landing next; until then, drive the repro and read the relevant
43+
state or error with `eval`.
44+
4245
3. **Hypothesize** (2 to 3): a thrown error in a specific component, a failed or
4346
duplicated request, a null/undefined access, a state update on an unmounted
4447
component, a missing loading/error branch.

skills/react-doctor/references/design.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,18 @@ size. Lead with those, then apply craft.
1313
```bash
1414
npx react-doctor browser open http://localhost:3000
1515
npx react-doctor browser screenshot --out review.png # what the user actually sees
16-
npx react-doctor browser audit # contrast, target size, a11y findings
1716
```
1817

19-
`audit` reports measured issues with the element and the failing value (e.g. a
20-
3.1:1 contrast ratio on body text, a 28px tap target). Fix those first; they are
21-
objective and a smarter model cannot dismiss them as opinion.
18+
Look at the screenshot, then measure specifics with `eval` (computed styles,
19+
bounding boxes, color values) to get objective numbers rather than opinions:
20+
21+
```bash
22+
npx react-doctor browser eval "getComputedStyle(document.querySelector('button')).fontSize"
23+
```
24+
25+
A one-shot `audit` command (axe-based contrast, tap-target, and a11y findings in
26+
one report) is landing next; until then, measure the checks below with `eval`.
27+
Lead with the measured issues; a smarter model cannot dismiss them as opinion.
2228

2329
## What to check
2430

0 commit comments

Comments
 (0)