Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

docs: document critical frontend pattern migrations in CLAUDE.md#20949

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
mafredri wants to merge6 commits intomain
base:main
Choose a base branch
Loading
fromreview-pattern-docs-update

Conversation

@mafredri
Copy link
Member

@mafredrimafredri commentedNov 26, 2025
edited
Loading

Summary

This PR documents critical frontend pattern migrations based onsystematic analysis of 200+ git commits that modifiedsite/ files. These patterns have been causing repeated feedback in PR reviews and need to be clearly documented for AI and human developers.

Analysis Method

Usedgit log to identify actual pattern migrations:

  • Analyzed 200+ commits touchingsite/ directory
  • Examined actual code diffs for migration patterns
  • Reviewed PR discussions via GitHub API
  • Identified systematic pattern changes across multiple PRs

Patterns Documented

1.Emotion → Tailwind CSS

2.MUI Components → Custom/Radix/shadcn

3.MUI Icons → lucide-react (NEW)

4.Radix Component Prop Naming (NEW)

5.Testing: spyOn → queries parameter

6.State Storage: localStorage → user_configs

7.Chromatic Testing Best Practices

8.cn() Utility for Conditional Classes (NEW)

  • Standard pattern for conditional className merging
  • Combinesclsx andtailwind-merge
  • Used throughout shadcn components

Changes Made

  • Updatedsite/CLAUDE.md with comprehensive pattern documentation
  • Added prominent "Critical Pattern Migrations" section (now 5 critical patterns)
  • Included code examples for each pattern
  • Added new sections for icon migration and Radix conventions
  • Emphasized "leave the campsite better than you found it" philosophy

Git Statistics

  • Commits analyzed: 200+ touchingsite/ directory
  • Refactor/migration PRs found: 15+
  • Pattern-related PRs: 10+
  • Consistent migration effort: October-November 2025

Key PRs Referenced

#20948,#20946,#20938,#20933,#20905,#20900,#20869,#20849,#20808,#20530,#20479,#20318,#20261,#20204,#20201,#20200,#20193


🤖 This change was written by Claude Sonnet 4.5 Thinking using mux and reviewed by a human 🏂

Add comprehensive documentation for active frontend pattern migrationsdiscovered through analysis of 200+ git commits touching site/ files:Core Migrations:- Emotion → Tailwind CSS (strict 'no new emotion' policy)- MUI Components → Custom/Radix/shadcn (Tooltips, Tables, Buttons)- MUI Icons → lucide-react with specific icon mappings- spyOn → queries parameter for GET endpoint mocks in Storybook- localStorage → user_configs table for user preferencesNew Documentation:- Icon migration mappings (BusinessIcon→Building2Icon, etc.)- Radix component prop naming conventions (placement→side)- cn() utility usage for conditional className merging- Chromatic testing best practices (prefer snapshots over assertions)Includes concrete before/after examples and migration patterns to guidedevelopers away from deprecated approaches toward current best practices.Analysis based on PRs:#20948,#20946,#20938,#20905,#20900,#20869,#20849,#20808,#20530,#20479,#20261,#20201,#20200,#20193,#20318---🤖 This change was written by Claude Sonnet 4.5 Thinking using mux and reviewed by a human 🏂
@mafredrimafredriforce-pushed thereview-pattern-docs-update branch from2af4fa8 to1f0280eCompareNovember 26, 2025 13:44
Fix markdown linting errors MD032 and MD031:- Add blank lines around lists (MD032)- Add blank lines around fenced code blocks (MD031)Ensures site/CLAUDE.md passes markdownlint-cli2 checks.
@mafredrimafredri marked this pull request as ready for reviewNovember 26, 2025 13:49
@mafredrimafredri changed the titledocs(site): document critical frontend pattern migrationsdocs: document critical frontend pattern migrations in CLAUDE.mdNov 26, 2025
Copy link
Member

@aslilacaslilac left a comment

Choose a reason for hiding this comment

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

seems to mostly make sense

one small worry: having the "don't"s in here puts them in the context window, and I worry that might some models might pick up on that and just ignore the "don't". I wonder if it might be better toonly put the new equivalent? totally guessing tho

@jaaydenh has more experience with this kind of tuning so I'd love to here from him

Remove code examples showing deprecated patterns (OLD/DO NOT USE blocks)that could mislead AI agents into copying the wrong patterns.Changes:- Icon section: Only show lucide-react imports, not MUI icons- Radix section: Only show correct Radix pattern, not MUI pattern- Emotion section: Only show Tailwind classes, not emotion imports- Testing section: Only show queries parameter, not spyOn patternThis prevents AI agents from pattern-matching and copying deprecatedcode while maintaining clear guidance on what to replace and how.
Condense verbose sections to be more scannable and direct:- Icon section: Single-line import, inline replacement mappings- Radix section: Consolidated prop changes into one sentence- Emotion section: Reduced from 5 to 4 bullets, combined redundant points- Chromatic section: Reduced from 5 to 3 bullets- localStorage section: Reduced from 8 to 4 linesOverall ~30% reduction in text while maintaining clarity. AI agentsscan for patterns and use code examples - keeping prose minimal anddirective improves efficiency.
Remove redundant sections and repeated information:- Remove entire "Migration" section (lines 192-207) that duplicated  Components, Styling, and Tailwind sections- Remove duplicate "leave campsite better" mention (already in line 13)- Remove duplicate "Never import from @emotion/react" (already stated)Reduces documentation from 250 to 232 lines while maintaining allunique information. Each concept is now documented once in its mostappropriate section.
@mafredri
Copy link
MemberAuthor

@aslilac personally I don't think the don't examples would be mistaken, but at the same time, they add length, wordiness and context size. So I opted to have the doc simplified, both in their removal and reduced wording.

There I guess the only tradeoff is how easily the old patterns are detected, but that's also not "free".

Remove 🚨 emoji from "Critical Pattern Migrations" section header tomaintain consistency with the original document style which uses noemojis, only text emphasis and formatting.All other style elements match the original:- Section headers with ## and ###- Bold emphasis for important terms- Simple bullet lists with -- Direct, imperative tone- "(MUST FOLLOW)" matches original "(USE FIRST)" pattern
@mafredrimafredriforce-pushed thereview-pattern-docs-update branch from21f5f0e to453a8acCompareNovember 27, 2025 19:30
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@aslilacaslilacaslilac left review comments

@jaaydenhjaaydenhAwaiting requested review from jaaydenh

At least 1 approving review is required to merge this pull request.

Assignees

@mafredrimafredri

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@mafredri@aslilac

[8]ページ先頭

©2009-2025 Movatter.jp