一键导入
sg-visual-review
Use after visual runs, code audits, or process checks when results need human review — builds and serves the interactive ShipGuard dashboard.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use after visual runs, code audits, or process checks when results need human review — builds and serves the interactive ShipGuard dashboard.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | sg-visual-review |
| description | Use after visual runs, code audits, or process checks when results need human review — builds and serves the interactive ShipGuard dashboard. |
| context | conversation |
| argument-hint | [--port=N] |
Generate and serve the ShipGuard dashboard to review visual test screenshots, code audit findings, and process-check results, annotate problems, and export re-run / fix manifests.
| Command | Behavior |
|---|---|
/sg-visual-review | Build + start server + tell user to open the printed URL (default http://127.0.0.1:8888) |
/sg-visual-review --port=9000 | Same, on a custom port |
Always: build the review page, start the HTTP server, and give the user the URL the server actually prints. Supported flags: --port=N (default 8888) and --host=H (default 127.0.0.1). To stop the server: /sg-visual-review-stop.
/sg-visual-discover has been run (manifests exist in visual-tests/)/sg-visual-run has been run at least once (screenshots + visual-results.json or legacy report.md exist in visual-tests/_results/)Sandbox note: --serve, POST /save-manifest, and monitor smoke tests need loopback port access. See ../../docs/sandbox.md.
Run the build script:
node visual-tests/build-review.mjs --serve
This script:
visual-tests/visual-tests/_results/visual-results.json for machine-readable status per testvisual-tests/_results/report.md if the JSON contract is missing or invalidvisual-tests/_regressions.yaml for failure reasonsvisual-tests/_results/screenshots/visual-tests/_results/visual-results.json from the resolved statuses, preserving the producer's run timestamp and per-test duration_ms (build time is recorded separately as generated_at)visual-tests/_results/process-results.json (written by /sg-process-check) into the Process tab, if presentvisual-tests/_results/review.html (inline CSS + JS, no dependencies)/sg-code-audit is running (or audit-monitor.json exists in _results/), live agent progress renders inside the Code Audit tab — a progress bar in Overview and per-agent pods in the Agents sub-tab. There is no separate Monitor tab.visual-tests/_results/persona-reports/--serve binds to 127.0.0.1 by default and refuses path traversal after decoding and resolving paths. Cross-origin POSTs to the server are rejected. LAN exposure requires an explicit host:
node visual-tests/build-review.mjs --serve --host=0.0.0.0
The change-report schema and workflow are owned by sg-change-report — see that skill for the report.json format and when to create one. This builder consumes:
visual-tests/_results/change-reports/<report-id>/report.json
visual-tests/_results/change-reports/<report-id>/screenshots/
and generates audience-specific decision pages (client, business, product, design, engineering, or custom) plus validation artifacts under:
visual-tests/_results/persona-reports/<report-id>/index.html
visual-tests/_results/persona-reports/<report-id>/<audience>.html
visual-tests/_results/persona-reports/<report-id>/client-invite-email.md
visual-tests/_results/persona-reports/<report-id>/client-response-email.md
visual-tests/_results/persona-reports/<report-id>/proposal-trace.md|.json
Each audience page includes before/after evidence, Accept / Adjust / Reject decisions, local comments, and JSON export; the email + trace files support manual validation without an email provider. Full example spec: skills/sg-visual-review/examples/change-report.json.
Commit the change-report source and the generated persona report with the UI change. Do not commit visual-tests/_results/review.html or visual-tests/_results/.server.pid; those are local generated files.
Open the URL printed by --serve (default http://127.0.0.1:8888):
open http://127.0.0.1:8888
# Or via agent-browser:
agent-browser open http://127.0.0.1:8888
The Code Audit tab, the live audit monitor, and the "Validate & Generate Report" button require the HTTP server. Opening review.html via file:// only shows the data embedded at build time (Visual Tests, Process, Recorded Tests) and cannot save fix manifests.
The review page provides:
Findings tab (unified, evidence-first — default when findings exist)
visual-tests/_results/findings.json, a derived list the builder generates on every build: audit bugs, process deltas, visual failures + browser_errors, crawler breakage (crawl-results.json from shipguard crawl/run), and human annotations (fix-manifest.json)SG-### id, severity (sorted first), an evidence badge — measured (a real observation), reasoned (a static/simulated prediction), manual (a human annotation) — source lane, and route/file locationrun.json (written by sg-ship / shipguard run) renders per-lane status chips (ran / skipped / not-applicable / error / needs-agent); a declared skipped lane shows its reason in place of a generic empty statenode visual-tests/shipguard.mjs review [--serve]Visual Tests tab
Code Audit tab
audit-results.json if present in _results/0 bugs found, not as missing dataaudit-monitor.json and the /api/monitor/* endpointsProcess tab
visual-tests/_results/process-results.json written by /sg-process-check (embedded at build time — rebuild after a new process check)Recorded Tests tab
/sg-record from visual-tests/manifests/ (step count, check count, recording date)sg-visual-run --manifests ... commandLightbox
Annotation Pen
Multi-Select + Re-run
{
"action": "rerun",
"timestamp": "2026-04-09T...",
"tests": [
{
"test": "auth/login",
"annotations": [
{ "x1": 0.2, "y1": 0.3, "x2": 0.8, "y2": 0.6, "note": "Button overlaps footer", "severity": "high" }
]
}
]
}
Validate & Generate Report workflow
fix-manifest.json to the server via POST /save-manifest (top-level action: "validate-and-fix" + timestamp; per-test redo_entirely / revert_to_before / improve_ui booleans; annotations as {x1,y1,x2,y2,note,severity})/sg-visual-fix to implement fixesTake the exported JSON and feed it back:
/sg-visual-run <paste test IDs>
Or use the test paths directly:
/sg-visual-run auth/login dashboard/home settings/profile
The build script and template are installed to the project:
| File | Purpose |
|---|---|
visual-tests/build-review.mjs | Node.js build script |
visual-tests/_review-template.html | HTML template with inline CSS + JS |
visual-tests/review-smoke-test.mjs | Isolated smoke test for review build/server/save-manifest/persona reports |
visual-tests/monitor-smoke-test.mjs | Isolated smoke test for audit monitor endpoints |
visual-tests/_results/review.html | Generated local review workspace (not committed) |
visual-tests/_results/change-reports/<report-id>/report.json | Durable source report (committed with UI changes) |
visual-tests/_results/persona-reports/<report-id>/index.html | Durable generated review report (committed when used for PR/client review) |
visual-tests/_results/persona-reports/ | Generated audience-specific reports |
If the build script is not yet in the project:
# Copy from the installed ShipGuard plugin root.
# Resolve SHIPGUARD_PLUGIN_ROOT from this skill path:
# $SHIPGUARD_PLUGIN_ROOT/skills/sg-visual-review/SKILL.md
cp "$SHIPGUARD_PLUGIN_ROOT/skills/sg-visual-review/build-review.mjs" visual-tests/
cp "$SHIPGUARD_PLUGIN_ROOT/skills/sg-visual-review/_review-template.html" visual-tests/
cp "$SHIPGUARD_PLUGIN_ROOT/skills/sg-visual-review/review-smoke-test.mjs" visual-tests/
cp "$SHIPGUARD_PLUGIN_ROOT/skills/sg-visual-review/monitor-smoke-test.mjs" visual-tests/
# Add npm script (optional)
# In package.json: "visual:review": "node visual-tests/build-review.mjs"
Run these after installing or changing the review dashboard files:
node visual-tests/review-smoke-test.mjs --port=23101
node visual-tests/monitor-smoke-test.mjs --port=23102
Both scripts use temporary fixtures. They should not write into the project except for normal process output.
Options:
--port=<port> uses a deterministic local port. The same value can be supplied with SHIPGUARD_REVIEW_SMOKE_PORT, SHIPGUARD_MONITOR_SMOKE_PORT, or SHIPGUARD_SMOKE_PORT.--keep-tmp keeps the fixture directory for inspection after the run.--debug keeps the fixture directory and prints server output on failure.If a sandbox blocks local bind, the scripts fail with the fixture path, rerun command, server output tail, and a listen EPERM hint.
--serve; file:// shows the build-time tabs onlyLock the literal user mission and authorization level before work to prevent scope drift, inferred permission, adjacent-work expansion, plan churn, and false completion. Use unconditionally when the active model is gpt-5.6 or gpt-5.6-sol at any reasoning effort, when the user names GPT-5.6 Sol or Sol Ultra as the agent, after terse continuations such as continue/do all, after compaction or correction, and whenever review/plan/code/publish/live boundaries could be crossed.
Use when UI changes need visual verification — after an audit or process check flags routes, after frontend edits, or on demand to run or re-run the project's visual test manifests.
Use when a change is ready to ship — before a PR or release — and the user wants the full ShipGuard verification (audit, behavior, visual, review) run on it.
Use when a project needs visual test manifests created or refreshed — before the first visual run, after UI routes change, or when sg-visual-run reports uncovered routes.
Use when the ShipGuard review dashboard server should be shut down after a review session — stops the sg-visual-review HTTP server via its PID file, with a port-based fallback.
Use after visual runs, screenshot capture, frontend PRs, or before stakeholder review — creates the durable ShipGuard before/after report for UI-visible changes.