Debug Frontend with Browser
Find the first boundary where correct data becomes incorrect. This skill extends
acceptance; it does not define a separate test workflow.
Mandatory foundation
Before any browser, Electron, network, cache, or application interaction:
- Read
../acceptance/SKILL.md and the project's
PROCESS.md in full.
- Follow its target grounding, living logs, project adapter, environment and auth
checks, approval gate, evidence rules, publication, and teardown.
- Enter this diagnostic workflow only after
acceptance has established the
approved execution surface. If its environment or auth gate is blocked, stop
there instead of inventing another execution path.
- Use the isolated environment and fixture strategy selected by the project
adapter. Never use the user's signed-in production browser or Electron client
as a fixture container or test sandbox.
- Treat an explicit production investigation as read-only unless the user
separately authorizes an exact live mutation and the project adapter permits
it. This skill never grants production-mutation authority.
- Never read secret files or print credentials, tokens, private content, or full
live objects. Return structural projections only.
If acceptance is unavailable, say so and stop before touching a live surface.
Responsibility boundary
acceptance owns |
This skill adds |
| Environment isolation and service lifecycle |
Falsifiable symptom and event timeline |
| Authentication and fixture seeding |
Boundary-by-boundary state comparison |
| Browser/Electron driver setup |
Safe minimal fixture extraction |
| Approval and mutation authority |
Pure-function replay and commit A/B |
| Evidence, report, publication, teardown |
Earliest-boundary fix guidance |
Do not duplicate or weaken acceptance rules here. When the two skills appear
to conflict, acceptance and the project layer control execution.
Diagnostic workflow
1. Make the symptom falsifiable
Write one expected invariant and one observed violation. Record:
- the triggering action;
- state before, during, and after it;
- whether navigation, remount, refresh, tab switching, or waiting changes it;
- stable identifiers required to follow the same entity across layers.
For timing or ordering defects, define the expected and observed event timelines
before reading implementation code.
2. Reproduce on the approved isolated surface
- Reproduce once without recording to prove the path.
- For an intermittent defect, repeat the same controlled action and record the
hit rate.
- Verify the intended action through a new ID, request, or state transition.
- Use a GIF or video for flicker and other time-based behavior.
- Re-snapshot after navigation or a major render because element references expire.
Use the surface and capture method chosen by acceptance; do not relaunch or
reattach to the user's resident application.
3. Find the first broken boundary
Compare the same entity IDs at each layer and mark each boundary correct or
incorrect.
| Boundary |
Inspect |
What it distinguishes |
| DOM / visible row |
Text, order, recording |
Symptom only |
| Renderer input |
Component props, virtual-list data |
Renderer vs upstream input |
| Derived state |
Selectors, parsed/display items |
Derivation vs raw state |
| Raw client state |
Store records, SWR state, persisted cache |
Cache vs transformation |
| Network / server |
Structural response and persisted row |
Client vs server |
| Pure transformation |
Exact parser/normalizer input |
Runtime vs deterministic logic |
Important:
- DOM absence is not state absence in a virtualized list.
- Retained tabs can own multiple React roots and stores; qualify them by stable
IDs and the visible route.
- For cache defects, distinguish in-memory fetch cache, Zustand state, persisted
cache, and server state instead of calling all of them "the cache."
- Stop expanding the search when a pure local function reproduces the exact
invalid output.
4. Build the smallest safe fixture
Create the fixture through the isolated environment's supported seed path. Keep
only fields required by the suspected boundary, such as:
id, type or role, parent linkage, and timestamps;
- cache key and lifecycle state;
- branch or group metadata;
- entity identifiers that affect selection or grouping.
Store reusable inputs through the project's fixture layout. Do not copy
private production content into fixtures or tracked files.
5. Attribute with the same fixture
Do not infer causality from PR timing or filenames.
- Run the same fixture against the suspected revision and its real parent.
- Compare the same observable boundary, not two different screenshots.
- Verify the commit parent, PR file list, merge time, and deployment timing.
- Separate the revision that introduced the latent bug from the data event that
first exposed it.
6. Fix the earliest incorrect boundary
- Change the layer that first produces invalid state.
- Preserve unrelated branch, optimistic-update, and cache semantics.
- Add a behavior-level regression test with the sanitized minimal fixture.
- Add a JSDoc comment when the fix protects a non-obvious invariant.
- Do not substitute timeouts, refreshes, DOM sorting, or downstream filters for a
source-state fix.
7. Return to the acceptance workflow for verification
After diagnosis or a fix, resume the parent acceptance workflow. It owns the
focused checks, isolated visual replay, evidence inspection, structured report,
publication, and cleanup. Do not publish a separate browser-debugging verdict.
Diagnostic supplements
Read references/pitfalls.md when the suspected boundary
involves retained React roots, virtualized data, optimistic reconciliation, stale
client caches, pure replay, or regression attribution.
1---2name: debug-frontend-with-browser3description: Use for intermittent UI, stale state, ordering, navigation or browser-only bugs. Extends acceptance with boundary tracing and regression diagnosis.4---5
6# Debug Frontend with Browser
7
8Find the first boundary where correct data becomes incorrect. This skill extends
9`acceptance`; it does not define a separate test workflow.
10
11## Mandatory foundation
12
13Before any browser, Electron, network, cache, or application interaction:
14
151. Read [`../acceptance/SKILL.md`](../acceptance/SKILL.md) and the project's
16 [`PROCESS.md`](../../acceptance/PROCESS.md) in full.
172. Follow its target grounding, living logs, project adapter, environment and auth
18 checks, approval gate, evidence rules, publication, and teardown.
193. Enter this diagnostic workflow only after `acceptance` has established the
20 approved execution surface. If its environment or auth gate is blocked, stop
21 there instead of inventing another execution path.
224. Use the isolated environment and fixture strategy selected by the project
23 adapter. Never use the user's signed-in production browser or Electron client
24 as a fixture container or test sandbox.
255. Treat an explicit production investigation as read-only unless the user
26 separately authorizes an exact live mutation and the project adapter permits
27 it. This skill never grants production-mutation authority.
286. Never read secret files or print credentials, tokens, private content, or full
29 live objects. Return structural projections only.
30
31If `acceptance` is unavailable, say so and stop before touching a live surface.
32
33## Responsibility boundary
34
35| `acceptance` owns | This skill adds |
36| ------------------------------------------- | -------------------------------------- |
37| Environment isolation and service lifecycle | Falsifiable symptom and event timeline |
38| Authentication and fixture seeding | Boundary-by-boundary state comparison |
39| Browser/Electron driver setup | Safe minimal fixture extraction |
40| Approval and mutation authority | Pure-function replay and commit A/B |
41| Evidence, report, publication, teardown | Earliest-boundary fix guidance |
42
43Do not duplicate or weaken `acceptance` rules here. When the two skills appear
44to conflict, `acceptance` and the project layer control execution.
45
46## Diagnostic workflow
47
48### 1. Make the symptom falsifiable
49
50Write one expected invariant and one observed violation. Record:
51
52- the triggering action;
53- state before, during, and after it;
54- whether navigation, remount, refresh, tab switching, or waiting changes it;
55- stable identifiers required to follow the same entity across layers.
56
57For timing or ordering defects, define the expected and observed event timelines
58before reading implementation code.
59
60### 2. Reproduce on the approved isolated surface
61
62- Reproduce once without recording to prove the path.
63- For an intermittent defect, repeat the same controlled action and record the
64 hit rate.
65- Verify the intended action through a new ID, request, or state transition.
66- Use a GIF or video for flicker and other time-based behavior.
67- Re-snapshot after navigation or a major render because element references expire.
68
69Use the surface and capture method chosen by `acceptance`; do not relaunch or
70reattach to the user's resident application.
71
72### 3. Find the first broken boundary
73
74Compare the same entity IDs at each layer and mark each boundary `correct` or
75`incorrect`.
76
77| Boundary | Inspect | What it distinguishes |
78| ------------------- | ----------------------------------------- | ------------------------------ |
79| DOM / visible row | Text, order, recording | Symptom only |
80| Renderer input | Component props, virtual-list data | Renderer vs upstream input |
81| Derived state | Selectors, parsed/display items | Derivation vs raw state |
82| Raw client state | Store records, SWR state, persisted cache | Cache vs transformation |
83| Network / server | Structural response and persisted row | Client vs server |
84| Pure transformation | Exact parser/normalizer input | Runtime vs deterministic logic |
85
86Important:
87
88- DOM absence is not state absence in a virtualized list.
89- Retained tabs can own multiple React roots and stores; qualify them by stable
90 IDs and the visible route.
91- For cache defects, distinguish in-memory fetch cache, Zustand state, persisted
92 cache, and server state instead of calling all of them "the cache."
93- Stop expanding the search when a pure local function reproduces the exact
94 invalid output.
95
96### 4. Build the smallest safe fixture
97
98Create the fixture through the isolated environment's supported seed path. Keep
99only fields required by the suspected boundary, such as:
100
101- `id`, type or role, parent linkage, and timestamps;
102- cache key and lifecycle state;
103- branch or group metadata;
104- entity identifiers that affect selection or grouping.
105
106Store reusable inputs through the project's fixture layout. Do not copy
107private production content into fixtures or tracked files.
108
109### 5. Attribute with the same fixture
110
111Do not infer causality from PR timing or filenames.
112
1131. Run the same fixture against the suspected revision and its real parent.
1142. Compare the same observable boundary, not two different screenshots.
1153. Verify the commit parent, PR file list, merge time, and deployment timing.
1164. Separate the revision that introduced the latent bug from the data event that
117 first exposed it.
118
119### 6. Fix the earliest incorrect boundary
120
121- Change the layer that first produces invalid state.
122- Preserve unrelated branch, optimistic-update, and cache semantics.
123- Add a behavior-level regression test with the sanitized minimal fixture.
124- Add a JSDoc comment when the fix protects a non-obvious invariant.
125- Do not substitute timeouts, refreshes, DOM sorting, or downstream filters for a
126 source-state fix.
127
128### 7. Return to the acceptance workflow for verification
129
130After diagnosis or a fix, resume the parent `acceptance` workflow. It owns the
131focused checks, isolated visual replay, evidence inspection, structured report,
132publication, and cleanup. Do not publish a separate browser-debugging verdict.
133
134## Diagnostic supplements
135
136Read [references/pitfalls.md](references/pitfalls.md) when the suspected boundary
137involves retained React roots, virtualized data, optimistic reconciliation, stale
138client caches, pure replay, or regression attribution.