agentleFS
harshsinghmpharshsinghmp/muse-skills/skills/design-interface/designscope/SKILL.md

designscope

Skill1 starsChanged 17 days agoMITView on GitHub

Analyze any visual source — image, website URL, or Figma file — to extract its structured design system — a design.md brief, responsive CSS Grid/Flexbox component layout tree, DTCG design-tokens.json, and optional WCAG contrast report. Also handles element mode: copy one component as a rebuild spec, or turn visual art into a token-grounded generative image prompt. Trigger on 'extract the design system from X', 'deconstruct this layout', 'recreate this website design', 'convert this screenshot into tokens and layout tree', 'what palette does this site use', 'document this design', 'copy this navbar', 'recreate this illustration', or whenever the user brings a screenshot, URL, Figma link, or mockup and wants it understood at a structural and design level.

We split this skill into the rules it gives an agent

13 rules. About 0 are common, 8 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every invocation resolves to exactly one mode.

    line 46
  2. Distinctive:

    Always follow this order, no skipping steps.

    line 109
  3. Very specific:

    If the user doesn't clarify, assume reconstruction + design system as the default combo.

    line 121
  4. Distinctive:

    If something fails (URL down, no Figma access, broken image), tell the user clearly and propose alternatives instead of inventing content.

    line 142
  5. Very specific:

    After Layers 1-6, run the Art Direction Patterns QA pass at the end of references/analysis-framework.md.

    line 159
  6. Very specific:

    When extracting layout structure (Layer 4), decompose the visual interface into an actionable responsive component layout tree (consult …

    line 169
  7. Very specific:

    Use the template in references/output-template.md as the output contract (read it when you reach this step).

    line 191
  8. Distinctive:

    Honesty over confidence: Every important inference carries a confidence level (✅ high / ⚠️ medium / ❓ low).

    line 196
  9. Distinctive:

    Refine the analysis: if something felt weak or the user sees something you didn't.

    line 223
  10. Distinctive:

    Don't close with "anything else?".

    line 228
  11. Distinctive:

    Every claim traces to something seen.

    line 237
  12. Distinctive:

    Before declaring the task complete:

    line 265
  13. Very specific:

    Hex format check: every color token is a real hex code (#[0-9A-Fa-f]{6}), not a prose approximation.

    line 268

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “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

🎨 designscope — Design System Extraction & Design Documentation

Point at any visual source — a screenshot, a live URL, a Figma link — and extract its design system into structured artifacts: a design.md brief with a responsive CSS Grid/Flexbox layout tree another AI (or human) can build from, a W3C DTCG design-tokens.json for design tooling, and an optional WCAG accessibility report. Element mode zooms into one component and outputs either a rebuild spec or a token-grounded image prompt. Outputs serve directly as briefs for AI builders and as client brand documentation.


Modes

Every invocation resolves to exactly one mode. Load only the matched reference:

ModeTrigger phrasesBehaviorReference
analysis-framework"designscope analysis-framework", "analysis-framework"Analysis Framework — The 5 analysis layersreferences/analysis-framework.md
capture-flows"designscope capture-flows", "capture-flows"Capture Flows — How to capture each source typereferences/capture-flows.md
element-copy"designscope element-copy", "element-copy"Element Copy — the "copy element" modereferences/element-copy.md
layout-tree-extraction"designscope layout-tree-extraction", "layout-tree-extraction"Layout Tree Extraction Referencereferences/layout-tree-extraction.md
output-template"designscope output-template", "output-template"Output Template — The design.md templatereferences/output-template.md
token-extraction"designscope token-extraction", "token-extraction"Token Extraction — How to infer tokens with rigorreferences/token-extraction.md
audit"design system audit", "audit tokens", "design-code agreement audit"Score tokens/components/docs/process/tooling; verify design-code state agreement and extraction fidelity.references/audit.md

When to Use

Triggers:

  • "Extract the design system from this site/screenshot/Figma file".
  • "Deconstruct this page into a component layout tree / layout hierarchy".
  • "Extract the responsive CSS Grid / Flexbox structure from this screenshot".
  • "Help me recreate this website design (structure + tokens)".
  • "What palette does this site use?", "what font is this?", "document the style of Y".
  • "Convert this image into tokens", "help me replicate this design".
  • Element-scoped: "copy this navbar", "just the pricing card", "recreate this illustration", "give me a prompt to regenerate this graphic".
  • Agency workflow: producing a brand/design brief to feed AI builders (Cursor, v0, Lovable) or to document a client's visual system.
  • Auditing whether a production site implements what a Figma design defined.

Anti-triggers:

  • Building UI from scratch with no reference source — use your normal frontend workflow.
  • Generating new designs or inventing a brand identity from nothing — this skill documents what exists; it does not create.
  • Copying verbatim brand-identifying artwork (logos, mascots) for reuse outside analysis/documentation.

Quick Reference

SourceCapture flowPrimary output
Local imageDirect multimodal visiondesign.md (with Component Layout Tree)
Website URLWeb fetch HTML → CSS variable extraction → native browser screenshots only if HTML is emptydesign.md + design-tokens.json
Figma linkFigma MCP: get_metadata → get_variable_defs → get_design_context → get_screenshotdesign.md + design-tokens.json
ModeScopeOutput
Full (default)Whole page/file/systemdesign.md (Tokens + Section 4.5 Layout Tree), optional design-tokens.json, optional design-a11y.md
ElementOne visual componentelement.md (rebuild spec or token-grounded image prompt)
Script / GuideWhen to run / consultPurpose
references/layout-tree-extraction.mdWhen decomposing visual layoutsBox-model, CSS Grid/Flexbox specs, and container decomposition
scripts/extract_css_vars.pyURL with linked stylesheetsPulls --* custom properties as explicit tokens
scripts/check_contrast.pyExtracted color pairsEmits WCAG contrast table
scripts/lint_design_md.pyAlways, before delivering design.mdValidates frontmatter, token refs, and required sections
scripts/verify_design.pyAudit design-tokens.json vs live URLReports token drift against production stylesheet

Procedure

Always follow this order, no skipping steps.

Step 1 — Identify source and objective

Confirm two things (only if unclear from the message):

  1. Which source is it? Image / URL / Figma / combination.
  2. What's the emphasis?
    • Reconstruction → to feed an AI builder (requires full Component Layout Tree in Section 4.5)
    • Mood/reference → to document style, branding, inspiration
    • Design system → to extract tokens and components as a system

If the user doesn't clarify, assume reconstruction + design system as the default combo. The design.md covers all three anyway — what changes is the depth.

Also determine mode: full analysis vs element copy. Element-mode signals: a definite article + single component ("the navbar", "that button"), an element-scoped verb ("copy", "extract just", "recreate"), or any request for an image-generation prompt. When genuinely ambiguous, default to full mode and offer element mode as the follow-up.

Step 2 — Capture the material

Execute the flow for the source type. Read references/capture-flows.md when you start this step.

  • Image: view it directly. Skip to Step 3.
  • URL: web-fetch the HTML first. If it has real content, work with it and also extract CSS custom properties (python scripts/extract_css_vars.py <URL>). If the HTML comes back empty (SPA without SSR), capture viewports or elements using your agent's native browser/screenshot tooling instead.
  • Figma: Figma MCP tools in order — get_metadata, get_variable_defs, get_design_context, get_screenshot.

If something fails (URL down, no Figma access, broken image), tell the user clearly and propose alternatives instead of inventing content.

Step 3 — Layered analysis + Art Direction QA pass

Analyze the material in 6 layers, general to specific. Read references/analysis-framework.md when you start this step.

LayerWhat to identify
1. IdentityPersonality, mood, references + Brand voice/atmosphere + the "ONE brand thing"
2. SystemTokens: colors, typography, spacing, radii, elevation + decorative depth, borders, accessibility
3. ComponentsGeneric components + Signature components
4. Layout & Layout TreeGrid & containers, responsive layout tree decomposition (Header, Hero, Bento/Feature Grid, Footer with CSS Grid/Flexbox specs), responsive behavior, image behavior
5. ReconstructionSuggested stack, quick wins, tricky bits, confidence map
6. Brand rulesDo's and Don'ts — explicit, brand-specific usage rules

After Layers 1-6, run the Art Direction Patterns QA pass at the end of references/analysis-framework.md. It surfaces patterns shallow analysis routinely misses. The QA pass is non-negotiable.

For token rigor ("green-500 = #16A34A", not "green"), consult references/token-extraction.md. For accessibility checks on extracted color pairs, run python scripts/check_contrast.py --pair "#111827,#FFFFFF".

Step 3.1 — Responsive Component Layout Tree Extraction

When extracting layout structure (Layer 4), decompose the visual interface into an actionable responsive component layout tree (consult references/layout-tree-extraction.md):

  1. Deconstruct into Container Blocks:
    • Header / Nav: flex row, sticky/fixed, justify-between, items-center.
    • Hero Section: flex col (centered) or 2-col CSS Grid (split text/preview), min-h bounds.
    • Feature & Bento Grids: CSS Grid (repeat(12, 1fr) or auto-fit), column/row spans.
    • Alternating Bands: flex col on mobile $\rightarrow$ alternating flex row/reverse on desktop.
    • Footer Matrix: multi-column link grid with top divider and bottom legal bar.
  2. Generate Responsive Box-Model Specifications:
    • Detail display (grid vs flex), flex direction, alignment (justify-*, items-*), and grid templates (grid-template-columns, gap).
    • Define breakpoint transition rules across Mobile (<640px/768px), Tablet (768px–1024px), Desktop (1024px–1280px), and Wide (>1280px).
  3. Map Visual Hierarchy Directly to Design Tokens:
    • Bind typography scale ({typography.display}, {typography.h1}, {typography.body}).
    • Bind spacing rhythm ({spacing.4}, {spacing.6}, {spacing.12}), radii, borders, and surface elevation tiers.
    • Output the complete structural hierarchy in Section 4.5 of design.md.

Step 4 — Generate the output artifacts

Use the template in references/output-template.md as the output contract (read it when you reach this step). For element mode, follow references/element-copy.md instead.

Non-negotiable honesty rules:

  1. Honesty over confidence. Every important inference carries a confidence level (✅ high / ⚠️ medium / ❓ low). Inventing tokens is worse than saying "not enough info".
  2. Real hex codes, not literary approximations. No "sky blue" — #3B82F6 with its semantic role.
  3. Mandatory "Open Questions" section. What you couldn't determine and what needs human input. If none, justify why.
  4. Mandatory "Do's and Don'ts" section. Brand-specific usage rules grounded in observation. If you can't generate at least 3 of each, say so explicitly — never pad with generic UX advice.
  5. Dual output when applicable. Besides design.md, generate design-tokens.json in W3C DTCG format ($value/$type) — only if you extracted concrete tokens.
  6. Accessibility report (optional). With at least two color pairs, generate a brief design-a11y.md with WCAG ratios via scripts/check_contrast.py.

Step 5 — Lint gate, then deliver

ALWAYS run the lint script before delivering any design.md:

python scripts/lint_design_md.py <generated-design.md>

Fix every reported failure before delivering (unresolved token refs, missing mandatory sections, empty Do's/Don'ts without abstain justification).

Then present the generated files and offer next steps based on the Step 1 emphasis:

  1. Refine the analysis if something felt weak or the user sees something you didn't.
  2. Convert the design.md into a build prompt for any AI code agent (Cursor, opencode, Copilot, v0, Lovable).
  3. Analyze another source to compare.

Don't close with "anything else?". Proactively suggest the logical next step.


Pitfalls

  • ❌ Never invent tokens you didn't observe. A short honest system beats a long invented one.
  • ❌ Never write "modern and clean design" without concrete observations backing it. Every claim traces to something seen.
  • ✅ Prefer extracted CSS variables over inferred values — they carry ✅ high confidence by default. Inference is the fallback, not the default.
  • ❌ Don't assume a framework without class evidence. No bg-blue-500 classes → don't say "this is Tailwind".
  • ❌ Don't invent variants. Saw one button → "1 variant observed", not "primary, secondary, tertiary".
  • ❌ Don't fabricate responsive behavior from desktop-only material — flag it in Open Questions and recommend multi-viewport captures.
  • ❌ Don't skip the Art Direction QA pass, layout tree decomposition, or lint gate.
  • ❌ Don't generate images in element mode. Deliver the prompt; rendering is the user's step.
  • ❌ Don't analyze in a vacuum. If the user gave context ("this is for X brand"), the analysis must connect with that hint.

Audit routing

designscope produces design systems (tokens, components, palettes). For deeper audits of the output:

  • UI/component audit → refactor-ui audit mode (scored UI report, WCAG 2.2 contrast)
  • Design-token audit → refactor-ui tokens mode (extract-and-centralize)
  • Content-quality audit → content audit mode (anti-slop scan, fact verification)

Cross-link: skills/references/audit-mode-guidance.md for canonical severity + routing.

Verification

Before declaring the task complete:

  1. Lint gate passes: python scripts/lint_design_md.py <output> reports zero failures.
  2. Hex format check: every color token is a real hex code (#[0-9A-Fa-f]{6}), not a prose approximation.
  3. DTCG validity: design-tokens.json parses as JSON, uses $value/$type, and every $extensions.designscope.confidence marker matches the confidence stated in design.md.
  4. Grep-audit your own output for invented tokens: pick 3 random tokens from the output and confirm each traces to something in the captured material (HTML, screenshot, Figma data). If one doesn't trace, remove it or downgrade to ❓ low with justification.
  5. Mandatory sections present: Open Questions and Do's/Don'ts exist — or carry explicit justifications for their absence.
  6. Layout Tree Present: Section 4.5 Component Layout Tree exists in design.md with container blocks, CSS Grid/Flexbox specifications, and token-grounded hierarchy.

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.