DesignScan

io.github.ms-zaman由 GitHub 账号 ms-zaman 发布v0.4.0更新于 Oct 25, 2026

Extract a website’s design tokens (colors, type, spacing, shadows) as DESIGN.md, W3C, or CSS.

发布方自己的服务:scan.mx Email Diagnostics

概览

AI 生成的概览

DesignScan 从网站提取设计令牌(颜色、字体、间距、阴影),生成 DESIGN.md、W3C 令牌或 CSS,供助手复刻该站点外观。

可以做什么
从任意网站 URL 提取设计令牌,支持浅色、深色或两者主题,通过无头浏览器分析页面样式与组件。输出 DESIGN.md 规范文件(YAML 令牌加说明文字)、W3C Design Tokens JSON、CSS 自定义属性或原始令牌 JSON。生成自包含的 HTML 预览页,渲染色板、字体样本、间距与圆角刻度及组件,便于使用前核对结果。为编码助手附加每次提取生成的确定性说明,涵盖标题层级、对比度、字体回退及按钮与间距约定。从已提交的 JSON 或实时 URL 构建或扩充精选品牌规范库。
适用场景
适合让助手复刻或对齐某个现有网站的视觉风格,例如为新项目生成与参考站点一致的设计规范,或从在线页面产出可直接粘贴的 CSS 或 W3C 令牌。也适合建立可复用的品牌设计规范库。
运行要求
以本地进程通过 stdio 运行,来自 npm 包 @designscan/extractor。需要 Node.js,并一次性安装 Playwright Chromium,同时需要网络访问目标站点。未声明账号、API 密钥、环境变量或请求头。
安装前请注意
引擎会用无头浏览器访问第三方在线网站,目标 URL 会从本机发起请求。提取结果可能退化或被机器人防护拦截,strict 选项可在结果不可靠时直接失败。生成的规范描述的是他人站点的外观,复用品牌素材或字体前请先确认授权。

安装

在 SourceWeft 中

  1. 打开 控制台中的 DesignScan,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

DesignScan

URL → design tokens → DESIGN.md. Point it at any website and get a spec-compliant DESIGN.md file (YAML tokens + prose) that AI coding agents can read to match that site's look.

Preview

Every run can also emit a self-contained HTML proof sheet (--preview) that renders the extracted tokens — color roles, type specimens, spacing/radius scales, components — so you can eyeball the result before trusting it:

[DesignScan preview proof sheet for stripe.com]

Notes for your coding agent

A DESIGN.md is always consumed by an AI coding agent (Cursor, Claude Code, …). So rather than run our own LLM to resolve semantic intent, every file ends with a Notes for your coding agent section: deterministic, per-extraction instructions computed from the actual tokens — heading hierarchy vs. a muted text color, sub-AA body contrast, brand-font fallback, the primary-button contract, shape/spacing rhythm. The reasoning stays on our side (no API key); the application happens for free inside the agent you already use.

It measurably changes the output. Below: the same stripe.DESIGN.md cloned by an agent that ignored the notes (left) vs one that followed them (right) — identical tokens, layout, and copy:

[Same DESIGN.md, with vs without the agent notes]

Brand corpus

A growing, curated library of real-brand specs lives in examples/ — each one a DESIGN.md, an HTML preview, and the raw token JSON, indexed in examples/README.md (visual gallery: index.html).

[DesignScan brand corpus gallery]

Rebuild it from the committed JSON with pnpm seed rebuild (no network), or add brands with pnpm seed add <url> — degenerate / bot-challenged pages are skipped automatically so the corpus only holds trustworthy specs.

Monorepo layout

PathWhat
packages/extractorThe extraction + generation engine (Playwright → tokens → DESIGN.md).
packages/designscanThe short npm name — a thin CLI shim over the engine (npx designscan <url>).
examples/The brand corpus — DESIGN.md + HTML preview + token JSON per brand, with a gallery index.

Install (as a CLI / library)

