Agent skill

Storybook Story

by radix-ng in radix-ng/primitives

Write or update Storybook stories and docs MDX for a Radix NG primitive following project conventions.

MITAuto-check passedFrontend & Design

Install Storybook Story

skills CLI
$ npx skills add radix-ng/primitives --skill storybook-story -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install radix-ng/primitives storybook-story --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/radix-ng/primitives.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/storybook-story .claude/skills/storybook-story && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
storybook-story
GitHub stars
274
Token cost
~3.7k tokens
SKILL.md length
1,506 words
Files
1
Skills in repo
7
Repo updated
First seen
Licence
MIT

At a glance

Write or update Storybook stories and docs MDX for a Radix NG primitive following project conventions.

  • Works in 8 steps: Any story embedded via must be a… → One component → one file. Every… → ?raw import per story file. In .stories.ts → …
  • : writing stories
  • SKILL.md covers Checklist — run through this…, Docs MDX template, Files to create/update and Reference examples
  • Calls pnpm; reaches w3.org

What it does

Storybook Story is an agent skill from radix-ng/primitives. Write or update Storybook stories and docs MDX for a Radix NG primitive following project conventions. Use when: writing stories, updating docs, adding a new story, updating MDX, "обнови сторис", "напиши доки для", "update stories", "add story". Enforces: one-file-per-component rule, ?raw source imports, tailwindDemoDecorator, semantic tokens, docs MDX template.

Its SKILL.md is about 3.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Frontend & Design, covering Markdown and Design systems. It works with Storybook. The repository describes itself as: Headless, signals-first UI primitives for Angular. Accessible. Customizable. The licence is MIT.

When your agent uses it

  • : writing stories
  • Adding a new story
  • Напиши доки для

Example prompts

  • “update stories”
  • “add story”
  • “/storybook-story”

Workflow steps

