Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/nedcodes-ok/cursorrules-collectionWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/nedcodes-ok/cursorrules-collection/shadcn-ui)<a href="https://agentmods.dev/rules/nedcodes-ok/cursorrules-collection/shadcn-ui"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursorrules-collection/shadcn-ui/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/nedcodes-ok/cursorrules-collection/shadcn-ui"><img src="https://agentmods.dev/badge/rules/nedcodes-ok/cursorrules-collection/shadcn-ui.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00761 | $0.00761 |
| Opus 5.5 | $0.00304 | $0.00304 |
| Sonnet 5.5 | $0.00152 | $0.00152 |
| Haiku 4.5 | $0.00076 | $0.00076 |
Grade A, and why
shadcn-ui scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 44 lines — stays where its author put it; the contents beside it link to each section on GitHub.
shadcn/ui Rules
Component Usage
- Import components from @/components/ui/, never from the underlying Radix/react-aria source directly
- Add new components via CLI:
npx shadcn-ui@latest add [component]— this copies source into your project, not a node_modules dependency - Do not modify files in components/ui/ directly — create wrapper components in components/ that compose the ui/ primitives. When you re-run
add, your changes get overwritten - Check if a shadcn component exists before building custom: Button, Dialog, Sheet, Popover, Command, Table, Form, Toast, Tabs, Accordion, etc. — the library covers more than people expect
- shadcn components are unstyled skeletons using your theme — they look broken without your tailwind config and globals.css set up
Styling
- Use the cn() utility (lib/utils.ts) for all conditional classes — it wraps clsx + tailwind-merge so conflicting utilities resolve correctly
- Follow the existing color convention: CSS variables in globals.css (--primary, --secondary, --muted, --destructive, --ring, etc.) mapped in tailwind.config — never use raw Tailwind colors like
bg-blue-500in shadcn components - Dark mode is built in via CSS variable switching — the same component renders both modes if your CSS variables are set up for both .dark and :root
- When extending a component's style, pass className to the component root — shadcn components forward className and merge it with cn()
Forms
- Use react-hook-form + zod + shadcn
<Form>components together — FormField, FormItem, FormLabel, FormControl, FormMessage provide accessible wiring automatically - FormField's
renderprop gives youfield— spread it onto the shadcn input:<Input {...field} />. Don't manually wire onChange/value - FormMessage renders the zod error for that field automatically — no need for custom error display logic
- For select/combobox in forms, use shadcn Select inside FormControl — it handles the hidden input value that react-hook-form needs
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 44 lines · 761 tokens per session scan A 995daa2159ef
shadcn-ui is a cursor rule published in the GitHub repository nedcodes-ok/cursorrules-collection (38 stars, last pushed 7mo ago), licensed MIT. It adds 761 tokens to every session, about $0.0030 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
ui-components
UI component and styling guidelines using Shadcn UI, Radix UI, and Tailwind.
nextjs-react-tailwind-cursorrules-prompt-file
Cursor rules for Next.js development with React and Tailwind CSS integration.
react-components-creation-cursorrules-prompt-file
Cursor rules for React component creation and development.
nextjs-material-ui-tailwind-css-cursorrules-prompt
Cursor rules for Next.js development with Material UI and Tailwind CSS integration.
react-chakra-ui-cursorrules-prompt-file
Cursor rules for React development with Chakra UI integration.
react-styled-components-cursorrules-prompt-file
Cursor rules for React development with Styled Components integration.