Docs: Improve agentic setup docs#34648
Conversation
- Simplify to one workflow - Add advanced usage section for `--output` example Co-authored-by: Copilot <copilot@github.com>
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds 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. ChangesInstall prompt snippet
Agent-driven Storybook setup
CLI docs reference update
Install & homepage callouts
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
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.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
There was a problem hiding this comment.
🧹 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
📒 Files selected for processing (3)
docs/_snippets/prompt-install-storybook.mddocs/ai/setup.mdxdocs/api/cli-options.mdx
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 ...
There was a problem hiding this comment.
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
- 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>
* 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 ...
What I did
--outputexampleChecklist for Contributors
Testing
Manual testing
N/A - docs-only tweaks
Documentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsMake 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