Skip to content

Docs: Improve agentic setup docs#34648

Merged
kylegach merged 15 commits into
nextfrom
docs-updates
May 8, 2026
Merged

Docs: Improve agentic setup docs#34648
kylegach merged 15 commits into
nextfrom
docs-updates

Conversation

@kylegach
Copy link
Copy Markdown
Contributor

@kylegach kylegach commented Apr 28, 2026

What I did

  • Simplify to one workflow
  • Add advanced usage section for --output example

Checklist for Contributors

Testing

Manual testing

N/A - docs-only tweaks

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

Summary by CodeRabbit

  • Documentation
    • Streamlined agent-assisted Storybook setup flow with clearer steps: global styles guidance, capped story generation (up to 10 components), interaction-test guidance, Vitest verification, addon recommendations, and Advanced usage for exporting setup instructions; updated CLI cross-reference for agent prompt handling
  • New Features
    • Added reusable install prompt snippet and “Copy prompt” action on install/home pages that copies the Storybook init instruction and emits a PromptInstallCopy event

- Simplify to one workflow
- Add advanced usage section for `--output` example

Co-authored-by: Copilot <copilot@github.com>
@kylegach kylegach self-assigned this Apr 28, 2026
@kylegach kylegach requested a review from jonniebigodes as a code owner April 28, 2026 18:01
@kylegach kylegach added documentation ci:docs Run the CI jobs for documentation checks only. labels Apr 28, 2026
@kylegach kylegach requested a review from yannbf April 28, 2026 18:01
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 28, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a new Storybook install prompt snippet, consolidates agent-assisted Storybook setup docs into a single “Set up Storybook with an agent” flow (updated generated steps and advanced usage), updates a CLI docs link, and adds “Copy prompt” callouts on install/index pages with an analytics event.

Changes

Install prompt snippet

Layer / File(s) Summary
Content
docs/_snippets/prompt-install-storybook.md
Adds a renderer-annotated fenced shell snippet containing the exact instruction npx storybook@latest init for agents and copy actions.

Agent-driven Storybook setup

Layer / File(s) Summary
Intro / Flow
docs/ai/setup.mdx
Replaces prior agentic-setup explanation with a single “Set up Storybook with an agent” flow referencing prompt-install-storybook.md and the storybook ai setup command.
Generated instructions
docs/ai/setup.mdx
Consolidates generated-instructions into a list: analyze app patterns, configure preview (global styles/decorators/providers), support portals, mock side effects in preview, generate up to 10 ai-generated stories, move play-functions to interaction tests, verify with Vitest + type checks, and install useful addons.
Next steps / Advanced usage
docs/ai/setup.mdx
Updates next steps to remove only the ai-generated tag after review; preserves Advanced usage including exporting instructions via ai-setup-output.mdstorybook-setup.md.
Cleanup
docs/ai/setup.mdx
Removes the old “What the generated prompt covers” section and related telemetry/preview-snapshot callout and --disable-telemetry mention.

CLI docs reference update

Layer / File(s) Summary
Link / Reference
docs/api/cli-options.mdx
Updates the CLI docs link that agents reference from the old agentic “user-initiated-setup” to “advanced usage/customizing-setup-instructions”; no change to stdout vs --output behavior.

Install & homepage callouts

Layer / File(s) Summary
UI Callout
docs/get-started/install.mdx, docs/index.mdx
Adds a “Copy prompt” callout/action that copies the predefined install prompt (npx storybook@latest init) and emits the PromptInstallCopy analytics/event; includes success-state UI labels.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • storybookjs/storybook#34560 — Edits the same docs/ai/setup.mdx agentic-setup documentation; likely overlaps in content and structure changes.
  • storybookjs/storybook#33244 — Modifies docs/index.mdx and docs/get-started/install.mdx callouts/snippets; likely related to the new copy-prompt UI.
  • storybookjs/storybook#34345 — References and documents the storybook ai setup/init flow; potentially connected to the CLI/agent handoff described.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
docs/_snippets/prompt-install-storybook.md (1)

1-3: Consider making the install prompt more explicit.

Line 2 is clear but very broad; a slightly more specific instruction will produce more consistent agent behavior.

✍️ Suggested wording
-Add Storybook to this project and follow the instructions precisely
+Set up Storybook in this project by running `storybook init`, then run `storybook ai setup` and follow the generated instructions precisely.

