Skip to content

CLI: Remove extensive prompt option #34740

Merged
yannbf merged 1 commit into
nextfrom
yann/undo-extensive-flag
May 7, 2026
Merged

CLI: Remove extensive prompt option #34740
yannbf merged 1 commit into
nextfrom
yann/undo-extensive-flag

Conversation

@yannbf
Copy link
Copy Markdown
Member

@yannbf yannbf commented May 7, 2026

Closes #

What I did

Removal of the --extensive CLI option

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

Caution

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

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.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

New Features

  • Added --disable-telemetry flag to storybook ai setup command, enabling users to opt out of diagnostic data collection.

Refactor

  • Removed the --extensive flag from storybook ai setup. The command now uses a single, optimized prompt variant by default, simplifying the AI setup experience.

@yannbf yannbf self-assigned this May 7, 2026
@yannbf yannbf added cli ci:normal maintenance User-facing maintenance tasks labels May 7, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

The PR removes the --extensive flag from the storybook ai setup CLI command, eliminating conditional prompt branching and consolidating to a single default flow using refactored prompt registries.

Changes

Remove --extensive flag from ai setup

Layer / File(s) Summary
Types & Prompt Registry
code/lib/cli-storybook/src/ai/types.ts, code/lib/cli-storybook/src/ai/setup-prompts/index.ts
AiSetupOptions removes extensive?: boolean and adds disableTelemetry?: boolean. Prompt registry split into DEFAULT_PROMPT_NAME (optimized-tests), CURRENTLY_USED_PROMPT with current variants, and FORMERLY_USED_PROMPTS for legacy variants.
Prompt Selection Logic
code/lib/cli-storybook/src/ai/setup-prompts/index.ts
New resolvePromptName() validates env-selected prompts; getAiSetupPrompt() and getAiSetupMarkdownOutput() simplified to single-argument functions using current/formerly-used registries.
CLI Integration
code/lib/cli-storybook/src/bin/run.ts, code/lib/cli-storybook/src/ai/index.ts
Remove --extensive flag from setup subcommand. aiSetup() stops destructuring extensive and calls getAiSetupMarkdownOutput() with only projectInfo.
Documentation
code/lib/cli-storybook/src/ai/setup-prompts/pattern-copy-play.ts
Update header comment to describe pattern-copy-play as the shipping default produced on every ai setup run without EVAL_SETUP_PROMPT set.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • storybookjs/storybook#34651: Introduces and standardizes the optimized-tests prompt, foundational for this PR's registry refactor.
  • storybookjs/storybook#34673: Touches the same AI setup prompt codepaths (ai/index.ts, setup-prompts/index.ts, types.ts) with related prompt selection changes.
  • storybookjs/storybook#34297: Modifies the same ai CLI modules; this PR builds on that PR's new current/former prompt registry structure.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Microsoft Presidio Analyzer (2.2.362)
code/lib/cli-storybook/src/ai/index.ts

Microsoft Presidio Analyzer failed to scan this file


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.

Actionable comments posted: 2

🤖 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 `@code/lib/cli-storybook/src/ai/setup-prompts/index.ts`:
- Around line 25-28: The FORMERLY_USED_PROMPTS registry currently includes an
entry ('optimized-tests') that is active, causing duplicate prompt names; remove
the 'optimized-tests' entry from FORMERLY_USED_PROMPTS and ensure the
formerly-used registry is populated only with prompts that are not present in
the active registry (e.g., compare against the active/current prompts registry
such as CURRENT_PROMPTS or wherever active prompts are registered) so the two
sets remain mutually exclusive; update the initialization logic for
FORMERLY_USED_PROMPTS to dedupe by checking existing active prompt keys (or
filter out any keys found in the active registry) and keep only genuinely
deprecated entries.

In `@code/lib/cli-storybook/src/ai/setup-prompts/pattern-copy-play.ts`:
- Around line 5-6: Update the misleading Status header in pattern-copy-play.ts
so it matches the actual default variant used in the setup code: change the
header text that currently says "shipping default" to reflect "optimized-tests"
(the default selected in ai/setup-prompts/index.ts); locate the status comment
block in pattern-copy-play.ts and replace the incorrect wording so future
maintainers see the correct default variant name.
🪄 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: 502a34e0-0187-4baa-9b93-4a81e26c0512

📥 Commits

Reviewing files that changed from the base of the PR and between 433de11 and 1791797.

📒 Files selected for processing (5)
  • code/lib/cli-storybook/src/ai/index.ts
  • code/lib/cli-storybook/src/ai/setup-prompts/index.ts
  • code/lib/cli-storybook/src/ai/setup-prompts/pattern-copy-play.ts
  • code/lib/cli-storybook/src/ai/types.ts
  • code/lib/cli-storybook/src/bin/run.ts
💤 Files with no reviewable changes (2)
  • code/lib/cli-storybook/src/bin/run.ts
  • code/lib/cli-storybook/src/ai/types.ts

Comment thread code/lib/cli-storybook/src/ai/setup-prompts/index.ts
Comment thread code/lib/cli-storybook/src/ai/setup-prompts/pattern-copy-play.ts
@yannbf yannbf merged commit a835ed3 into next May 7, 2026
129 of 133 checks passed
@yannbf yannbf deleted the yann/undo-extensive-flag branch May 7, 2026 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:normal cli maintenance User-facing maintenance tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants