r/ChatGPTCoding • u/Longjumping_War_8480 • 1d ago
Resources And Tips Why dumping huge UI/design rules into .cursorrules makes coding agents worse — and how stage-based skill routing fixed it for me
Most people either give their coding agent zero design instructions (and get the same purple-gradient SaaS layout) or paste a massive style guide into `CLAUDE.md` / `.cursorrules`. From testing both, the second approach actually hurts output quality: the model mixes conflicting rules, burns context before writing code, and still ignores spacing or motion details.
What worked much better for me was splitting design knowledge into a tiny ~190-line router and a JSON stage graph (`R0–R21` across 7 stages: direction → tokens → copy → layout → motion → browser audit). At each step, the agent only reads the 3–5 specific skill files that match the task instead of loading ~345 design rules at once.
Two things made the biggest difference in the 3 builds attached above (a 3D Apple-style product sequence, a 3D pizzeria landing page, and a 60fps canvas motion piece):
- Locking down color, typography, and real copy *before* letting the agent write any Three.js or layout code.
- Ending every run with a deterministic browser check (contrast, mobile overflow, `prefers-reduced-motion`) rather than trusting the model's "looks good" summary.
I packaged this routing setup as an open-source repo (MIT) with a Node validation script that checks all 324 route/file references. Happy to drop the GitHub link in the comments if anyone wants to inspect the graph or try it.



1
u/Longjumping_War_8480 22h ago
This skill - https://github.com/landie3310-bot/Design-master
1
u/Difficult_Duty2198 1d ago
does the router approach cut down on the agent ignoring spacing stuff in practice, or do you still end up fixing a lot at the browser audit stage?
1
u/hieuphung97 22h ago
Instruction dilution is the real reason monolithic rule files fail. When an agent loads design tokens alongside database migrations, the attention budget splits and it drops negative constraints. Scoping rules to an execution stage keeps instruction adherence high.
1
u/sapplex1 22h ago
This matches what I see in my SwiftUI work. I maintain 45 small iOS apps, and my rules file kept growing. Every new lesson went in. Soon the agent was reading navigation rules during a data task. It still made spacing mistakes.
Splitting rules by stage helped more than writing better rules. Layout guidance loads when I build a screen. Release checks load when I ship. The rest stays out of the run.
I also stopped trusting the final summary. A quick screenshot pass catches problems that another paragraph of instructions misses. Did your audit stage stay cheap, or did it become the slow part of the run?
1
u/Mountain_Fudge3980 13h ago
fwiw you can get part of this without a custom router. cursor's project rules in .cursor/rules can auto attach by glob, so the motion stuff only shows up when it's touching those files, and claude code only pulls in a nested CLAUDE.md once it reads files in that folder. doesn't give you the stage ordering though, that part's the interesting bit imo. how are you deciding which stage it's in, does the agent pick or do you?
1
u/Right-Performance-93 11h ago
a router file still sits in the turn that picks the stage. i only keep a line that names the path, and the stage notes get read when that file is the one being edited. the screenshot check is the part that catches what the rules miss.