Skip to content

Conversation

@herablog
Copy link
Member

@herablog herablog commented Nov 12, 2025

概要

Chrome DevTools MCPを使用してStorybookの全ページをエラーチェックするコマンドを追加しました。(普段あまり使わないかつ使わなくても致命的でないためコマンドで定義しています)

ある程度意図通りに動作するようになったため、このタイミングでPRを作成します。なお、エラーの修正自体はこのPRの関心事ではありません。たまにサンプリングしようとしますが、全てを確認するように指示するとうまくいきました。

コマンドの内容は短くできる可能性がありますが、意図通りに動作させるために細かめに指示を記載しています。

変更内容

Storybookエラー修正の自動化コマンド:

  • .claude/commands/fix-storybook-errors.md.cursor/commands/fix-storybook-errors.md を追加
  • Chrome DevTools MCPを使用してStorybookのエラーを検出・自動修正するステップバイステップの自動化を文書化
  • セットアップ、エラー検出、分類、自動修正、レポート、クリーンアップの手順を含む
  • ClaudeとCursorの両方の環境に対応し、それぞれに適したインストール手順とエラーハンドリングを記載

ドキュメント更新:

  • AGENTS.mdCLAUDE.md を更新し、Storybookのエラーチェックに fix-storybook-errors コマンドを使用するよう変更

This pull request introduces a new standardized workflow for detecting and fixing Storybook errors using Chrome DevTools MCP, and updates documentation to reference this workflow. The main changes are the addition of detailed command documentation for both Claude and Cursor agents, and the replacement of manual error-checking instructions with usage of the new fix-storybook-errors command.

Documentation and Workflow Standardization

  • Added .claude/commands/fix-storybook-errors.md and .cursor/commands/fix-storybook-errors.md files, providing step-by-step instructions for using Chrome DevTools MCP to automatically detect and fix Storybook errors, including prerequisites, error detection, auto-fixing, verification, reporting, and cleanup. [1] [2]

Process and Usage Updates

  • Updated CLAUDE.md and AGENTS.md to reference the new fix-storybook-errors command for verifying Storybook pages, replacing previous manual Chrome DevTools MCP instructions. [1] [2]

@changeset-bot
Copy link

changeset-bot bot commented Nov 12, 2025

⚠️ No Changeset found

Latest commit: 1c94beb

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

@herablog herablog requested a review from Copilot November 12, 2025 09:19
@herablog herablog self-assigned this Nov 12, 2025
Copy link
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

This PR adds tooling to automatically detect and fix Storybook errors across all component stories using Chrome DevTools MCP integration. The command checks console errors, visual errors, and network issues, with auto-fix capabilities for common problems like HTML structure errors and React key duplicates.

Key changes:

  • Adds fix-storybook-errors command with comprehensive error detection and auto-fix workflows for both Cursor and Claude environments
  • Fixes HTML structure error in Dialog component by replacing invalid nested <p> tags with line breaks
  • Fixes React key duplication in HeroCarousel by switching from content-based to index-based keys

Reviewed Changes

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

File Description
.cursor/commands/fix-storybook-errors.md New command documentation for Cursor with Chrome DevTools MCP integration instructions and auto-fix workflow
.claude/commands/fix-storybook-errors.md New command documentation for Claude with appropriate MCP tool permissions and setup instructions
packages/spindle-ui/src/Dialog/Dialog.stories.example.tsx Fixed HTML structure error by removing nested <p> tags and using line breaks
packages/spindle-ui/src/HeroCarousel/HeroCarousel.tsx Fixed React key duplication by switching to index-based keys

@reg-suit
Copy link

reg-suit bot commented Nov 12, 2025

reg-suit detected visual differences.

Check this report, and review them.

🔴 Changed ⚪ New 🔵 Passing
2 2 252
How can I change the check status? If reviewers approve this PR, the reg context status will be green automatically.

@herablog herablog force-pushed the feat-storybook-mcp-check-TIN1w branch 3 times, most recently from 36e6cf5 to 78a7edc Compare November 14, 2025 07:32
Add command to check all Storybook pages for errors using Chrome DevTools MCP.
Includes auto-fix capabilities for HTML structure errors and React key duplication.
Supports both Cursor and Claude environments with appropriate MCP setup instructions.
Update AGENTS.md and CLAUDE.md to reference the fix-storybook-errors command instead of generic Chrome DevTools MCP instructions.
@herablog herablog force-pushed the feat-storybook-mcp-check-TIN1w branch from 78a7edc to 1c94beb Compare November 17, 2025 07:19
@herablog herablog requested a review from yanagi0602 November 17, 2025 07:26
Copy link
Contributor

@yanagi0602 yanagi0602 left a comment

Choose a reason for hiding this comment

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

実行されること、意図的に発生させたエラーが検知されて修正されることを確認しました。

@herablog herablog marked this pull request as ready for review November 26, 2025 01:23
@herablog herablog merged commit 13033b2 into main Nov 26, 2025
7 checks passed
@herablog herablog deleted the feat-storybook-mcp-check-TIN1w branch November 26, 2025 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants