Shade new component

From TryGhost/Ghost · View interactive version

Shade new component is an AI agent skill from the GitHub repository TryGhost/Ghost. Acceptance checklist for adding or editing a Shade component or pattern file — naming, sibling story, className forwarding, cva variants, required states, recipe usage. Trigger when editing files in apps/shade/src/components.

How to use this skill

Skill file

Shade — new component / pattern checklist

Before marking a Shade component or pattern done, this checklist must pass.

Files and naming

Storybook title prefix

| Layer | Title |

| ------------- | --------------------- |

| Primitive | Primitives / <Name> |

| Component | Components / <Name> |

| Recipe | Recipes / <Name> |

| Pattern | Patterns / <Name> |

| Token gallery | Tokens / <Topic> |

Required on every story file:

Component shape

// thing-variants.ts
import {cva} from 'class-variance-authority';

const thingVariants = cva('base-classes-here', {
    variants: {
        variant: {default: '...', destructive: '...'},
        size: {default: '...', sm: '...'}
    },
    defaultVariants: {variant: 'default', size: 'default'}
});

export {thingVariants};
// thing.tsx
import * as React from 'react';
import {type VariantProps} from 'class-variance-authority';
import {thingVariants} from '@/components/ui/thing-variants';
import {cn} from '@/lib/utils';

export interface ThingProps
    extends React.HTMLAttributes<HTMLDivElement>,
    VariantProps<typeof thingVariants> {}

const Thing = React.forwardRef<HTMLDivElement, ThingProps>(
    ({className, variant, size, ...props}, ref) => (
        <div
            ref={ref}
            className={cn(thingVariants({variant, size, className}))}
            {...props}
        />
    )
);
Thing.displayName = 'Thing';

export {Thing};

Hard requirements:

When applicable:

Required states (all four)

Every interactive component must work in:

Each state visible in the story. Optional states (active, loading, error, empty) only when they apply.

For form controls, drive chrome through the inputSurface recipe — don't roll your own border/focus ring. See the shade-input-surface-recipe skill.

Tokens

See shade-tokens-not-hex and shade-no-dark-variants.

Before marking done

Source of truth

Shade's CODE0 and the component's stories.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.