herocn skills are instructions your AI coding assistant loads when it works with herocn components. They teach the agent herocn's design rules, so the code it writes looks right without you having to correct it.
Skills complement the MCP server. The MCP server lets the agent look up docs and component source; skills tell it how to compose those components. The skills are published on skills.sh and work with any agent it supports, including Claude Code, Cursor, Codex and OpenCode.
We'll add more skills over time. Re-run the install command to get the latest versions.
Install every herocn skill into your project:
pnpm dlx skills add maqed/herocnOr install a single skill:
pnpm dlx skills add maqed/herocn --skill herocn-designThe CLI detects your agent and copies the skill into its skills folder (for example, .claude/skills/herocn-design/ for Claude Code). Commit that folder so everyone on your team gets the same rules.
Design rules for composing herocn primitives. The agent uses it whenever it writes, edits or reviews code that uses herocn components. You don't need to mention the skill or ask about variants.
herocn layers its backgrounds: the page sits at the bottom, and cards, dialogs and popovers sit above it. A form control's default style is built for the page background, so on a raised surface it blends in. The secondary variant gives the control a contrasting background.
import { Button } from "@/components/ui/button";import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle,} from "@/components/ui/card";import { Input } from "@/components/ui/input";import { Label } from "@/components/ui/label";
export function CardDemo() { return ( <Card className="w-full max-w-sm"> <CardHeader> <CardTitle>Login to your account</CardTitle> <CardDescription> Enter your email below to login to your account </CardDescription> <CardAction> <Button variant="ghost">Sign Up</Button> </CardAction> </CardHeader> <CardContent> <form> <div className="flex flex-col gap-6"> <div className="grid gap-2"> <Label htmlFor="email">Email</Label> <Input variant="secondary" id="email" type="email" placeholder="[email protected]" required /> </div> <div className="grid gap-2"> <div className="flex items-center"> <Label htmlFor="password">Password</Label> <a href="#" className="ml-auto inline-block text-xs underline-offset-4 hover:underline sm:text-sm" > Forgot your password? </a> </div> <Input variant="secondary" id="password" type="password" required /> </div> </div> </form> </CardContent> <CardFooter className="flex-col gap-2"> <Button type="submit" className="w-full"> Login </Button> <Button variant="outline" className="w-full"> Login with Google </Button> </CardFooter> </Card> );}The agent looks at each control's nearest container, the closest element that paints its own background, and picks the variant from it:
| Nearest container | Variant |
|---|---|
Card or Surface (default variant) | secondary |
Accordion variant="surface" | secondary |
DialogContent, AlertDialogContent, SheetContent, DrawerContent, PopoverContent, HoverCardContent | secondary |
ButtonGroup, choice cards, body cells of a default Table, and the search box in ComboboxContent | secondary |
Card/Surface with secondary, tertiary or transparent, table header cells, Sidebar, the page | default |
Only the nearest container counts. An input in a <Surface variant="secondary"> keeps the default variant even when that surface sits inside a default Card. An input in a dialog uses secondary even when the dialog's trigger sits inside a card.
<Card> <CardContent> <Input placeholder="Email" /> <Textarea placeholder="Bio" /> </CardContent></Card><Card> <CardContent> <Input variant="secondary" placeholder="Email" /> <Textarea variant="secondary" placeholder="Bio" /> </CardContent></Card>The skill also knows where the prop goes on compound components. It goes on the Select root rather than SelectTrigger, on InputGroup rather than InputGroupInput, and on RadioGroup rather than each item.
"use client";
import { Button } from "@/components/ui/button";import { Field, FieldGroup, FieldLabel } from "@/components/ui/field";import { Input } from "@/components/ui/input";import { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger,} from "@/components/ui/popover";
export function PopoverForm() { return ( <Popover> <PopoverTrigger render={<Button variant="tertiary" />}> Open Popover </PopoverTrigger> <PopoverContent className="w-64"> <PopoverHeader> <PopoverTitle>Dimensions</PopoverTitle> <PopoverDescription> Set the dimensions for the layer. </PopoverDescription> </PopoverHeader> <FieldGroup className="gap-4"> <Field orientation="horizontal"> <FieldLabel htmlFor="popover-form-width" className="w-1/2"> Width </FieldLabel> <Input variant="secondary" id="popover-form-width" defaultValue="100%" /> </Field> <Field orientation="horizontal"> <FieldLabel htmlFor="popover-form-height" className="w-1/2"> Height </FieldLabel> <Input variant="secondary" id="popover-form-height" defaultValue="25px" /> </Field> </FieldGroup> </PopoverContent> </Popover> );}Form controls don't belong in menus, with one exception. A search box in a DropdownMenu uses DropdownMenuInput, which is already styled for the menu. If you ask for an input in a ContextMenu or Menubar, such as an inline rename, the agent opens a Dialog or Popover for it instead and tells you why.
Ask the agent to review herocn UI, and it checks the rules above and also improves the design more broadly: hierarchy, structure, spacing, copy and states. Its review separates herocn rule violations from other design improvements, so you can tell which is which.
Once the skill is installed, work as usual. For example:
app/settings/page.tsx for design issues."The source for every skill lives in packages/skills on GitHub.