agentleFS
moronireismoronireis/agent-system-partners/.claude/skills/design-md/SKILL.md

design-md

Skill0 starsChanged 2 months agoMITView on GitHub

Extracts Google-spec DESIGN.md from any URL via static HTML/CSS analysis (no headless browser). Outputs tokens.json, preview.html, lint report, optional drift vs local DESIGN.md.

  • Reads credentials
  • Installs packages

68 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use touchdesigner-mcp, teams-meeting-pipeline and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • john-data-chenSkill

    touchdesigner-mcp

    Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.

    Also in 7 projects that use this

  • john-data-chenSkill

    teams-meeting-pipeline

    Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.

    Also in 9 projects that use this

  • mae616Skill

    p5js

    p5.js(クリエイティブコーディング)のProcessing由来「コードでスケッチ」思想を軸に、setup/drawループ・座標系・インタラクション・パフォーマンス最適化を整理する。p5.js、Processing、クリエイティブコーディング、ジェネラティブアート、インタラクティブ表現、ビジュアルプログラミング、Canvas描画、パーティクル、フラクタル、ノイズ表現に関する相談で必ず使うこと。ユーザーが「コードでアート」「動くビジュアル」「インタラクティブな描画」と言った場合にも適用する。

    Also in 12 projects that use this

  • jh941213Skill

    docs-ci

    문서 CI(링크·OpenAPI lint·breaking 게이트·mermaid 검증)나 문서 드리프트 감지(docs.yaml 신선도 검사)를 설치하거나 돌릴 때 사용. 문서 내용 작성은 docs-architecture·docs-interfaces·docs-manuals.

    Also in 3 projects that use this

  • jh941213Skill

    docs-interfaces

    API·이벤트 인터페이스 문서(OpenAPI·swagger·AsyncAPI 명세, 엔드포인트 레퍼런스, API 구성도·시퀀스, API CHANGELOG)를 만들거나 코드와 맞출 때 사용. 시스템 구성도는 docs-architecture, API 설계 원칙은 api-design-principles.

    Also in 3 projects that use this

  • Tommy-ywSkill

    popular-web-designs

    54 production-quality design systems extracted from real websites. Load a template to generate HTML/CSS that matches the visual identity of sites like Stripe, Linear, Vercel, Notion, Airbnb, and more. Each template includes colors, typography, components, layout rules, and ready-to-use CSS values.

    Also in 11 projects that use this

  • +4 more from jh941213

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 1 is distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 59 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Don't add Playwright / Puppeteer / Hyperbrowser.

    line 187
  2. Very specific:

    Don't call the Anthropic API directly.

    line 188
  3. Very specific:

    Don't bypass the content-validation gate without --no-content-gate — thin content (bot blocks, paywalls, JS shells) wastes LLM turns.

    line 189

“Common” is measured: kept by at least 6 in 10 of the 59 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/design-md — URL → DESIGN.md Pipeline

Built by Alan Nicolas (@oalanicolas) — github.com/oalanicolas

Extract a Google-spec DESIGN.md from any public URL using static analysis only — no headless browser, no Playwright, no Hyperbrowser. The cognition layer is claude -p (default) or OpenRouter Haiku.

Standalone skill. Self-contained — copy the design-md/ folder into any Claude Code project's .claude/skills/ and run npm install inside it. No host-repo coupling.

When to invoke

  • User asks to "extract design from <URL>", "get a DESIGN.md from <site>", "rip the DS from <url>", or similar
  • User wants drift detection: "is my DESIGN.md still aligned with <live URL>?"
  • User wants tokens.json + preview.html generated from any public site
  • User wants a stack/style fingerprint of an unknown site

Skip if the user wants TSX components (use /print-to-code style skills instead) or motion-only extraction.

Install

# 1. Drop the folder into your project
cp -R design-md .claude/skills/

# 2. Install local deps
cd .claude/skills/design-md && npm install

# 3. (Optional) install the lint dependency once globally so npx is offline-friendly
npx --yes @google/design.md@0.1.0 --version

