⏳ This skill is pending AI review.

Scores will appear once the review pipeline completes.

version unknown

sentry-visual-qa

getsentry@getsentry⭐ 0 stars· last commit 2mo ago· 0 open issues

Verifies user-visible Sentry UI changes in a real browser and reports only what the captured screenshots, videos, and DOM checks support. Use when frontend, CSS, layout, theme, responsive, navigation, loading, animation, or interaction changes in a Sentry checkout need visual validation. Runs against a dedicated local dev-ui server on its own port in a dedicated QA browser session with its own Sentry login, never the user's main browser profile.

Choose how to use this skill

You do not need every option. Choose the path your AI client supports. The stable page stays the same; versioned files are immutable.

1. Native installer

This listing has no registered native installer command. Use the complete package or source fallback below, depending on what your client supports.

Do not guess an installer command or replace an existing version without reviewing the diff.

2. Complete package recommended

Download the ZIP when available. It includes SKILL.md plus the references, security notes and version metadata.

No complete ProSkills package is published for this listing yet.

3. Prompt-only

Copy the prompt above when the agent can read the stable page or when you want to adopt the workflow without installing a skill.

Need only the instruction file?

Download SKILL.md only if your client requires a single file. The complete ZIP is safer for a full installation because it preserves the references and release context.

No path installs or executes anything by itself. Your agent still needs access to the project files. Before updating, compare the installed version and review the diff.

—/10

// RATINGS

⭐GitHub Stars
⭐ 0 on GitHubGitHub ↗

New / niche

🟢ProSkills Score
—
📍

Not yet listed on ClawHub or SkillsMP

// README

sentry-visual-qa

An agent skill — a SKILL.md with its scripts and references — that makes a coding agent verify user-visible Sentry UI changes in a real browser, and report only what the captured screenshots, videos, and DOM checks actually support.

The problem it solves: agents are happy to call a CSS change "correct" from the diff alone. This skill makes the agent open the rendered surface, gate on the page having really loaded, capture the smallest evidence set that answers the question, and say plainly which surfaces it did not check.

What it does

  • Runs a dedicated UI-only devserver (pnpm run dev-ui) on its own port, so a QA run never collides with the devserver you are working in.
  • Drives a dedicated headless browser session with its own Sentry login — never your personal browser profile.
  • Gates every capture behind a readiness check (READY / LOGIN_REQUIRED / UNREACHABLE / REFUSED / BUILD_BROKEN), so a login page or a loading spinner can't be reported as evidence.
  • Picks evidence by request type: screenshots for stable states, short video for timing and motion, DOM checks as support.
  • Captures before/after pairs by switching the checkout to the merge-base on the same server.
  • Covers the component's scraps story (Sentry's component-story system) alongside the in-app surface when one exists.

Requirements

  • A local getsentry/sentry checkout (the dev-ui server is started from it)
  • A Sentry account to run QA as — a dedicated one, see Authentication
  • The agent-browser CLI on PATH — brew install agent-browser (developed against 0.37.1); on a remote workspace install from npm instead, see Signing in from a remote workspace
  • python3 — used only to mirror auth cookies onto the dev origin
  • curl, bash
  • ffmpeg, for video capture only

Install

The repository root is the skill, so clone it straight into your agent's skills directory and git pull updates the skill in place:

git clone https://github.com/getsentry/sentry-visual-qa.git ~/.agents/skills/sentry-visual-qa

If your agent reads skills from somewhere else, or you keep your checkouts elsewhere, clone once and link it in under the same directory name:

ln -s ~/.agents/skills/sentry-visual-qa <your-agent-skills-dir>/sentry-visual-qa

Authentication

QA runs as a real Sentry account in a dedicated browser session, never your everyday browser profile. Session cookies live in ~/.agent-browser/sessions/, and scripts/sqa passes the session flags on every call — invoking agent-browser directly drops them and silently captures a logged-out page.

Use a dedicated account, not your own

Whatever the account can see, the agent can capture. The dev-ui server proxies every API call to production sentry.io, so a run renders live production data — issues, events, member names — for every organization that account belongs to.

Do not sign in with an account that has production or customer access. Create a separate Sentry user whose only membership is an organization with nothing sensitive in it, and use it for QA and nothing else. sentry-sdks is the default target here for exactly that reason: it holds SDK projects rather than customer data.

scripts/sqa does refuse URLs pointing at Sentry's own sentry org (exit 4, configurable via SENTRY_QA_FORBIDDEN_ORGS) — but treat that as a backstop, not the boundary. A blocklist only stops the targets someone thought to name, while an account with no access to sensitive data cannot render it whatever URL it is handed.

Confirm which account is live before trusting any capture:

scripts/sqa whoami
# {"authed":true,"user":"[email protected]","org":"my-org","devUi":true,...}

Why signing in takes two steps

The dev-ui server proxies /api to sentry.io server-side, so the browser needs Sentry session cookies on the dev origin — and cookies set on .sentry.io are never sent to *.dev.getsentry.net. SSO cannot complete through the dev origin either, so signing in at the dev-ui /auth/login/ does not work. Sign in upstream, then mirror the cookies across:

scripts/sqa login   # headed sentry.io sign-in; a human completes SSO
scripts/sqa sync    # mirror the session cookies onto .dev.getsentry.net
scripts/sqa ready   # expect READY

sync copies session, sentry-sc, and sentry_react_auth. sentry-sudo is skipped unless you pass --with-sudo — rendering does not need elevated access. Cookie values are never printed, logged, or written to disk by these scripts.

Re-run sqa sync whenever the sentry.io session refreshes; the mirrored copies do not update themselves. references/session-and-login.md covers account switching and auth troubleshooting.

Signing in from a remote workspace (coder.dev)

sqa login opens a headed browser, and a remote workspace has no display to open it on. On a coder.dev workspace it fails with Missing X server or $DISPLAY; agent-browser's automatic Xvfb fallback only helps if Xvfb is installed, and a framebuffer nobody can see does not get you through SSO anyway. Drive the sign-in through the agent-browser dashboard instead — it streams the headless browser and forwards clicks and keystrokes.

Homebrew's agent-browser has no dashboard. The homebrew-core formula builds without the dashboard frontend, so dashboard start serves a Dashboard not built stub (vercel-labs/agent-browser#1412). Install from npm for this flow.

1. Let Chrome start. Ubuntu 24.04 ships kernel.apparmor_restrict_unprivileged_userns=1, which blocks Chrome's namespace sandbox. Every agent-browser command then dies before a browser exists, the daemon never creates its socket, and the CLI reports Failed to connect: No such file or directory (os error 2) — or, from agent-browser doctor, No usable sandbox!. Export the launch flag for the whole session:

export AGENT_BROWSER_ARGS="--no-sandbox"

2. Open the sign-in page headless, bypassing the --headed that sqa login forces:

agent-browser --session sentry-qa --restore sentry-qa open https://sentry.io/auth/login/

3. Start the dashboard for your proxied origin. Coder serves each port at the origin in $VSCODE_PROXY_URI. The dashboard refuses any non-loopback origin it was not told about, and it wants an access token on top of that — an allowed origin alone still returns Origin, Referer, or dashboard access token is invalid.

agent-browser dashboard start \
  --allowed-origins "https://4848--main--<workspace>--<user>.coder.sentry.dev"

Open the URL it prints including the #dashboard-access-token=... fragment. That fragment is the only thing that sets the auth cookie, and the page strips it from the address bar once read, so a bookmarked copy will not authenticate a fresh browser. The token is regenerated every time the dashboard restarts.

Port-forwarding sidesteps the token entirely, because loopback is trusted by default:

coder port-forward <workspace> --tcp 4848:4848   # from your laptop, then http://localhost:4848

4. Sign in through the Viewport tab, then mirror the cookies as usual:

scripts/sqa sync
scripts/sqa ready    # expect READY

Typing in the dashboard viewport

Clicking and navigation work. Text entry has two gaps, so fill fields from the CLI instead:

  • . arrives as Delete. The viewport sends key.charCodeAt(0) as the virtual key code, and ".".charCodeAt(0) is 46 — VK_DELETE. A period is not merely dropped: it deletes whatever is to the right of the cursor, so typing one mid-string silently eats a character.
  • There is no clipboard bridge. The viewport forwards keyboard and mouse events only, so Ctrl+V pastes

// HOW IT'S BUILT

// FILES

