Skip to content

tooling: add the thunder-perf-hunt performance/a11y/bug-hunt skill#1061

Open
cjroth wants to merge 4 commits into
mainfrom
tooling/thunder-perf-hunt-skill
Open

tooling: add the thunder-perf-hunt performance/a11y/bug-hunt skill#1061
cjroth wants to merge 4 commits into
mainfrom
tooling/thunder-perf-hunt-skill

Conversation

@cjroth

@cjroth cjroth commented Jul 7, 2026

Copy link
Copy Markdown
Member

What

Adds the thunder-perf-hunt skill — a two-layer harness for hunting performance, functional-bug, and a11y issues in the web app.

  • Layer 1 (deterministic): Bun + Playwright probes that boot a Docker-free stack (pglite + anonymous auth) on dedicated ports (:1431/:8010) and drive headless Chromium + Firefox, emitting compact JSON — run.ts (perf/a11y/console sweep), report.ts (thresholded findings), explore.ts (curiosity-driven state-graph crawler), analyze-bundle.ts, plus lib/ and probes/.
  • Layer 2 (agentic): SKILL.md + references/ — the Scout → Triage → adversarial Verify → Fix → PR workflow (separate discovery from verification; reproduce + attribute before believing), with per-lens playbooks (metrics/thresholds, re-render, fix, a11y, gecko-profiler, verification rubric, self-improve).
  • Learned overlay: calibration.json (false-positive exclusions + discovered scenarios) and LEARNINGS.md (the self-improvement log).

Why it's safe / self-contained

  • Binds to dedicated ports off the make dev (1420/8000) and e2e bands, so it never collides with a dev server or the e2e suite; reuses an already-serving stack if present.
  • Never touches production — pglite + anonymous auto-session; the only new runtime dep is axe-core (devDependency, for the a11y probe).
  • .gitignore ignores the .perf-hunt/ run artifacts and .pglite/ throwaway data, so runs never dirty the tree.

What this session produced with it

Four fix PRs (#1057 a11y; #1058/#1059/#1060 bundle — entry chunk 788.5 → 633.9 KB gzip, ~−20%), each adversarially verified. This PR also folds in the harness self-improvements from those runs (idle-restore render-probe fix that eliminated 107 false positives, a streaming scenario via the dev Message Simulator, explore.ts honoring calibration exclusions, and documented false-positive suppressions).

How to run

See SKILL.md. Quick start: bun .claude/skills/thunder-perf-hunt/scripts/run.ts --mode sweep --browsers chromium,firefox (browsers install once via bun node_modules/playwright-core/cli.js install chromium firefox).

Reviewer notes

A two-layer harness that boots a Docker-free stack (pglite + anonymous auth) and
drives headless Chromium + Firefox against the app to hunt Core Web Vitals
regressions, unnecessary React re-renders, long tasks/LoAF, layout thrash, memory
leaks, bundle bloat, functional bugs (curiosity-driven state-graph crawler), and
a11y violations — then adversarially verifies each finding before proposing fixes.

- scripts/: deterministic Bun + Playwright probes emitting compact JSON (run.ts,
  report.ts, explore.ts, analyze-bundle.ts + lib/ and probes/).
- SKILL.md + references/: the agentic Scout -> Triage -> adversarial Verify ->
  Fix -> PR workflow and per-lens playbooks.
- calibration.json + LEARNINGS.md: the learned-overlay + self-improvement log,
  including this session's tuning (idle-restore render probe fix, a streaming
  scenario via the dev Message Simulator, explore.ts honoring calibration
  exclusions, and false-positive suppressions).
- Adds axe-core (devDependency) for the a11y probe; .gitignore ignores the
  .perf-hunt/ run artifacts and .pglite/ throwaway data.

Binds to dedicated ports (:1431/:8010) so it never collides with make dev or the
e2e suite. See SKILL.md to run it.
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Semgrep Security Scan

No security issues found.

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

PR Metrics

Metric Value
Lines changed (prod code) +3022 / -0
JS bundle size (gzipped) 🟢 781.6 KB → 781.4 KB (-177 B, -0.0%)
Test coverage 🟢 77.53% → 77.53% (+0.0%)
Performance (preview) Preview not ready — Render deploy may have timed out
Accessibility
Best Practices
SEO

Updated Tue, 07 Jul 2026 06:27:22 GMT · run #2216

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔭 thunder-deep-review (advisory)

Complements the other bots — surfaces only what they did not flag. Never approves, never requests changes, never gates merge.
head: 212c7ba58263 · mode: deep · deferred 0 item(s) already reported by other bots (best-effort dedup)

Comment thread .claude/skills/thunder-perf-hunt/scripts/explore.ts
Comment thread .claude/skills/thunder-perf-hunt/scripts/probes/a11y.ts Outdated
- explore.ts: give each browser its own state graph (nodes/edges + the
  MAX_STATES budget) so a browser running after another gets a full
  crawl instead of short-circuiting on states an earlier browser already
  filled. signature() is browser-independent, so the shared graph was
  starving the second browser (Firefox). Findings/seenFindingKeys stay
  shared so a bug seen in both browsers is still reported once.
- a11y.ts: drop the hardcoded /home/chris axe-core fallback path (leaked
  a username and silently broke a11y coverage on other machines);
  require.resolve already resolves it from the installed devDependency.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔭 thunder-deep-review (advisory)

Complements the other bots — surfaces only what they did not flag. Never approves, never requests changes, never gates merge.
head: ebc3a1319ab2 · mode: deep · deferred 0 item(s) already reported by other bots (best-effort dedup)

Comment thread .claude/skills/thunder-perf-hunt/scripts/lib/boot.ts Outdated
Comment thread .claude/skills/thunder-perf-hunt/SKILL.md Outdated
Comment thread .claude/skills/thunder-perf-hunt/scripts/probes/heap.ts Outdated
- boot.ts: spawn backend/frontend with stdout/stderr 'ignore' instead of
  'pipe'. Readiness is polled via waitForUrl and nothing drains the
  streams, so a chatty Vite/backend would fill the ~64KB OS pipe buffer
  and hang mid-sweep (looking like a scenario timeout).
- heap.ts/types.ts/report.ts: rename detachedNodesDelta -> domNodesDelta
  (it's the total live DOM-node delta, not detached nodes) and make the
  byte threshold the sole leak trigger — a positive node delta alone was
  over-reporting leaks on healthy pages after a navigate cycle.
- SKILL.md: fix SETUP step 1 to use the working bun playwright-core
  invocation instead of `bunx playwright install`, which the
  Prerequisites note explicitly warns fails in this bun-only repo.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔭 thunder-deep-review (advisory)

Complements the other bots — surfaces only what they did not flag. Never approves, never requests changes, never gates merge.
head: 820e1afd9b2f · mode: deep · deferred 0 item(s) already reported by other bots (best-effort dedup)

Comment thread .claude/skills/thunder-perf-hunt/scripts/report.ts Outdated
…sers

mergeAcrossBrowsers keyed only on category + attribution, so the same
component/selector/asset flagged on two different scenarios collapsed
into one finding — the first-seen severity/evidence won and the rest
were lost, under-reporting for a deliberately recall-biased tool. Fold
the scenario into the merge key so only true cross-browser duplicates
of one issue on one scenario merge, and keep the max severity on merge.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔭 thunder-deep-review (advisory)

Reviewed the diff — no issues to report. ✅ Never approves, never requests changes, never gates merge.
head: 3e213f7a43d8 · mode: deep · deferred 0 item(s) already reported by other bots (best-effort dedup)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant