agentleFS
Aaradhya-Dev-TamrakarAaradhya-Dev-Tamrakar/super-nlm/.agents/skills/shadcn-context/SKILL.md

shadcn-context

Skill0 starsChanged 2 months agoMITView on GitHub

Provides exact component schemas, prop definitions, and composition rules for shadcn/ui, Radix UI primitives, and modern design system packs to prevent style hallucinations.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All className composition must use the project cn() utility combining clsx and tailwind-merge:

    line 16
  2. Very specific:

    Exact Import Paths: Always import components from @/components/ui/<component> (or project alias) rather than inventing arbitrary wrapper …

    line 123
  3. Very specific:

    The asChild Pattern: When wrapping custom buttons or Link components (such as Next.js Link), use asChild on the Trigger to pass …

    line 124
  4. Very specific:

    Accessibility Integrity: Never remove DialogTitle or DialogDescription—if visually hidden, use the sr-only utility to maintain screen …

    line 129

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Shadcn-Context & Design System Packs

This skill equips Antigravity with exact component schemas, prop definitions, and composition rules for shadcn/ui, Radix UI Primitives, and Tailwind CSS, preventing component hallucinations and ensuring strict compliance with production component architectures.


1. Core Architecture & Utility Foundation

The cn() Utility

All className composition must use the project cn() utility combining clsx and tailwind-merge:

import { clsx, type ClassValue } from "clsx"
import { twMerge } from "tailwind-merge"

export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs))
}

Class Variance Authority (CVA)

Component variants must be declared with class-variance-authority:

import { cva, type VariantProps } from "class-variance-authority"

export const buttonVariants = cva(
  "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
  {
    variants: {
      variant: {
        default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
        destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
        outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
        secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
        ghost: "hover:bg-accent hover:text-accent-foreground",
        link: "text-primary underline-offset-4 hover:underline",
      },
      size: {
        default: "h-9 px-4 py-2",
        sm: "h-8 rounded-md px-3 text-xs",
        lg: "h-10 rounded-md px-8",
        icon: "h-9 w-9",
      },
    },
    defaultVariants: {
      variant: "default",
      size: "default",
    },
  }
)

2. Component Composition Schemas

Dialog / Modal

import {
  Dialog,
  DialogContent,
  DialogDescription,
  DialogFooter,
  DialogHeader,
  DialogTitle,
  DialogTrigger,
} from "@/components/ui/dialog"

<Dialog>
  <DialogTrigger asChild>
    <Button variant="outline">Open Dialog</Button>
  </DialogTrigger>
  <DialogContent className="sm:max-w-[425px]">
    <DialogHeader>
      <DialogTitle>Edit Profile</DialogTitle>
      <DialogDescription>Make changes here and click save.</DialogDescription>
    </DialogHeader>
    {/* Body content */}
    <DialogFooter>
      <Button type="submit">Save changes</Button>
    </DialogFooter>
  </DialogContent>
</Dialog>

Form Field (React Hook Form + Zod)

import {
  Form,
  FormControl,
  FormDescription,
  FormField,
  FormItem,
  FormLabel,
  FormMessage,
} from "@/components/ui/form"

<FormField
  control={form.control}
  name="username"
  render={({ field }) => (
    <FormItem>
      <FormLabel>Username</FormLabel>
      <FormControl>
        <Input placeholder="shadcn" {...field} />
      </FormControl>
      <FormDescription>Your public display name.</FormDescription>
      <FormMessage />
    </FormItem>
  )}
/>

3. Anti-Hallucination & Customization Rules

  1. Exact Import Paths: Always import components from @/components/ui/<component> (or project alias) rather than inventing arbitrary wrapper libraries.
  2. The asChild Pattern: When wrapping custom buttons or Link components (such as Next.js Link), use asChild on the Trigger to pass accessibility props to the direct child element without rendering duplicate button wrappers.
  3. No Cookie-Cutter Defaults:
    • Customize border-radii (rounded-xl or rounded-2xl for modern software).
    • Augment standard buttons with subtle inner highlight rims (shadow-[inset_0_1px_0_rgba(255,255,255,0.15)]).
    • Replace standard black overlays with frosted blurred backdrops (backdrop-blur-sm bg-black/50).
  4. Accessibility Integrity: Never remove DialogTitle or DialogDescription—if visually hidden, use the sr-only utility to maintain screen reader compliance.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.