agent-stack-template / rules
Cursor rule31 starsChanged 3 months agoMITView on GitHub
UI, design tokens and mobile-first rules
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 4,187 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .agents/skills/react-hook-form/AGENTS.mdAGENTS.md
- .agents/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/git-flow.mdcCursor rule
- .cursor/rules/performance.mdcCursor rule
- .cursor/rules/prisma-schema.mdcCursor rule
- .cursor/rules/project.mdcCursor rule
- .cursor/rules/server-actions.mdcCursor rule
- .cursor/rules/tdd-domain.mdcCursor rule
- better-auth-best-practicesSkill
- better-auth-security-best-practicesSkill
- changelog-automationSkill
- frontend-designSkill
- interface-designSkill
- marketing-psychologySkill
- organization-best-practicesSkill
- react-hook-formSkill
- shadcnSkill
- vercel-react-best-practicesSkill
The file
We split this ui-design-system.mdc into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
No business rules in React.
- Distinctive: line 41
If a style combination appears three times, it becomes a CVA variant or a component.
- Very specific: line 46
Every interactive element needs hover, focus-visible, disabled and loading.
- Very specific: line 47
Every list needs an empty state and an error state.
≈ “Common” is an estimate: at least 1 in 5 of the 6,668 Cursor rule 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.
Files
--- description: UI, design tokens and mobile-first rules globs: src/components/**/*.tsx,src/features/**/components/**/*.tsx,src/app/**/*.tsx,src/app/globals.css alwaysApply: false --- # UI Source of truth: `DESIGN.md`. Theme tokens: `src/app/globals.css`. ## Before writing UI 1. Reuse `src/components/ui/*`. Extend with a CVA `variant` / `size` rather than a one-off `className`. 2. Reuse the shell: `ContentPanel`, `SurfaceSection`, `FormSheet`, `FormField`. 3. No business rules in React. ## Mobile-first Base styles target a phone (< 640px); enrich upward with `sm:` / `md:` / `lg:`. Designing for desktop and patching with `max-md:` is the wrong direction. - Tables: only identity + the primary value in the base layout; everything else `hidden sm:table-cell`. - Forms: one column at base; grids from `sm:`. - Primary controls at least ~40px tall on touch. ## Colour Semantic classes only: `bg-background`, `bg-card`, `text-foreground`, `text-muted-foreground`, `bg-primary`, `border-border`, `ring-ring`, `sidebar-*`, and the accent tokens (`info`, `success`, `warning`, `destructive`). Forbidden in product UI: hex, raw `rgb()`, and Tailwind colour scales (`bg-zinc-50`, `text-blue-600`). A new colour is a token in `:root` / `.dark` plus an entry in `@theme inline` — never an inline value. ## Repetition If a style combination appears three times, it becomes a CVA variant or a component. Two is a coincidence; three is a pattern. ## States and motion Every interactive element needs hover, focus-visible, disabled and loading. Every list needs an empty state and an error state. Animate only `transform` and `opacity`, under 300ms, and respect `prefers-reduced-motion`. ## Navigation A new destination goes in `src/components/app-shell/nav-config.ts`. A link added directly in a component never gets prefetched and never gets a title.
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
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.

