Skip to content

[Experiment] Storybook-to-Markdown Skill Convertor for Wonder Blocks#2967

Open
jeresig wants to merge 2 commits intomainfrom
md-skill-experiment
Open

[Experiment] Storybook-to-Markdown Skill Convertor for Wonder Blocks#2967
jeresig wants to merge 2 commits intomainfrom
md-skill-experiment

Conversation

@jeresig
Copy link
Copy Markdown
Member

@jeresig jeresig commented Feb 19, 2026

Summary:

This is an experiment to see if we can convert all of our storybook files to passable markdown so that it can then be accessed by a skill (that is then baked into this repo so that folks can install it by running: npx skills @khan/wonder-blocks).

This change was 99.9% created by Claude Code using Opus 4.6, my only change was adding in the .gitattributes bit to mark the output as generated files.

I used these prompts to produce this output:

  • Create a Node script that is able to convert our existing Storybook documentation into a series of well-formatted Markdown files. It doesn't have to preserve functionality but it should preserve content (e.g. the code of the examples should still exist).
  • Looking at a file like @docs/dropdown/listbox.md I see output like: { children: items, } for when there isn't a render function. It should instead use the default component (Listbox in this case) and display this as {items}. Additionally, there are examples where there is use of {...args} (shold be removed) and Storybook specific methods like action(...) (should be removed). Any other args should be added into the code examples, for example:
  • Update docs-to-markdown.mjs so that it outputs the files to skills/wonder-blocks/docs/ and have it generate a skills/wonder-blocks/SKILL.md file following this specification: https://agentskills.io/specification.md It should provide a short description of how these files should be used and links to each of the component overview files. The component overviews should also be updated to include links to all of their related sub-files. Files should be generous in linking to related markdown files.
  • Add a Github workflow that runs @scripts/docs-to-markdown.mjs and commits the results to the repo (making sure that any renamed or deleted files are handled correctly).

Now, is this perfect? Definitely not. I have some ideas on how we could improve the code output (making a linter to require all variables to be inline inside all Storybook examples, and then have Claude tackle that work). But I'm wondering if this might be "good enough" for folks to get experimenting?

I also added in a Github workflow so that the files will get regenerated whenever they land on main. I'm open to other suggestions here!

Issue: FEI-XXXX

Test plan:

A cool side effect of this is that you can now browse the docs using tools like Obsidian!

Screenshot 2026-02-19 at 4 06 37 PM

Screenshot 2026-02-19 at 4 06 56 PM

@jeresig jeresig self-assigned this Feb 19, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 19, 2026

🦋 Changeset detected

Latest commit: 49d1b04

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@khan-actions-bot khan-actions-bot requested a review from a team February 19, 2026 21:09
@khan-actions-bot
Copy link
Copy Markdown
Contributor

khan-actions-bot commented Feb 19, 2026

Gerald