The skill only requires Node 18+. The claude -p provider needs the Claude Code CLI on PATH. The openrouter provider needs OPENROUTER_API_KEY set.

Quick run

node .claude/skills/design-md/run.cjs --url https://www.anthropic.com/

Output lands under one folder per URL variant in outputs/design-md/{slug}/ (relative to your CWD). The slugger is subdomain- and path-aware so different DSes under the same company don't collide:

  • https://www.anthropic.com/ → anthropic
  • https://www.shopify.com/ → shopify
  • https://www.shopify.com/br/enterprise → shopify-br-enterprise (different DS from root)
  • https://brand.acme.com/brandbook/guidelines → acme-brand-brandbook-guidelines
  • https://app.linear.app/ → linear-app (product UI ≠ marketing root)

www. is stripped silently; other subdomains and the first 4 path segments become qualifiers (capped at 80 chars). Root URLs of the same company are backwards-compatible (still slug to bare company name).

{company}/                ← latest "best" extraction at root
  DESIGN.md               ← Google-spec, with provenance comments inline
  tokens.json             ← parsed YAML frontmatter
  extraction-log.yaml     ← provenance + confidence summary (machine-readable)
  lint-report.json        ← @google/design.md lint output
  quality-score.json      ← A-F across 7 categories
  preview.html            ← single-file standalone (Google Fonts CDN + Prism)
  style-fingerprint.json  ← visual archetype classification
  agent-prompt.txt        ← reusable LLM prompt with extracted tokens
  telemetry.json          ← run timing, model, cost, reuse trace
  inputs/                 ← raw HTML, CSS, tokens-detected, fingerprints, prompt
  history/
    {YYYYMMDD-HHmmss}/    ← prior runs, archived when superseded

The latest run only stays at the company root if it scores >= the previous best (quality + confidence_high · 0.5 − lint_errors · 5). Otherwise it goes to history/{ts}/ and the previous best stays at root.

