GenClass

v0.2.2
io.github.genclass-dev/genclass Checked 8 hours ago Published 26 days ago

Find race conditions in your web app by reordering its responses, replay one, prove the fix.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

genclass_status GenClass status

Which pages on this machine are connected to GenClass (route, schedule, model state), counts of findings by kind, the explore session and armed replays. Call it first in a web project, and before you test a page.

genclass_findings GenClass findings

What GenClass recorded in pages on this machine, ranked and deduplicated with counts: races found by explore (final state depends on response order), responses that overwrote newer data, uncaught errors (with the click and request before them), the same request sent twice by two clicks, the on-device model's detections, visual checks. Use when the user reports an intermittent bug, after changing data-fetching or submit code, or before saying a UI change is done.

ParameterTypeDescription
kindstringOnly this kind.
limitnumberAt most this many (default 20).
routestringOnly this page path, e.g. /checkout.
since_minutesnumberOnly findings seen in the last N minutes.

genclass_explain Explain a GenClass finding

Everything about one finding: what happened in causal order (click → request → response → state write), the recorded steps and delivery order, what differed from the request-order baseline, the model's facts, how to replay it exactly, and a Playwright regression test that fails while the bug is there.

ParameterTypeDescription
id *stringFinding id, e.g. f3.

genclass_explore Explore response orders

Find races before users do. action "start" arms the next page loads: 2 baselines with responses in request order (with `slow_ms`, a third with no added delay), then `runs` loads where overlapping responses arrive in a seeded different order (optionally slower, or with `focus` endpoints last). Run the same scenario once per armed load, then action "report": each load's final state is compared with the baseline; a difference in what the page shows, its form values, the requests it sent or its errors depends on network timing (a race), and comes with a seed that replays it. Store values that diff…

ParameterTypeDescription
action *string
focusarrayRequest signatures to deliver last, e.g. ["PUT /api/notes/:id"] (one production flagged).
idstringreport: the session id (default the latest).
routestringOnly arm page loads of this path (default: any page).
runsnumberSeeded loads after the baselines (default 6, max 50).
seednumberFirst seed (default 1).
slow_msnumberAlso add up to this much latency per response (a slow network), e.g. 800.

genclass_replay Replay a finding

Reproduce one finding exactly. action "arm": the next page load of the finding's route gets the delivery order that produced it; do the same steps (genclass_explain lists them). action "result": whether that replay reproduced it. Use before a fix to confirm the bug and after it to prove the fix.

ParameterTypeDescription
action *string
id *stringFinding id, e.g. f3.
timesnumberarm: how many page loads (default 1).

genclass_analytics GenClass analytics

What GenClass measured about the app. local: per-endpoint request counts, median and p95 latency, error rates and failure streaks; per-page runs, errors and overwritten fields; learned relations between fields and learned flows, from pages on this machine. production: the GenClass dashboard's sessions, detections by diagnosis and page, and latest decisions (needs GENCLASS_DASHBOARD, the dashboard's private link; "sample" reads the public sample).

ParameterTypeDescription
rangestring
routestring
sourcestring

genclass_setup Set up GenClass

The lines to add so this project's dev build connects to GenClass (detects Vite, Next.js and others from package.json), how to check it works, and this MCP client's config lines for keeping the server configured. It changes no file; show the user the lines and wait for a yes before you run or add them.

genclass_scan Scan a page for visual bugs

Audit one page in one step with GenClass's 23 measured visual checks: text you cannot read against its background, images, fonts, stylesheets and media that failed to load, a page that scrolls sideways on a phone, controls stuck under fixed bars, layers that swallow clicks, covered dialogs, template leaks like {{name}} or [object Object]. It loads the URL headless at desktop and phone sizes in Playwright's Chromium on this machine (when that is missing it says how to install it); hosted: true runs it on the genclass.dev page check instead, which adds accessibility, speed and security audits, t…

ParameterTypeDescription
url *stringThe page, e.g. http://localhost:5173/pricing or https://example.com.
hostedbooleanRun on the genclass.dev page check instead of this machine (public pages only; adds accessibility, speed and security). It sends the URL there, so ask the user first.
phonebooleanThe phone size only (default: desktop and phone).

genclass_clear Clear GenClass records

Forget recorded runs and findings on this machine (all, findings or runs), e.g. after a fix to start clean.

ParameterTypeDescription
whatstring