Based on learnings: Write clear agent prompts with specific instructions.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/_snippets/prompt-install-storybook.md` around lines 1 - 3, The prompt
string "Add Storybook to this project and follow the instructions precisely" is
too vague—replace it with a specific, actionable install prompt that lists exact
steps and targets (e.g., install Storybook deps, run npx storybook init --type
<framework>, add a .storybook/main.(js|ts) config, create a basic
Button.stories.(tsx|jsx) in src/components, and run npm run storybook) so agents
consistently perform the install; update the snippet in
docs/_snippets/prompt-install-storybook.md to include the framework name,
commands to run, files to create, and the expected verification step (open
http://localhost:6006) for reproducibility.
docs/ai/setup.mdx (1)

27-27: Soften the absolute behavior claim for agent execution flow.

Line 27 reads deterministic (“first runs ...”). Consider wording it as typical behavior (or noting permission-dependent flow) to avoid over-promising across different agents/environments.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/ai/setup.mdx` at line 27, The sentence that asserts deterministic agent
behavior ("The agent first runs `storybook init`...") should be softened: change
phrasing to indicate typical or permission-dependent flow (e.g., "The agent
typically runs `storybook init`..." or "If permitted, the agent first runs
`storybook init`...") and add a brief clause that the subsequent `storybook ai
setup` prompt and automated changes occur only with user approval; update the
sentence containing `storybook init` / `storybook ai setup` to reflect this
conditional/typical behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@docs/_snippets/prompt-install-storybook.md`:
- Around line 1-3: The prompt string "Add Storybook to this project and follow
the instructions precisely" is too vague—replace it with a specific, actionable
install prompt that lists exact steps and targets (e.g., install Storybook deps,
run npx storybook init --type <framework>, add a .storybook/main.(js|ts) config,
create a basic Button.stories.(tsx|jsx) in src/components, and run npm run
storybook) so agents consistently perform the install; update the snippet in
docs/_snippets/prompt-install-storybook.md to include the framework name,
commands to run, files to create, and the expected verification step (open
http://localhost:6006) for reproducibility.

In `@docs/ai/setup.mdx`:
- Line 27: The sentence that asserts deterministic agent behavior ("The agent
first runs `storybook init`...") should be softened: change phrasing to indicate
typical or permission-dependent flow (e.g., "The agent typically runs `storybook
init`..." or "If permitted, the agent first runs `storybook init`...") and add a
brief clause that the subsequent `storybook ai setup` prompt and automated
changes occur only with user approval; update the sentence containing `storybook
init` / `storybook ai setup` to reflect this conditional/typical behavior.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d73225ca-dd36-4129-b380-cca6bf1710d0

📥 Commits

Reviewing files that changed from the base of the PR and between fbf3baa and 1fcf3fe.

📒 Files selected for processing (3)
  • docs/_snippets/prompt-install-storybook.md
  • docs/ai/setup.mdx
  • docs/api/cli-options.mdx

Base automatically changed from project/sb-agentic-setup to next April 30, 2026 10:22
kylegach and others added 6 commits April 30, 2026 15:28
Co-authored-by: Copilot <copilot@github.com>
* next: (94 commits)
  add addon-mcp to internal UI Storybook
  Bump version from "10.4.0-alpha.11" to "10.4.0-alpha.12" [skip ci]
  migrate render analysis to provide pattern
  Write changelog for 10.4.0-alpha.12 [skip ci]
  fix types
  fix minor bug
  account for review feedback
  fix test
  Apply suggestion from @coderabbitai[bot]
  Docs: Improve `fn` details for Actions
  Account for PR feedback
  Avoid mutating env in tests
  fix tests
  do not show onboarding when AI is selected
  Update CHANGELOG.md for v10.3.6 [skip ci]
  share constant for `.rnstorybook`
  Bump version from "10.4.0-alpha.10" to "10.4.0-alpha.11" [skip ci]
  provide config in watch mode too
  Fix inconsistencies in eval README
  Write changelog for 10.4.0-alpha.11 [skip ci]
  ...
- Can only provide callback props from within a client component, and our MDX is always server-rendered
Co-authored-by: Copilot <copilot@github.com>
* next: (77 commits)
  Fix up logic for showing agent-only docs page
  Tests: Add tests for changes to finalization docs output
  Agentic Setup: Show Discord and human docs only to humans
  Tidy up unneeded test mocks
  Agentic Setup: Remove redundant ai-setup-evidence event
  Refactor tests for React Native entrypoint generation to enhance inline snapshots
  Update tests for React Native entrypoint generation to use inline snapshots
  Update default prompt
  Fix project name
  Agentic Setup: Update project list in tests
  Refactor React Native entrypoint templates to improve AsyncStorage integration
  Add setup instructions for local monorepo deps
  Fix coverage type
  Fix coverage type
  fix CI issues
  Update code/core/src/common/js-package-manager/BUNProxy.ts
  fix issues
  Implement cumulative self-healing scoring and history caching for story test results
  fix internal coverage types
  Enhance React Native entrypoint generation with Expo support
  ...
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/ai/setup.mdx`:
- Around line 23-25: Replace the ambiguous phrase "run this prompt" with
explicit instructions such as "copy/paste this prompt into your agent" in the
docs/ai/setup.mdx paragraph that contains the CodeSnippets reference;
specifically update the sentence that currently reads "To set up Storybook in
your project using an agent, run this prompt:" to something like "To set up
Storybook in your project using an agent, copy/paste the following prompt into
your agent:" so readers won't mistake it for a shell command (the sentence near
the <CodeSnippets path="prompt-install-storybook.md" /> tag is the target).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 14f6ae2c-5119-4db4-bfc1-7a2866983959

📥 Commits

Reviewing files that changed from the base of the PR and between b70c360 and 2a5f7b8.

📒 Files selected for processing (1)
  • docs/ai/setup.mdx

Comment thread docs/ai/setup.mdx Outdated
Comment thread docs/ai/setup.mdx Outdated
Comment thread docs/ai/setup.mdx Outdated
Comment thread docs/ai/setup.mdx Outdated
Comment thread docs/ai/setup.mdx Outdated
Comment thread docs/ai/setup.mdx Outdated
Comment thread docs/ai/setup.mdx
kylegach and others added 5 commits May 5, 2026 10:39
- Re-order sidebar to match narrative flow
- Add agentic setup to AI intro page
- Tweak install prompt callouts
- Handle multi-line Callouts
* next: (227 commits)
  Revert "fix run oxfmt after generating source files"
  fix run oxfmt after generating source files
  try catch git init in sandboxes
  Cleanup
  fix: init git for change detection on every dev task run
  Apply review feedback for change detection
  Refactor metroConfig tests to use 'oxfmt' for formatting and update inline snapshots to use single quotes for consistency.
  Enhance metroConfig tests by adding formatted diff comparison for code changes and updating test cases to use async/await for improved readability.
  Move common logic into a shared util
  only do cumulative results in self healing loop
  Refactor tests to normalize path comparisons in React Native entrypoint tests and update regex for prompt loading test
  fix issues
  fix type issues
  bring back fire and forget logic
  Bump version from "10.4.0-alpha.15" to "10.4.0-alpha.16" [skip ci]
  Update tests
  Rework to include instructions in the cleanup step
  Simplify code a little bit
  Only show Clear filters button if there are active filters
  Dedupe lock file
  ...
Co-authored-by: Steve Dodier-Lazaro <Sidnioulz@users.noreply.github.com>
Comment thread docs/ai/index.mdx Outdated
kylegach added 2 commits May 8, 2026 10:22
* next: (108 commits)
  Cli: set ai prompt to yes if yes flag for react-vite to tanstack migration
  Update React Native entry point tests to use dynamic app name and include LiteUI component
  Add '@storybook/react-native-ui-lite' to React Native generator and template
  Update code/lib/create-storybook/templates/react-native/index.js
  Update AppRegistry component name in React Native template
  Remove extensive prompt option and related references from ai setup
  Fix: keep original onAllStatusChange timing behavior
  Update tests
  Remove duplicate index/refs update in onAllStatusChange handler
  Address CodeRabbit review feedback
  fix(manager-api): await recompute filter calls to refresh story list
  Ensure runId for ai-setup events is always at the root
  docs: add link
  chore: move tinyclip to devdeps
  Rework run deduplication logic for final telemetry
  Tanstack: optimize react-store
  Docs tweaks
  feat: always log the prompt
  Update JSDoc
  Fix ai checklist util mocks
  ...
@kylegach kylegach merged commit c79db75 into next May 8, 2026
14 checks passed
@kylegach kylegach deleted the docs-updates branch May 8, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:docs Run the CI jobs for documentation checks only. documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants