Agent skill

Wonder Blocks

by Khan in Khan/wonder-blocks

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

MITAuto-check passedFrontend & Design

Install Wonder Blocks

skills CLI
$ npx skills add Khan/wonder-blocks --skill wonder-blocks -a claude-code

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

GitHub CLI
$ gh skill install Khan/wonder-blocks wonder-blocks --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/Khan/wonder-blocks.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/wonder-blocks .claude/skills/wonder-blocks && 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
wonder-blocks
GitHub stars
163
Token cost
~3.2k tokens
SKILL.md length
1,069 words
Files
2 (incl. references)
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

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

  • The user asks you to build
  • SKILL.md covers Implementation workflow, Package quick-reference, Styling with aphrodite and Design tokens, plus 9 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Review UI components

What it does

Wonder Blocks is an agent skill from Khan/wonder-blocks. Implements user interfaces using the Wonder Blocks (WB) design system — Khan Academy's React component library. Use this skill whenever the user asks you to build, modify, or review UI components; wants to use or map WB tokens for colors/spacing/typography (including translating Figma designs to WB components and tokens); or asks how to do something "the Wonder Blocks way". If the user is building any kind of form, layout, modal, button, dropdown, or typography treatment in a WB-enabled codebase, this skill…

Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/forms.md`).

It sits in Frontend & Design, covering Design systems, Typography and React components. It works with Figma, TypeScript, React and Model Context Protocol. The repository describes itself as: React components for Wonder Blocks design system. The licence is MIT.

When your agent uses it

  • The user asks you to build
  • Review UI components
  • Map WB tokens for colors/spacing/typography (including translating Figma designs to WB components and tokens)
  • Asks how to do something the Wonder Blocks way

Example prompts

  • “the Wonder Blocks way”
  • “t explicitly say”
  • “Use the wonder-blocks skill to implement user interfaces using the Wonder Blocks (WB) design system — Khan Academy's React component library”
  • “/wonder-blocks”

What it can do on your machine

Read from SKILL.md and the folder at commit 04b6068. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

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

  • Network

    No URLs in SKILL.md.

    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

Wonder Blocks loads about 3.2k tokens when it runs, and up to ~6.5k if it reads all its reference files. Until then it costs about 173 tokens; SKILL.md has 1,069 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~173
When it runs · the whole SKILL.md, loaded when a task matches
~3.2k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~6.5k

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 Khan/wonder-blocks at commit 04b6068, republished under its MIT licence (© Khan). 1,069 words, ~3,230 tokens.

Download SKILL.mdSave it as .claude/skills/wonder-blocks/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
wonder-blocks
description
Implements user interfaces using the Wonder Blocks (WB) design system — Khan Academy's React component library. Use this skill whenever the user asks you to build, modify, or review UI components; wants to use or map WB tokens for colors/spacing/typography (including translating Figma designs to WB components and tokens); or asks how to do something "the Wonder Blocks way". If the user is building any kind of form, layout, modal, button, dropdown, or typography treatment in a WB-enabled codebase, this skill applies — even if they don't explicitly say "Wonder Blocks". Do NOT trigger for debugging TypeScript errors, writing tests, or fixing CI/lint issues in WB packages.

Wonder Blocks UI Implementation

Wonder Blocks is Khan Academy's React component library (@khanacademy/wonder-blocks-*). All components are TypeScript-friendly, use aphrodite for styling, and follow WAI-ARIA accessibility patterns.

Implementation workflow

If the Figma MCP or WB Storybook MCP is used, use each for its purpose:

  • Figma MCP — design specs and layout intent. Start here.
  • WB Storybook MCP — source of truth for component APIs. Never guess prop names or token paths.
  • This skill — foundations and general best practices for using the design system.

If the WB Storybook MCP is not available, refer to the type definitions for WB components to learn more about the API.

IMPORTANT: This skill is required even when similar patterns already exist in the codebase. Do not skip it because you found a nearby file to copy from.


Package quick-reference

PackageKey exports
wonder-blocks-coreView,addStyle
wonder-blocks-tokenssemanticColor, sizing, border, boxShadow, font, breakpoint
wonder-blocks-typographyBodyText, Heading
wonder-blocks-buttonButton, ActivityButton
wonder-blocks-linkLink
wonder-blocks-clickableClickable, ClickableBehavior
wonder-blocks-icon-buttonIconButton, ActivityIconButton, ConversationIconButton
wonder-blocks-iconIcon, PhosphorIcon
wonder-blocks-formTextField, TextArea, Checkbox, CheckboxGroup, Choice, RadioGroup
wonder-blocks-labeled-fieldLabeledField
wonder-blocks-dropdownSingleSelect, MultiSelect, ActionMenu, Combobox, OptionItem, ActionItem, SeparatorItem
wonder-blocks-modalModalLauncher, OnePaneDialog, FlexibleDialog, DrawerLauncher, DrawerDialog
wonder-blocks-accordionAccordion, AccordionSection
wonder-blocks-badgeBadge, StatusBadge, GemBadge, StreakBadge, DueBadge, NeutralBadge
wonder-blocks-bannerBanner
wonder-blocks-breadcrumbsBreadcrumbs, BreadcrumbsItem
wonder-blocks-cardCard
wonder-blocks-cellCompactCell, DetailCell
wonder-blocks-popoverPopover, PopoverContent, PopoverContentCore
wonder-blocks-progress-spinnerCircularSpinner
wonder-blocks-search-fieldSearchField
wonder-blocks-switchSwitch
wonder-blocks-tabsResponsiveTabs, ResponsiveNavigationTabs
wonder-blocks-toolbarToolbar
wonder-blocks-tooltipTooltip, TooltipContent
wonder-blocks-themingTheme providers
wonder-blocks-stylesGlobal style helpers like focusStyles

Styling with aphrodite

WB uses aphrodite for scoped CSS. Never use inline style objects for complex styles — define them with StyleSheet.create so they're type-safe and mergeable.

tsx
import {StyleSheet} from "aphrodite";
import {View} from "@khanacademy/wonder-blocks-core";
import {sizing, semanticColor} from "@khanacademy/wonder-blocks-tokens";

const MyComponent = () => (
    <View style={styles.container}>
        ...
    </View>
);

const styles = StyleSheet.create({
    container: {
        padding: sizing.size_160,
        backgroundColor: semanticColor.core.background.base.default,
    },
});
  • Apply multiple styles with an array: style={[styles.base, isActive && styles.active]}.

  • Avoid applying too many custom styles to a Wonder Blocks component. Layout related properties are okay like margin, but prefer using props for choosing supported variants.

  • If custom styling is necessary for a Wonder Blocks component, use the style or styles prop depending on the component. Prompt the user to reach out to the Wonder Blocks team if many styles need to be overridden. This may mean there is a limitation with the component.

tsx
import { StyleSheet } from "aphrodite";
import { sizing } from "@khanacademy/wonder-blocks-tokens";
import { BodyText } from "@khanacademy/wonder-blocks-typography";

const styles = StyleSheet.create({
    text: {
        margin: sizing.size_160,
    },
});

const Example = () => (
    <BodyText style={styles.text}>Hello world</BodyText>
);

Design tokens

Always reach for tokens rather than hardcoded values. The two main namespaces:

semanticColor — the right choice for most UI work. Tokens like semanticColor.core.background.base.default, semanticColor.core.foreground.neutral.strong, semanticColor.core.border.neutral.default, semanticColor.feedback.success.background. These automatically adapt to themes. Use these values with the appropriate CSS properties.

sizing — Use sizing tokens for spacing. These values use rem values so they scale with the font size. 1rem = 10px

border — Always use border tokens instead of hardcoded pixel values.

  • Radius: border.radius.radius_040, border.radius.radius_full, etc.
  • Width: border.width.thin, border.width.medium, border.width.thick
ts
// ✅ correct
border: `${border.width.thin} solid ${semanticColor.core.border.neutral.default}`,
borderRadius: border.radius.radius_040,

// ❌ avoid
border: `1px solid ${semanticColor.core.border.neutral.default}`,
borderRadius: 4,

boxShadow — boxShadow.low, boxShadow.mid, boxShadow.high.

font — Always use font tokens instead of hardcoded values for weight, size, and line-height.

  • Weight: font.body.weight.regular, font.body.weight.bold
  • Size: font.body.size.medium, font.heading.size.large, etc.
  • Line height: font.body.lineHeight.medium, etc.
ts
// ✅ correct
fontWeight: font.body.weight.bold,

// ❌ avoid
fontWeight: "700",
fontWeight: 700,

breakpoint — media query breakpoints for responsive layouts.

tsx
import {breakpoint} from "@khanacademy/wonder-blocks-tokens";
const styles = StyleSheet.create({
    [breakpoint.mediaQuery.sm]: {
        flexDirection: "column",
    },
});

Typography

Use Heading and BodyText components from @khanacademy/wonder-blocks-typography. Use the tag prop to make sure it is using the correct semantics. Heading defaults to h2 and BodyText defaults to p.

Use heading sizes to establish visual hierarchy — a page title should be visually larger than a section heading, which should be larger than a subsection heading. Match the size prop to the heading's place in the hierarchy, not just its semantic level. The tag prop can create an accessible heading hierarchy in order regardless of style.

tsx
import {Heading, BodyText} from "@khanacademy/wonder-blocks-typography";

// Page title — largest
<Heading size="large" tag="h1">Settings</Heading>
// Section heading — smaller than page title
<Heading size="medium" tag="h2">Account</Heading>
// Subsection — smaller still
<Heading size="small" tag="h3">Profile</Heading>
<BodyText>Description text</BodyText>
<BodyText size="small" tag="span">Inline note</BodyText>

Icons

WB uses Phosphor icons. Import icon assets from @phosphor-icons/core and use with the WB PhosphorIcon from @khanacademy/wonder-blocks-icon.

tsx
import {PhosphorIcon} from "@khanacademy/wonder-blocks-icon";
// Import specific icon assets from @phosphor-icons/core
import magnifyingGlassIcon from "@phosphor-icons/core/regular/magnifying-glass.svg";

<PhosphorIcon icon={magnifyingGlassIcon} size="medium" />

For custom svg icons or specific icon components from the @khanacademy/wonder-blocks-icon package like GemIcon or StreakIcon, use the Icon component.

tsx
import {Icon, GemIcon} from "@khanacademy/wonder-blocks-icon";
import ExampleIcon from "icon.svg";

<Icon size="medium"><GemIcon /></Icon>
<Icon size="medium"><ExampleIcon /></Icon>

Layout

Use View from @khanacademy/wonder-blocks-core instead of plain div for flex containers.

  • View renders display: flex; flex-direction: column by default.
  • Use the tag prop for semantic HTML: <View tag="main">, <View tag="section">, <View tag="nav">, <View tag="ul">, etc.
tsx
import {View} from "@khanacademy/wonder-blocks-core";

<View style={styles.container}>
  <View tag="header" style={styles.header}>...</View>
  <View tag="main">...</View>
</View>

For bordered content sections (summaries, form panels, info boxes), use Card from wonder-blocks-card instead of recreating the pattern with a custom View + border + padding styles.

tsx
import {Card} from "@khanacademy/wonder-blocks-card";

<Card>...</Card>
Show full SKILL.md (429 more words)Show less

Components

  • Use components from Wonder Blocks as much as possible and prefer them over native browser elements or custom components.
  • Avoid using these components:
    • Strut, Spring, MediaLayout
    • LabelXSmall, LabelSmall, LabelMedium, LabelLarge, HeadingXSmall, HeadingSmall, HeadingMedium, HeadingLarge, Body, BodySerif, BodySerifBlock, BodyMonospace, Tagline, Title, Caption, Footnote
    • LabeledTextField
  • When using Wonder Blocks components, prioritize using props rather than using custom styles to override behaviours. Custom styles for layout purposes such as margin, padding or gap are acceptable.
  • If there is something that the Wonder Blocks component does not currently support, pause and prompt the user to reach out to the #wonder-blocks team to let them know of this limitation. Do this instead of implementing a custom component by default.

Accessibility

  • Always pass aria-label to IconButton and any Clickable with non-text content.
  • Use WB LabeledField for form fields — they wire up htmlFor/id and aria-describedby automatically.
  • For overlays, ModalLauncher and DrawerLauncher handles focus trapping and restoration automatically.
  • The Wonder Blocks components will often implement aria attributes for accessible patterns. Only add aria attributes when the prop docs instructs you to.
  • Use the tag prop when needed to ensure correct semantics. Check the default and allowed tags for a component first.
  • For custom components, use the focusStyles.focus styles from @khanacademy/wonder-blocks-styles for :focus-visible styles.

Motion

  • For WB components that support animations, they should accept an animated prop so consumers can pass in the user's reduced motion preference.

Responsiveness

  • UI should scale based on screen width and zoom level. Use sizing tokens (rem-based) for spacing that should scale correctly with browser zoom.
  • Avoid fixed pixel widths on containers — prefer maxInlineSize, percentages, or flex-based sizing so content reflows at smaller screen widths.
  • The interface should not be horizontally scrollable. Use breakpoint.mediaQuery tokens to adapt layouts at smaller screen sizes (e.g., switching from row to column). Tables are an exception and may scroll horizontally when their content requires it.

Internationalization

  • Always use logical CSS properties in StyleSheet.create to support RTL languages. This is enforced by ESLint — using physical properties will cause lint errors.

    Physical (avoid)Logical (use)
    marginLeft / marginRightmarginInlineStart / marginInlineEnd
    paddingLeft / paddingRightpaddingInlineStart / paddingInlineEnd
    marginTop / marginBottommarginBlockStart / marginBlockEnd
    paddingTop / paddingBottompaddingBlockStart / paddingBlockEnd
    borderTop / borderBottomborderBlockStart / borderBlockEnd
    borderLeft / borderRightborderInlineStart / borderInlineEnd
    maxWidth / minWidthmaxInlineSize / minInlineSize
    maxHeight / minHeightmaxBlockSize / minBlockSize
    width / height (when directional)inlineSize / blockSize
  • Components with built-in labels should accept a labels prop so consumers can pass in translated strings.

Patterns

  • Forms and error validation: When implementing form elements (text inputs, textareas, checkboxes, radio groups, selects, or a submit action), read the reference file before writing any form code. Also reference this when creating new form field components: ./references/forms.md

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

Files

SKILL.md and 1 other file (references) in .agents/skills/wonder-blocks of Khan/wonder-blocks.

  • SKILL.md
  • references/forms.md

Open the folder on GitHubat commit 04b6068

Compare with similar skills

Wonder Blocks 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.

Wonder Blocks compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Wonder Blocks this skillKhan/wonder-blocks163—~3.2kAutomated safety check: PassMIT
Connect Component To Figmadequelabs/cauldron129—~2kAutomated safety check: PassMPL-2.0
DaleuiDaleStudy/daleui119—~675Automated safety check: PassMIT
Animated React Component LibrariesHainrixz/editor-pro-max2641 repos~5.7kAutomated safety check: PassCustom licence
Fast Typescript Checkinternet-development/www-sacred1.6k—~4.3kAutomated safety check: PassMIT
React Render Types CompositionHorusGoul/eslint-plugin-react-render-types111—~1.1kAutomated safety check: PassMIT

Similar skills

  • Connect Component To Figma

    dequelabs/cauldron

    Add a Figma Code Connect (.figma.tsx) file for a Cauldron React component.

    129 GitHub stars~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 2 days ago
    Frontend & DesignAuto-check passed
  • Animated React Component Libraries

    Hainrixz/editor-pro-max

    Helps choose and drop in animated React components from Magic UI and React Bits for landing pages, marketing sites and dashboards, instead of hand-coding animations.

    264 GitHub starsUsed in 1 repo~5.7k tokens
    Frontend & DesignAuto-check passed
  • Fast Typescript Check

    internet-development/www-sacred

    Keep www-sacred's TypeScript fast to type-check and fast to run.

    1.6k GitHub stars~4.3k tokensUpdated 2 days ago
    Frontend & DesignAuto-check passed
  • React Render Types Composition

    HorusGoul/eslint-plugin-react-render-types

    Composition patterns for building React components with @renders type annotations from eslint-plugin-react-render-types.

    111 GitHub stars~1.1k tokensUpdated 2 mo ago
    Frontend & DesignAuto-check passed
  • Figma Build

    awdr74100/figwright

    Build a Figma design from code or a description — the reverse of figma-codegen.

    995 GitHub stars~2k tokensUpdated today
    Frontend & DesignAuto-check passed

More from Khan/wonder-blocks

  • Storybook

    Khan/wonder-blocks

    Storybook best practices for Wonder Blocks component stories.

    163 GitHub stars~4.2k tokensUpdated yesterday
    Auto-check passed
  • Unit Tests

    Khan/wonder-blocks

    Jest + React Testing Library best practices for Wonder Blocks unit tests.

    163 GitHub stars~4.2k tokensUpdated yesterday
    Auto-check passed

Questions about Wonder Blocks

What does Wonder Blocks do?

Implements user interfaces using the Wonder Blocks (WB) design system — Khan Academy's React component library. Wonder Blocks is an agent skill from Khan/wonder-blocks. Implements user interfaces using the Wonder Blocks (WB) design system — Khan Academy's React component library.

When should I use Wonder Blocks?

Wonder Blocks fits situations like: the user asks you to build; review UI components; map WB tokens for colors/spacing/typography (including translating Figma designs to WB components and tokens); asks how to do something the Wonder Blocks way.

How do I install Wonder Blocks in Claude Code?

Run `npx skills add Khan/wonder-blocks --skill wonder-blocks -a claude-code`. Or copy the skill folder (.agents/skills/wonder-blocks in Khan/wonder-blocks) into .claude/skills/wonder-blocks in your project. Claude Code loads it when a task matches its description.

How do I install Wonder Blocks in Codex?

Run `npx skills add Khan/wonder-blocks --skill wonder-blocks -a codex`. Or copy the skill folder (.agents/skills/wonder-blocks in Khan/wonder-blocks) into .agents/skills/wonder-blocks in your project. Codex loads it when a task matches its description.

Can I use Wonder Blocks 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 Khan/wonder-blocks --skill wonder-blocks -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/wonder-blocks, .gemini/skills/wonder-blocks, .github/skills/wonder-blocks and .opencode/skills/wonder-blocks in your project.

What does Wonder Blocks need to run?

SKILL.md names no scripts, command-line tools or credentials: Wonder Blocks is instructions for the agent only.

Does Wonder Blocks access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Wonder Blocks 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 Wonder Blocks use?

Wonder Blocks 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 Wonder Blocks use?

About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3.3k tokens, read only when the agent opens those files.

What are the alternatives to Wonder Blocks?

Skills that share tags, products or a category with Wonder Blocks: Connect Component To Figma (dequelabs/cauldron, 129 stars), Daleui (DaleStudy/daleui, 119 stars), Animated React Component Libraries (Hainrixz/editor-pro-max, 264 stars) and Fast Typescript Check (internet-development/www-sacred, 1.6k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Wonder Blocks?

Khan (a GitHub organization) maintains it in Khan/wonder-blocks, which has 163 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on October 8, 2026.

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