design-audit
Visually audit a published article's live page using Cloudflare Browser Rendering + Claude vision. Captures desktop + mobile screenshots, runs vision analysis, classifies findings as content-addressable (fixable by rewriting copy) or not, and feeds the content-addressable ones into the QC + Polish agents so the article gets rewritten to address them. Use when adding visual QC to a published-article pipeline, when debugging Step 11.5 failures, or when extending the audit to a new vision model / new viewport.
- License 许可
- MIT
- 最近更新
- 2026-09-25
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- design-audit
- includes
- [ "src/tools/browser-rendering.ts", "src/tools/vision-audit.ts", "src/pipeline/design-audit.ts" ]
- metadata
- { "author": "cats-seo-aiagent", "version": "1.0" }
- triggers
- [ "design audit", "visual audit", "browser rendering screenshot", "claude vision analysis", "step 11.5" ]
- description
- Visually audit a published article's live page using Cloudflare Browser Rendering + Claude vision. Captures desktop + mobile screenshots, runs vision analysis, classifies findings as content-addressable (fixable by rewriting copy) or not, and feeds the content-addressable ones into the QC + Polish agents so the article gets rewritten to address them. Use when adding visual QC to a published-article pipeline, when debugging Step 11.5 failures, or when extending the audit to a new vision model / new viewport.
03 SKILL.md 正文
Design Audit — Step 11.5
Visual post-publish audit for articles on catsluvus.com. Runs AFTER
KV Deploy (step 10) and indexing (step 11), BEFORE QC Review (step
12.5) and Polish (step 13), so its findings can shape the rewrite.
Flow
┌────────────────────────────┐
article ─┤ runDesignAudit(agent, │
URL │ url, slug) │
└───────────┬────────────────┘
│
┌──────────────┴──────────────┐
▼ ▼
capturePageScreenshot capturePageScreenshot
(desktop 1440×900) (mobile 390×844)
│ │
├─── R2: design-audits/{slug}/desktop.jpg
│ ├─ R2: design-audits/{slug}/mobile.jpg
▼ ▼
analyzeScreenshotWithVision analyzeScreenshotWithVision
(Claude vision) (Claude vision)
│ │
└──────────────┬──────────────┘
▼
dedupe + classify
│
▼
DesignAuditReport
{ issues, contentIssues,
analysisErrors, rawVisionResponses,
desktopScreenshotKey, mobileScreenshotKey }
│
┌──────────────┴──────────────┐
▼ ▼
QC Agent (12.5) Polish Agent (13)
feeds contentIssues appends content-addressable
into competitor-gap findings to failedChecks
rewrite prompt and regenerates copy
Code Layout
| File | Role |
|---|---|
src/tools/browser-rendering.ts |
Pure capturePageScreenshot() + AI-SDK screenshotPage tool |
src/tools/vision-audit.ts |
Pure analyzeScreenshotWithVision() + AI-SDK auditScreenshot + auditPageDesign tools + issue coercion + category classification |
src/tools/index.ts |
createDesignAuditTools(agent): ToolSet — the bundle |
src/pipeline/design-audit.ts |
Deterministic runDesignAudit() orchestrator used by writer.ts |
src/server.ts |
Registers the bundle via agent.designAuditTools and exposes /api/verify-design-audit |
Three Ways to Invoke
1. Deterministic (pipeline)
import { runDesignAudit } from "./pipeline/design-audit";
const report = await runDesignAudit(agent, articleUrl, slug);
Used by writer.ts at Step 11.5. Always runs both viewports, always
persists screenshots, always returns a structured report.
2. Agentic (generateText({tools}))
import { generateText, stepCountIs } from "ai";
const result = await generateText({
model: getKimiModel(agent.envBindings),
tools: { ...agent.designAuditTools /* ...other tools */ },
prompt: "Inspect https://catsluvus.com/cats/foo and tell me what's wrong.",
stopWhen: stepCountIs(5)
});
Model decides which tool to call — screenshotPage first, or
auditPageDesign for one-shot, or skip if the URL is unreachable.
3. MCP / HTTP
GET/POST /api/verify-design-audit?url=<url>— runs the full flow against the live bindings, returns the report as JSON. Always HTTP 200; check theokfield.- The three tools above are exposed through the Agent's MCP surface, so any MCP-connected client (Claude Desktop, another agent) sees them as callable capabilities.
Configuration
Secrets & bindings (Worker)
CLOUDFLARE_ACCOUNT_ID— inwrangler.jsoncvars, not a secret (public identifier). Step 11.5 skips if missing.CLOUDFLARE_API_TOKEN_SECRET— Worker secret. Must have:- Browser Rendering: Edit (else 401 code 10000 on
/screenshot)
- Browser Rendering: Edit (else 401 code 10000 on
- Vision analysis uses the Claude Code subscription, not Workers AI.
IMAGES_R2— R2 bucket for screenshot archive (design-audits/{slug}/).
AI Gateway
Gateway id cats-seo-aiagent must exist on the account.
authentication: false is fine since the Worker uses a scoped API
token on the request itself.
Setup via Doppler + wrangler
doppler secrets get CLOUDFLARE_API_TOKEN_SECRET --plain --no-read-env \
| npx wrangler secret put CLOUDFLARE_API_TOKEN_SECRET --name cats-seo-aiagent
Create the gateway programmatically if missing (one-time):
curl -X POST \
-H "X-Auth-Email: $CLOUDFLARE_EMAIL" \
-H "X-Auth-Key: $CLOUDFLARE_GLOBAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id":"cats-seo-aiagent","collect_logs":true,"authentication":false}' \
"https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai-gateway/gateways"
Category → Content-Addressable Classification
Vision models tend to claim every issue is contentAddressable: true. We
override in CATEGORY_CONTENT_ADDRESSABLE so only fixable-by-rewrite
categories flow into Polish:
| Category | Content-Addressable | Example |
|---|---|---|
cta |
✓ | "CTA button has no text" → rewrite button copy |
content |
✓ | "Intro is generic" → rewrite intro |
hero |
✓ | "Hero headline is 'Untitled'" → rewrite headline |
nav |
✓ | "Nav labels are unclear" → relabel |
layout |
✗ | CSS issue — logged only |
typography |
✗ | CSS — logged only |
color |
✗ | CSS — logged only |
mobile |
✗ | CSS/responsive — logged only |
Verifying an Audit Ran
GET /api/logs→ look for"Design Audit: N issues (M content-addressable)"or"Design Audit skipped: <reason>"entries with step11.5.GET /api/verify-design-audit?url=<articleUrl>→ full report. InspectanalysisErrors(empty = clean chain),issues[](deduped findings),rawVisionResponses.{desktop,mobile}(truncated Claude vision output for debugging silent parse failures).- R2 bucket
seo-images→design-audits/{slug}/{desktop,mobile}.jpg.
When to Customize
- Vision model: Claude only (
getKimiModelinsrc/tools/vision-audit.ts). Do not add a Workers AI vision fallback. - Add viewports: extend
DESIGN_AUDIT_VIEWPORTSinsrc/tools/browser-rendering.tsand add a third capture inrunDesignAudit(). - Change content-addressable mapping: edit
CATEGORY_CONTENT_ADDRESSABLEinsrc/tools/vision-audit.ts. Err on the side of false — Polish wasting AI spend is worse than missing a signal. - Disable for local dev: leave Browser Rendering bindings unset;
runDesignAudit()returns{ skipped: true, skipReason: "Browser Rendering not configured (... unset)" }.
04 同仓库更多 Skills
web-html
HTML5: semantic markup, ARIA/WCAG accessibility, forms, Web Components, Shadow DOM, SEO
seo-optimizer
This skill should be used when analyzing HTML/CSS websites for SEO optimization, fixing SEO issues, generating SEO reports, or implementing SEO best practices. Use when the user requests SEO audits, optimization, meta tag improvements, schema markup implementation, sitemap generation, or general search engine optimization tasks.
review-skill
Review and improve AI agent skills (SKILL.md files) against best practices from the Agent Skills specification and Anthropic's authoring guidelines. Scores skills on 10 quality dimensions, identifies specific issues, and rewrites problem areas. Use when creating, editing, auditing, or improving agent skills. Triggers on: review skill, improve skill, audit SKILL.md, check skill quality, skill best practices, optimize skill description.
prompt-engineer
Expert in designing effective prompts for LLM-powered applications. Masters prompt structure, context management, output formatting, and prompt evaluation. Use when: prompt engineering, system prompt, few-shot, chain of thought, prompt design.
product-pick-blurb
Editorial template for "Our Top Picks" product blurbs on catsluvus.com articles. Use when tuning the writer prompt that emits pickReasons, when explaining why every blurb ends with "Why we like this pick:", or when auditing published articles for blurb consistency.
meta-tags-optimizer
This skill should be used when the user asks to "optimize title tag", "write meta description", "improve CTR", "Open Graph tags", "social media preview", "my title tag needs work", "low click-through rate", "fix my meta tags", or "OG tags not showing". Creates and optimizes meta tags including title tags, meta descriptions, Open Graph tags, and Twitter cards for maximum click-through rates and social sharing engagement. For a broader on-page audit, see on-page-seo-auditor. For structured data markup, see schema-markup-generator.