Skip to content
This repository was archived by the owner on Oct 14, 2026. It is now read-only.

fix(codex): tell codex to use require_escalated - #290

Merged
huang-julien merged 6 commits into
mainfrom
fix/codex_skill
Jun 19, 2026
Merged

huang-julien merged 6 commits into
mainfrom
fix/codex_skill

Conversation

@huang-julien

@huang-julien huang-julien commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex has some quirks we have to handle.

  • CLI commands are run in a sandboxed env. Requiring elevated privilege to have the CLI call localhost
  • force the preview browser opened to the user

Summary by CodeRabbit

  • Documentation
    • Updated Storybook workflow instructions with clearer wording around the correct CLI “source of truth.”
    • Added sandbox-specific permission requirements (require_escalated) for running Storybook CLI commands.
    • Adjusted the preview/rules steps to use elevated permissions when checking npx storybook ai --help and generating story-writing instructions.
    • Streamlined the Step 1/Step 2 flow for detecting a running Storybook instance and opening the preview URL.

Copilot AI review requested due to automatic review settings June 12, 2026 14:12
@changeset-bot

changeset-bot Bot commented Jun 12, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 7429b78

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@netlify

netlify Bot commented Jun 12, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for storybook-mcp-self-host-example canceled.

Name Link
🔨 Latest commit 7429b78
🔍 Latest deploy log https://app.netlify.com/projects/storybook-mcp-self-host-example/deploys/6a3530fc1ec3720008dfc20d

@pkg-pr-new

pkg-pr-new Bot commented Jun 12, 2026 •

Copy link
Copy Markdown
npx https://pkg.pr.new/storybookjs/mcp/@storybook/addon-mcp@290
npx https://pkg.pr.new/storybookjs/mcp/@storybook/mcp@290
npx https://pkg.pr.new/storybookjs/mcp/@storybook/mcp-proxy@290

commit: 7429b78

Copilot AI left a comment

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.

Pull request overview

Updates the Codex Storybook “stories” skill to better align with how Storybook’s AI CLI should be used in sandboxed Codex environments, including guidance around elevated execution and ensuring the preview browser is visible for verification.

Changes:

  • Adds an introductory “source of truth” note emphasizing Storybook CLI AI subcommands and a strict workflow.
  • Documents rerunning Storybook CLI commands with require_escalated in sandboxed environments.
  • Updates Step 1/2 instructions to emphasize preview browser visibility and require_escalated usage.

Comment thread packages/codex-plugin/plugins/storybook/skills/stories/SKILL.md Outdated
Comment thread packages/codex-plugin/plugins/storybook/skills/stories/SKILL.md
Comment thread packages/codex-plugin/plugins/storybook/skills/stories/SKILL.md Outdated
Comment thread packages/codex-plugin/plugins/storybook/skills/stories/SKILL.md
@codecov

codecov Bot commented Jun 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.78%. Comparing base (bbf7e82) to head (7429b78).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #290      +/-   ##
==========================================
+ Coverage   79.68%   79.78%   +0.09%     
==========================================
  Files          67       67              
  Lines        2048     2048              
  Branches      578      578              
==========================================
+ Hits         1632     1634       +2     
+ Misses        235      234       -1     
+ Partials      181      180       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@huang-julien huang-julien changed the title fix(codex): update story skill fix(codex): tell codex to use require_escalated Jun 16, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 16, 2026 11:57

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread packages/codex-plugin/plugins/storybook/skills/stories/SKILL.md Outdated
Comment thread packages/codex-plugin/plugins/storybook/skills/stories/SKILL.md
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 16, 2026 12:00

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

Comment thread packages/codex-plugin/plugins/storybook/skills/stories/SKILL.md
Comment thread packages/codex-plugin/plugins/storybook/skills/stories/SKILL.md
Comment thread packages/codex-plugin/plugins/storybook/skills/stories/SKILL.md
@coderabbitai

coderabbitai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4a4b1c8f-0b69-4ef0-a582-d92d1aedfad8

📥 Commits

Reviewing files that changed from the base of the PR and between 061709c and 7429b78.

📒 Files selected for processing (1)
  • packages/codex-plugin/plugins/storybook/skills/stories/SKILL.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/codex-plugin/plugins/storybook/skills/stories/SKILL.md

📝 Walkthrough

Walkthrough