Required Reviewers
  • @Khan/wonder-blocks for changes to .gitattributes, .changeset/twelve-terms-leave.md, scripts/docs-to-markdown.mjs, .github/workflows/generate-docs.yml, skills/wonder-blocks/SKILL.md, skills/wonder-blocks/docs/gallery.md, skills/wonder-blocks/docs/get-started.md, skills/wonder-blocks/docs/overview.md, skills/wonder-blocks/docs/using-color.md, skills/wonder-blocks/docs/accordion/accessibility.md, skills/wonder-blocks/docs/accordion/accordion-section.md, skills/wonder-blocks/docs/accordion/accordion.md, skills/wonder-blocks/docs/badge/badge.md, skills/wonder-blocks/docs/badge/due-badge.md, skills/wonder-blocks/docs/badge/gem-badge.md, skills/wonder-blocks/docs/badge/neutral-badge.md, skills/wonder-blocks/docs/badge/overview.md, skills/wonder-blocks/docs/badge/status-badge.md, skills/wonder-blocks/docs/badge/streak-badge.md, skills/wonder-blocks/docs/breadcrumbs/accessibility.md, skills/wonder-blocks/docs/button/accessibility.md, skills/wonder-blocks/docs/button/activity-button.md, skills/wonder-blocks/docs/button/best-practices.md, skills/wonder-blocks/docs/button/button.md, skills/wonder-blocks/docs/button/navigation-callbacks.md, skills/wonder-blocks/docs/button/overview.md, skills/wonder-blocks/docs/card/accessibility.md, skills/wonder-blocks/docs/cell/compact-cell.md, skills/wonder-blocks/docs/cell/detail-cell.md, skills/wonder-blocks/docs/clickable/clickable-accessibility.md, skills/wonder-blocks/docs/clickable/clickable-behavior.md, skills/wonder-blocks/docs/clickable/clickable.md, skills/wonder-blocks/docs/core/add-style.md, skills/wonder-blocks/docs/core/exports-use-force-update.md, skills/wonder-blocks/docs/core/exports-use-is-mounted.md, skills/wonder-blocks/docs/core/exports-use-latest-ref.md, skills/wonder-blocks/docs/core/exports-use-on-mount-effect.md, skills/wonder-blocks/docs/core/exports-use-online.md, skills/wonder-blocks/docs/core/exports-use-pre-hydration-effect.md, skills/wonder-blocks/docs/core/exports-use-render-state.md, skills/wonder-blocks/docs/core/id.md, skills/wonder-blocks/docs/core/initial-fallback.md, skills/wonder-blocks/docs/core/overview.md, skills/wonder-blocks/docs/core/server.md, skills/wonder-blocks/docs/core/view.md, skills/wonder-blocks/docs/data/exports-abort-inflight-requests.md, skills/wonder-blocks/docs/data/exports-data-error.md, skills/wonder-blocks/docs/data/exports-data-errors.md, skills/wonder-blocks/docs/data/exports-data.md, skills/wonder-blocks/docs/data/exports-fetch-tracked-requests.md, skills/wonder-blocks/docs/data/exports-get-gql-request-id.md, skills/wonder-blocks/docs/data/exports-gql-error.md, skills/wonder-blocks/docs/data/exports-gql-errors.md, skills/wonder-blocks/docs/data/exports-gql-router.md, skills/wonder-blocks/docs/data/exports-has-tracked-requests-to-be-fetched.md, skills/wonder-blocks/docs/data/exports-initialize-hydration-cache.md, skills/wonder-blocks/docs/data/exports-intercept-requests.md, skills/wonder-blocks/docs/data/exports-purge-caches.md, skills/wonder-blocks/docs/data/exports-purge-hydration-cache.md, skills/wonder-blocks/docs/data/exports-scoped-in-memory-cache.md, skills/wonder-blocks/docs/data/exports-serializable-in-memory-cache.md, skills/wonder-blocks/docs/data/exports-shared-cache.md, skills/wonder-blocks/docs/data/exports-status.md, skills/wonder-blocks/docs/data/exports-track-data.md, skills/wonder-blocks/docs/data/exports-use-cached-effect.md, skills/wonder-blocks/docs/data/exports-use-gql.md, skills/wonder-blocks/docs/data/exports-use-hydratable-effect.md, skills/wonder-blocks/docs/data/exports-use-server-effect.md, skills/wonder-blocks/docs/data/exports-use-shared-cache.md, skills/wonder-blocks/docs/data/exports-when-client-side.md, skills/wonder-blocks/docs/data/graph-ql.md, skills/wonder-blocks/docs/data/overview.md, skills/wonder-blocks/docs/data/server-side-rendering-and-hydration.md, skills/wonder-blocks/docs/data/testing.md, skills/wonder-blocks/docs/data/types-cached-response.md, skills/wonder-blocks/docs/data/types-error-options.md, skills/wonder-blocks/docs/data/types-fetch-policy.md, skills/wonder-blocks/docs/data/types-gql-context.md, skills/wonder-blocks/docs/data/types-gql-fetch-fn.md, skills/wonder-blocks/docs/data/types-gql-fetch-options.md, skills/wonder-blocks/docs/data/types-gql-operation-type.md, skills/wonder-blocks/docs/data/types-gql-operation.md, skills/wonder-blocks/docs/data/types-raw-scoped-cache.md, skills/wonder-blocks/docs/data/types-response-cache.md, skills/wonder-blocks/docs/data/types-result.md, skills/wonder-blocks/docs/data/types-scoped-cache.md, skills/wonder-blocks/docs/data/types-valid-cache-data.md, skills/wonder-blocks/docs/date-picker/overview.md, skills/wonder-blocks/docs/date-picker/temporal-api-guide.md, skills/wonder-blocks/docs/dropdown/action-item.md, skills/wonder-blocks/docs/dropdown/action-menu-accessibility.md, skills/wonder-blocks/docs/dropdown/action-menu.md, skills/wonder-blocks/docs/dropdown/combobox-accessibility.md, skills/wonder-blocks/docs/dropdown/combobox.md, skills/wonder-blocks/docs/dropdown/listbox.md, skills/wonder-blocks/docs/dropdown/multi-select-accessibility.md, skills/wonder-blocks/docs/dropdown/multi-select.md, skills/wonder-blocks/docs/dropdown/option-item.md, skills/wonder-blocks/docs/dropdown/overview.md, skills/wonder-blocks/docs/dropdown/single-select-accessibility.md, skills/wonder-blocks/docs/dropdown/single-select.md, skills/wonder-blocks/docs/form/checkbox-accessibility.md, skills/wonder-blocks/docs/form/checkbox-group.md, skills/wonder-blocks/docs/form/checkbox.md, skills/wonder-blocks/docs/form/choice.md, skills/wonder-blocks/docs/form/labeled-text-field-deprecated.md, skills/wonder-blocks/docs/form/overview.md, skills/wonder-blocks/docs/form/radio-group.md, skills/wonder-blocks/docs/form/radio-internal.md, skills/wonder-blocks/docs/form/text-area-accessibility.md, skills/wonder-blocks/docs/form/text-area.md, skills/wonder-blocks/docs/form/text-field.md, skills/wonder-blocks/docs/icon-button/activity-icon-button.md, skills/wonder-blocks/docs/icon-button/conversation-icon-button.md, skills/wonder-blocks/docs/icon-button/icon-button.md, skills/wonder-blocks/docs/icon-button/node-icon-button.md, skills/wonder-blocks/docs/icon-button/overview.md, skills/wonder-blocks/docs/labeled-field/accessibility.md, skills/wonder-blocks/docs/layout/media-layout-deprecated.md, skills/wonder-blocks/docs/layout/spring.md, skills/wonder-blocks/docs/layout/strut.md, skills/wonder-blocks/docs/modal/building-blocks-modal-dialog.md, skills/wonder-blocks/docs/modal/building-blocks-modal-footer.md, skills/wonder-blocks/docs/modal/building-blocks-modal-header.md, skills/wonder-blocks/docs/modal/building-blocks-modal-panel.md, skills/wonder-blocks/docs/modal/drawer-launcher-drawer-launcher.md, skills/wonder-blocks/docs/modal/flexible-dialog.md, skills/wonder-blocks/docs/modal/modal-launcher.md, skills/wonder-blocks/docs/modal/one-pane-dialog.md, skills/wonder-blocks/docs/modal/overview.md, skills/wonder-blocks/docs/popover/popover-accessibility.md, skills/wonder-blocks/docs/popover/popover-content-core.md, skills/wonder-blocks/docs/popover/popover-content.md, skills/wonder-blocks/docs/popover/popover.md, skills/wonder-blocks/docs/progress-spinner/circular-spinner.md, skills/wonder-blocks/docs/styles/action-styles-action-styles-all-variants.md, skills/wonder-blocks/docs/styles/action-styles.md, skills/wonder-blocks/docs/styles/focus-styles.md, skills/wonder-blocks/docs/styles/overview.md, skills/wonder-blocks/docs/switch/best-practices.md, skills/wonder-blocks/docs/tabs/overview.md, skills/wonder-blocks/docs/tabs/responsive-navigation-tabs-navigation-tabs-accessibility.md, skills/wonder-blocks/docs/tabs/responsive-navigation-tabs-navigation-tabs-dropdown.md, skills/wonder-blocks/docs/tabs/responsive-navigation-tabs-navigation-tabs-navigation-tab-item.md, skills/wonder-blocks/docs/tabs/responsive-navigation-tabs-navigation-tabs.md, skills/wonder-blocks/docs/tabs/responsive-navigation-tabs.md, skills/wonder-blocks/docs/tabs/responsive-tabs-tabs-accessibility.md, skills/wonder-blocks/docs/tabs/responsive-tabs-tabs-dropdown-accessibility.md, skills/wonder-blocks/docs/tabs/responsive-tabs-tabs-dropdown.md, skills/wonder-blocks/docs/tabs/responsive-tabs-tabs.md, skills/wonder-blocks/docs/tabs/responsive-tabs.md, skills/wonder-blocks/docs/testing/mocking-exports-mock-fetch.md, skills/wonder-blocks/docs/testing/mocking-exports-mock-gql-fetch.md, skills/wonder-blocks/docs/testing/mocking-exports-respond-with.md, skills/wonder-blocks/docs/testing/mocking-exports-settle-controller.md, skills/wonder-blocks/docs/testing/mocking-overview.md, skills/wonder-blocks/docs/testing/mocking-types-fetch-mock-fn.md, skills/wonder-blocks/docs/testing/mocking-types-fetch-mock-operation.md, skills/wonder-blocks/docs/testing/mocking-types-gql-fetch-mock-fn.md, skills/wonder-blocks/docs/testing/mocking-types-gql-mock-operation.md, skills/wonder-blocks/docs/testing/mocking-types-mock-response.md, skills/wonder-blocks/docs/testing/overview.md, skills/wonder-blocks/docs/testing/test-harness-exports-harness-adapters.md, skills/wonder-blocks/docs/testing/test-harness-exports-hook-harness.md, skills/wonder-blocks/docs/testing/test-harness-exports-make-hook-harness.md, skills/wonder-blocks/docs/testing/test-harness-exports-make-test-harness.md, skills/wonder-blocks/docs/testing/test-harness-exports-test-harness.md, skills/wonder-blocks/docs/testing/test-harness-overview.md, skills/wonder-blocks/docs/testing/test-harness-types-test-harness-adapter.md, skills/wonder-blocks/docs/testing/test-harness-types-test-harness-adapters.md, skills/wonder-blocks/docs/testing/test-harness-types-test-harness-config.md, skills/wonder-blocks/docs/testing/test-harness-types-test-harness-configs.md, skills/wonder-blocks/docs/testing/utilities-exports-render-hook-static.md, skills/wonder-blocks/docs/testing/utilities-overview.md, skills/wonder-blocks/docs/theming/merge-theme.md, skills/wonder-blocks/docs/theming/overview.md, skills/wonder-blocks/docs/theming/theme-switcher.md, skills/wonder-blocks/docs/timing/overview.md, skills/wonder-blocks/docs/timing/types-ischedule-actions.md, skills/wonder-blocks/docs/timing/use-interval.md, skills/wonder-blocks/docs/timing/use-timeout.md, skills/wonder-blocks/docs/timing/with-action-scheduler-migration-from-standard-api.md, skills/wonder-blocks/docs/timing/with-action-scheduler.md, skills/wonder-blocks/docs/tokens/border.md, skills/wonder-blocks/docs/tokens/box-shadow.md, skills/wonder-blocks/docs/tokens/deprecated-color-deprecated.md, skills/wonder-blocks/docs/tokens/deprecated-deprecated-semantic-colors.md, skills/wonder-blocks/docs/tokens/deprecated-spacing-deprecated.md, skills/wonder-blocks/docs/tokens/media-query-breakpoints.md, skills/wonder-blocks/docs/tokens/overview.md, skills/wonder-blocks/docs/tokens/semantic-color.md, skills/wonder-blocks/docs/tokens/semantic-colors-groups.md, skills/wonder-blocks/docs/tokens/sizing.md, skills/wonder-blocks/docs/tokens/typography.md, skills/wonder-blocks/docs/tokens/utilities-fade.md, skills/wonder-blocks/docs/tokens/utilities-mix.md, skills/wonder-blocks/docs/tooltip/tooltip-content.md, skills/wonder-blocks/docs/tooltip/tooltip.md, skills/wonder-blocks/docs/typography/accessibility.md, skills/wonder-blocks/docs/typography/body-monospace.md, skills/wonder-blocks/docs/typography/body-serif-block.md, skills/wonder-blocks/docs/typography/body-serif.md, skills/wonder-blocks/docs/typography/body-text-new.md, skills/wonder-blocks/docs/typography/body.md, skills/wonder-blocks/docs/typography/caption.md, skills/wonder-blocks/docs/typography/footnote.md, skills/wonder-blocks/docs/typography/heading-large.md, skills/wonder-blocks/docs/typography/heading-medium.md, skills/wonder-blocks/docs/typography/heading-new.md, skills/wonder-blocks/docs/typography/heading-small.md, skills/wonder-blocks/docs/typography/heading-xsmall.md, skills/wonder-blocks/docs/typography/label-large.md, skills/wonder-blocks/docs/typography/label-medium.md, skills/wonder-blocks/docs/typography/label-small.md, skills/wonder-blocks/docs/typography/label-xsmall.md, skills/wonder-blocks/docs/typography/tagline.md, skills/wonder-blocks/docs/typography/title.md