12 files shipped with this skill. Inline text is the catalog copy. The upstream link is the source repository.

  • SKILL.md17 KB8d98e55413e5upstream ↗
    ---
    name: sentry-visual-qa
    description: Verifies user-visible Sentry UI changes in a real browser and reports only what the captured screenshots, videos, and DOM checks support. Use when frontend, CSS, layout, theme, responsive, navigation, loading, animation, or interaction changes in a Sentry checkout need visual validation. Runs against a dedicated local dev-ui server on its own port in a dedicated QA browser session with its own Sentry login, never the user's main browser profile.
    ---
    
    # Sentry Visual QA
    
    Verify rendered Sentry behavior in a browser instead of inferring visual correctness from code. Capture the smallest set of evidence that answers the request, and never claim a rendered state you did not open.
    
    Paths in this skill are relative to the skill's own directory. Prefix them with the base directory reported when the skill loads, or `cd` there first.
    
    All browser work goes through `scripts/sqa`, a wrapper that pins every command to the dedicated QA session and its saved login. Calling `agent-browser` directly loses the session and silently captures a logged-out page.
    
    Runs are headless. Only the one-time sign-in opens a window, and `scripts/sqa sync` closes it again. To watch a run while debugging, set `SENTRY_QA_HEADED=1` and close the browser first — headed or headless is fixed when the browser launches, not per command.
    
    ## Workflow
    
    1. Classify the request as **stable** (screenshot), **temporal** (video), or **exact-state** (DOM check).
    2. Start the QA server with `scripts/sqa serve` (reuses one already serving).
    3. Run `scripts/sqa ready`. Capture nothing until it prints `READY` — it waits for the page to actually render, not just to authenticate. See the state table below.
    4. Choose representative pages, states, viewports, and themes.
    5. Capture evidence with meaningful waits and fresh refs — a before/after pair whenever the change alters a surface that already existed.
    6. Share artifacts, then report target, evidence, result, findings, and limitations.
    
    ## Open A Reference
    
    | Open when you need to... | Read |
    |--------------------------|------|
    | `ready` reports `LOGIN_REQUIRED`, set up the QA login for the first time, or switch which Sentry account QA runs as | `references/session-and-login.md` |
    | wait on Sentry's SPA correctly, force a theme, reach a flag-gated view, or explain a broken page | `references/sentry-capture.md` |
    
    ## Gate States
    
    | `sqa ready` says | Exit | Do this |
    |------------------|------|---------|
    | `READY` | 0 | proceed to capture |
    | `LOGIN_REQUIRED` | 2 | `scripts/sqa sync`; if that fails, `scripts/sqa login` |
    | `UNREACHABLE` | 3 | dev-ui is not running **or the browser never launched** — check both before reporting blocked |
    | `REFUSED` | 4 | forbidden org; stop and ask which org to use |
    | `BUILD_BROKEN` | 5 | frontend bundle never loaded; diagnose the compiler, report blocked |
    
    Never capture on any state but `READY`. A screenshot of a login page, an error page, or a loading screen is not evidence of anything.
    
    `UNREACHABLE` names a symptom, not a cause: `ready` reports it whenever the browser did not land on the page, which includes the browser failing to start at all. Confirm the server is actually down — `curl -sk -o /dev/null -w '%{http_code}' https://localhost:$SENTRY_QA_PORT/` — before blaming it. If the server answers, the browser is the problem; run the same URL through `agent-browser` directly to see Chrome's own stderr. `sqa` already passes `--no-sandbox` and `--ignore-certificate-errors`, which covers containers and the dev server's self-signed certificate; a launch failure past that is a new one worth reading the error for.
    
    ## Choose Evidence
    
    | Request | Primary evidence | Optional support |
    |---------|------------------|------------------|
    | Layout, CSS, content, typography | Screenshot | DOM text or style check |
    | Light and dark themes | Screenshot per theme | `__initialData.user.options.theme` check |
    | Responsive behavior | Screenshot per breakpoint | Video only if resize motion matters |
    | Loading state, skeleton, animation | Short video | Screenshot for a distinct final state |
    | Navigation or interaction sequence | Short video | Screenshot for a specific defect |
    | Stable menu, modal, hover, focus state | Screenshot | Video if the transition matters |
    | Exact text, route, ARIA, attribute | DOM check | Screenshot if the visible state matters |
    
    Screenshots for stable states, short video for timing and motion. A purely temporal request may skip a redundant screenshot. DOM checks support visual evidence; they never replace it when the user asks how something looks.
    
    ```bash
    scripts/sqa screenshot /tmp/sentry-qa.png
    scripts/sqa screenshot --full /tmp/sentry-qa-full.png
    scripts/sqa screenshot --annotate /tmp/sentry-qa-issue.png
    ```
    
    ## Resolve The Target
    
    QA runs against the UI-only devserver and nothing else:
    
    ```
    https://sentry-sdks.dev.getsentry.net:7900/            # default; pnpm run dev-ui
    https://sentry-sdks.dev.getsentry.net:7900/issues/     # org routes hang off the same host
    ```
    
    **Never target the `sentry` org.** `sentry.dev.getsentry.net:7900` and `sentry.sentry.io` route to Sentry's own production organization — real customer and internal data. This is a hard stop, not a preference: `scripts/sqa` refuses those URLs (`REFUSED`, exit 4), and that refusal is never worked around, including when a user request seems to call for it. Say the target is not permitted and ask which org to use.
    
    Always use an allowed org subdomain. Override with `SENTRY_QA_ORG` for another org, or `SENTRY_QA_URL` for a full URL; use a different target only when the user names one.
    
    This server builds local `static/` and proxies every API call to **production sentry.io**. Two consequences that decide whether a run is possible at all:
    
    - A backend (`src/`) change is **not** live here. Report **blocked** rather than implying it was verified.
    - Every byte rendered is production data. Treat it as customer data — see Protect Sensitive Data.
    
    QA runs its own dev-ui server on port 7900, separate from the everyday one on 7999, so a QA run never collides with or restarts what the user is working in:
    
    ```bash
    scripts/sqa serve      # start or reuse; waits until it actually serves
    scripts/sqa serve stop # stop the one this skill started
    ```
    
    `scripts/dev-ui` sets `SENTRY_WEBPACK_PROXY_PORT`, because `dev-ui-server.ts` ignores argv — there is no `--port` flag. Do not pass `NO_TS_FORK`: it does nothing in this repo. Type checking is gated on `ENABLE_TS_CHECKER` and is already off unless set (`rspack.config.ts`), so the QA server never type-checks; that belongs in `pnpm run typecheck`.
    
    Override the port with `SENTRY_QA_PORT`. Keep it well below 7999: the server silently scans up to +10 when a port is taken, so a nearby value can land on the everyday server.
    
    `scripts/dev-ui` also sets `WEBPACK_CACHE_PATH=node_modules/.cache/rspack-qa`, so a restart in the same checkout reuses rspack's persistent cache (~15s and ~30s of CPU instead of ~55s and ~250s). A cold start in a fresh checkout still builds the whole bundle; `serve` blocks until the server actually answers, and reuses one that is already serving. Do not set `LAZY_COMPILATION`: on the dev-ui server pages never leave the loading shell and rspack can panic.
    
    A QA server is a second full rspack build running alongside the user's own, which is memory-hungry — enough that one can be OOM-killed mid-build. Reuse an already-serving one, run `scripts/sqa serve stop` when the QA run is finished, and if a start dies partway, check memory before assuming the code is at fault. The checkout is found from the working directory, an explicit `SENTRY_QA_REPO`, or the repo remembered from a previous start — so `serve` works from the skill directory too.
    
    ## Keep Scope Representative
    
    - Cover one to four representative pages or states unless the user asks for more or the change spans more templates.
    - Pick the viewport-theme combinations most likely to expose the issue instead of an exhaustive matrix.
    - State plainly which requested surfaces were not verified.
    
    ## Cover The Scraps Story Too
    
    If the changed component has a story, capture it **in addition to** the in-app surfaces, never instead of them. The story shows every variant on one page; the app shows the component in real layout, data, and surrounding chrome. A regression can appear in either alone.
    
    ```bash
    find static/app -name "<component>.mdx" -not -path "*/node_modules/*"
    ```
    
    Stories render at `/scraps/<category>/<slug>/` on the QA host:
    
    - `<category>` is the tree the file sits in: `core`, `product`, `patterns`, or `principles`
    - `<slug>` is the mdx frontmatter `title`, lowercased with spaces as dashes
    
    `static/app/components/core/button/button.mdx` (`title: Button`) is `https://sentry-sdks.dev.getsentry.net:7900/scraps/core/button/`. When the slug is unclear, open `/scraps/` and find the component in the sidebar.
    
    Capture the variants the change actually touches, not the whole story page, unless the change is global. If the component has no `.mdx`, say so in the report rather than leaving story coverage ambiguous.
    
    ## Capture Before And After
    
    A screenshot of the new state proves it renders. It does not show what changed. When the branch alters a
    surface that **already existed**, capture the same state on the base revision too and present the two together —
    otherwise a reviewer has to hold the old layout in their head and take your word for the delta.
    
    | Change | Before shot |
    |--------|-------------|
    | Layout, spacing, colour, typography, or copy on an existing view | Required |
    | An existing component restyled, or moved between layouts | Required |
    | A brand-new view, component, or story with no prior rendering | None exists — say so, do not fake one |
    | Behavior no still frame distinguishes (timing, motion) | Pair the videos instead, or state that a frame cannot show it |
    
    ### Capture after first, before second
    
    The working tree is already in the after state, so capturing it costs nothing and risks nothing. Only then
    switch refs. If a run dies partway, the evidence that matters is already on disk and the checkout is untouched.
    
    ### The pair must differ only in the code
    
    Same URL, same viewport, same theme, same data. A before shot at another window size is worse than no before
    shot: it reads as a regression the branch did not cause. Re-apply `set viewport` after the switch if anything
    restarted the browser, and name the files as a pair (`-before-<state>.png` / `-after-<state>.png`).
    
    Data is the trap specific to this server. It proxies every API call to **production sentry.io**, so the rows,
    counts, and charts behind the two captures can move between them for reasons that have nothing to do with the
    branch. Prefer a target whose content is fixed — a scraps story, or a named issue or event id — over an issue
    stream or a time-ranged chart. When only a live view will do, say in the report that the data differs between
    the frames.
    
    ### Swap the checkout, not the server
    
    One QA server, rebuilt incrementally. Do **not** start a second one on the base revision: two rspack builds is
    already enough memory pressure to get one OOM-killed.
    
    ```bash
    BASE=$(git merge-base HEAD origin/master)
    git status --porcelain                 # must be empty; commit, or `git stash -u` and pop back this turn
    git switch --detach "$BASE"
    # rspack rebuilds on its own; wait for it, then re-gate
    scripts/sqa ready "$URL"
    scripts/sqa set viewport 1440 900
    scripts/sqa screenshot /tmp/sentry-qa-before-<state>.png
    git switch -                           # restore immediately, same turn
    ```
    
    - A dirty tree is a hard stop. Switching refs over uncommitted work can lose it. Commit, or `git stash -u` and
      pop it back before the turn ends.
    - Restore the original ref in the same turn as the capture, and confirm with `git status`. Never end a run on a
      detached HEAD or with a stash still on the stack. If restore fails, report that first — ahead of any finding.
    - Working inside your own worktree makes this free: the switch never touches the user's checkout. Prefer it.
    
    ### A matching before shot usually means a stale bundle
    
    `sqa ready` proves the page rendered. It does not prove it rendered the **base** bundle — the capture can land
    before rspack finishes, and a before shot that looks identical to the after shot is far more often a stale
    bundle than a change with no visible effect. Confirm the old code is actually live before trusting the frame:
    the changed element visibly back to its previous form, or a DOM check that distinguishes the two.
    
    ### Present them side by side
    
    ```markdown
    | before | after |
    |---|---|
    | [![before](URL)](URL) | [![after](URL)](URL) |
    ```
    
    One row per state, before on the left. Keep the two captures the same width so the diff is the only thing the
    eye catches.
    
    ## Capture Reliable State
    
    Wait for the state that proves progress, not an arbitrary delay:
    
    ```bash
    scripts/sqa wait --text "Expected text"
    scripts/sqa wait --url "**/issues/**"
    scripts/sqa wait 300
    ```
    
    Sentry polls in the background, so `wait --load networkidle` often never settles — prefer text or URL waits. Run `scripts/sqa snapshot -i` after navigation or a significant DOM change and use only fresh `@e*` refs.
    
    Record initial-load behavior before the first navigation:
    
    Viewport is per browser launch, not per session. Re-apply `set viewport` after anything that restarts the browser (`login`, `sync`, an explicit `close`), or captures silently come back at the default size.
    
    ```bash
    scripts/sqa set viewport 1440 900
    scripts/sqa record start /tmp/sentry-qa-load.webm "$URL"
    scripts/sqa wait --text "Issues"
    scripts/sqa record stop
    ```
    
    `record start` creates a fresh context and reloads, so discard earlier refs and re-snapshot before interacting. Stop recording as soon as the behavior is captured. Never end a run with an active recording.
    
    ## Share Evidence
    
    - Put artifacts in front of the user with the harness file-sending tool, and say where each file is saved.
    - Claim an artifact was delivered only after the send succeeds in this turn; otherwise report the error plus the saved path.
    - When opening a PR right now, attach the artifacts to that `gh pr create` call. Write the body against the local paths, and `gh` swaps each one for its uploaded asset URL:
    
    ```bash
    gh pr create --draft --attach './before.png#Issues stream, before' --attach ./after.png
    ```
    
    - Reference every image in the body yourself, as a **linked** image — `[![alt](./before.png)](./before.png)`, the same local path in both halves. `gh` rewrites both halves to the asset URL and the anchor survives. An image the body never references is appended as a bare `![alt](url)`, and GitHub then points its synthesized anchor at a signed URL that expires in five minutes — the thumbnail renders, the click-through 404s. Video is the exception: leave it unreferenced and let `gh` append the bare URL, which is what makes it play.
    - On an existing PR the user authored — they opened it, or an agent opened it for them; check with `gh pr view <n> --json author,body` — add the evidence to its body without asking. Add or replace a `## Screenshots` section in the current body that references each image by local path, as above, and write it back in one call, so `gh` rewrites the references and everything else in the body survives:
    
    ```bash
    gh pr edit <n> --body-file body.md --attach './before.png#Issues stream, before' --attach ./after.png
    ```
    
    - Evidence goes in the body, never in a comment. `gh pr comment --attach` needs an explicit ask in that message.
    - On a PR or issue someone else authored, do not upload or post anything — body edits, comments, and review replies included — without an explicit ask in that message. Attaching is posting: the file-send already put the evidence in the user's hands, and GitHub's composer uploads whatever they drag into it.
    
    ## Protect Sensitive Data
    
    Every in-app capture here renders production data, so this is not an edge case — it is nearly every run. Stories fed by fixtures are the exception.
    
    - The `sentry` org is never a target. `scripts/sqa` refuses it; do not reach for it another way.
    - Capture only the org the user works in. Never another organization's slug, event contents, member emails, or support context.
    - Never capture credential entry, session tokens, or auth cookies, and never print cookie values.
    - A frame that renders production data (an issue stream, event, org settings, anything fetched from sentry.io) may not go into a PR, commit, or issue until the user confirms it is clean. A frame showing only fixture data — a scraps story or a story fed by a fixture API — needs no such confirmation, and can go into the user's own PR body directly. If you are not sure which kind a frame is, treat it as production data.
    - If answering the request requires rendering data that cannot be shown, report the limitation instead of capturing it.
    
    ## Report The Result
    
    - **Target:** exact URL, plus the account `whoami` reported
    - **Evidence:** each screenshot, video, and DOM check, and why it was chosen. For a before/after pair, name the base revision the before shot came from, and say so when a surface that already existed has no before shot
    - **Result:** `pass`, `issues found`, or `blocked`
    - **Findings:** specific rendered behavior observed
    - **Limitations:** requested pages, states, viewports, or themes not verified
    
    Use **pass** only when captured evidence matches the requested behavior with no obvious scoped regression. Use **issues found** for broken layout, wrong motion, flicker, missing assets, or invalid state. Use **blocked** when no safe reachable target exists.
    
    Never generalize beyond the evidence collected, and never call a rendered change correct without opening a browser.
    
  • README.md11 KB2f427c5c1be9upstream ↗
    # sentry-visual-qa
    
    An agent skill — a `SKILL.md` with its scripts and references — that makes a coding agent verify
    user-visible [Sentry](https://github.com/getsentry/sentry) UI changes in a real browser, and
    report only what the captured screenshots, videos, and DOM checks actually support.
    
    The problem it solves: agents are happy to call a CSS change "correct" from the diff alone.
    This skill makes the agent open the rendered surface, gate on the page having really loaded,
    capture the smallest evidence set that answers the question, and say plainly which surfaces it
    did not check.
    
    ## What it does
    
    - Runs a dedicated UI-only devserver (`pnpm run dev-ui`) on its own port, so a QA run never
      collides with the devserver you are working in.
    - Drives a dedicated headless browser session with its own Sentry login — never your personal
      browser profile.
    - Gates every capture behind a readiness check (`READY` / `LOGIN_REQUIRED` / `UNREACHABLE` /
      `REFUSED` / `BUILD_BROKEN`), so a login page or a loading spinner can't be reported as evidence.
    - Picks evidence by request type: screenshots for stable states, short video for timing and
      motion, DOM checks as support.
    - Captures before/after pairs by switching the checkout to the merge-base on the same server.
    - Covers the component's scraps story (Sentry's component-story system) alongside the
      in-app surface when one exists.
    
    ## Requirements
    
    - A local `getsentry/sentry` checkout (the dev-ui server is started from it)
    - A Sentry account to run QA as — a dedicated one, see [Authentication](#authentication)
    - The [`agent-browser`](https://agent-browser.dev/) CLI on `PATH` — `brew install agent-browser`
      (developed against 0.37.1); on a remote workspace install from npm instead, see
      [Signing in from a remote workspace](#signing-in-from-a-remote-workspace-coderdev)
    - `python3` — used only to mirror auth cookies onto the dev origin
    - `curl`, `bash`
    - `ffmpeg`, for video capture only
    
    ## Install
    
    The repository root *is* the skill, so clone it straight into your agent's skills directory
    and `git pull` updates the skill in place:
    
    ```bash
    git clone https://github.com/getsentry/sentry-visual-qa.git ~/.agents/skills/sentry-visual-qa
    ```
    
    If your agent reads skills from somewhere else, or you keep your checkouts elsewhere, clone
    once and link it in under the same directory name:
    
    ```bash
    ln -s ~/.agents/skills/sentry-visual-qa <your-agent-skills-dir>/sentry-visual-qa
    ```
    
    ## Authentication
    
    QA runs as a real Sentry account in a dedicated browser session, never your everyday browser
    profile. Session cookies live in `~/.agent-browser/sessions/`, and `scripts/sqa` passes the
    session flags on every call — invoking `agent-browser` directly drops them and silently
    captures a logged-out page.
    
    ### Use a dedicated account, not your own
    
    **Whatever the account can see, the agent can capture.** The dev-ui server proxies every API
    call to production sentry.io, so a run renders live production data — issues, events, member
    names — for every organization that account belongs to.
    
    Do not sign in with an account that has production or customer access. Create a **separate
    Sentry user** whose only membership is an organization with nothing sensitive in it, and use
    it for QA and nothing else. `sentry-sdks` is the default target here for exactly that reason:
    it holds SDK projects rather than customer data.
    
    `scripts/sqa` does refuse URLs pointing at Sentry's own `sentry` org (exit 4, configurable via
    `SENTRY_QA_FORBIDDEN_ORGS`) — but treat that as a backstop, not the boundary. A blocklist only
    stops the targets someone thought to name, while an account with no access to sensitive data
    cannot render it whatever URL it is handed.
    
    Confirm which account is live before trusting any capture:
    
    ```bash
    scripts/sqa whoami
    # {"authed":true,"user":"[email protected]","org":"my-org","devUi":true,...}
    ```
    
    ### Why signing in takes two steps
    
    The dev-ui server proxies `/api` to sentry.io **server-side**, so the browser needs Sentry
    session cookies on the **dev origin** — and cookies set on `.sentry.io` are never sent to
    `*.dev.getsentry.net`. SSO cannot complete through the dev origin either, so signing in at the
    dev-ui `/auth/login/` does not work. Sign in upstream, then mirror the cookies across:
    
    ```bash
    scripts/sqa login   # headed sentry.io sign-in; a human completes SSO
    scripts/sqa sync    # mirror the session cookies onto .dev.getsentry.net
    scripts/sqa ready   # expect READY
    ```
    
    `sync` copies `session`, `sentry-sc`, and `sentry_react_auth`. `sentry-sudo` is skipped unless
    you pass `--with-sudo` — rendering does not need elevated access. Cookie values are never
    printed, logged, or written to disk by these scripts.
    
    Re-run `sqa sync` whenever the sentry.io session refreshes; the mirrored copies do not update
    themselves. `references/session-and-login.md` covers account switching and auth troubleshooting.
    
    ### Signing in from a remote workspace (coder.dev)
    
    `sqa login` opens a **headed** browser, and a remote workspace has no display to open it on.
    On a coder.dev workspace it fails with `Missing X server or $DISPLAY`; agent-browser's
    automatic Xvfb fallback only helps if `Xvfb` is installed, and a framebuffer nobody can see
    does not get you through SSO anyway. Drive the sign-in through the agent-browser dashboard
    instead — it streams the headless browser and forwards clicks and keystrokes.
    
    > **Homebrew's `agent-browser` has no dashboard.** The homebrew-core formula builds without the
    > dashboard frontend, so `dashboard start` serves a `Dashboard not built` stub
    > ([vercel-labs/agent-browser#1412](https://github.com/vercel-labs/agent-browser/issues/1412)).
    > Install from npm for this flow.
    
    **1. Let Chrome start.** Ubuntu 24.04 ships `kernel.apparmor_restrict_unprivileged_userns=1`,
    which blocks Chrome's namespace sandbox. Every `agent-browser` command then dies before a
    browser exists, the daemon never creates its socket, and the CLI reports
    `Failed to connect: No such file or directory (os error 2)` — or, from `agent-browser doctor`,
    `No usable sandbox!`. Export the launch flag for the whole session:
    
    ```bash
    export AGENT_BROWSER_ARGS="--no-sandbox"
    ```
    
    **2. Open the sign-in page headless**, bypassing the `--headed` that `sqa login` forces:
    
    ```bash
    agent-browser --session sentry-qa --restore sentry-qa open https://sentry.io/auth/login/
    ```
    
    **3. Start the dashboard for your proxied origin.** Coder serves each port at the origin in
    `$VSCODE_PROXY_URI`. The dashboard refuses any non-loopback origin it was not told about, and
    it wants an access token on top of that — an allowed origin *alone* still returns
    `Origin, Referer, or dashboard access token is invalid.`
    
    ```bash
    agent-browser dashboard start \
      --allowed-origins "https://4848--main--<workspace>--<user>.coder.sentry.dev"
    ```
    
    Open the URL it prints **including the `#dashboard-access-token=...` fragment**. That fragment
    is the only thing that sets the auth cookie, and the page strips it from the address bar once
    read, so a bookmarked copy will not authenticate a fresh browser. The token is regenerated
    every time the dashboard restarts.
    
    Port-forwarding sidesteps the token entirely, because loopback is trusted by default:
    
    ```bash
    coder port-forward <workspace> --tcp 4848:4848   # from your laptop, then http://localhost:4848
    ```
    
    **4. Sign in through the Viewport tab**, then mirror the cookies as usual:
    
    ```bash
    scripts/sqa sync
    scripts/sqa ready    # expect READY
    ```
    
    #### Typing in the dashboard viewport
    
    Clicking and navigation work. Text entry has two gaps, so fill fields from the CLI instead:
    
    - **`.` arrives as Delete.** The viewport sends `key.charCodeAt(0)` as the virtual key code,
      and `".".charCodeAt(0)` is 46 — `VK_DELETE`. A period is not merely dropped: it deletes
      whatever is to the right of the cursor, so typing one mid-string silently eats a character.
    - **There is no clipboard bridge.** The viewport forwards keyboard and mouse events only, so
      Ctrl+V pastes the *remote* browser's clipboard rather than yours.
    
    ```bash
    agent-browser --session sentry-qa snapshot -i             # get the @refs
    agent-browser --session sentry-qa fill "@e11" "[email protected]"
    agent-browser --session sentry-qa fill "@e12" "$(cat)"    # type, then Ctrl-D: keeps it out of shell history
    ```
    
    `fill` and `keyboard inserttext` bypass key dispatch, so both handle periods correctly.
    
    ## Configuration
    
    Everything is environment variables; there is no config file.
    
    | Variable | Default | Purpose |
    |----------|---------|---------|
    | `SENTRY_QA_ORG` | `sentry-sdks` | Org subdomain QA runs against |
    | `SENTRY_QA_URL` | `https://$SENTRY_QA_ORG.dev.getsentry.net:$SENTRY_QA_PORT` | Full target URL override |
    | `SENTRY_QA_PORT` | `7900` | Port for the QA devserver, kept clear of the everyday `7999` |
    | `SENTRY_QA_REPO` | walks up from `$PWD` | Path to the Sentry checkout |
    | `SENTRY_QA_SESSION` | `sentry-qa` | Browser session name |
    | `SENTRY_QA_HEADED` | unset (headless) | Set to `1` to watch a run while debugging |
    | `SENTRY_QA_FORBIDDEN_ORGS` | `sentry` | Orgs that are refused outright |
    | `SENTRY_QA_COOKIE_DOMAIN` | `.dev.getsentry.net` | Destination domain for the cookie mirror |
    | `SENTRY_QA_START_TIMEOUT` | `300` | Seconds to wait for a cold devserver build |
    | `SENTRY_QA_PROBE_TIMEOUT` | `60` | Seconds for a single readiness probe |
    | `SENTRY_QA_RENDER_TIMEOUT` | `120` | Seconds to wait for the app shell to render |
    
    Server state (pid, port, remembered checkout) lives in
    `${XDG_CACHE_HOME:-~/.cache}/sentry-visual-qa`.
    
    ## Safety
    
    Every capture renders production data, for the reason described under
    [Authentication](#authentication). Two rules follow from that, and the skill enforces both:
    
    - Sentry's own `sentry` org is never a target. `scripts/sqa` refuses those URLs outright
      (exit 4), and the skill instructs the agent never to route around that refusal.
    - A frame showing production data goes into a PR, commit, or issue only after a human confirms
      it is clean. Fixture-only frames (stories) are exempt.
    
    The skill adds before/after evidence to the body of a PR the user authored without asking. It
    never comments, and never posts to a PR or issue someone else authored unless asked.
    
    Backend (`src/`) changes are *not* live on this server — the skill reports such a request as
    blocked rather than implying it was verified.
    
    ## Layout
    
    ```
    SKILL.md                      workflow, evidence model, capture rules, reporting contract
    SPEC.md                       behavior contract: scope, runtime contract, known limitations
    SOURCES.md                    provenance, upstream fidelity boundary, revision log
    references/
      session-and-login.md        session isolation, first-time login, account switching
      sentry-capture.md           SPA waits, theme forcing, feature flags, failure diagnosis
    scripts/
      sqa                         session-pinned agent-browser wrapper + ready/login/sync/serve
      dev-ui                      start/stop/status for the QA devserver on its own port
      sync-cookies, _sync_cookies.py   mirror sentry.io auth cookies onto the dev origin
    ```
    
    ## Provenance
    
    Adapted for personal local use from `getsentry/junior`'s `visual-web-qa` skill. `SOURCES.md`
    records what was preserved from upstream, what was adapted, and what was dropped.
    
    ## License
    
    [MIT](LICENSE)
    
  • scripts/_sync_cookies.py2.2 KBc6fdc9077450upstream ↗
    """Mirror Sentry auth cookies onto the dev-ui domain. Called by scripts/sync-cookies.
    
    Reads `agent-browser cookies get --json` on stdin. Cookie values are passed
    straight to `agent-browser cookies set` and are never printed or persisted.
    """
    
    import json
    import os
    import subprocess
    import sys
    
    
    def main() -> int:
        want = set(os.environ["SENTRY_QA_NAMES"].split())
        dest = os.environ["SENTRY_QA_DEST"]
        session = os.environ["SENTRY_QA_SESSION_NAME"]
    
        try:
            payload = json.load(sys.stdin)
        except Exception:
            print("could not read cookies; is the QA session open on sentry.io?", file=sys.stderr)
            return 3
    
        cookies = payload
        if isinstance(payload, dict):
            data = payload.get("data") or {}
            cookies = payload.get("cookies") or data.get("cookies") or data or []
    
        copied = []
        missing = set(want)
        for cookie in cookies:
            name = cookie.get("name")
            if name not in want or not cookie.get("domain", "").endswith("sentry.io"):
                continue
            missing.discard(name)
            cmd = [
                "agent-browser", "--session", session, "--restore", session,
                "cookies", "set", name, cookie["value"],
                "--domain", dest, "--path", cookie.get("path", "/"),
            ]
            if cookie.get("secure"):
                cmd.append("--secure")
            if cookie.get("httpOnly"):
                cmd.append("--httpOnly")
            if cookie.get("sameSite") in ("Strict", "Lax", "None"):
                cmd += ["--sameSite", cookie["sameSite"]]
            result = subprocess.run(cmd, capture_output=True, text=True)
            # Never echo cmd or its output: argv carries the cookie value.
            status = "ok" if result.returncode == 0 else "FAILED"
            print(f"  {name:20} -> {dest}  {status}")
            if result.returncode == 0:
                copied.append(name)
    
        if not copied:
            print("no auth cookies found on sentry.io; sign in there first", file=sys.stderr)
            return 2
        if missing:
            print(f"note: not present on sentry.io: {', '.join(sorted(missing))}", file=sys.stderr)
        print(f"copied {len(copied)} cookie(s) to {dest}")
        return 0
    
    
    if __name__ == "__main__":
        sys.exit(main())
    
  • scripts/dev-ui6.8 KB0825fd0b1232upstream ↗
    #!/usr/bin/env bash
    # Manage the QA dev-ui server: its own port, separate from the everyday one.
    #
    #   dev-ui [start]   start (or reuse) the QA dev-ui server, wait until it serves
    #   dev-ui stop      stop the server this script started
    #   dev-ui status    report whether the QA port is serving
    #
    # Port comes from SENTRY_QA_PORT (default 7900). dev-ui-server.ts ignores argv and
    # reads SENTRY_WEBPACK_PROXY_PORT, then scans up to +10 if that port is taken, so the
    # default is kept far below 7999 and the bound port is verified after start.
    #
    # Type checking is NOT run here: rspack gates it on ENABLE_TS_CHECKER, which is off
    # unless explicitly set (rspack.config.ts). Typechecking belongs in `pnpm run typecheck`.
    #
    # WEBPACK_CACHE_PATH turns on rspack's persistent filesystem cache (rspack.config.ts),
    # relative to the checkout, so a restart in the same checkout is warm: ~30s of rspack
    # CPU instead of ~250s. QA-specific dir so it never shares a cache with the everyday
    # server; ~1GB per checkout. Override, or disable with an empty value, from the env.
    #
    # Do NOT set LAZY_COMPILATION: on the dev-ui server, pages never get past the loading
    # shell (sqa ready -> BUILD_BROKEN), the runtime keeps rebuilding, and rspack 2.2.3
    # can panic with "capacity overflow".
    set -uo pipefail
    
    PORT="${SENTRY_QA_PORT:-7900}"
    REPO=""  # resolved by resolve_repo below
    STATE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/sentry-visual-qa"
    PID_FILE="$STATE_DIR/dev-ui-$PORT.pid"
    LOG_FILE="$STATE_DIR/dev-ui-$PORT.log"
    WAIT_SECONDS="${SENTRY_QA_START_TIMEOUT:-300}"
    
    # rspack-dev-middleware holds requests to / until the first bundle finishes, so a
    # short timeout looks identical to "not running". Distinguish by curl exit code:
    #   0  = serving        7  = nothing listening        28 = listening, still building
    probe() {
      curl -skS --connect-timeout 3 -m "${SENTRY_QA_PROBE_TIMEOUT:-60}" -o /dev/null \
        "https://sentry.dev.getsentry.net:$PORT/" >/dev/null 2>&1
      echo $?
    }
    
    serving() { [ "$(probe)" = "0" ]; }
    
    is_checkout() { [ -f "$1/package.json" ] && grep -q '"dev-ui"' "$1/package.json" 2>/dev/null; }
    
    # The skill is usually invoked from its own directory, so $PWD alone is not enough:
    # take an explicit override, else walk up from $PWD, else the repo remembered from a
    # previous successful start.
    resolve_repo() {
      if [ -n "${SENTRY_QA_REPO:-}" ]; then
        echo "$SENTRY_QA_REPO"
        return
      fi
      d="$PWD"
      while [ "$d" != "/" ]; do
        if is_checkout "$d"; then
          echo "$d"
          return
        fi
        d="$(dirname "$d")"
      done
      [ -f "$STATE_DIR/repo" ] && cat "$STATE_DIR/repo"
    }
    
    case "${1:-start}" in
      status)
        if serving; then
          echo "SERVING port $PORT"
          exit 0
        fi
        echo "NOT SERVING port $PORT"
        exit 1
        ;;
    
      stop)
        # pnpm spawns node, which spawns rspack, and the group is not a session leader
        # (no setsid on macOS), so killing the recorded pid alone orphans the server.
        # Collect the recorded pid, its descendants, and whatever holds the port.
        pids=""
        if [ -f "$PID_FILE" ]; then
          root="$(cat "$PID_FILE")"
          pids="$root"
          queue="$root"
          while [ -n "$queue" ]; do
            next=""
            for pid in $queue; do
              kids="$(pgrep -P "$pid" 2>/dev/null)"
              [ -n "$kids" ] && next="$next $kids" && pids="$pids $kids"
            done
            queue="$next"
          done
        fi
        # Only this port's listener, never the everyday server on another port.
        listeners="$(lsof -ti "tcp:$PORT" -sTCP:LISTEN 2>/dev/null)"
        pids="$pids $listeners"
        # Keep only pids that are actually alive: a crashed or OOM-killed server leaves
        # a stale pidfile behind, and killing a dead pid would look like a success.
        live=""
        for pid in $(echo $pids | tr ' ' '\n' | grep -E '^[0-9]+$' | sort -u); do
          kill -0 "$pid" 2>/dev/null && live="$live $pid"
        done
        pids="$live"
    
        if [ -z "${pids// /}" ]; then
          echo "nothing running on port $PORT" >&2
          [ -f "$PID_FILE" ] && echo "(cleared a stale pidfile)" >&2
          rm -f "$PID_FILE"
          exit 1
        fi
        kill $pids 2>/dev/null
        sleep 3
        still="$(lsof -ti "tcp:$PORT" -sTCP:LISTEN 2>/dev/null)"
        if [ -n "$still" ]; then
          kill -9 $still 2>/dev/null
          sleep 1
        fi
        rm -f "$PID_FILE"
        if lsof -ti "tcp:$PORT" -sTCP:LISTEN >/dev/null 2>&1; then
          echo "port $PORT is still held; stop it where it was started" >&2
          exit 1
        fi
        echo "stopped dev-ui on port $PORT"
        ;;
    
      start)
        if serving; then
          echo "REUSING already-serving dev-ui on port $PORT"
          exit 0
        fi
        REPO="$(resolve_repo)"
        if [ -z "$REPO" ] || ! is_checkout "$REPO"; then
          echo "no sentry checkout found from $PWD" >&2
          echo "run from the checkout, or set SENTRY_QA_REPO=/path/to/sentry" >&2
          exit 3
        fi
    
        mkdir -p "$STATE_DIR"
        echo "$REPO" > "$STATE_DIR/repo"
        : > "$LOG_FILE"
        echo "starting dev-ui on port $PORT (log: $LOG_FILE)" >&2
        # Redirect the whole background job, not just pnpm: `a && b &` forks a wrapper
        # subshell that waits on the server, and if that wrapper keeps our stdout/stderr
        # the caller's pipe never closes, so `sqa serve` hangs after printing SERVING.
        # `exec` replaces the wrapper with pnpm, so the pidfile records the server itself.
        ( cd "$REPO" || exit 1
          SENTRY_WEBPACK_PROXY_PORT="$PORT" \
            WEBPACK_CACHE_PATH="${WEBPACK_CACHE_PATH-node_modules/.cache/rspack-qa}" \
            exec nohup pnpm run dev-ui
        ) >>"$LOG_FILE" 2>&1 </dev/null &
        echo $! > "$PID_FILE"
        # `stop` walks descendants from this pid and also frees the port directly.
    
        # Track elapsed by wall clock: each probe can itself block for a long time.
        start_ts=$SECONDS
        while [ $((SECONDS - start_ts)) -lt "$WAIT_SECONDS" ]; do
          code="$(probe)"
          if [ "$code" = "0" ]; then
            # dev-ui-server.ts silently shifts port when one is taken; confirm the bind.
            if grep -q "Starting on port" "$LOG_FILE" 2>/dev/null; then
              actual="$(grep -o "Starting on port [0-9]*" "$LOG_FILE" | tail -1 | grep -o '[0-9]*')"
              if [ -n "$actual" ] && [ "$actual" != "$PORT" ]; then
                echo "PORT_SHIFTED requested $PORT but bound $actual" >&2
                echo "set SENTRY_QA_PORT=$actual, or free the port and restart" >&2
                exit 4
              fi
            fi
            echo "SERVING port $PORT"
            exit 0
          fi
          if ! kill -0 "$(cat "$PID_FILE" 2>/dev/null)" 2>/dev/null; then
            echo "dev-ui exited during startup; last lines:" >&2
            tail -15 "$LOG_FILE" >&2
            exit 5
          fi
          [ "$code" = "28" ] && echo "  still bundling ($((SECONDS - start_ts))s)" >&2
          sleep 2
        done
        echo "dev-ui did not serve within ${WAIT_SECONDS}s; last lines:" >&2
        tail -15 "$LOG_FILE" >&2
        exit 5
        ;;
    
      ""|-h|--help)
        sed -n '2,12p' "$0" | sed 's/^# \{0,1\}//'
        ;;
    
      *)
        echo "unknown command: $1" >&2
        exit 64
        ;;
    esac
    
  • scripts/sqa7.9 KB5ee075420e79upstream ↗
    #!/usr/bin/env bash
    # Run agent-browser pinned to the dedicated Sentry QA browser session.
    #
    #   sqa <agent-browser args...>   passthrough with the QA session + saved login
    #   sqa whoami                    print which Sentry account the session is on
    #   sqa ready [url]               open url and classify: READY | LOGIN_REQUIRED | UNREACHABLE
    #   sqa login                     open a headed sentry.io sign-in (SSO needs a human)
    #   sqa serve                     start (or reuse) the QA dev-ui server on its own port
    #   sqa sync                      mirror sentry.io cookies onto the dev-ui domain
    #
    # Env: SENTRY_QA_SESSION (default sentry-qa), SENTRY_QA_ORG (default sentry-sdks),
    #      SENTRY_QA_URL (default https://$SENTRY_QA_ORG.dev.getsentry.net:7999),
    #      SENTRY_QA_PORT (default 7900, separate from the everyday 7999),
    #      SENTRY_QA_HEADED=1 to watch the browser while debugging (default headless),
    #      AGENT_BROWSER_ARGS to replace Chrome's launch args (see the default below).
    set -uo pipefail
    
    SESSION="${SENTRY_QA_SESSION:-sentry-qa}"
    QA_ORG="${SENTRY_QA_ORG:-sentry-sdks}"
    # Orgs that are never a QA target. `sentry` is Sentry's own production org.
    FORBIDDEN_ORGS="${SENTRY_QA_FORBIDDEN_ORGS:-sentry}"
    QA_PORT="${SENTRY_QA_PORT:-7900}"
    BASE_URL="${SENTRY_QA_URL:-https://$QA_ORG.dev.getsentry.net:$QA_PORT}"
    SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
    
    # Headless unless SENTRY_QA_HEADED is set. Passed explicitly so a config file or
    # stray env cannot silently open windows. Headed/headless is fixed when the browser
    # launches, so a running headed browser must be closed before this takes effect.
    HEADED="false"
    [ -n "${SENTRY_QA_HEADED:-}" ] && HEADED="true"
    
    # Chrome's launch args, exported so every agent-browser call below inherits them.
    #
    # --no-sandbox: Chrome's sandbox needs unprivileged user namespaces, which
    #   containers and hardened hosts routinely disable. Without this Chrome dies
    #   before it writes DevToolsActivePort ("No usable sandbox!"), and since the
    #   browser never comes up, `ready` blames the server and reports UNREACHABLE --
    #   sending you off to debug a dev-ui that was fine all along.
    # --ignore-certificate-errors: the dev-ui server signs its own certificate, so
    #   the browser rejects it (ERR_CERT_AUTHORITY_INVALID) and never lands on the
    #   page. Scoped to this session's browser, which only ever opens the local QA
    #   server and sentry.io.
    #
    # Set AGENT_BROWSER_ARGS yourself to override; agent-browser takes a comma- or
    # newline-separated list.
    export AGENT_BROWSER_ARGS="${AGENT_BROWSER_ARGS:---no-sandbox,--ignore-certificate-errors}"
    
    ab() { agent-browser --session "$SESSION" --restore "$SESSION" --headed "$HEADED" "$@"; }
    
    # Refuse any URL pointing at a forbidden org, on the dev-ui host or on sentry.io.
    # This is a hard stop, not a default: those orgs hold production customer data.
    deny_check() {
      local arg host label bad
      for arg in "$@"; do
        case "$arg" in
          http://*|https://*) ;;
          *) continue ;;
        esac
        host="${arg#*://}"; host="${host%%/*}"; host="${host%%:*}"
        label="${host%%.*}"
        case "$host" in
          *.dev.getsentry.net|*.sentry.io)
            for bad in $FORBIDDEN_ORGS; do
              if [ "$label" = "$bad" ]; then
                echo "REFUSED $arg" >&2
                echo "the $bad org is production Sentry data and is never a QA target" >&2
                echo "use an org subdomain such as https://$QA_ORG.dev.getsentry.net:7999" >&2
                return 1
              fi
            done
            ;;
        esac
      done
      return 0
    }
    
    IDENTITY_JS='(() => {
      const d = window.__initialData;
      if (!d) return JSON.stringify({sentryApp: false, url: location.href});
      return JSON.stringify({
        sentryApp: true,
        authed: !!d.isAuthenticated,
        user: (d.user && d.user.email) || null,
        superuser: !!(d.user && d.user.isSuperuser),
        org: d.lastOrganization || null,
        theme: (d.user && d.user.options && d.user.options.theme) || null,
        devUi: !!window.__SENTRY_DEV_UI,
        url: location.href,
      });
    })()'
    
    case "${1:-}" in
      whoami)
        ab eval "$IDENTITY_JS"
        ;;
    
      ready)
        url="${2:-$BASE_URL}"
        deny_check "$url" || exit 4
        ab open "$url" >/dev/null 2>&1
        # `open` exits 0 even on ERR_CONNECTION_REFUSED, leaving the browser on the
        # previous page or chrome-error://. Assert we actually landed on the target,
        # or the gate would validate whatever was loaded before.
        expected_host="${url#*://}"; expected_host="${expected_host%%/*}"
        landed_host="$(ab eval "location.host" 2>/dev/null | tr -d '"\\')"
        if [ "$landed_host" != "$expected_host" ]; then
          echo "UNREACHABLE $url"
          echo "navigation did not land on $expected_host (browser is at: ${landed_host:-chrome-error})" >&2
          echo "hint: start the QA server with: sqa serve" >&2
          exit 3
        fi
        # The loading shell is served before React mounts, so poll for hydration
        # instead of treating a slow boot as a broken build.
        identity=""
        tries=0
        while [ "$tries" -lt 20 ]; do
          identity="$(ab eval "$IDENTITY_JS" 2>/dev/null | tr -d '\\' | sed 's/^"//;s/"$//')"
          case "$identity" in
            *'"sentryApp":true'*) break ;;
          esac
          tries=$((tries + 1))
          ab wait 1000 >/dev/null 2>&1
        done
        # Hydration is not rendering: bootWithHydration sets __initialData before React
        # mounts and before route chunks compile, so the loading shell can still be on
        # screen while identity already reports authenticated. Wait for the shell to go.
        shell_ts=$SECONDS
        shell_timeout="${SENTRY_QA_RENDER_TIMEOUT:-120}"
        while [ $((SECONDS - shell_ts)) -lt "$shell_timeout" ]; do
          ab get text body 2>/dev/null | grep -qi "ton of JavaScript" || break
          ab wait 2000 >/dev/null 2>&1
        done
        if ab get text body 2>/dev/null | grep -qi "ton of JavaScript"; then
          echo "BUILD_BROKEN $url"
          echo "still the loading shell after ${shell_timeout}s; check the compiler, not the component" >&2
          echo "see references/sentry-capture.md" >&2
          exit 5
        fi
        case "$identity" in
          *'"authed":true'*)
            echo "READY $identity"
            exit 0
            ;;
        esac
        # Unauthenticated Sentry bounces to a login or marketing page, and neither
        # boots the React app, so match the URL before deciding the host is broken.
        case "$identity" in
          *auth/login*|*auth/sso*|*/welcome*|*/login*|*'"authed":false'*)
            echo "LOGIN_REQUIRED $identity"
            echo "if already signed in on sentry.io: sqa sync   otherwise: sqa login" >&2
            echo "see references/session-and-login.md" >&2
            exit 2
            ;;
          *'"sentryApp":false'*)
            echo "UNREACHABLE $url"
            echo "page loaded but is not the Sentry app: $identity" >&2
            exit 3
            ;;
          *)
            echo "LOGIN_REQUIRED $identity"
            echo "see references/session-and-login.md" >&2
            exit 2
            ;;
        esac
        ;;
    
      login)
        # SSO cannot complete through the dev-ui origin, so sign in on sentry.io
        # and mirror the cookies afterwards with `sqa sync`.
        echo "Opening a headed browser at https://sentry.io/auth/login/." >&2
        echo "Sign in there, then run: sqa sync   (that mirrors cookies and returns to headless)" >&2
        # A running headless browser cannot be flipped to headed, so restart it.
        agent-browser --session "$SESSION" close >/dev/null 2>&1
        agent-browser --session "$SESSION" --restore "$SESSION" --headed open "https://sentry.io/auth/login/"
        exit 2
        ;;
    
      serve)
        shift
        "$SCRIPT_DIR/dev-ui" "$@"
        ;;
    
      sync)
        shift
        if "$SCRIPT_DIR/sync-cookies" "$@"; then
          # The login window exists only to obtain cookies; once mirrored, close it so
          # the next command relaunches headless. Restore keeps the cookies.
          agent-browser --session "$SESSION" close >/dev/null 2>&1
          echo "closed the login browser; the next sqa command starts headless"
        else
          exit $?
        fi
        ;;
    
      ""|-h|--help)
        sed -n '2,11p' "$0" | sed 's/^# \{0,1\}//'
        ;;
    
      *)
        deny_check "$@" || exit 4
        ab "$@"
        ;;
    esac
    
  • scripts/sync-cookies1.1 KB6f9a05c7c99aupstream ↗
    #!/usr/bin/env bash
    # Copy Sentry auth cookies from sentry.io onto the dev-ui domain.
    #
    # The dev-ui server proxies /api to sentry.io server-side, so the browser must
    # hold session cookies on the *dev* origin. SSO cannot complete through the
    # :7999 origin, so the flow is: sign in on sentry.io in the QA session, then run
    # this to mirror those cookies onto .dev.getsentry.net.
    #
    #   sync-cookies [--with-sudo]
    #
    # Copies session, sentry-sc and sentry_react_auth. sentry-sudo is skipped unless
    # --with-sudo is passed: sudo mode grants elevated access that rendering does not
    # need. Cookie values are never printed, logged, or written to disk.
    set -uo pipefail
    
    SESSION="${SENTRY_QA_SESSION:-sentry-qa}"
    DEST_DOMAIN="${SENTRY_QA_COOKIE_DOMAIN:-.dev.getsentry.net}"
    NAMES="session sentry-sc sentry_react_auth"
    [ "${1:-}" = "--with-sudo" ] && NAMES="$NAMES sentry-sudo"
    
    export SENTRY_QA_NAMES="$NAMES"
    export SENTRY_QA_DEST="$DEST_DOMAIN"
    export SENTRY_QA_SESSION_NAME="$SESSION"
    
    SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
    agent-browser --session "$SESSION" --restore "$SESSION" cookies get --json 2>/dev/null \
      | python3 "$SCRIPT_DIR/_sync_cookies.py"
    
  • references/sentry-capture.md6.3 KBa369b092b4bdupstream ↗
    # Capturing Sentry's UI
    
    Open when waiting on Sentry's SPA, forcing a theme, reaching a flag-gated view, or explaining a page that renders wrong.
    
    ## Contents
    
    - Waiting on the SPA
    - Forcing light and dark
    - Reaching flag-gated UI
    - Explaining a broken page
    - Dev-UI traps
    - The page is stuck loading JavaScript
    
    ## Waiting On The SPA
    
    Sentry polls in the background and streams data after first paint, so `wait --load networkidle` frequently never resolves.
    
    | Goal | Wait on |
    |------|---------|
    | Route change | `sqa wait --url "**/issues/**"` |
    | View finished rendering | `sqa wait --text "<a heading only that view renders>"` |
    | Data arrived, not just the skeleton | `sqa wait --text "<a value from the row/chart>"` |
    | Animation with no completion signal | `sqa wait 300` |
    
    Screenshot the loaded state, not the skeleton: wait for real content before capturing, or the evidence just shows placeholders. Re-run `sqa snapshot -i` after every navigation or significant DOM change and use only fresh `@e*` refs.
    
    ## Forcing Light And Dark
    
    The account's `user.options.theme` wins. `prefers-color-scheme` only decides when that option is `system` — see `useColorscheme`.
    
    ```bash
    scripts/sqa whoami            # confirm "theme":"system" first
    scripts/sqa set media dark
    scripts/sqa set media light
    ```
    
    If `whoami` reports `"theme":"dark"` or `"light"`, `set media` changes nothing. Either change the QA account's theme in user settings, or say the theme could not be switched — do not present one theme's screenshot as both.
    
    Confirm which theme actually rendered before reporting it:
    
    ```bash
    scripts/sqa eval "getComputedStyle(document.body).backgroundColor"
    ```
    
    ## Reaching Flag-Gated UI
    
    Most new Sentry UI sits behind a feature flag, so an empty page usually means the flag is off, not that the change is broken.
    
    ```bash
    scripts/sqa eval "JSON.stringify(window.__initialData.features)"
    ```
    
    On the local devserver, enable a flag in `~/.sentry/sentry.conf.py` and restart the devserver:
    
    ```python
    SENTRY_FEATURES["organizations:my-new-feature"] = True
    ```
    
    Organization-level flags also need the org in scope; project-level flags need the right project selected. If the flag cannot be enabled, report **blocked** and name the flag.
    
    ## Explaining A Broken Page
    
    Check the browser and the server before concluding the change is at fault:
    
    ```bash
    scripts/sqa errors     # uncaught page errors
    scripts/sqa console    # console output, including failed chunk loads
    tail -100 .artifacts/dev.log   # devserver output: tracebacks, reload failures
    ```
    
    | Symptom | Likely cause |
    |---------|--------------|
    | Blank page, chunk 404s in console | webpack still rebuilding, or a stale dev build |
    | Page renders, panel empty | feature flag off, or org/project not in scope |
    | 403 or a redirect to login | QA account lacks access to that org, project, or view |
    | 500 with a traceback in `dev.log` | backend change, not a visual regression |
    | Layout fine locally, wrong on the dev-ui server | UI-only server runs local `static/` against production APIs |
    
    ## Dev-UI Traps
    
    - The server builds local `static/` and proxies APIs to **production** sentry.io. A `src/` change is not live here; report **blocked** instead of implying it was checked.
    - Always use an allowed org subdomain (`https://sentry-sdks.dev.getsentry.net:7900/...`). The `sentry.` host is Sentry's own production org and is refused outright; never route around that.
    - `whoami` should report `"devUi":true`. If it does not, the capture is not coming from the dev-ui server.
    - Data is production data, so empty states are real. Do not report a rendering bug without a DOM check confirming the view is actually empty.
    
    ## Hydration Is Not Rendering
    
    `window.__initialData` is set by `bootWithHydration` before React mounts and before route chunks compile, so `whoami` can report `"authed":true` while the loading shell is still on screen. An identity check alone is not proof the page rendered.
    
    `scripts/sqa ready` handles this: after hydration it waits for the loading shell to disappear (up to `SENTRY_QA_RENDER_TIMEOUT`, default 120s) before reporting `READY`. On a freshly started server the first visit to a route compiles its chunk on demand, so that wait is normal, not a hang.
    
    If capturing outside the gate, confirm the view rendered before the screenshot:
    
    ```bash
    scripts/sqa wait --text "<a heading only that view renders>"
    ```
    
    ## The Page Is Stuck Loading JavaScript
    
    `Loading a $#!%-ton of JavaScript…` means the bundle never arrived. This is almost always a build failure, not a rendering bug. Check the compiler before touching the component:
    
    `scripts/sqa ready` already polls for 20s before reporting `BUILD_BROKEN`, so a slow boot is not mistaken for a failure. When it does report it, diagnose like this:
    
    ```bash
    scripts/sqa console --clear && scripts/sqa reload && scripts/sqa wait 5000
    scripts/sqa console | grep -i "rspack-dev-server\|Errors while compiling"
    curl -skS -o /dev/null -w '%{http_code}\n' https://sentry-sdks.dev.getsentry.net:7900/_assets/app.js
    ```
    
    **Clear the console first.** `sqa console` returns a buffered log for the whole session, so errors from an earlier navigation will otherwise look like errors on the current page — the fastest way to report a fixed build as still broken.
    
    The bundle entrypoints are `/_assets/runtime.js`, `/_assets/app.js`, and `/_assets/sentry.js`. Read them off the page rather than assuming a path:
    
    ```bash
    scripts/sqa eval "Array.from(document.querySelectorAll('script[src]')).map(s=>s.src).join('\n')"
    ```
    
    A 200 on `app.js` plus a React DevTools or React Router message in a freshly cleared console means the app booted and the problem is elsewhere.
    
    | Compiler error | Cause | Fix |
    |----------------|-------|-----|
    | `Package subpath './x' is not defined by "exports"` | `node_modules` is older than `package.json` requires | `pnpm install`, then let the server rebuild |
    | `Module not found` for a repo path | file renamed or not saved | fix the import |
    | Type or syntax error naming a changed file | the change under QA does not compile | fix it before capturing |
    
    Compare the installed version against the requirement before concluding anything:
    
    ```bash
    python3 -c "import json;print(json.load(open('node_modules/<pkg>/package.json'))['version'])"
    grep '"<pkg>"' package.json
    ```
    
    Report **blocked** with the compiler error while the bundle is broken. Never screenshot the loading screen and describe it as the change rendering.
    
  • references/session-and-login.md4.9 KBa5380e0b5e72upstream ↗
    # QA Session And Login
    
    Open when `sqa ready` reports `LOGIN_REQUIRED`, when setting up QA for the first time, or when switching which Sentry account QA runs as.
    
    ## Why A Dedicated Session
    
    QA runs in the named agent-browser session `sentry-qa`, never in the user's everyday Chrome profile. That keeps the agent out of personal cookies and lets QA run as a chosen account — typically a bot account, not the user's own.
    
    - Cookies and localStorage persist at `~/.agent-browser/sessions/<session>-<restore>.json`.
    - `--session` and `--restore` must be passed on **every** invocation. `scripts/sqa` does this; bare `agent-browser` does not.
    - Never pass `--profile` or `--auto-connect`. Both attach to the user's real Chrome and its live Sentry login.
    
    ## Why Login Takes Two Steps
    
    The dev-ui server proxies `/api` to sentry.io **server-side** (`rspack.config.ts`, `cookieDomainRewrite`). The browser therefore needs Sentry session cookies on the **dev origin**, and cookies set on `.sentry.io` are never sent to `sentry.dev.getsentry.net:7900`.
    
    SSO cannot complete through the dev-ui origin, so signing in at `:7900/auth/login/` does not work. The working flow is sign in on sentry.io, then mirror the cookies across:
    
    ```bash
    scripts/sqa login     # headed sentry.io sign-in; a human completes SSO
    scripts/sqa sync      # mirror session cookies onto .dev.getsentry.net
    scripts/sqa ready     # expect READY
    ```
    
    `sqa login` needs a person at the keyboard. If the user is not present, stop and say a one-time sign-in is needed — never fall back to a profile that belongs to the user.
    
    ## Headed Versus Headless
    
    Captures run headless. `scripts/sqa` passes `--headed false` on every call so a config file or stray env cannot open windows mid-run.
    
    The mode is decided when the browser **launches**, not per command, so a session that is already running headed stays headed until it is closed. That is why `sqa login` closes the browser before opening the sign-in window, and `sqa sync` closes it afterwards.
    
    ```bash
    agent-browser --session sentry-qa close    # then the next sqa command relaunches headless
    SENTRY_QA_HEADED=1 scripts/sqa ready       # watch a run while debugging (close first)
    ```
    
    Closing the browser is safe: `--restore` writes cookies to `~/.agent-browser/sessions/` and reloads them on the next launch, so the login survives. Verified: after a close, `sqa ready` returns `READY` for the same account without a new sign-in.
    
    ## What `sync` Copies
    
    `scripts/sync-cookies` copies `session`, `sentry-sc`, and `sentry_react_auth` from sentry.io onto `.dev.getsentry.net`.
    
    - `sentry-sudo` is **skipped** unless `--with-sudo` is passed. Sudo mode grants elevated access that rendering does not need.
    - Cookie values are never printed, logged, or written to disk. Do not echo them, and do not dump `cookies get` to a file.
    - Re-run `sqa sync` whenever the sentry.io session is refreshed; the mirrored copies do not update themselves.
    
    ## Verify Identity Before Capturing
    
    ```bash
    scripts/sqa whoami
    # {"sentryApp":true,"authed":true,"user":"[email protected]","superuser":false,
    #  "org":"my-org","theme":"system","devUi":true,"url":"..."}
    ```
    
    Report the `user` value alongside the target URL. A screenshot proves nothing if it was taken as the wrong account: permissions, feature flags, and org access all vary per account. Expect `"devUi":true` on every run; if it is false, the target is not the dev-ui server.
    
    ## Run As A Second Account
    
    Session name is the account boundary. Give each account its own session:
    
    ```bash
    SENTRY_QA_SESSION=sentry-qa-member scripts/sqa login
    SENTRY_QA_SESSION=sentry-qa-member scripts/sqa sync
    SENTRY_QA_SESSION=sentry-qa-member scripts/sqa ready
    ```
    
    Use this to compare member-versus-owner rendering. Never log a second account into an existing session; the saved state becomes a mix of both.
    
    ## Troubleshooting
    
    | Symptom | Cause | Fix |
    |---------|-------|-----|
    | `LOGIN_REQUIRED` on dev-ui, but sentry.io works in the same session | cookies live on `.sentry.io` only | `scripts/sqa sync` |
    | `LOGIN_REQUIRED` right after a successful login | flags dropped on a later call | run everything through `scripts/sqa` |
    | `LOGIN_REQUIRED` on a previously working session | sentry.io session expired | `scripts/sqa login`, then `sync` |
    | `sync` reports no cookies found | session never signed in to sentry.io | `scripts/sqa login` first |
    | `UNREACHABLE` | dev-ui not running | `pnpm run dev-ui` in the sentry checkout |
    | TLS failure on `:7900` | local cert not trusted by the QA browser | add `--ignore-https-errors` to the `sqa` call |
    | Logged in as the wrong account | shared session state | delete `~/.agent-browser/sessions/<session>-*.json`, log in again |
    
    ## Never
    
    - Never capture or share the login form mid-entry, auth cookies, session tokens, or an API token.
    - Never write credentials into the skill, the repo, a screenshot, a commit, or a report.
    - Never reuse the user's personal Sentry session to reach data the QA account cannot see.
    
  • .gitignore10 Be43b0f988953upstream ↗
    .DS_Store
    
  • LICENSE1.0 KB890fd57561eeupstream ↗
    MIT License
    
    Copyright (c) 2026 Billy Vong
    
    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:
    
    The above copyright notice and this permission notice shall be included in all
    copies or substantial portions of the Software.
    
    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
    SOFTWARE.
    
  • SOURCES.md7.1 KB7f74c743a244upstream ↗
    # Sources
    
    ## Adapted Skill
    
    - Repository: `getsentry/junior`
    - Path: `packages/junior-agent-browser/skills/visual-web-qa`
    - Fetched: September 10, 2026, from `main`
    - Trust: first-party Sentry repository
    - Related upstream file consulted: `packages/junior-agent-browser/skills/agent-browser/SKILL.md`
    
    ## Fidelity Boundary
    
    Preserved from upstream:
    - Evidence model: screenshots for stable states, short video for temporal behavior, DOM checks as support only
    - Target-resolution priority and the refusal to pass off production as an unmerged change
    - Representative-scope rule over an exhaustive matrix
    - Report shape: target, evidence, result, findings, limitations
    - Constraints on recording lifecycle, sensitive capture, and unsupported delivery claims
    
    ## Local Adaptations
    
    - Replaced junior's `sendFiles` tool with the local harness file-send, plus `gh pr create --attach` for evidence on a PR being opened now, under the user's standing rule against posting to GitHub conversations without an explicit ask. Evidence that is not cleared to post is not uploaded either — the user drags the sent file into GitHub's composer
    - Added `scripts/sqa`, because `agent-browser` requires `--session` and `--restore` on every invocation and dropping them silently captures a logged-out page
    - Added the `ready` gate (`READY` / `LOGIN_REQUIRED` / `UNREACHABLE`) so a login or error page cannot be captured and reported as QA evidence
    - Added identity reporting via `window.__initialData` (`isAuthenticated`, `user.email`, `lastOrganization`), verified against `static/app/types/system.tsx`
    - Added a dedicated QA session and auth-vault profile, explicitly separate from the user's Chrome profile, with a second-session recipe for running as another account
    - Replaced the generic target list with Sentry's: full devserver `:8000`, UI-only devserver `:7999` (local `static/` against production APIs), preview, sentry.io
    - Replaced `wait --load networkidle` as the default with text and URL waits, because Sentry polls in the background
    - Added Sentry-specific capture knowledge: theme resolution via `user.options.theme` and `useColorscheme`, feature-flag gating through `~/.sentry/sentry.conf.py`, and `.artifacts/dev.log` for backend tracebacks
    - Sharpened the sensitive-data rule to the repo's customer-information policy: the `:7999` server and sentry.io render real customer data
    
    ## Omitted
    
    - Upstream `spec.md` behavior-contract format, replaced by this repo's `SPEC.md` template
    - `spec_hash` frontmatter and junior's Skillet packaging fields, which have no local consumer
    - The general `agent-browser` skill's routing boundary; the locally installed CLI ships its own `skills get core`
    
    ## Verified Locally
    
    - `agent-browser 0.37.1` at `/opt/homebrew/bin/agent-browser`
    - `open`, `eval`, `screenshot`, `--session`, `--restore` round-tripped in a scratch session
    - `sqa ready` classification confirmed on a down devserver (exit 3) and unauthenticated sentry.io (exit 2)
    
    ## Revision — September 10, 2026 (dev-ui only)
    
    Narrowed to a single target after an end-to-end test run:
    
    - Dropped the full devserver, preview, and sentry.io targets. QA runs only against `pnpm run dev-ui`, on the org subdomain `https://sentry-sdks.dev.getsentry.net:7999` (`SENTRY_QA_ORG` overrides). The bare `sentry.` host has no org in scope.
    - Removed the auth-vault password login. It targeted the local devserver, which is no longer a target.
    - Added `scripts/sync-cookies`: dev-ui proxies `/api` to sentry.io server-side (`rspack.config.ts` `cookieDomainRewrite`), so the browser needs Sentry cookies on the dev origin, and SSO cannot complete through the `:7999` origin. Login is now sign in on sentry.io, then mirror `session`, `sentry-sc`, `sentry_react_auth` onto `.dev.getsentry.net`. `sentry-sudo` is opt-in via `--with-sudo`.
    - Inverted the sensitive-data guidance: with dev-ui the only target, every capture is production data rather than seeded local data.
    - Added build-failure diagnosis after a live run hit `Loading a $#!%-ton of JavaScript…` caused by `@sentry/conventions` 0.21.0 installed against a `^0.22.0` requirement. The skill now checks the compiler and entrypoint before blaming the component.
    
    ## Revision — scraps story coverage
    
    - Added the rule that a changed component's scraps story is captured alongside in-app surfaces, not instead of them.
    - Story URL shape verified against `static/app/router/routes.tsx` (`/scraps/*`, `/stories/*` is a legacy redirect), `static/app/stories/view/index.tsx` (`/scraps/:category/:slug`), and `storyTree.tsx:690` (link construction). Categories from `storyTree.tsx:108`; slug from the mdx frontmatter `title`, confirmed with `components/core/button/button.mdx`.
    
    ## Revision — headless default
    
    - `scripts/sqa` now passes `--headed false` on every call, with `SENTRY_QA_HEADED=1` as a debugging opt-in. Headed/headless is fixed at browser launch, so `sqa login` closes any running browser before opening the sign-in window and `sqa sync` closes it afterwards.
    - Verified that closing the browser does not lose the session: `--restore` reloads the mirrored cookies and `sqa ready` returns `READY` without a new sign-in.
    
    ## Revision — dedicated QA dev-ui server
    
    - Added `scripts/dev-ui` (`sqa serve`): starts, reuses, or stops a QA dev-ui server on port 7900, so QA never collides with the everyday server on 7999.
    - Port is set with `SENTRY_WEBPACK_PROXY_PORT`, not a flag: `scripts/dev-ui-server.ts` never reads argv, so a `--port` argument is silently ignored. It also scans up to +10 when the port is taken, so the QA default is kept far below 7999 and the bound port is verified after start.
    - `NO_TS_FORK` is not used: it does not exist in this repo. Type checking is `SHOULD_CHECK_TYPES = DEV_MODE && Boolean(env.ENABLE_TS_CHECKER)` (`rspack.config.ts:81`), opt-in and already off.
    - Readiness probe distinguishes curl exit 0 (serving), 7 (nothing listening), and 28 (listening, still bundling), because rspack-dev-middleware blocks requests to `/` until the first bundle finishes; a short timeout otherwise looks identical to a dead server.
    - `ready` now asserts the browser landed on the requested host and port: `agent-browser open` exits 0 even on `ERR_CONNECTION_REFUSED`, so the gate could previously validate a stale page and report `READY` for a server that was not running.
    
    - `ready` additionally waits for the loading shell to clear: hydration sets `__initialData` before React mounts, so the gate previously reported `READY` while the page still showed the loading screen, and a capture taken then was the spinner.
    - `dev-ui stop` kills the recorded pid, its descendants, and the port listener. Killing only the recorded pid left the server running: pnpm spawns node which spawns rspack, and macOS has no `setsid`, so the process-group kill never applied.
    - Checkout resolution takes `SENTRY_QA_REPO`, else walks up from `$PWD`, else the repo remembered from a previous start, because the skill is usually invoked from its own directory.
    - `dev-ui stop` filters to live pids: an OOM-killed server leaves a stale pidfile, and killing a dead pid otherwise reported a successful stop. Observed after a QA server was OOM-killed while the everyday server kept running.
    
  • SPEC.md5.5 KB58ae31b0e7cfupstream ↗
    # Sentry Visual QA Specification
    
    ## Intent
    
    Make the agent verify user-visible Sentry UI changes by opening the rendered surface in a real browser, collecting evidence matched to the behavior in question, and reporting only what that evidence supports. Adapted from `getsentry/junior`'s `visual-web-qa` for personal local use, where the browser is the locally installed `agent-browser` CLI and QA runs as a chosen Sentry account in an isolated session.
    
    ## Scope
    
    In scope:
    - Visual verification of Sentry frontend changes against the dev-ui server (`pnpm run dev-ui`) on the org subdomain, on its own port (default 7900)
    - Screenshot, short video, and DOM-check evidence
    - Before/after pairs for changes to surfaces that already existed, captured by switching the checkout to the merge-base on the same QA server rather than standing up a second one
    - Scraps story coverage (`/scraps/<category>/<slug>/`) alongside in-app surfaces when the changed component has an `.mdx` story
    - Login and identity handling for the dedicated QA browser session, including the sentry.io -> dev-origin cookie mirror
    
    Out of scope:
    - General browser automation with no visual-correctness question
    - Backend-only, CLI, or test-only changes (dev-ui serves production APIs, so `src/` changes are unverifiable here)
    - Jest/RTL and acceptance-test authoring
    - Posting evidence to a PR or issue someone else authored without an explicit ask (evidence in the body of the user's own PR is in scope)
    
    ## Users And Trigger Context
    
    - Primary user: one engineer working in a local `getsentry/sentry` checkout
    - Common requests: "does this look right", "screenshot this page", "check dark mode", "check mobile width", "record the loading state"
    - Should not trigger for: backend diffs, unit tests, scraping or form automation, or when the user opts out of browser verification
    
    ## Runtime Contract
    
    - Required first actions: `scripts/sqa serve`, then `scripts/sqa ready` (org subdomain by default), then `scripts/sqa sync` if it reports `LOGIN_REQUIRED`, before any capture
    - Required outputs: target URL, account from `whoami`, evidence list, result (`pass` / `issues found` / `blocked`), findings, limitations, whether a scraps story exists and was covered, and — for a change to an existing surface — a before/after pair or the reason there is none
    - Non-negotiable constraints: runs are headless except the one-time sign-in window; the `sentry` org is never a target and its refusal is never worked around; no capture on any gate state but `READY`; no visual claim without browser evidence; no personal Chrome profile; no credential capture or cookie values printed; no active recording left running; the checkout is never switched over a dirty tree and never left on a detached HEAD
    - Bundled files loaded at runtime: `scripts/sqa` always; references only on their routed condition
    
    ## Source And Evidence Model
    
    Authoritative sources:
    - `getsentry/junior` `packages/junior-agent-browser/skills/visual-web-qa` (workflow and evidence model)
    - `agent-browser` 0.37.1 CLI surface, verified locally
    - `getsentry/sentry` `AGENTS.md`, `static/app/utils/useColorscheme.tsx`, `static/app/types/system.tsx`
    
    Data that must not be stored: passwords, session cookies, API tokens, customer org slugs, customer event data, member emails.
    
    ## Reference Architecture
    
    - `SKILL.md`: workflow, evidence and target tables, capture rules, reporting contract
    - `references/session-and-login.md`: session isolation, first-time login, account switching, auth troubleshooting
    - `references/sentry-capture.md`: SPA waits, theme forcing, feature flags, failure diagnosis, devserver traps
    - `scripts/sqa`: session-pinned agent-browser wrapper plus `whoami`, `ready`, `login`, `sync`, `serve`
    - `scripts/dev-ui`: start/stop/status for the QA dev-ui server on its own port
    - `scripts/sync-cookies` + `scripts/_sync_cookies.py`: mirror sentry.io auth cookies onto `.dev.getsentry.net`; values never printed or stored
    
    ## Validation
    
    - Lightweight: `bash -n scripts/sqa`, and `sqa ready` against a down host (`UNREACHABLE`, exit 3), an unauthenticated dev-ui (`LOGIN_REQUIRED`, exit 2), and an authenticated one (`READY`, exit 0, `"devUi":true`)
    - Deeper: one authenticated run producing a screenshot plus a matching `whoami`
    - Acceptance gate: no captured artifact is reported without a preceding `READY`
    
    ## Known Limitations
    
    - SSO logins need a one-time headed sign-in by a human on sentry.io, followed by `sqa sync`; the mirror must be re-run when that session refreshes
    - Theme forcing works only when the QA account's theme option is `system`
    - Flag-gated views depend on production flag state for the QA account; they cannot be toggled locally
    - In-app captures render production data, so those frames are not publishable until the user confirms they are clean; fixture-only story frames can go straight into the user's own PR body
    - Org access is limited to what the QA account can see; forbidden orgs are refused by `scripts/sqa`
    - Video capture needs `ffmpeg`
    - A broken frontend build shows as a stuck loading screen, not a rendering defect
    - Before and after captures render live production data, so a live view can differ between the two frames for reasons unrelated to the branch; fixed targets (stories, a named issue or event) avoid it
    
    ## Maintenance Notes
    
    - Update `SKILL.md` when the target list, evidence model, or reporting contract changes
    - Update `scripts/sqa` when `agent-browser` changes its session, restore, or auth flags, or when Sentry changes `window.__initialData`
    - Update `SOURCES.md` when re-syncing with the upstream junior skill
    

Plain-text copy, no login: /skill-bundles/getsentry-skill-sentry-visual-qa.md

// REPO STATS

0 stars
0 open issues
Last commit: 2mo ago