gemini_qa_loop

An automated interface-testing loop that builds a Vite web app, captures browser screenshots and a walkthrough video, and sends them to Gemini 3 Flash for visual quality scoring. It records the results and their history.

In plain words
What is it for?
Use it to build and preview the app, run Playwright end-to-end tests, publish screenshots, record a walkthrough, run Gemini's UI review, and inspect the generated reports.
Why use it?
It finds visual and usability problems through automated browser checks and image review instead of relying only on code tests.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/homenshum/nodebenchai/gemini_qa_loop
Clone the repo
git clone --depth 1 https://github.com/HomenShum/NodeBenchAI

Made for: Cursor.

Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 889 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00889
Opus 5 $0.00000 $0.00445
Sonnet 5 $0.00000 $0.00178
Haiku 4.5 $0.00000 $0.00089

Measured 2d ago against content hash 05b86c9342ba, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

gemini_qa_loop scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/gemini_qa_loop.mdc · 86 lines

How it starts

The opening of the file, as written. The whole thing — 86 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Gemini QA Loop — Automated UI/UX Quality Gate

Continuous dogfood loop using Gemini 3 Flash vision to score and fix UI/UX issues automatically.

Pipeline Steps (in order)

# 1. Build production bundle
npx vite build

# 2. Ensure preview server is running (port 4173)
npx vite preview --host 127.0.0.1 --port 4173 &

# 3. Capture screenshots via e2e test
BASE_URL=http://127.0.0.1:4173 npx playwright test tests/e2e/full-ui-dogfood.spec.ts --project=chromium --workers=1

# 4. Publish screenshots to public/dogfood/
npm run dogfood:publish

# 5. Record walkthrough video
node scripts/ui/recordDogfoodWalkthrough.mjs --baseURL http://127.0.0.1:4173 --publish static

# 6. Run Gemini QA (sends screenshots + video to Gemini 3 Flash for scoring)
BASE_URL=http://127.0.0.1:4173 node scripts/ui/runDogfoodGeminiQa.mjs

# 7. Read results
# Score + summary printed to stdout
# Full JSON: .tmp/dogfood-gemini-qa/screens-qa.json and video-qa.json
# History: public/dogfood/qa-results.json

Scoring Formula

Score = 100 - (P1_count × 6) - (P2_count × 2) - (P3_count × 1)
  • P1: Major polish (low contrast, missing focus state, misleading UI) — 6 pts each
  • P2: Minor polish (spacing, inconsistent styling, empty state copy) — 2 pts each
  • P3: Nit (alignment, minor label wording) — 1 pt each

Fix Strategy Per Severity

P1 Fixes (highest ROI — each fix recovers 6 points)

  • Low contrast text: Check dark mode. Use dark:text-gray-300 minimum.
  • Missing focus styling: Add focus-visible:ring-2 focus-visible:ring-blue-500.
  • Missing visual hierarchy: Add left border accent, font weight differentiation, size stepping.
  • Poor empty states: Add icon + descriptive copy + CTA button.
  • Misleading labels: Show exact price/data, add tooltips.

P2 Fixes (each recovers 2 points)

  • Spacing: Standardize gaps. Date formats: Use month: 'short'. Icon contrast: dark:bg-indigo-500/25 min.

Loop Protocol

while score < target:
    1. Read .tmp/dogfood-gemini-qa/screens-qa.json and video-qa.json
    2. Fix all P1s first (highest ROI), then easy P2s
    3. npx vite build && run e2e + publish + record + Gemini QA
    4. Read new score
    5. If 3 consecutive rounds without improvement → change strategy

Read the full file on GitHub · 86 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 86 lines · 0 tokens per session scan A 05b86c9342ba

Subscribe to this mod's changes

gemini_qa_loop is a cursor rule published in the GitHub repository HomenShum/NodeBenchAI (14 stars, last pushed 18d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 889 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.