Updates SKILL.md for the Storybook stories skill to correct "AI subcommands" wording, add a sandbox-specific requirement to run Storybook CLI commands with require_escalated, and rework the Step 1/Step 2 preview and story-writing instruction steps to include that constraint.

Changes

Storybook Skill Instruction Updates

Layer / File(s) Summary
require_escalated constraint and wording corrections
packages/codex-plugin/plugins/storybook/skills/stories/SKILL.md
Corrects "Storybook CLI ai subcommands" to plural, adds a sandboxed-environment instruction requiring require_escalated for CLI commands, and reworks Steps 1–2 so that npx storybook ai --help and the AI subcommand invocations both include require_escalated.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

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 `@packages/codex-plugin/plugins/storybook/skills/stories/SKILL.md`:
- Line 104: The instruction on line 104 is ambiguous because it refers to "the
ai subcommand" without specifying which one. Replace the vague phrasing "Run the
ai subcommand with `require_escalated`" with an explicit reference to the
specific subcommand `get-storybook-story-instructions` so readers know exactly
which subcommand to execute. This clarification ensures the documentation
provides unambiguous guidance on fetching story-writing instructions.
🪄 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: e02945cb-c6bb-4183-b74f-d6dd4402cec4

📥 Commits

Reviewing files that changed from the base of the PR and between bbf7e82 and 061709c.

📒 Files selected for processing (1)
  • packages/codex-plugin/plugins/storybook/skills/stories/SKILL.md

- Run `STORYBOOK_FEATURE_AI_CLI=1 npx storybook ai --help` with `require_escalated` to get all available subcommands and options.
- Save the available subcommands and options in your working memory for reference.
- Run the ai subcommand to get the story-writing instructions.
- Run the ai subcommand with `require_escalated` to get the story-writing instructions.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Specify the exact subcommand for fetching story-writing instructions.

Line 104 says "Run the ai subcommand with require_escalated" without naming the specific subcommand. Based on Storybook documentation, the tool for fetching story-writing instructions is get-storybook-story-instructions. The instruction should explicitly use this name to avoid ambiguity.

📝 Proposed revision for clarity
- Run the ai subcommand with `require_escalated` to get the story-writing instructions.
+ Run `STORYBOOK_FEATURE_AI_CLI=1 npx storybook ai get-storybook-story-instructions` with `require_escalated` to get the story-writing instructions.
🤖 Prompt for 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.

In `@packages/codex-plugin/plugins/storybook/skills/stories/SKILL.md` at line 104,
The instruction on line 104 is ambiguous because it refers to "the ai
subcommand" without specifying which one. Replace the vague phrasing "Run the ai
subcommand with `require_escalated`" with an explicit reference to the specific
subcommand `get-storybook-story-instructions` so readers know exactly which
subcommand to execute. This clarification ensures the documentation provides
unambiguous guidance on fetching story-writing instructions.

Copilot AI review requested due to automatic review settings June 19, 2026 12:07

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

you MUST NOT report the component change as complete until this workflow has
finished for every component you touched. A component change without
matching, verified stories is not a deliverable.
- In sandboxed Codex environments, run any Storybook CLI command with `require_escalated` (sandbox/network permissions may otherwise prevent localhost access).
The Storybook preview MUST be running so the story can be verified.

Run `STORYBOOK_FEATURE_AI_CLI=1 npx storybook ai --help` subcommand to check for running Storybook instances. If there is a running instance, note its port and open the preview URL in the preview browser.
Run `STORYBOOK_FEATURE_AI_CLI=1 npx storybook ai --help` subcommand with `require_escalated` to check for running Storybook instances.
Comment on lines 94 to +97
2. Wait for the terminal to show which port Storybook is running on and use that port to open the preview URL (e.g. `http://localhost:6006`) in the preview browser.
3. Save the port being used by Storybook shown in the terminal in your working memory. USE THIS PORT FOR ANY SUBCOMMAND THAT NEEDS TO KNOW THE PORT (e.g. `preview-stories`).
3. Make the preview browser visible to the user.
4. Save the port being used by Storybook shown in the terminal in your working memory. USE THIS PORT FOR ANY SUBCOMMAND THAT NEEDS TO KNOW THE PORT (e.g. `preview-stories`).
5. Open the preview URL in the preview browser.
@huang-julien
huang-julien merged commit f4c2bf4 into main Jun 19, 2026
16 checks passed
@huang-julien
huang-julien deleted the fix/codex_skill branch June 19, 2026 12:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants