aurostack-org/stacks/add-component

Claude Code and agent skill by aurostack-org/stacks

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Add or restyle a component in the shared UI kit (packages/ui) — variants with cva, the cn helper, theme tokens only, exported from the kit's index. Use when a screen needs a control or block the kit does not have, when a design system defines a component to implement, or when asked to "add a Badge/Tabs/Avatar component" or "restyle the button to match the design".

Install

npx vskill@latest install aurostack-org/stacks/add-component

SKILL.md

The same SKILL.md was published earlier as aurostack-org/stacks/add-component.

Add a UI kit component

The kit is packages/ui/src/components/ui/, used by every app. button.tsx is the pattern: read it first.

  1. Check the kit first. If an existing component covers it with a new

variant, add the variant rather than a second component.

  1. Write it in packages/ui/src/components/ui/<name>.tsx:

```tsx import { cva, type VariantProps } from 'class-variance-authority'; import { cn } from '../../lib/utils';

const badgeVariants = cva('inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium', { variants: { tone: { neutral: 'bg-muted text-muted-foreground', accent: 'bg-accent text-accent-foreground' } }, defaultVariants: { tone: 'neutral' } });

export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement>, VariantProps<typeof badgeVariants> {}

export function Badge({ className, tone, ...props }: BadgeProps) { return <span className={cn(badgeVariants({ tone }), className)} {...props} />; } ```

  • Theme tokens only: semantic utilities (bg-primary,

text-primary-foreground, bg-card, border-border, ring-ring, bg-scrim), never hex values or arbitrary colours. A colour the design needs that has no token is a token to add in packages/ui/src/styles/globals.css (both :root and .dark where the app has a dark theme, plus its @theme inline line), not a literal.

  • Accept className and merge it with cn() last, so callers can adjust

layout.

  • Use Radix primitives (Slot for asChild, popover, select…) for

anything interactive with focus or keyboard behaviour.

  • Real elements: <button>, <a>, <input> with a <label>;

aria-label on icon-only buttons; a visible focus ring (focus-visible:ring-2 ring-ring).

  1. Export it from packages/ui/src/index.ts; apps import it from @acme/ui.
  1. Check with yarn lint && yarn typecheck (turbo, every app), and look at it in both

themes (if the app has two) and at phone width in the screen that uses it.

When implementing a design system's component, match its spec (sizes, radii, states) through the tokens; if the design system's values differ from the theme, fix the theme tokens once rather than overriding per component.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/aurostack-org/stacks/add-component/badge)](https://verified-skill.com/skills/aurostack-org/stacks/add-component)

Something wrong with this skill or its page? Tell us.