Override the outputs root via the --out flag or by setting DESIGN_MD_OUTPUTS_DIR=/abs/path (used by the scripts/*.cjs helpers).

Drift mode

Compare a live URL against a local DESIGN.md:

node .claude/skills/design-md/run.cjs \
  --url https://brand.acme.com/brandbook/guidelines \
  --compare apps/my-app/DESIGN.md

Adds drift-report.json + verdict in stdout: in-sync / minor-drift / notable-drift / major-drift.

Flags

FlagDefaultNotes
--url <url>requiredPublic http(s) URL
--out <dir>outputs/design-md/{slug}/ (CWD-relative)Output directory
--prompt <file>data/url-extract-prompt.txt (in skill)Override LLM prompt template
--compare <file>—Local DESIGN.md to drift-check against
--no-content-gateoffSkip the content-validation gate (R1)
--no-llm-retryoffCI mode — fail hard on first LLM error
--no-reuseoffDisable phase reuse from prior runs (force cold run)
--provider <id>autoclaude-cli (local) or openrouter (CI/Vercel)
--model <id>provider defaultclaude-cli → Opus 4.7; openrouter → Haiku 4.5 (allow-list enforced)
--max-tokens <n>8192Only used by openrouter

Environment variables

VarPurpose
OPENROUTER_API_KEYRequired when --provider openrouter
DESIGN_MD_OUTPUTS_DIROverride outputs root for the scripts/*.cjs helpers
DESIGN_MD_POST_HOOKOptional Node script invoked after each successful extract (node $HOOK $outDir). Fire-and-forget — failures don't fail the extract.
DESIGN_MD_SKIP_HOOKSet to 1 to bypass the post-hook

Phase reuse (default on)

Re-running the extractor on a URL with a prior fresh extract (< 24h) reuses outputs phase-by-phase from {company}/ (the current "best" run) instead of re-fetching, re-detecting, or re-calling the LLM.

PhaseReuse conditionSkips on hit
fetch{company}/inputs/page.html exists and is < 24h oldHTTP fetch + headers
collectPhase fetch hit AND {company}/inputs/css-collected.css existsCSS bundle download (often 0.5–2 MB) + favicon + logo
detectPhase collect hit AND all 13 detection files + style-fingerprint.json existAll regex/static analysis
markdownPhase fetch hit AND {company}/inputs/page.md existsHTML → markdown conversion
llmPrior run telemetry has same model AND prompt content matches (path-normalized)LLM call + retry loop

End-of-run telemetry includes reuse.trace and a one-liner: [reuse] 5/5 phases reused from {slug} — fetch=HIT collect=HIT detect=HIT markdown=HIT llm=HIT. Pass --no-reuse for CI/auditing where each run must be deterministic from cold.

Migrating existing extracts

A one-shot script consolidates legacy {slug}-{timestamp}/ dirs into the new {company}/ layout:

# Preview migration plan
node scripts/organize.cjs --dry-run

# Apply (drops failed extracts without DESIGN.md)
node scripts/organize.cjs --apply --skip-junk

Best-run selection: complete → high quality_score → high confidence_high → low lint errors → most recent.

Pipeline (8 phases)

  1. axios.get(url) → HTML
  2. cheerio walks <link rel="stylesheet">, inline <style>, style="" → fetches and concatenates all CSS (preload + @import resolved)
  3. Regex pass detects: hex/rgb/hsl, font-family|size|weight, line-height, border-radius, padding|margin|gap, Google Fonts URLs. Emits stack.json (Next.js, Tailwind, Radix, GSAP, …) and style-fingerprint.json (shadcn-neutral, carbon-enterprise, apple-glass, polaris-friendly, marketing-gradient, …)
  4. turndown HTML → markdown; first heading + first long paragraph become the type specimen pageCopy
  5. Templates data/url-extract-prompt.txt with input file paths (HTML, CSS, page-copy, tokens-detected, css-vars, font-faces, stack-summary). Fingerprints feed prose tone — LLM matches archetype rather than producing generic descriptions
  6. claude -p <prompt> --output-format text (or OpenRouter API) — instructed to use the Write tool to emit DESIGN.md at the resolved output path. Normalize + lint (@google/design.md@0.1.0) + retry once on max-turns / missing sections
  7. Parse YAML frontmatter → tokens.json. Build extraction-log.yaml, quality score, drift report (if --compare). Embed fonts as data: URLs
  8. Render single-file preview.html — color swatches, typography (Google Fonts), spacing/radius scales, raw DESIGN.md (Prism CDN), audit panel with fingerprint summary

Optional Phase 9: invoke DESIGN_MD_POST_HOOK if set (fire-and-forget — failures don't fail the extract).

Exit codes

CodeMeaning
0Success — DESIGN.md produced, preview rendered
1Usage error (missing --url)
2LLM ran but DESIGN.md was not written. Check inputs/prompt.txt
4Content-validation gate failed (bot detection / paywall / SPA shell). Override with --no-content-gate
5LLM exhausted budget AND retry failed, OR missing required sections after retry
6--provider openrouter chosen but OPENROUTER_API_KEY not set
7OpenRouter HTTP error after retry exhausted

Confidence ladder (C1)

Each top-level token in the YAML frontmatter is annotated with a provenance comment that the script grades:

LevelSourceExample comment
highCSS var or @font-face# from --swatch--clay
mediumNon-var CSS declaration# from h1 declaration
lowInferred# inferred from primary darker variant

Aggregated in extraction-log.yaml#confidence_summary and rendered as colored badges in the preview header.

Tests

cd .claude/skills/design-md
npm test
# or directly:
node --test lib/*.test.cjs lib/providers/*.test.cjs

Anti-patterns

  • Don't add Playwright / Puppeteer / Hyperbrowser. The constraint is intentional — prove static analysis + headless LLM works before adding browsers.
  • Don't call the Anthropic API directly. The cognition layer is claude -p (or OpenRouter pass-through). Provider/model policy lives in lib/llm.cjs (PROVIDER_DEFAULTS).
  • Don't bypass the content-validation gate without --no-content-gate — thin content (bot blocks, paywalls, JS shells) wastes LLM turns.

References

Author

Alan Nicolas — @oalanicolas — github.com/oalanicolas

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.