Don't want to be involved in this pull request? Comment #removeme and we won't notify you of further changes.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 19, 2026

npm Snapshot: Published

🎉 Good news!! We've packaged up the latest commit from this PR (a8ea49b) and published all packages with changesets to npm.

You can install the packages in frontend by running:

./dev/tools/deploy_wonder_blocks.js --tag="PR2967"

Packages can also be installed manually by running:

pnpm add @khanacademy/wonder-blocks-<package-name>@PR2967

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 19, 2026

Size Change: 0 B

Total Size: 118 kB

ℹ️ View Unchanged
Filename Size
packages/wonder-blocks-accordion/dist/es/index.js 3 kB
packages/wonder-blocks-announcer/dist/es/index.js 1.74 kB
packages/wonder-blocks-badge/dist/es/index.js 2.02 kB
packages/wonder-blocks-banner/dist/es/index.js 2.01 kB
packages/wonder-blocks-birthday-picker/dist/es/index.js 1.91 kB
packages/wonder-blocks-breadcrumbs/dist/es/index.js 755 B
packages/wonder-blocks-button/dist/es/index.js 4.26 kB
packages/wonder-blocks-card/dist/es/index.js 1.08 kB
packages/wonder-blocks-cell/dist/es/index.js 2.18 kB
packages/wonder-blocks-clickable/dist/es/index.js 2.6 kB
packages/wonder-blocks-core/dist/es/index.js 2.59 kB
packages/wonder-blocks-data/dist/es/index.js 5.48 kB
packages/wonder-blocks-date-picker/dist/es/index.js 6.38 kB
packages/wonder-blocks-dropdown/dist/es/index.js 19.7 kB
packages/wonder-blocks-form/dist/es/index.js 6.3 kB
packages/wonder-blocks-grid/dist/es/index.js 1.24 kB
packages/wonder-blocks-icon-button/dist/es/index.js 4 kB
packages/wonder-blocks-icon/dist/es/index.js 1.91 kB
packages/wonder-blocks-labeled-field/dist/es/index.js 3.47 kB
packages/wonder-blocks-layout/dist/es/index.js 1.63 kB
packages/wonder-blocks-link/dist/es/index.js 1.53 kB
packages/wonder-blocks-modal/dist/es/index.js 7.21 kB
packages/wonder-blocks-pill/dist/es/index.js 1.31 kB
packages/wonder-blocks-popover/dist/es/index.js 4.32 kB
packages/wonder-blocks-progress-spinner/dist/es/index.js 1.48 kB
packages/wonder-blocks-search-field/dist/es/index.js 1.1 kB
packages/wonder-blocks-styles/dist/es/index.js 464 B
packages/wonder-blocks-switch/dist/es/index.js 1.55 kB
packages/wonder-blocks-tabs/dist/es/index.js 5.57 kB
packages/wonder-blocks-testing-core/dist/es/index.js 3.25 kB
packages/wonder-blocks-testing/dist/es/index.js 978 B
packages/wonder-blocks-theming/dist/es/index.js 384 B
packages/wonder-blocks-timing/dist/es/index.js 1.37 kB
packages/wonder-blocks-tokens/dist/es/index.js 4.95 kB
packages/wonder-blocks-toolbar/dist/es/index.js 906 B
packages/wonder-blocks-tooltip/dist/es/index.js 6.02 kB
packages/wonder-blocks-typography/dist/es/index.js 1.57 kB