The engine ships as the publishable @designscan/extractor package — a designscan CLI and a typed library — with designscan as its short npx alias.

bash
# one-off, no installnpx designscan stripe.com --md --out stripe.DESIGN.md
# or install the CLInpm i -g @designscan/extractornpx playwright install chromium   # one-time (the engine drives headless Chromium)designscan stripe.com --md --preview --out stripe.DESIGN.md

Quick start (from this repo)

This is a pnpm workspace (corepack enable to get pnpm).

bash
pnpm installpnpm --filter @designscan/extractor exec playwright install chromium  # one-time
# token profile (JSON) for any URLpnpm extract stripe.com
# generate a DESIGN.md (light theme by default)pnpm extract stripe.com --md --out out/stripe.DESIGN.md
# pick a theme: light (default) | dark | bothpnpm extract vercel.com --md --theme dark --out out/vercel.dark.DESIGN.md
# both = bundle light + dark into one file (parallel *-dark tokens)pnpm extract vercel.com --md --theme both --out out/vercel.DESIGN.md
# --preview = also write a self-contained HTML proof sheet beside the file,# rendering every token (swatches, type specimens, scales, components) so you# can eyeball the extraction before trusting it (--theme both adds a Light/Dark toggle)pnpm extract stripe.com --md --preview --out out/stripe.DESIGN.md# → out/stripe.DESIGN.md  +  out/stripe.preview.html
# --format = pick your output: json (profile) | md (DESIGN.md) | w3c | csspnpm extract stripe.com --format w3c --out out/stripe.tokens.json  # W3C Design Tokens (Style Dictionary etc.)pnpm extract stripe.com --format css --out out/stripe.tokens.css   # CSS custom properties, paste-ready# (--theme both folds a genuinely distinct dark pass into every format)
# --strict = exit non-zero if the result looks degenerate (bot challenge / too# few signals), for CI/automation that must not consume junk tokenspnpm extract stripe.com --strict --quiet
# seed / rebuild the curated brand corpus under examples/pnpm seed add tailwindcss.com vercel.com   # extract live + add to the corpuspnpm seed rebuild                          # regen md/preview/gallery from JSON

Scripts (root)

ScriptDoes
pnpm extract <url> [--format json|md|w3c|css] [--theme light|dark|both] [--preview] [--strict] [--timeout ms] [--out f]Extract tokens in your format: profile JSON, DESIGN.md (--md shorthand), W3C Design Tokens, or CSS custom properties (--theme both = light + dark in one file; --preview = HTML proof sheet beside it; --strict = non-zero exit on a degenerate result)
pnpm seed rebuild / pnpm seed add <url…>Build the brand corpus under examples/ (md + preview + gallery; add extracts live)
pnpm buildCompile the publishable package (tsc → dist)
pnpm typecheckType-check all packages
pnpm testRun the test suite (vitest)
pnpm checkBiome — format + lint (use pnpm format to auto-fix)
pnpm lint:designmdValidate examples/*.DESIGN.md against the official spec

All of these run on every push/PR via GitHub Actions. The engine is consumable as a library through its public API (packages/extractor/src/index.ts).

Status

  • Step 1 — Extraction engine (Playwright → clean token profile)
  • Step 2 — Generator (token profile → spec-valid DESIGN.md, lint-clean)
  • Step 3 — HTML preview (--preview → self-contained token proof sheet, light/dark toggle)
  • [~] Step 4 — agent guidance. Each DESIGN.md now ships a Notes for your coding agent section: deterministic, per-extraction instructions (contrast, heading hierarchy, font fallback) so the consuming agent applies the tokens with intent — no LLM on our side. (Optional LLM-refined prose still future.)
  • [~] Step 5 — brand-seed library (pnpm seed, curated corpus + gallery) done; npx … add / checkout next

See packages/extractor/README.md for the full roadmap and engine details.

来源:README.md,提交 e22bacb

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.4.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Scan 集成