Agentic Setup: Show Discord and human docs only to humans#34705
Conversation
There was a problem hiding this comment.
Pull request overview
Adjusts create-storybook’s final “next steps” messaging so agent-driven installs don’t receive human-oriented follow-ups (Discord link) and instead get an LLM-oriented docs reference.
Changes:
- Added an agent-specific “Official documentation reference” output pointing to
https://storybook.js.org/llms.txt. - Kept the existing human-oriented links (storybook.js.org + Discord) for non-agent flows by branching on an option flag.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📝 WalkthroughWalkthrough
ChangesConditional Messaging in Finalization Output
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
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. Review rate limit: 2/5 reviews remaining, refill in 32 minutes and 33 seconds. Comment |
Co-authored-by: Copilot <copilot@github.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@code/lib/create-storybook/src/commands/FinalizationCommand.ts`:
- Around line 106-116: The branch is using this.options.showAiInstructions but
should use the agent-mode flag; update the condition on the FinalizationCommand
code block to check this.options.showAgentFollowUp instead of
this.options.showAiInstructions so agents see the LLM docs URL
(https://storybook.js.org/llms.txt) and non-agent users see the human
docs/Discord message; keep the existing logger.log/dedent strings intact.
🪄 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: ef3cb1d0-425e-4abb-98bc-ddb446e47dbe
📒 Files selected for processing (2)
code/lib/create-storybook/src/commands/FinalizationCommand.test.tscode/lib/create-storybook/src/commands/FinalizationCommand.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- code/lib/create-storybook/src/commands/FinalizationCommand.test.ts
| // We don't want to tell agents about Discord, and we want to customise their docs URL. | ||
| if (this.options.showAiInstructions) { | ||
| logger.log(dedent` | ||
| Official documentation reference: ${CLI_COLORS.cta('https://storybook.js.org/llms.txt')} | ||
| `); | ||
| } else { | ||
| logger.log(dedent` | ||
| Want to learn more about Storybook? ${CLI_COLORS.cta('https://storybook.js.org/')} | ||
| Having trouble or want to chat? ${CLI_COLORS.cta('https://discord.gg/storybook/')} | ||
| `); | ||
| } |
There was a problem hiding this comment.
Use the agent-mode flag for this branch, not showAiInstructions
At Line 107, the condition is keyed to showAiInstructions (AI feature opt-in), but the intent/comment is “don’t tell agents about Discord.” Based on code/lib/create-storybook/src/initiate.ts:154-162, agent mode is represented by showAgentFollowUp, so this can hide human docs/Discord for non-agent users who enabled AI.
Suggested fix
- if (this.options.showAiInstructions) {
+ if (this.options.showAgentFollowUp) {
logger.log(dedent`
Official documentation reference: ${CLI_COLORS.cta('https://storybook.js.org/llms.txt')}
`);
} else {📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // We don't want to tell agents about Discord, and we want to customise their docs URL. | |
| if (this.options.showAiInstructions) { | |
| logger.log(dedent` | |
| Official documentation reference: ${CLI_COLORS.cta('https://storybook.js.org/llms.txt')} | |
| `); | |
| } else { | |
| logger.log(dedent` | |
| Want to learn more about Storybook? ${CLI_COLORS.cta('https://storybook.js.org/')} | |
| Having trouble or want to chat? ${CLI_COLORS.cta('https://discord.gg/storybook/')} | |
| `); | |
| } | |
| // We don't want to tell agents about Discord, and we want to customise their docs URL. | |
| if (this.options.showAgentFollowUp) { | |
| logger.log(dedent` | |
| Official documentation reference: ${CLI_COLORS.cta('https://storybook.js.org/llms.txt')} | |
| `); | |
| } else { | |
| logger.log(dedent` | |
| Want to learn more about Storybook? ${CLI_COLORS.cta('https://storybook.js.org/')} | |
| Having trouble or want to chat? ${CLI_COLORS.cta('https://discord.gg/storybook/')} | |
| `); | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@code/lib/create-storybook/src/commands/FinalizationCommand.ts` around lines
106 - 116, The branch is using this.options.showAiInstructions but should use
the agent-mode flag; update the condition on the FinalizationCommand code block
to check this.options.showAgentFollowUp instead of
this.options.showAiInstructions so agents see the LLM docs URL
(https://storybook.js.org/llms.txt) and non-agent users see the human
docs/Discord message; keep the existing logger.log/dedent strings intact.
ø
Summary by CodeRabbit
New Features
Tests