compressed-size-action

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 19, 2026

A new build was pushed to Chromatic! 🚀

https://5e1bf4b385e3fb0020b7073c-cftoxhanbs.chromatic.com/

Chromatic results:

Metric Total
Captured snapshots 0
Tests with visual changes 0
Total stories 830
Inherited (not captured) snapshots [TurboSnap] 480
Tests on the build 480

@@ -0,0 +1,1956 @@
#!/usr/bin/env node
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the new script - I have not reviewed this at all.

Copy link
Copy Markdown
Member

@jandrade jandrade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks promising, and definitively worth experimenting. I left some initial comments to exclude some pages before giving final approval.

I'm going to be creating a PR to improve a bit the documentation around deprecated components that I'd like to land before this PR gets merged so we don't generate unwanted MD files.

Thanks for working on this!

const storyFiles = await fg("__docs__/**/*.stories.tsx", {
cwd: ROOT,
ignore: [
"__docs__/**/*-testing-snapshots.stories.tsx",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: We should also ignore playtesting stories. We use them just to do some internal manual testing (and some interactive testing). For example: https://github.com/Khan/wonder-blocks/blob/main/__docs__/wonder-blocks-tabs/tabs-testing-playtesting.stories.tsx

cwd: ROOT,
ignore: [
"__docs__/**/*-testing-snapshots.stories.tsx",
"__docs__/components/**",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: We should also ignore any files that include the deprecated word. For example: tokens/deprecated-color...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also going to be experimenting with some visual badges (which uses Storybook tags) to be able to filter out deprecated components.

https://storybook.js.org/blog/storybook-tags/

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason, the tool skipped creating the Switch Docs page.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really cool! 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants