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.
npx agentmods add rules/nedcodes-ok/cursorrules-collection/shadcn-uigit clone --depth 1 https://github.com/nedcodes-ok/cursorrules-collectionWhat 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 | $0.00000 | $0.00761 |
| Opus 5 | $0.00000 | $0.00380 |
| Sonnet 5 | $0.00000 | $0.00152 |
| Haiku 4.5 | $0.00000 | $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 2d 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.
- 2d 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 (37 stars, last pushed 6mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 761 tokens. 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.