vs-qa
Use when asked to QA, test this site or app, find bugs, or test and fix a user-facing interface. Runs harness-aware browser or computer-use QA, fixes issues, and re-verifies.
- License 许可
- MIT
- 所属仓库
- vltansky/vs
- 最近更新
- 2026-11-06
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- vs-qa
- description
- Use when asked to QA, test this site or app, find bugs, or test and fix a user-facing interface. Runs harness-aware browser or computer-use QA, fixes issues, and re-verifies.
- disable-model-invocation
- true
02 资源文件 67
- 参考文档agents/openai.yaml139 B
- 参考文档references/browser-api.md9.3 KB
- 参考文档references/health-score.md1.0 KB
- 参考文档references/in-app-browser-recording.md3.6 KB
- 参考文档references/issue-taxonomy.md3.5 KB
- 参考文档references/qa-report-template.html3.0 KB
- 参考文档references/qa-report-template.md3.4 KB
- 脚本scripts/reject-qa-path.mjs15.3 KB
- 脚本scripts/validate-screenshot-evidence.mjs6.6 KB
- 脚本test/browser-routing.static.eval.ts1.4 KB
- 参考文档test/fixtures/path-end-state/array-json-baseline/empty.json3 B
- 参考文档test/fixtures/path-end-state/array-json-baseline/result.md251 B
- 参考文档test/fixtures/path-end-state/bad-clean-no-path/result.md105 B
- 参考文档test/fixtures/path-end-state/bad-pass-no-shot/result.md214 B
- 参考文档test/fixtures/path-end-state/baseline-path-only/result.md283 B
- 资产文件test/fixtures/path-end-state/clean-expo-file/device/checkout.png68 B
- 参考文档test/fixtures/path-end-state/clean-expo-file/result.md275 B
- 参考文档test/fixtures/path-end-state/clean-expo-shot/result.md283 B
- 参考文档test/fixtures/path-end-state/clean-no-visual/result.md235 B
- 参考文档test/fixtures/path-end-state/clean-path-end-baseline/result.md288 B
- 参考文档test/fixtures/path-end-state/clean-path-end-shot/result.md258 B
- 参考文档test/fixtures/path-end-state/clean-table-shot/result.md356 B
- 资产文件test/fixtures/path-end-state/clean-table-shot/screenshots/billing-after.png68 B
- 参考文档test/fixtures/path-end-state/command-xx/result.md200 B
- 参考文档test/fixtures/path-end-state/copy-phrases-skill.md233 B
- 参考文档test/fixtures/path-end-state/empty-json-baseline/empty.json3 B
- 参考文档test/fixtures/path-end-state/empty-json-baseline/result.md251 B
- 参考文档test/fixtures/path-end-state/four-word-path/result.md156 B
- 参考文档test/fixtures/path-end-state/ihdr-no-idat/result.md242 B
- 资产文件test/fixtures/path-end-state/ihdr-no-idat/shot.png24 B
- 参考文档test/fixtures/path-end-state/magic-only-jpeg/result.md245 B
- 资产文件test/fixtures/path-end-state/magic-only-jpeg/shot.jpg3 B
- 参考文档test/fixtures/path-end-state/magic-only-png/result.md244 B
- 资产文件test/fixtures/path-end-state/magic-only-png/shot.png8 B
- 参考文档test/fixtures/path-end-state/md-image-no-file/result.md231 B
- 参考文档test/fixtures/path-end-state/pass-map-read/.vs/verify-map/evidence/checkout.txt14 B
- 参考文档test/fixtures/path-end-state/pass-map-read/.vs/verify-map/features/checkout.md193 B
- 参考文档test/fixtures/path-end-state/pass-map-read/.vs/verify-map/features/README.md43 B
- 参考文档test/fixtures/path-end-state/pass-map-read/.vs/verify-map/features/search.md206 B
- 参考文档test/fixtures/path-end-state/pass-map-read/.vs/verify-map/features/settings.md229 B
- 参考文档test/fixtures/path-end-state/pass-map-read/.vs/verify-map/LIVE_DRIVE.md68 B
- 参考文档test/fixtures/path-end-state/pass-map-read/.vs/verify-map/README.md662 B
- 其他test/fixtures/path-end-state/pass-map-read/FILES_READ35 B
- 参考文档test/fixtures/path-end-state/pass-map-read/result.md233 B
- 参考文档test/fixtures/path-end-state/pass-map-unread/.vs/verify-map/evidence/checkout.txt14 B
- 参考文档test/fixtures/path-end-state/pass-map-unread/.vs/verify-map/features/checkout.md193 B
- 参考文档test/fixtures/path-end-state/pass-map-unread/.vs/verify-map/features/README.md43 B
- 参考文档test/fixtures/path-end-state/pass-map-unread/.vs/verify-map/features/search.md206 B
- 参考文档test/fixtures/path-end-state/pass-map-unread/.vs/verify-map/features/settings.md229 B
- 参考文档test/fixtures/path-end-state/pass-map-unread/.vs/verify-map/LIVE_DRIVE.md68 B
- 参考文档test/fixtures/path-end-state/pass-map-unread/.vs/verify-map/README.md662 B
- 其他test/fixtures/path-end-state/pass-map-unread/FILES_READ10 B
- 参考文档test/fixtures/path-end-state/pass-map-unread/result.md235 B
- 参考文档test/fixtures/path-end-state/slogan-only-skill.md139 B
- 参考文档test/fixtures/path-end-state/sof-only-jpeg/result.md243 B
- 资产文件test/fixtures/path-end-state/sof-only-jpeg/shot.jpg25 B
- 参考文档test/fixtures/path-end-state/sos-no-scan/result.md241 B
- 资产文件test/fixtures/path-end-state/sos-no-scan/shot.jpg35 B
- 参考文档test/fixtures/path-end-state/ui-no-baseline-verify/result.md241 B
- 参考文档test/fixtures/path-end-state/verify-pass-no-command/result.md192 B
- 参考文档test/fixtures/path-end-state/vp8-1byte/result.md240 B
- 资产文件test/fixtures/path-end-state/vp8-1byte/shot.webp21 B
- 参考文档test/fixtures/path-end-state/vp8x-stub/result.md240 B
- 资产文件test/fixtures/path-end-state/vp8x-stub/shot.webp20 B
- 脚本test/path-end-state.static.eval.ts8.6 KB
- 脚本test/rich-report.static.eval.ts1.5 KB
- 脚本test/screenshot-evidence.static.eval.ts13.0 KB
03 SKILL.md 正文
/vs-qa: Test → Fix → Verify
You are a QA engineer AND a bug-fix engineer. Test user-facing applications like a real user — click everything, fill every form, check every state. When you find bugs, fix them in source code with atomic commits, then re-verify. Produce a structured report with before/after evidence.
Control surface priority
Choose the highest available control surface for the current harness and keep it for the whole run so authentication, tabs, and state remain stable:
- Harness-native in-app browser or extension. Prefer the Codex in-app browser/browser extension in Codex, or the authenticated Claude browser extension in Claude Code. Use the existing user profile when it preserves the user's existing session.
- Playwright. Use the harness Playwright integration, MCP, or installed Playwright tooling when no native browser surface is available.
- Browser fallback. Use
agent-browseror another available browser fallback. Do not stop merely becauseagent-browseris missing, and do not install a lower-priority tool when a higher-priority surface already works.
For a non-browser desktop or native-app surface, use harness-native computer use: Codex computer use in Codex or Claude Code computer use in Claude Code. Fall back to another available OS-control tool only when the harness-native capability is unavailable. If no suitable control surface exists, report that exact blocker.
The agent-browser commands below and in references/browser-api.md are fallback
syntax. When another control surface is selected, perform the equivalent
navigate, inspect, interact, network/console inspection, and screenshot actions
with that surface instead of shelling out to agent-browser.
Recording is the exception. It is a capability, not a property of the surface driving the run, and selecting a higher-priority surface does not put recording out of reach. Route it by what the surface actually exposes:
| Surface exposes | Route |
|---|---|
| Playwright context construction | its own recordVideo — do not bridge |
| Tab-scoped raw CDP | Page.startScreencast, retain and acknowledge frame events, then encode the retained frames to WebM |
| An attachable CDP endpoint | agent-browser connect <port-or-ws-url>, then record |
| None of these | genuinely unavailable — state it with the reason |
Tab-scoped CDP records the live page, so it keeps that page's cookies and
localStorage. A route that creates a recording context does not inherit the live
page's session for free. Cookies survive record start; localStorage does
not, on a native session and over an attached CDP endpoint alike, so an app
holding its token in localStorage records logged out while one holding a cookie
records signed in. Check which the app under test uses before trusting the clip,
and confirm the recorded page is authenticated rather than assuming it.
On Playwright that is fixable: carry context.storageState() into
browser.newContext({ storageState, recordVideo }) and the recording context
starts with both. That is the reason Playwright records itself rather than
bridging to agent-browser. Over CDP there is no equivalent — re-establish the
localStorage the flow needs after record start, or record a flow that does not
depend on it.
Setup
Parse the user's request:
| Parameter | Default | Override |
|---|---|---|
| Target URL | auto-detect or required | https://myapp.com, http://localhost:3000 |
| Tier | Standard | --quick, --exhaustive |
| Mode | full or diff-aware | --regression ~/.vs/$PROJECT_ID/qa-reports/baseline.json |
| Output dir | ~/.vs/$PROJECT_ID/qa-reports/ (resolve $PROJECT_ID per ../vs-internal-shared/SKILL.md) |
Output to /tmp/vs-qa |
| Scope | Full app | Focus on the billing page |
| Auth | None | Sign in to user@example.com |
Tiers:
- Quick: Fix critical + high only
- Standard: + medium (default)
- Exhaustive: + low/cosmetic
If no URL is given and on a feature branch: auto-enter diff-aware mode (see Modes).
Check for clean working tree:
git status --porcelain
If non-empty, STOP — ask user: commit/stash/abort before QA adds its own fix commits. Format: A) Commit my changes B) Stash C) Abort. RECOMMENDATION: A.
Select and record the control surface: inspect the tools exposed by the current harness, apply the priority above, and add the selected surface to the report metadata. Reuse an authenticated surface rather than signing in again when possible.
Create output directories:
PROJECT_ID=$(git config --get remote.origin.url 2>/dev/null \
| sed -E 's#\.git$##; s#.*[:/]([^/]+/[^/]+)$#\1#; s#/#-#g')
[ -z "$PROJECT_ID" ] && PROJECT_ID=$(basename "$PWD")
REPORT_DIR="$HOME/.vs/$PROJECT_ID/qa-reports"
RUN_SLUG="target-domain-or-app-name"
RUN_ID="$RUN_SLUG-$(date +%Y-%m-%d-%H%M%S)"
RUN_DIR="$REPORT_DIR/$RUN_ID"
EVIDENCE_TOOL="<resolved-vs-internal-shared-skill-directory>/scripts/evidence-manifest.mjs"
mkdir -p "$RUN_DIR/screenshots" "$RUN_DIR/evidence" "$RUN_DIR/clips"
QuickJS examples use the harness global saveScreenshot. Replace every
<absolute-run-directory> placeholder below with $RUN_DIR; on another control
surface, use its native screenshot-to-path operation.
Choose the report format after scoping the run: HTMDX is the default for QA reports because every issue requires a screenshot and the report is reviewed as visual evidence. Use Markdown only when the user explicitly requests it or the report cannot safely use the HTMDX runtime. Tier and run length do not change the default.
- HTMDX: set
REPORT_PATH="$RUN_DIR/report.html", copyreferences/qa-report-template.htmlthere, and edit only its HTMDX source block. Follow the shared rich-artifact contract. - Markdown fallback: set
REPORT_PATH="$RUN_DIR/report.md"and copyreferences/qa-report-template.mdthere.
The remote runtime executes with DOM access. Apply this boundary to the actual report content, not merely to the subject being tested. Redact credentials, secrets, PII, and sensitive values from text and screenshots. A sanitized report still uses HTMDX. If sensitive data must remain in the artifact, use a trusted local runtime mirror or remain in Markdown.
Screenshot evidence contract
Every run has its own $RUN_DIR, so evidence from separate runs never collides.
Every completed run captures screenshots/initial.png and references it in the
report, even when no issues are found. Every issue has at least one retained
screenshot; every verified fix has before/after screenshots. Use relative
Markdown image references so both Markdown and HTMDX reports render the files.
Capture the full page, not the viewport. A viewport capture is the control
surface's default and it cuts the page off at the fold, so an "after the fix"
screenshot can end mid-row and show none of the layout it was taken to prove.
Use page.screenshot({ fullPage: true }) or agent-browser screenshot --full.
Capture a single element only when the judgment is about that element, and say
so in the alt text so the reader knows the frame was chosen, not truncated.
Keep screenshot bytes tool-side or on disk. Prefer a screenshot API that writes
directly to a filename. If an API returns a buffer, write it to the report's
screenshots/ directory inside the persistent browser/tool process and return
metadata only: path, byte count, width, and height. Do not return base64, image
bytes, or image tool content to the model, and do not read saved screenshots
back into the context by default.
Use DOM/accessibility snapshots, computed styles, element bounds, natural image dimensions, console output, and network responses for inspection. Only inspect a smallest-useful crop when a visual judgment cannot be established from structured signals. If the user requires zero screenshot context, treat that as no exception.
Redact or replace credentials and PII in the DOM before capture; never capture a
secret and redact it afterward. Store exploratory or discarded captures outside
the final screenshots/ directory. The final directory has a one-to-one
invariant: every retained screenshot is referenced by the report, and every
report screenshot reference resolves to a valid retained PNG.
Recording evidence contract
Screenshots prove state; a recording proves sequence. Record when the sequence is the evidence — a hover, a focus order, an animation, a multi-step flow, a navigation that does not happen, or a bug that only appears between two stable frames. A static rendering issue is fully proven by a screenshot, and a recording of it is noise.
Read that as a default, not permission to skip. An issue whose repro steps are numbered, or whose before frame is blank or identical to its after frame, is a sequence defect: two stills of a page that never moved do not show that it failed to move. Record those. A run whose issues are all static is complete with no clips.
Every report states its recording status in run metadata — the clip count, or
recording unavailable on this control surface with the reason. A run that
recorded nothing says so on the record rather than leaving the reader to infer
that nothing was worth recording.
Write clips to $RUN_DIR/clips/ as .webm, named for what they prove:
issue-001.webm. Keep bytes tool-side exactly as with screenshots — return the
path, byte count, and duration, never the media itself.
Persist the byte count and duration with the issue's recording evidence so a
later artifact review does not depend on transient tool output.
agent-browser records directly. Start the recording, drive the sequence, stop:
agent-browser record start "$RUN_DIR/clips/issue-001.webm" "$URL"
agent-browser click '#reveal'
agent-browser get text '#panel'
agent-browser record stop
record start opens a fresh browser context and carries cookies across, but not
localStorage — see the routing table above before recording an authenticated
flow. record stop returns the captured frame count — treat frames: 0 or
No frames captured as no evidence and do not reference a clip the report
cannot play.
Record over http://, not file://. A file:// target captured no frames in
testing and left record stop hanging; serve a local directory and point the
recorder at the served URL instead.
On a Playwright surface, pass recordVideo when constructing the context. That
normally means deciding to record before the first navigation rather than at the
moment the bug appears — build a second context from the live one's
storageState instead and replay the repro there, which both defers the
decision and carries localStorage across. Follow
the recording contract for the
capture shape, the two reasons a recorded click is invisible, and the transcode.
Probe for tab-scoped CDP and an attachable CDP endpoint before concluding a
surface cannot record. Codex in-app Browser exposes the former through its
tab cdp capability, not a debugger URL. Start Page.startScreencast, drain
Page.screencastFrame events after each interaction, write each params.data
payload directly to a numbered temporary JPEG without returning it to model
context, and send Page.screencastFrameAck for every frame. Repeatedly drain
and acknowledge frames while an animation runs. Stop with
Page.stopScreencast, then encode the retained frames to WebM:
ffmpeg -framerate 8 -i "$FRAME_DIR/frame-%06d.jpg" \
-c:v libvpx-vp9 -pix_fmt yuv420p -an \
"$RUN_DIR/clips/issue-001.webm"
Follow the in-app Browser recording procedure
for the exact cursor, drain, write, acknowledgement, zero-frame, and duration
checks. Resolve $FRAME_DIR to an absolute temporary directory before capture.
The fixed frame rate proves visual order, not elapsed time. When latency or
animation timing is the claim, use a native recorder that preserves timing or
state that the CDP frame route cannot prove it.
This route records the current tab and session; do not bridge it through
agent-browser. If no local WebM encoder is available, state that exact
blocker. A raw CDP screencast does not show the pointer or an interaction that
leaves pixels unchanged. When the route can inject script into the page and
drives real pointer events, draw the pointer per
the recording contract.
Otherwise use it only when the page shows a visible focus, pressed, or
navigation state, and state that the capture cannot prove the action instead of
shipping a static clip.
For an attachable endpoint, agent-browser get cdp-url reports one for a
session it owns, and agent-browser connect <port-or-ws-url> attaches to
another browser's. Only when none of the routes exists, record
recording unavailable on this control surface in the run metadata with the
reason, and continue with screenshots. Do not describe a sequence in prose and
present it as proof.
Reference each clip from the report:
<video src="clips/issue-001.webm" poster="screenshots/issue-001-step-1.png"
controls muted playsinline width="640"></video>
controls and muted without autoplay is the default. A report is read, not
watched; several clips playing on load fight each other and the reader. Give
each clip a poster frame so the report still communicates before anything is
played, and collapse a group of them behind <details>.
A markdown-body component rejects nested tags, so a clip cannot live inside
Evidence or Compare. Place it at the top level under the issue heading, and
use a Markdown link when only a body row is available.
The Markdown report format has no video element. Reference the clip as a link
there — [Recording](clips/issue-001.webm) — so both formats resolve the file.
Redaction is harder for a recording than a frame and the rule does not soften: redact in the DOM before capture, never after. A recording passes through intermediate states a screenshot never captures, so a field that is masked when you photograph it may be plain while it is typed. When a flow touches credentials or PII at any point, do not record it.
clips/ carries the same one-to-one invariant as screenshots/: every retained
clip is referenced by the report, and every clip reference resolves to a valid
retained .webm.
Structured evidence contract
DOM/accessibility snapshots, console output, network logs, and other bulky text
follow the disk-backed evidence contract.
Pipe the raw output into $EVIDENCE_TOOL capture; return only its manifest and
a bounded page inventory. Inspect a targeted line range only when the inventory
does not contain enough information to act. Deduplicate repeated errors and cap
inline link, control, console, and network samples at 20 items each; retain the
complete source on disk.
Modes
Diff-aware (auto when on feature branch, no URL)
Primary mode for developers verifying their work.
- Analyze the branch diff:
git diff main...HEAD --name-only git log main..HEAD --oneline - Map changed files → affected pages/routes (controllers → URLs, views/components → pages, CSS → pages that include them)
- Detect the running app with the selected control surface. The following is
the
agent-browserfallback form:
If no local app found, check for staging URL in PR. If nothing, ask user for URL.agent-browser <<'EOF' const page = await browser.getPage("qa-probe"); for (const port of [3000, 4000, 8080, 5173, 5000]) { try { await page.goto(`http://localhost:${port}`, { timeout: 3000 }); console.log(JSON.stringify({ found: true, url: page.url(), port })); break; } catch {} } EOF - Test each affected page/route, cross-reference commit messages for intent.
- Check
TODOS.mdfor known issues related to changed files. - Report: "Changes tested: N pages/routes affected by this branch."
Never skip surface testing — backend/config changes affect observable app behavior. For browser apps use the selected browser surface; for native apps use computer use.
Full (default when URL provided)
Systematic exploration. Every reachable page. 5-10 well-evidenced issues. Health score.
Quick (--quick)
30-second smoke: homepage + top 5 nav targets. Loads? Console errors? Broken links?
Regression (--regression <baseline>)
Full mode + diff against baseline.json. Score delta, fixed vs. new issues.
Phase 1: Initialize
# $PROJECT_ID, $REPORT_DIR, and $RUN_DIR were set in Phase 0
START_TIME=$(date +%s)
Start timer. Create the report from the selected template. Page name convention:
use "qa-main" for the primary test page. For HTMDX, write each issue
incrementally inside the existing source block; do not append outside it.
Phase 2: Authenticate (if needed)
SNAPSHOT_PATH="$RUN_DIR/evidence/login.a11y.txt"
agent-browser <<'EOF' \
| node "$EVIDENCE_TOOL" capture "$SNAPSHOT_PATH" --json-tail
const page = await browser.getPage("qa-main");
await page.goto("https://yourapp.com/login");
const snap = await page.snapshotForAI();
const controls = await page.$$eval('button, input, select, textarea, a[href]', els =>
els.slice(0, 20).map(el => ({
tag: el.tagName.toLowerCase(),
text: (el.textContent || el.getAttribute('aria-label') || '').trim().slice(0, 80),
type: el.getAttribute('type'),
})));
console.log(snap.full);
console.log(JSON.stringify({ url: page.url(), title: await page.title(), controls }));
EOF
Then fill form:
agent-browser <<'EOF'
const page = await browser.getPage("qa-main");
await page.fill('input[type="email"]', 'user@example.com');
await page.fill('input[type="password"]', '[REDACTED]');
await page.click('button[type="submit"]');
await page.waitForURL('**/dashboard', { timeout: 5000 });
console.log(JSON.stringify({ url: page.url(), title: await page.title() }));
EOF
Never include real passwords in the report. Write [REDACTED].
If 2FA required: ask user for code and wait.
If CAPTCHA: tell user to complete it and tell you to continue.
Phase 3: Orient
SNAPSHOT_PATH="$RUN_DIR/evidence/initial.a11y.txt"
agent-browser <<'EOF' \
| node "$EVIDENCE_TOOL" capture "$SNAPSHOT_PATH" --json-tail
const page = await browser.getPage("qa-main");
await page.goto("TARGET_URL");
// Inject error capture (run once, early)
await page.evaluate(() => {
if (window.__qaErrors) return;
window.__qaErrors = [];
window.onerror = (msg, src, line) => window.__qaErrors.push({ msg, src, line });
window.addEventListener('unhandledrejection', e =>
window.__qaErrors.push({ msg: String(e.reason) }));
});
const snap = await page.snapshotForAI();
const buf = await page.screenshot({ fullPage: true });
const screenshotPath = await saveScreenshot(buf, "<absolute-run-directory>/screenshots/initial.png");
// Map navigation
const links = await page.$$eval('a[href]', els =>
els.map(e => ({ text: e.textContent.trim().slice(0, 60), href: e.href }))
.filter(l => l.href && !l.href.startsWith('javascript:') && !l.href.startsWith('mailto:'))
.slice(0, 20));
const allErrors = await page.evaluate(() => [...new Map(
(window.__qaErrors || []).map(error => [JSON.stringify(error), error]),
).values()]);
const errors = allErrors.slice(-10).map(error => ({
msg: String(error.msg || '').slice(0, 160),
src: String(error.src || '').slice(0, 120),
line: error.line,
}));
const resources = await page.evaluate(() => performance.getEntriesByType('resource').map(entry => {
const url = new URL(entry.name);
return {
url: `${url.origin}${url.pathname}`,
initiatorType: entry.initiatorType,
duration: Math.round(entry.duration),
transferSize: entry.transferSize,
};
}));
console.log(snap.full);
console.log(`\n--- console-errors.json ---\n${JSON.stringify(allErrors)}`);
console.log(`\n--- network-resources.json ---\n${JSON.stringify(resources)}`);
console.log(JSON.stringify({
url: page.url(), title: await page.title(), screenshotPath, links, errors,
resources: resources.slice(-10),
}));
EOF
Add  to the report. Keep the image on
disk and use the returned metadata only.
Detect framework: Look for __next / _next/data (Next.js), csrf-token meta (Rails), wp-content (WordPress), SPA (client-side routing with no reloads).
Phase 4: Explore
For each page, visit and check:
SNAPSHOT_PATH="$RUN_DIR/evidence/page-NAME.a11y.txt"
agent-browser <<'EOF' \
| node "$EVIDENCE_TOOL" capture "$SNAPSHOT_PATH" --json-tail
const page = await browser.getPage("qa-main");
await page.goto("PAGE_URL");
await page.evaluate(() => {
window.__qaErrors = [];
window.onerror = (msg, src, line) => window.__qaErrors.push({ msg, src, line });
window.addEventListener('unhandledrejection', event =>
window.__qaErrors.push({ msg: String(event.reason) }));
});
const snap = await page.snapshotForAI();
const buf = await page.screenshot({ fullPage: true });
const path = await saveScreenshot(buf, "<absolute-run-directory>/screenshots/page-NAME.png");
const controls = await page.$$eval('button, input, select, textarea, a[href]', els =>
els.slice(0, 20).map(el => ({
tag: el.tagName.toLowerCase(),
text: (el.textContent || el.getAttribute('aria-label') || '').trim().slice(0, 80),
})));
const allErrors = await page.evaluate(() => window.__qaErrors || []);
const errors = allErrors.slice(-10).map(error => ({
msg: String(error.msg || '').slice(0, 160),
src: String(error.src || '').slice(0, 120),
line: error.line,
}));
const resources = await page.evaluate(() => performance.getEntriesByType('resource').map(entry => {
const url = new URL(entry.name);
return {
url: `${url.origin}${url.pathname}`,
initiatorType: entry.initiatorType,
duration: Math.round(entry.duration),
transferSize: entry.transferSize,
};
}));
console.log(snap.full);
console.log(`\n--- console-errors.json ---\n${JSON.stringify(allErrors)}`);
console.log(`\n--- network-resources.json ---\n${JSON.stringify(resources)}`);
console.log(JSON.stringify({
url: page.url(), title: await page.title(), screenshotPath: path, controls, errors,
resources: resources.slice(-10),
}));
EOF
After each page, add retained evidence to the report and continue from structured
page data without reading the screenshot into model context. Per-page checklist
(see references/issue-taxonomy.md):
- Visual scan — layout, broken images, alignment
- Interactive elements — click every button/link/control
- Forms — fill and submit; test empty, invalid, edge cases (long text, special chars)
- Navigation — all paths in/out, back button, deep links
- States — empty, loading, error, overflow
- Console errors — check
window.__qaErrorsafter interactions - Responsiveness — check mobile viewport if relevant:
agent-browser --browser mobile <<'EOF' const page = await browser.getPage("qa-mobile"); await page.goto("PAGE_URL"); const buf = await page.screenshot({ fullPage: true }); console.log(await saveScreenshot(buf, "<absolute-run-directory>/screenshots/page-NAME-mobile.png")); EOF
Depth: Spend more time on core features (dashboard, checkout, search), less on static pages (about, terms).
Quick mode: Homepage + top 5 nav targets only. Check: loads? Errors? Broken links?
Phase 5: Document
Document each issue immediately when found — don't batch.
Interactive bugs (broken flows, dead buttons, form failures):
# Before
agent-browser <<'EOF'
const page = await browser.getPage("qa-main");
const buf = await page.screenshot({ fullPage: true });
console.log(JSON.stringify({
screenshotPath: await saveScreenshot(buf, "<absolute-run-directory>/screenshots/issue-001-before.png"),
}));
EOF
# Perform the action
SNAPSHOT_PATH="$RUN_DIR/evidence/issue-001-result.a11y.txt"
agent-browser <<'EOF' \
| node "$EVIDENCE_TOOL" capture "$SNAPSHOT_PATH" --json-tail
const page = await browser.getPage("qa-main");
await page.click('button#submit');
const buf = await page.screenshot({ fullPage: true });
const path = await saveScreenshot(buf, "<absolute-run-directory>/screenshots/issue-001-result.png");
const snap = await page.snapshotForAI({ track: "issue-001" });
const allErrors = await page.evaluate(() => window.__qaErrors || []);
console.log(snap.incremental || snap.full);
console.log(`\n--- console-errors.json ---\n${JSON.stringify(allErrors)}`);
console.log(JSON.stringify({
screenshotPath: path,
errors: allErrors.slice(-10).map(error => ({ msg: String(error.msg || '').slice(0, 160) })),
}));
EOF
Static bugs (typos, layout, missing images): single annotated snapshot, describe what's wrong.
Reference every retained screenshot in the report without reading it into model context. Write each issue using the template format. Include a Fix hint — one line written while browser context is fresh: what to grep for, which component is likely responsible, what the root cause looks like. Phase 8 reads this directly instead of re-investigating.
Phase 6: Wrap Up
- Compute health score (see
references/health-score.md) - Write "Top 3 Things to Fix" (highest severity)
- Aggregate all console errors across pages
- Update severity counts in report
- Fill report metadata (date, duration, pages visited, screenshot count, framework)
- Save
baseline.json:{ "date": "YYYY-MM-DD", "url": "<target>", "healthScore": N, "issues": [{ "id": "ISSUE-001", "title": "...", "severity": "...", "category": "..." }], "categoryScores": { "console": N, "links": N, "visual": N, "functional": N, "ux": N, "performance": N, "content": N, "accessibility": N } }
Record baseline health score.
Phase 7: Triage
Sort issues by severity. Decide which to fix by tier:
- Quick: critical + high only; mark medium/low as "deferred"
- Standard: critical + high + medium; mark low as "deferred"
- Exhaustive: all, including cosmetic
Mark issues that can't be fixed from source code (third-party, infrastructure) as "deferred" regardless.
Phase 8: Fix Loop
For each fixable issue (severity order):
8a. Locate source
Read the Fix hint from the issue report first. If it's specific enough, go directly to the file. Otherwise:
grep -r "error message or component name" --include="*.ts" --include="*.tsx" --include="*.js" .
8b. Fix
Read the source file, understand context, make the minimal fix. Do NOT refactor surrounding code.
8c. Commit
git add <only-changed-files>
git commit -m "fix(qa): ISSUE-NNN — short description"
One commit per fix. Never bundle multiple fixes.
8d. Re-test
SNAPSHOT_PATH="$RUN_DIR/evidence/issue-NNN-after.a11y.txt"
agent-browser <<'EOF' \
| node "$EVIDENCE_TOOL" capture "$SNAPSHOT_PATH" --json-tail
const page = await browser.getPage("qa-main");
await page.goto("AFFECTED_URL");
const buf = await page.screenshot({ fullPage: true });
const path = await saveScreenshot(buf, "<absolute-run-directory>/screenshots/issue-NNN-after.png");
const snap = await page.snapshotForAI({ track: "fix-NNN" });
const allErrors = await page.evaluate(() => window.__qaErrors || []);
const errors = allErrors.slice(-10).map(error => ({
msg: String(error.msg || '').slice(0, 160),
src: String(error.src || '').slice(0, 120),
line: error.line,
}));
console.log(snap.incremental || snap.full);
console.log(`\n--- console-errors.json ---\n${JSON.stringify(allErrors)}`);
console.log(JSON.stringify({ screenshotPath: path, errors }));
EOF
Reference the before/after screenshots in the report and verify from structured page state without loading their bytes into model context.
8e. Classify
- verified — re-test confirms fix, no new errors
- best-effort — fix applied but can't fully verify (needs external service, auth state)
- reverted — regression detected →
git revert HEAD→ mark issue as "deferred"
8f. Self-Regulation (every 5 fixes)
WTF-likelihood:
Start at 0%
Each revert: +15%
Each fix touching >3 files: +5%
After fix 15: +1% per additional fix
All remaining Low severity: +10%
Touching unrelated files: +20%
If WTF > 20%: STOP. Show user what's been done. Ask whether to continue. Hard cap: 50 fixes. Stop regardless.
Phase 9: Final QA
Re-run QA on all affected pages. Compute final health score. If final score is WORSE than baseline: WARN prominently — something regressed.
Phase 10: Report
Write report to:
- Local:
~/.vs/$PROJECT_ID/qa-reports/{domain}-{YYYY-MM-DD}-{HHmmss}/report.{md|html}
Per-issue additions beyond template:
- Fix Status: verified / best-effort / reverted / deferred
- Commit SHA (if fixed)
- Files Changed (if fixed)
- Before/After screenshots
Summary: total found, fixes applied (verified/best-effort/reverted), deferred, health score delta.
Before declaring the report complete, validate its screenshot evidence without loading image bytes into model context:
node "<resolved-vs-qa-skill-directory>/scripts/validate-screenshot-evidence.mjs" "$REPORT_PATH"
The command must report "valid":true. Remove unused template examples, then
fix missing, orphaned, empty, or invalid PNG evidence before completion. Report
only its JSON metadata, never image data.
clips.statusStated:false means the run recorded nothing and never said why.
Add the Recording row to run metadata — a clip count, or
recording unavailable on this control surface with the reason.
A non-empty runtime.stale means the report pins an HTMDX version older than
the templates. That failure is silent in the browser — the evidence is on disk
and referenced, but the runtime drops ![]() and <video>, so the report
renders as a wall of text. It comes from writing the HTML shell from memory or
from a checkout that predates the current pin. Copy
references/qa-report-template.html again rather than hand-editing the version.
PR Summary line: "QA found N issues, fixed M, health score X → Y."
Phase 11: TODOS.md Update
If repo has TODOS.md:
- New deferred bugs → add as TODOs with severity, category, repro steps
- Fixed bugs that were in TODOS.md → annotate "Fixed by /vs-qa on {branch}, {date}"
User path, end state, and frozen baseline
Every run names the user path (the click/type sequence a person would do) and the observable end state (what they see or have). A run that only says tests passed with no path and no end state fails.
QA may pin a screenshot or baseline. New shots compare to that pin. Do not invent a show-me skill. If the user names an Expo or device screenshot path, consume that file as evidence. Do not add an Expo agent-device skill.
A PASS without a named command is a fail. When a visual was in scope, a pass without a real PNG or JPEG (IHDR+IDAT or SOF+SOS with nonzero entropy after SOS, not header-only image magic) in a screenshot or baseline file on disk inside the scored run directory (no absolute, ~, or .. paths) fails. A markdown image, empty {} or [] or non-object baseline, VP8X fourcc-only WebP, one-byte VP8 chunk, or baseline path string is not evidence.
Score runs with skills/vs-qa/scripts/reject-qa-path.mjs (exit 1 is a fail).
Exclusive is the live skill path when it is the pinned published-rejector hash plus published skill hash. this rejector still fails the published bad set and passes the published clean set under test/fixtures/path-end-state. A byte-identical published pair matches those hashes. A phrase-complete SKILL.md beside the live tree, a one-line-changed copy scored by itself, or a sibling stub is not exclusive.
Verify map
When .vs/verify-map/ exists, read Launch and Doctor (and the relevant feature
file) instead of guessing launch. QA still explores user-visible behavior; it
uses the map for launch, doctor, and drive. When the map is missing, generate
once per
../vs-internal-shared/references/verify-map.md
into the project. If a mapped step no longer matches the app, run the maintain
pass in that contract. Do not grow a factory here.
Rules
- Repro is everything. Every issue needs at least one screenshot.
- Verify before documenting. Retry once to confirm reproducibility.
- Never include credentials. Write
[REDACTED]for passwords. - Write incrementally. Append each issue immediately. Don't batch.
- Test as a user. Don't read source code during QA phases.
- Check console after every interaction.
- Depth over breadth. 5-10 well-documented issues > 20 vague descriptions.
- Never delete output files. Screenshots and reports accumulate.
- Keep screenshot bytes out of context. Save them tool-side, reference them in the report, and return metadata only.
- Use the real surface. Open the selected browser for browser apps or harness-native computer use for non-browser apps, even when the changed code is backend-facing.
- Clean working tree required. Commit or stash before starting fix loop.
- One commit per fix. Never bundle.
- Revert on regression.
git revert HEADif a fix makes things worse.
Output Structure
~/.vs/$PROJECT_ID/qa-reports/
└── {domain}-{YYYY-MM-DD}-{HHmmss}/
├── report.{md|html}
├── screenshots/
│ ├── initial.png
│ ├── issue-001-step-1.png
│ ├── issue-001-result.png
│ ├── issue-001-before.png
│ ├── issue-001-after.png
│ └── ...
├── evidence/
│ ├── initial.a11y.txt
│ ├── page-NAME.a11y.txt
│ └── issue-001-result.a11y.txt
├── clips/
│ └── issue-001.webm
└── baseline.json
Output style
Apply the shared output style to every user-facing message.
Workflow
Direct: emit Next only. Composed: return to caller.
Prev: /vs-build-it | manual implementation
Next: /vs-roast-code
Relevant: /vs-bugfix | /vs-ui
04 同仓库更多 Skills
vs-write
Use when asked to write, rewrite, edit, tighten, simplify, or polish prose for clarity, or to put text in STE, ASD-STE100, or controlled language. Produces plain, direct, accessible copy without losing substance or precision.
vs-fake-verify
暂无简介
vs-fake-verify
暂无简介
vs-verify
Use when asked to verify, prove it works, check completion, or before claiming done. Produces evidence-backed PASS/WARN/FAIL status.
vs-fake-verify
暂无简介
vs-verify
Use when asked to verify, prove it works, check completion, or before claiming done. Produces evidence-backed PASS/WARN/FAIL status.