Website to JSON Design Tokens Converter for AI Coding Agents
Turn a captured website into structured JSON design details that an AI coding agent can use for typography, color, spacing, and components.
website to json design tokens converter for ai coding agents
A website-to-JSON design-tokens workflow gives your AI coding agent a structured starting point for rebuilding a visual style instead of asking it to copy a screenshot. Use it to collect observed colors, type choices, spacing, borders, radii, shadows, and component patterns, then review those details before adding them to a project.
A practical way to convert a website
Use this four-step workflow:
- Capture the reference page. Save the public page you want to study, including the page state and viewport that matter to your build.
- Inspect the visible system. Record the page structure, typography, color roles, layout patterns, controls, cards, borders, radii, shadows, and repeated spacing.
- Export JSON as a working artifact. Put the observed details into a structured file grouped by tokens, text styles, components, and notes about where each value appeared.
- Verify before coding. Compare the exported values with the reference page. Keep observations separate from decisions you make for your own product.
A useful JSON shape might look like this:
The exact values should come from the page you inspect, not from a generic design-token template.
Captured pages
Linear typography
- Inter
Weight 400
- Inter
Weight 500
What to include in the JSON
Start with values that affect many screens. Include page background and foreground colors, secondary text, borders, interactive colors, font families, available weights, heading and body sizes, line heights, common gaps, container widths, corner radii, and shadow treatments.
Then add component observations. A button entry can describe its label size, weight, padding, radius, border, fill, hover treatment, and disabled treatment. A card entry can describe its surface color, internal spacing, border, radius, shadow, and relationship to nearby cards. This gives an AI coding agent enough context to build consistent components rather than styling each element in isolation.
Do not treat every measured value as a universal token. A one-off illustration offset or an unusual hero size may belong in a page-specific note. Mark it as such so the agent does not spread it across the whole codebase.
A concrete reference check
The examples include a captured Linear page and a typography summary for that reference. They show Inter used at weight 400 for body copy, labels, navigation, and controls, with weight 500 for headings and emphasized interface text. The accompanying description points to a compact sans-serif system where size, weight, and muted color create contrast.
Use the example to check how a restrained type system supports hierarchy, but do not assume the same values belong in your project. Confirm the page state, inspect other sections, and decide which observations are reusable.
JSON versus a project token layer
A JSON export is an organized record of observed details. It is not automatically an official internal design system, a source of truth, or a guarantee that every page uses the same rules. Use it as input for your coding agent, then refine names, aliases, component APIs, accessibility choices, and responsive behavior in the project itself.
For a reliable handoff, ask the agent to separate observed, inferred, and projectDecision fields. That distinction prevents uncertain observations from becoming hard-coded assumptions. It also makes later review easier when the reference changes or when your own product needs a different value.
Use this in your AI agent
> Inspect the captured website reference and create a structured JSON design-details file for this project. Separate observed values from inferred patterns and project decisions. Include color roles, typography families and weights, sizes and line heights, spacing, borders, radii, shadows, gradients, and reusable component notes. Use the captured Linear typography example only as a comparison point, not as an assumed source of truth. Flag uncertain values for review before applying them to code. > > Install Fudge for your AI agent.
What JSON fields should I give an AI coding agent for a website design conversion?
Give the agent fields that explain both the value and its role. A compact structure is:
Use roles such as page surface, raised surface, primary text, muted text, border, action, and status instead of naming colors only by hue. For typography, record where each family and weight appears. For spacing, distinguish repeated values from one-off measurements. Add responsive notes when a layout changes between viewports.
The confidence section is especially useful. Put directly observed details in high, patterns that appear more than once in medium, and guesses in review. Ask the agent to preserve the source details and propose project-friendly token names separately. This avoids turning an uncertain measurement into a permanent coding rule.
How do I turn the JSON design details into usable code without copying a website blindly?
First, review the JSON and remove anything that is page-specific or uncertain. Then map the remaining observations into your project's own naming system. For example, convert a repeated dark surface into color.surface.raised, a recurring compact gap into space.3, and a heading treatment into a text-style definition. Keep the original observed value in a note so the decision remains traceable.
Next, build one representative screen with the tokens. Check hierarchy, contrast, wrapping, focus states, responsive behavior, and component states. Do not judge the conversion from a single hero section. Compare navigation, cards, forms, empty states, and dense content as well.
A good agent prompt asks for a plan before changing files: list proposed tokens, identify values that conflict, show which components will use them, and call out missing states. After review, have it implement the token layer and one or two components first. This creates a small checkpoint before the style spreads through the application.
Treat the reference as evidence for visual decisions, not a command to reproduce its product, content, or interaction model. Your project still needs its own accessibility checks, responsive rules, semantics, and design ownership.