8 steps, taken from the first numbered list in SKILL.md.

  1. Any story embedded via must be a standalone component — props` do not survive a Canvas embed.
  2. One component → one file. Every standalone story component gets its own file
  3. ?raw import per story file. In .stories.ts
  4. tailwindDemoDecorator() is required in decorators. No styleUrl, no inline .
  5. Semantic tokens only in templates: bg-background, text-foreground, bg-muted, bg-popover, border-border, text-muted-foreground…
  6. Shared style constants from packages/primitives/storybook/styles.ts (cn, demoButton, demoMenu, etc.). Extend styles.ts when a pattern…
  7. Story order: Default first, then state variants, then advanced examples.
  8. Wrapper component from packages/primitives/storybook/tailwind-demo.ts. It marks the root with data-demo="tailwind".

What it can do on your machine

Read from SKILL.md and the folder at commit eed2a31. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • pnpm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • w3.org

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Storybook Story loads about 3.7k tokens when it runs. Until then it costs about 96 tokens; SKILL.md has 1,506 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~96
When it runs · the whole SKILL.md, loaded when a task matches
~3.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from radix-ng/primitives at commit eed2a31, republished under its MIT licence (© radix-ng). 1,506 words, ~3,670 tokens.

Download SKILL.mdSave it as .claude/skills/storybook-story/SKILL.md (or your agent's skills folder).
name
storybook-story
description
Write or update Storybook stories and docs MDX for a Radix NG primitive following project conventions. Use when: writing stories, updating docs, adding a new story, updating MDX, "обнови сторис", "напиши доки для", "update stories", "add story". Enforces: one-file-per-component rule, ?raw source imports, tailwindDemoDecorator, semantic tokens, docs MDX template.

Writing Storybook Stories for Radix NG Primitives

Checklist — run through this before writing any story file

  1. Any story embedded via <Canvas of={X}> must be a standalone component — props do not survive a Canvas embed. The exception is the primary Default story, which may be a small inline template using props + args, provided it is surfaced in the MDX via <Primary /> / <Controls /> (never <Canvas of={Default}>). This matches the button and checkbox references.

    ts
    // ✅ Default — small inline template with props/args, shown via <Primary/> in MDX
    export const Default: Story = {
      args: { disabled: false },
      render: (args) => ({
        props: { ...args, b: demoButton },
        template: html`
          <button rdxButton ${argsToTemplate(args)} [class]="b.base">Button</button>
        `
      })
    };
    
    // ✅ Named example — standalone component, safe to embed via <Canvas of={X}>
    export const Variants: Story = {
      parameters: source(variantsSource),
      render: () => ({
        template: html`
          <button-variants-example />
        `
      })
    };
    
    // ❌ wrong — a props-based story embedded via <Canvas of={WithScroll}> renders blank
    export const WithScroll: Story = {
      render: () => ({ props: { r: demoRadio }, template: `<div [class]="r.group">...` })
    };

    In the MDX: surface Default with <Primary /> (+ <Controls />) and add of={Stories} to <Meta>; embed every other example with <Canvas of={Stories.X} />.

  2. One component → one file. Every standalone story component gets its own file: stories/select-default.ts, stories/select-with-scroll.ts, etc. Never put multiple story components in a single stories/<name>.ts.

    Reason: ?raw imports the entire file, so a shared file shows all source for every story.

  3. ?raw import per story file. In <name>.stories.ts:

    ts
    import defaultSource from './select-default?raw';
    export const Default: Story = {
      parameters: source(defaultSource),
      render: () => ({
        template: html`
          <select-default />
        `
      })
    };

    Each story export gets parameters: source(itsOwnFile?raw).

  4. tailwindDemoDecorator() is required in decorators. No styleUrl, no inline <style>.

  5. Semantic tokens only in templates: bg-background, text-foreground, bg-muted, bg-popover, border-border, text-muted-foreground, text-primary-foreground. No raw colors (violet, mauve, white, black).

  6. Shared style constants from packages/primitives/storybook/styles.ts (cn, demoButton, demoMenu, etc.). Extend styles.ts when a pattern recurs — don't inline long class strings.

  7. Story order: Default first, then state variants, then advanced examples.

  8. Wrapper component from packages/primitives/storybook/tailwind-demo.ts. It marks the root with data-demo="tailwind".

Docs MDX template

<Meta title="Primitives/Name" of={Stories} />   {/* `of=` is required for <Primary>/<Controls> */}
# Name
#### One-line summary.
<Primary />    {/* renders the inline Default story; do NOT use <Canvas of={Default}> */}
<Controls />   {/* args table for the Default story */}
## Features  (✅ bullets)
## Import     (code block)
## Anatomy    (HTML block showing all parts)
## Examples   (### Title + one-line desc + <Canvas of={Stories.X} /> per example)
## Data attributes  (optional table, if the primitive exposes data-* state separately)
## API Reference  (### per part → "Renders a `<x>` element" note + <ArgTypes> + Data attributes / CSS variables tables; see "API Reference — Base UI parity")
## Accessibility  (native-first lead sentence + a standards-mapping table + a ### Keyboard Interactions table; goes LAST — see rules below)
  • Surface Default with <Primary /> (+ <Controls />), not <Canvas of={Default}> — see checklist item 1. A simple primitive may instead use <Canvas sourceState="hidden" of={Stories.SomeStandaloneStory} /> as the hero (e.g. Button uses Variants).
  • No bare <Canvas> without a preceding ### Title description.
  • API Reference parts are ### subheadings under the ## API Reference ## — never repeat ## for each directive (that makes them siblings of API Reference, not children).
  • No empty <ArgTypes> tables. Parts with no inputs → one-line prose note instead.
  • Imports at the top: Storybook blocks (incl. Primary, Controls) → * as Stories → individual directive classes for ArgTypes.
API Reference — Base UI parity (canonical convention)

Mirror the matching Base UI component so our API Reference reads the same. Pull the per-part contract (rendered element, props, data-*, CSS vars, change-event reasons) from the authoritative source: the Base UI checkout's docs/src/app/(docs)/react/components/<name>/types.md (autogenerated; falls back to its packages/react/src/<name>/**/*DataAttributes.ts / *CssVars.ts enums) — not from your own memory or the website. The checkout's local path is in personal memory (reference-base-ui-contract); don't hardcode it here. Each ### part subsection, in this order:

  1. One-line summary + host element. `RdxFooPanelDirective` — what the part does. End with the host element. These are attribute-directives, not React components — they do not render an element, the consumer supplies it. Write "Apply to a <x> element", never Base UI's "Renders a <x>". Use the tag shown in Anatomy: a container part → "Apply to a container element (typically a <div>)"; a part that needs native button semantics → "Apply to a native <button> element". Only say a specific tag is required when the selector enforces it (e.g. button[rdxFoo]) — otherwise it's the recommended host. Add behavior/a11y prose (exposed aria-*, context-only parts) on the next line.
  2. <ArgTypes of={Directive} /> — only for parts with inputs/outputs (no empty tables; context-only parts get prose instead, see above).
  3. Data attributes table (**Data attributes** bold label, not a heading), when the part sets any data-*. Shape: | Attribute | Present when |, one data-* per row in backticks, descriptions end with a period. Mirror Base UI's wording where it maps cleanly.
  4. CSS variables table (**CSS variables** bold label), when the part sets any --* custom property. Shape: | Variable | Description |.
  • Ground every data-* / --* in source — never invent. Read the part's host: {} bindings (and any style.--* / setProperty); list exactly what's there. This is the same "trace it to a real handler" rule as Keyboard Interactions. Internal inline-style manipulation (temporary node.style.height = 'auto' for measuring, toggling transitionDuration/animationName) is not a public CSS variable — only list --* properties actually bound on the host.
  • Take the host tag from the selector / Anatomy, never assume. When rolling this out to other primitives, derive each part's element from its @Directive({ selector }): a tag-qualified selector (button[rdxFoo]) → that tag is required; a plain attribute selector ([rdxFoo]) → use the tag shown in that primitive's Anatomy block as the recommended host. Do not copy Collapsible's tags (<button>/<div>) onto another primitive by analogy — verify per part.
  • Per-part, not one global section. Prefer Base UI's layout (each table inside its part's ###) over a single top-level ## Data attributes section. Drop the global section once a primitive uses per-part tables.
  • Subtitle (#### …) matches Base UI's one-liner where one exists (e.g. Collapsible → "A collapsible panel controlled by a button.").
  • Reference page to copy: packages/primitives/collapsible/stories/collapsible.docs.mdx.
  • After editing any *.docs.mdx, run pnpm skills:build to regenerate the LLM bundle (CI-verified).
Show full SKILL.md (751 more words)Show less
Accessibility section (canonical convention)

The ## Accessibility section has three parts, in this order: a native-first lead sentence, a standards-mapping table, then the ### Keyboard Interactions subsection. It is the last section on the page, after ## API Reference. The library-wide philosophy lives once on the Overview/Accessibility page (source hierarchy Native HTML → WAI-ARIA → APG → WCAG 2.2 + the honest "designed against / tested for" disclaimer); per-primitive sections link back to it, they don't restate the manifesto.

  • Lead sentence. One line stating what native semantics the primitive reuses and that ARIA is added only where the platform doesn't provide the widget — then name + link the specific APG pattern it's built against (Dialog, Menu, Tabs, Tooltip, Switch, Radio Group, …). If the primitive is purely native (e.g. Label, Aspect Ratio), say so and skip the APG link.
  • Standards-mapping table. | Area | Implementation | Reference |, rows in this order where they apply: Semantics (roles, aria-modal, labelling), Keyboard (one-line summary), Focus (initial focus, trap, restore), State (aria-controls / aria-expanded / data-*). The Reference column links the concrete APG sub-section and the specific WCAG 2.2 success criteria (e.g. [WCAG 4.1.2](https://www.w3.org/TR/WCAG22/#name-role-value) for name/role/value, 2.1.1 keyboard, 2.1.2 no-keyboard-trap, 2.4.3 focus-order). Ground every row in source — the same "trace it to a real handler / real binding" rule as Keyboard Interactions and data-*. Never list an Area you can't point to in code + a test.
  • Honest claims only — never write "WCAG compliant" / "accessible" as a bare assertion. Conformance depends on consumer assembly. Frame as "built/designed against … and tested for the documented behaviors". Add a row only when a passing test backs it (jest-axe + behavior/Vitest) — claims are earned, not declared.
  • Nesting & placement. ## Accessibility holds the ### Keyboard Interactions subsection (Title Case, level 3). Never a standalone ## Keyboard interactions heading. If ## Accessibility already exists, add subsections inside it — never a second Accessibility section.
  • Table shape. | Key | Description |. One key (or key combo) per row. Descriptions are concise and end with a period. (Prettier aligns the pipes — don't hand-pad.)
  • Key formatting. Each key token in backticks. Arrow keys are ArrowUp / ArrowDown / ArrowLeft / ArrowRight (no space, not "Arrow Up"). Join alternatives with / (e.g. Enter / Space); join chords with + (e.g. Shift + Tab). Use a Character keys row for typeahead. Function keys like F8 also go in backticks.
  • Ground every key in source — never invent. A key belongs in the table only if you can trace it to a real handler: a (keydown.*) host listener, useArrowNavigation/composite roving navigation, a native <button> trigger (Space/Enter activation counts), or a composed layer (dismissable-layer → Escape; focus-scope → Tab / Shift + Tab). If a primitive has no keyboard handling at all (purely pointer-driven, e.g. Toast), omit the section rather than fabricate one.
  • User-facing language. Describe behavior, not implementation — never name internal directives (RdxDismissableLayer, RdxEscapeKeyDown, "composite group") in the table.
  • Reference sections to copy: Dialog (packages/primitives/dialog/stories/dialog.docs.mdx) is the canonical full Accessibility section — native-first lead, standards-mapping table, Keyboard Interactions. Also: Tabs, Menu (rich nav + typeahead), Time/Date Field (segmented input), Switch / Toggle (minimal Space/Enter).
Standard-backed test names (canonical convention)

Tag the specs that verify an accessibility behavior so the test name cites the standard it backs — this makes the suite a self-documenting traceability matrix for the Accessibility-table rows.

  • Prefix the it(...) title with [APG <Pattern>] and/or [WCAG <x.y.z>], then the normal description: it('[APG Dialog][WCAG 4.1.2] links the trigger and popup with accessible ids and roles', …), it('[WCAG 2.1.2] lets Tab leave a non-modal focus scope', …). One bracket per standard, APG before WCAG, no lowercasing ([APG Dialog], not [apg]).
  • Tag only specs that map cleanly to a criterion — roles/labels, Escape/keyboard, focus trap/restore, axe. Don't tag plumbing tests (controlled state, outputs) just to decorate them.
  • In code, comment only deviations or non-trivial decisions with a standard reference + link (e.g. // APG keyboard convention: Tab leaves the composite; arrows move within it.) — don't sprinkle citations on obvious bindings. Reference: packages/primitives/dialog/__tests__/dialog.spec.ts.
TOC gotcha — real headings in demos

The docs "On this page" TOC is built by tocbot from h2, h3 in .sbdocs-content. Storybook's default toc.ignoreSelector is .docs-story *, which keeps headings rendered inside story previews out of the TOC. This repo sets it in apps/radix-storybook/.storybook/preview.ts as '#primary, .docs-story *' — keep .docs-story *. Dropping it makes demos that render real heading elements (e.g. Accordion's <h3 rdxAccordionHeader>) leak their text into the TOC. Prefer real semantic headings in demos where the ARIA pattern calls for them; rely on the ignore selector rather than downgrading to <div>.

Files to create/update

FilePurpose
stories/<name>-<variant>.tsOne per story component
stories/<name>.stories.tsCSF with imports + story exports
stories/<name>.docs.mdxDocs page following template above

Reference examples

  • Button: packages/primitives/button/ — simplest complete example
  • Menu: packages/primitives/menu/stories/ — multiple standalone files + full MDX
  • Checkbox: packages/primitives/checkbox/stories/ — form variants, multiple files

© radix-ng, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/storybook-story of radix-ng/primitives.

Open the folder on GitHubat commit eed2a31

Compare with similar skills

Storybook Story next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Storybook Story compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Storybook Story this skillradix-ng/primitives274—~3.7kAutomated safety check: PassMIT
Write StoriesEndava/BEEQ163—~968Automated safety check: PassApache-2.0
Lobe Designlobehub/lobe-ui2.2k—~2.2kAutomated safety check: PassMIT
Using Docs Kitlobehub/lobe-ui2.2k—~2.8kAutomated safety check: PassMIT
Run Umbraco UIumbraco/Umbraco.UI152—~1.2kAutomated safety check: PassMIT
Wonder BlocksKhan/wonder-blocks163—~3.2kAutomated safety check: PassMIT

Similar skills

  • Write Stories

    Endava/BEEQ

    Write Storybook stories and MDX docs for BEEQ web components.

    163 GitHub stars~968 tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Lobe Design

    lobehub/lobe-ui

    Build UI with the LobeHub design system — @lobehub/ui/base-ui, the controlled form at @lobehub/ui/base-ui/form, and the chat, mobile, dashboard, awesome, brand, mdx, and i18n namespaces, plus…

    2.2k GitHub stars~2.2k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Using Docs Kit

    lobehub/lobe-ui

    Set up and author a documentation site with @lobehub/docs-kit (the lobedocs CLI, React Router + Vite static docs used by ui.lobehub.com).

    2.2k GitHub stars~2.8k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Run Umbraco UI

    umbraco/Umbraco.UI

    Build, run, and drive the Umbraco.UI (UUI) web-component library via its Storybook.

    152 GitHub stars~1.2k tokensUpdated 2 days ago
    Frontend & DesignAuto-check passed
  • Wonder Blocks

    Khan/wonder-blocks

    Implements user interfaces using the Wonder Blocks (WB) design system — Khan Academy's React component library.

    163 GitHub stars~3.2k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Daleui

    DaleStudy/daleui

    Use the daleui React design system with semantic Panda CSS tokens and accessible components.

    119 GitHub stars~675 tokensUpdated 3 days ago
    Frontend & DesignAuto-check passed

More from radix-ng/primitives

  • Radix Ng

    radix-ng/primitives

    Build correct, accessible UI with @radix-ng/primitives — the signals-first, headless Angular primitive library.

    274 GitHub stars~2.2k tokensUpdated 12 days ago
    Auto-check passed
  • Radix Ng Examples

    radix-ng/primitives

    Index of every documented @radix-ng/primitives example. An agent skill from radix-ng/primitives.

    274 GitHub stars~2.1k tokensUpdated 12 days ago
    Auto-check passed
  • Project Knowledge

    radix-ng/primitives

    A skill your agent uses when you need information about this project's architecture, tech stack, coding patterns, data model, deployment setup, git workflow, or UX guidelines.

    274 GitHub starsUsed in 1 repo~833 tokens
    Auto-check passed
  • Testing

    radix-ng/primitives

    Test Radix NG primitives across every layer and pick the RIGHT one for a change: Vitest unit (zoneless), jest-axe a11y, Playwright browser regression (apps/visual-regression), SSR…

    274 GitHub stars~3.3k tokensUpdated 12 days ago
    Auto-check passed
  • Documentation Writing

    radix-ng/primitives

    Maintain project documentation in .claude/skills/project-knowledge/: audit, edit, check consistency, track status.

    274 GitHub stars~1.4k tokensUpdated 12 days ago
    Auto-check passed
  • Angular Developer

    radix-ng/primitives

    Angular framework reference for building this signals-first, headless directive library.

    274 GitHub stars~1.2k tokensUpdated 12 days ago
    Auto-check passed

Works with

Questions about Storybook Story

What does Storybook Story do?

Write or update Storybook stories and docs MDX for a Radix NG primitive following project conventions. Storybook Story is an agent skill from radix-ng/primitives. Write or update Storybook stories and docs MDX for a Radix NG primitive following project conventions.

When should I use Storybook Story?

Storybook Story fits situations like: : writing stories; adding a new story; Напиши доки для.

How do I install Storybook Story in Claude Code?

Run `npx skills add radix-ng/primitives --skill storybook-story -a claude-code`. Or copy the skill folder (.claude/skills/storybook-story in radix-ng/primitives) into .claude/skills/storybook-story in your project. Claude Code loads it when a task matches its description.

How do I install Storybook Story in Codex?

Run `npx skills add radix-ng/primitives --skill storybook-story -a codex`. Or copy the skill folder (.claude/skills/storybook-story in radix-ng/primitives) into .agents/skills/storybook-story in your project. Codex loads it when a task matches its description.

Can I use Storybook Story in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add radix-ng/primitives --skill storybook-story -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/storybook-story, .gemini/skills/storybook-story, .github/skills/storybook-story and .opencode/skills/storybook-story in your project.

What does Storybook Story need to run?

Going by SKILL.md and its folder, Storybook Story needs the command-line tools its instructions call (pnpm).

Does Storybook Story access the network?

SKILL.md names 1 domain. In commands or code: w3.org; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.

Is Storybook Story safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Storybook Story use?

Storybook Story is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Storybook Story use?

About 3.7k tokens (SKILL.md is roughly 15k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Storybook Story?

Skills that share tags, products or a category with Storybook Story: Write Stories (Endava/BEEQ, 163 stars), Lobe Design (lobehub/lobe-ui, 2.2k stars), Using Docs Kit (lobehub/lobe-ui, 2.2k stars) and Run Umbraco UI (umbraco/Umbraco.UI, 152 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Storybook Story?

radix-ng (a GitHub organization) maintains it in radix-ng/primitives, which has 274 GitHub stars. The repository holds 7 skills in this directory. The repository was last updated on September 28, 2026.

Source: radix-ng/primitives on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.