I used to paste half the design system into the agent prompt “just so it knows our Button.” The reply was longer, slower, and somehow still invented a new PrimaryButton with a hardcoded hex.
More context is not the same as better compliance. Agents drown in component catalogs. What they need is a small, sharp contract : which primitives exist, which props are legal, and what “done” looks like when the diff lands.
Here’s the prompting pattern that finally stopped the reinvent-the-wheel PRs.
The failure mode: catalog dump
A prompt that looks like this fails quietly:
Here is our entire components/ui tree (paste 40 files). Build a settings form that matches the design system.
What I got back:
A new SettingsCard that duplicated Card
Inline styles next to token imports
A custom toggle instead of our Switch
“Close enough” spacing that wasn’t on the spacing scale
The model saw the library. It didn’t treat the library as the only legal surface.…