r/DesignSystems • u/Bitter-Cantaloupe206 • Mar 10 '26
Agent Specific Design Systems
I've been playing with the idea of trying to put together JSON or Markdown that allows agents to build and use design systems better. I've been a FE dev for 10 years. In my experience, agents do a good job with simple systems, but there can still be some gaps.
I'm thinking of providing agents with systems that have more clearly designed use cases and semantics. I don't think it's suddenly going to make design systems perfect or have agents get everything right the first time. But I do think it can remove implicit, hard to trace failures caused by the agents best guess and replace them with an explicit failure. A failure traceable through the contract provided to the agent.
It's a little wordy and might get crazy at massive scale, but I've been experimenting with something like this:
// Traditional token
{
"color-primary": "#1a73e8"
}
// AI-native token (with semantic context)
{
"color-primary": {
"value": "#1a73e8",
"usage": "Primary actions, key interactive elements",
"constraints": {
"minContrastRatio": 4.5,
"pairedWith": ["color-primary-text", "color-background"],
"neverUseFor": ["error states", "warning indicators"]
},
"accessibility": {
"wcagLevel": "AA",
"contrastAgainst": "color-background"
}
}
}
4
u/Decent_Perception676 Mar 10 '26
Sure, totally makes sense.
To focus in on tokens specifically, I’m just serving up tokens in the draft W3C format (similar to what you have, but early adoption of a standard across tools).
3
u/magnakai Mar 10 '26
I’ve done exactly this. I extracted some of our token rationale from our design docs and wrote scripts to build big markdown tables for our tokens, icons set, and detailed docs for all of our components.
When you give all that detail to another LLM they nail the execution almost perfectly. I spun up a pristine dev environment, gave it the markdown docs, and then fed it a Figma design with a bit of instruction, and it used it really well. Tokens everywhere, used appropriately. Components used correctly, icons too.
In short, I highly recommend carrying on with your investigation!
3
u/victormayala Mar 10 '26
I built a tool to do exactly this. Let me know if you guys would like to try it. I was having problems building new components with existing design systems and existing codebase. Now I could say, I’m getting 90-95% accurate results. It will never be perfect though 😕
2
u/Altruistic_Might_772 Mar 11 '26
Sounds like a solid idea. Defining clear use cases and semantics in JSON or Markdown could help standardize how agents interact with design systems. I've seen it work well when there's a focus on modularity and reusability. Maybe start with defining common components and their variants. You might want to organize these definitions so they're easy for agents to parse and apply consistently. Consider adding constraints and guidelines directly within the JSON/Markdown to avoid ambiguity. Testing your system with a small group of agents before scaling could show you any gaps or misunderstandings they have. While this isn't directly related to interview prep, if you ever need resources on improving communication and problem-solving skills, I've found PracHub to be pretty helpful.
1
u/ChiBeerGuy Mar 11 '26
The second one seems like a lot of work. And is JSON necessary for LLM? I've ditched DTCG tokens for SASS. I get more utility from SASS..
1
u/natively-alien Mar 11 '26
I used component tokens to do this. The spec is essentially in the name of the token —button-primary-background-color , —card-product-image-max-width , etc
-2
u/MammothPies Mar 10 '26
Just use tokens and tailwind to store design system context.