Skip to content

Agentic Setup: Show Discord and human docs only to humans#34705

Merged
yannbf merged 3 commits into
nextfrom
sidnioulz/no-discord-for-agents
May 4, 2026
Merged

Agentic Setup: Show Discord and human docs only to humans#34705
yannbf merged 3 commits into
nextfrom
sidnioulz/no-discord-for-agents

Conversation

@Sidnioulz
Copy link
Copy Markdown
Member

@Sidnioulz Sidnioulz commented May 4, 2026

ø

Summary by CodeRabbit

  • New Features

    • Finalization messaging now conditionally shows either an official documentation reference or the standard documentation plus community chat link, depending on the configured follow-up mode.
  • Tests

    • Updated tests to verify the correct follow-up messaging and links are emitted for each configuration, ensuring users see the intended documentation and support links.

@Sidnioulz Sidnioulz requested a review from yannbf May 4, 2026 14:49
Copilot AI review requested due to automatic review settings May 4, 2026 14:49
@Sidnioulz Sidnioulz added build Internal-facing build tooling & test updates ci:normal labels May 4, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.

Comment thread code/lib/create-storybook/src/commands/FinalizationCommand.ts
Comment thread code/lib/create-storybook/src/commands/FinalizationCommand.ts Outdated
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

📝 Walkthrough

Walkthrough

printNextSteps in FinalizationCommand.ts now switches which informational links it logs based on the showAiInstructions flag: when true it logs only the official AI docs https://storybook.js.org/llms.txt; when false it logs the general docs https://storybook.js.org/ and the Discord invite. Tests updated to assert these behaviors.

Changes

Conditional Messaging in Finalization Output

Layer / File(s) Summary
Core Logic
code/lib/create-storybook/src/commands/FinalizationCommand.ts
printNextSteps now branches on showAiInstructions: agent/AI-instructions path logs https://storybook.js.org/llms.txt only; non-agent path logs https://storybook.js.org/ and https://discord.gg/storybook/.
Tests
code/lib/create-storybook/src/commands/FinalizationCommand.test.ts
Agent-mode test constructs command with showAiInstructions: true and asserts logger.log includes https://storybook.js.org/llms.txt and excludes https://discord.gg/storybook/. Non-agent success-with-AI-instructions test asserts logger.log includes https://storybook.js.org/ and https://discord.gg/storybook/ and excludes /llms.txt.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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


Review rate limit: 2/5 reviews remaining, refill in 32 minutes and 33 seconds.

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

Sidnioulz and others added 2 commits May 4, 2026 17:15
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 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

📥 Commits

Reviewing files that changed from the base of the PR and between 19bed7b and 0533612.

📒 Files selected for processing (2)
  • code/lib/create-storybook/src/commands/FinalizationCommand.test.ts
  • code/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

Comment on lines +106 to +116
// 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/')}
`);
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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.

Suggested change
// 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.

@yannbf yannbf merged commit fdcea98 into next May 4, 2026
116 of 119 checks passed
@yannbf yannbf deleted the sidnioulz/no-discord-for-agents branch May 4, 2026 16:30
@github-actions github-actions Bot mentioned this pull request May 4, 2026
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Internal-facing build tooling & test updates ci:normal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants