Skip to content

Conversation

@georgewrmarshall
Copy link
Contributor

@georgewrmarshall georgewrmarshall commented Oct 2, 2025

Description

Add CLAUDE.md developer guidance file and update .gitignore to prevent accidental commits of Claude AI development files.

This PR includes a comprehensive CLAUDE.md file that provides guidance to Claude Code when working with this repository, including common development commands, testing strategies, and high-level architecture overview. The .gitignore is also updated to prevent accidental commits of temporary Claude files, following the same pattern used in the MetaMask mobile repository.

Changelog

CHANGELOG entry: null

Related issues

Fixes: N/A

Manual testing steps

  1. Verify CLAUDE.md file is present in the repository root
  2. Create temporary claude.md files and confirm they are ignored by git
  3. Check if temp/ directories are properly ignored

Screenshots/Recordings

Not applicable - this is a configuration and documentation change.

Pre-merge author checklist

  • I've followed MetaMask Contributor Docs and MetaMask Extension Coding Standards
  • I've completed the PR template to the best of my ability
  • I've included tests if applicable
  • I've documented my code using JSDoc format if applicable
  • I've applied the right labels on the PR (see labeling guidelines). Not required for external contributors.

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Adds a CLAUDE.md developer guide and updates .gitignore to ignore Claude-related files and temp directories.

  • Documentation:
    • Add CLAUDE.md with concise guidance for development, testing, architecture, build system, key controllers, configuration, and multi-chain/Snaps support.
  • Tooling/Config:
    • Update .gitignore to ignore CLAUDE.md and temp/ directories to prevent accidental commits of Claude AI development files.

Written by Cursor Bugbot for commit 0d6a498. This will update automatically on new commits. Configure here.

@georgewrmarshall georgewrmarshall added team-design-system All issues relating to design system in Extension no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed labels Oct 2, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Oct 2, 2025

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@georgewrmarshall georgewrmarshall self-assigned this Oct 2, 2025
@georgewrmarshall georgewrmarshall requested a review from a team October 2, 2025 22:50
@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 313b23d | Date: 10/2/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±72ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 733ms (±69ms) 🟢 | historical mean value: 740ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 77ms (±12ms) 🟢 | historical mean value: 78ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 72ms 1.01s 1.33s 1.27s 1.33s
domContentLoaded 733ms 69ms 699ms 1.01s 946ms 1.01s
firstPaint 77ms 12ms 56ms 172ms 88ms 172ms
firstContentfulPaint 77ms 12ms 56ms 172ms 88ms 172ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [313b23d]
UI Startup Metrics (1223 ± 68 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1223111415606812661309
load105893713696410971152
domContentLoaded105193113646410851145
domInteractive17136481636
firstPaint65883136842910721149
backgroundConnect2512373019254268
firstReactRender23164562440
getState1263461424
initialActions719413626
loadScripts806696106759840894
setupStore1063141017
WebpackHomeuiStartup20961639261525222672521
load16741324205420317982009
domContentLoaded16671321204020217952002
domInteractive181389131550
firstPaint1786654471194327
backgroundConnect291679133165
firstReactRender87383446785314
getState2452855414216
initialActions9227827618
loadScripts16631318202820017922000
setupStore3453177315282
FirefoxBrowserifyHomeuiStartup14791250189712615161777
load1267109015858513231411
domContentLoaded1267109015848513221411
domInteractive1103445361116235
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect39212333235114
firstReactRender30257373052
getState8310212732
initialActions6113017418
loadScripts1236107514208012951383
setupStore14520427942
WebpackHomeuiStartup15641380197714616731892
load13251171167613414311595
domContentLoaded13241171167513414311594
domInteractive1053235663107303
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect342095103847
firstReactRender38325444046
getState6313269
initialActions3112236
loadScripts12991144165513614041572
setupStore105128141015
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 10 Bytes (0%)

@HowardBraham
Copy link
Contributor

Are you sure we want to ignore this file? Because maybe we want to actually commit it.

@georgewrmarshall
Copy link
Contributor Author

Are you sure we want to ignore this file? Because maybe we want to actually commit it.

We could also just do that!

@georgewrmarshall georgewrmarshall changed the title chore: add CLAUDE.md to .gitignore to prevent accidental commits chore: add CLAUDE.md and update .gitignore to prevent accidental commits Oct 3, 2025
@github-actions github-actions bot added size-M and removed size-XS labels Oct 3, 2025
cursor[bot]

This comment was marked as outdated.


# Claude AI development files
CLAUDE.md
/CLAUDE.md
Copy link

Choose a reason for hiding this comment

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

Bug: Tracked File Contradicts Gitignore

The CLAUDE.md file is committed in this change but also added to .gitignore. This creates a contradiction: the file is tracked now, but Git will ignore future changes. This suggests CLAUDE.md is intended to be a tracked file, like documentation.

Fix in Cursor Fix in Web

@metamaskbot
Copy link
Collaborator

📊 Page Load Benchmark Results

Current Commit: 0d6a498 | Date: 10/3/2025

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.05s (±71ms) 🟡 | historical mean value: 1.05s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 736ms (±69ms) 🟢 | historical mean value: 741ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±14ms) 🟢 | historical mean value: 81ms ⬇️ (historical data)
📈 Detailed Results
Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.05s 71ms 1.01s 1.37s 1.26s 1.37s
domContentLoaded 736ms 69ms 699ms 1.03s 933ms 1.03s
firstPaint 76ms 14ms 60ms 200ms 88ms 200ms
firstContentfulPaint 76ms 14ms 60ms 200ms 88ms 200ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms

Results generated automatically by MetaMask CI

@metamaskbot
Copy link
Collaborator

Builds ready [0d6a498]
UI Startup Metrics (1228 ± 69 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyHomeuiStartup1228111014156912851348
load105995412236310981177
domContentLoaded105294812146210911172
domInteractive17134361736
firstPaint60888122243110661134
backgroundConnect2512413028255264
firstReactRender25174972842
getState1353661624
initialActions50436714
loadScripts80771196661850925
setupStore962331015
WebpackHomeuiStartup19191573231217020592192
load15651378182311416531788
domContentLoaded15511366181211316391766
domInteractive171181141460
firstPaint2655617714251891590
backgroundConnect3516101134057
firstReactRender62192354069155
getState164128171746
initialActions40295319
loadScripts15471364180711216371754
setupStore154154161535
FirefoxBrowserifyHomeuiStartup14181208190012114641636
load1223104815009012741403
domContentLoaded1223104814999012741403
domInteractive1063337958107259
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3220112153376
firstReactRender29245253041
getState63627610
initialActions41677312
loadScripts1199103114769012541352
setupStore10510914832
WebpackHomeuiStartup15201306196812515881790
load1321116916249613921496
domContentLoaded1320116816249613921496
domInteractive963036253105188
firstPaintNaNNaNNaNNaNNaNNaN
backgroundConnect3617195283784
firstReactRender322576103368
getState72719619
initialActions40798312
loadScripts1295115315399013601464
setupStore12513117948
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 58 Bytes (0%)
  • ui: 0 Bytes (0%)
  • common: 10 Bytes (0%)

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

Adds a CLAUDE.md developer guidance document tailored for AI-assisted development and configuration hygiene to reduce accidental commits of temporary AI files.

  • Introduces CLAUDE.md with commands, architecture, testing, and configuration guidance.
  • Mentions tooling/config updates to ignore Claude-related temp files (diff for .gitignore not included here).

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +105 to +108
- Built-in support for Ethereum and EVM-compatible networks
- Bitcoin wallet snap integration
- Solana wallet snap integration
- Account abstraction and delegation features
Copy link

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

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

This section implies Bitcoin and Solana support as general integrations and that account abstraction is a core feature. To avoid misleading readers, clarify that non-EVM chains and AA are available via optional Snaps or specific features, not built-in by default. Suggested wording:

  • Built-in support for Ethereum and other EVM-compatible networks
  • Optional Bitcoin support via Snaps (not enabled by default)
  • Optional Solana support via Snaps (not enabled by default)
  • Account abstraction and delegation may be available via specific snaps/features; see project docs for current scope.
Suggested change
- Built-in support for Ethereum and EVM-compatible networks
- Bitcoin wallet snap integration
- Solana wallet snap integration
- Account abstraction and delegation features
- Built-in support for Ethereum and other EVM-compatible networks
- Optional Bitcoin support via Snaps (not enabled by default)
- Optional Solana support via Snaps (not enabled by default)
- Account abstraction and delegation may be available via specific snaps/features; see project docs for current scope.

Copilot uses AI. Check for mistakes.
Comment on lines +9 to +35
- `yarn start` - Start development build with file watching (MV3, no LavaMoat)
- `yarn start:mv2` - Start development build for Firefox (MV2)
- `yarn start:flask` - Start development build with Flask features (experimental)
- `yarn dist` - Production build for Chromium browsers (MV3)
- `yarn dist:mv2` - Production build for Firefox (MV2)
- `yarn build:test` - Create test build for e2e testing

### Testing

- `yarn test` - Run linting and unit tests
- `yarn test:unit` - Run Jest unit tests only
- `yarn test:e2e:chrome` - Run e2e tests in Chrome
- `yarn test:e2e:firefox` - Run e2e tests in Firefox
- `yarn test:e2e:single <test-file>` - Run single e2e test

### Linting & Code Quality

- `yarn lint` - Run all linting (ESLint, TypeScript, Stylelint, Prettier)
- `yarn lint:fix` - Auto-fix linting issues where possible
- `yarn lint:tsc` - TypeScript compiler checks
- `yarn lint:eslint` - ESLint checks only

### Development Tools

- `yarn storybook` - Start Storybook for component development
- `yarn dapp` - Start test dapp server for testing MetaMask integration

Copy link

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

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

These command lists duplicate package.json scripts and are likely to drift. Consider adding a brief note that the package.json scripts are the source of truth and keep only high-level examples here, or link to package.json. Alternatively, add a 'yarn run' tip or a small 'yarn help' script to enumerate available commands.

Copilot uses AI. Check for mistakes.
Comment on lines +40 to +58
- **`app/`** - Browser extension core functionality
- `scripts/background.js` - Main background script (service worker in MV3)
- `scripts/contentscript.js` - Content script injected into web pages
- `scripts/inpage.js` - Provider API injected into page context
- `scripts/metamask-controller.js` - Main controller orchestrating all functionality
- `scripts/controllers/` - Individual controllers (preferences, transactions, etc.)

- **`ui/`** - React-based user interface
- `pages/` - Main UI screens (home, settings, confirmations, etc.)
- `components/` - Reusable React components
- `hooks/` - Custom React hooks
- `ducks/` - Redux state management (actions, reducers, selectors)
- `selectors/` - Redux state selectors

- **`shared/`** - Code shared between background and UI
- `constants/` - Application constants and enums
- `lib/` - Utility libraries and helpers
- `modules/` - Business logic modules
- `types/` - TypeScript type definitions
Copy link

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

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

These hard-coded file paths/extensions can easily become outdated. To reduce confusion, consider linking to actual files/folders in this repo (relative links) or omitting file extensions where not essential so the section stays accurate if files are migrated or renamed.

Suggested change
- **`app/`** - Browser extension core functionality
- `scripts/background.js` - Main background script (service worker in MV3)
- `scripts/contentscript.js` - Content script injected into web pages
- `scripts/inpage.js` - Provider API injected into page context
- `scripts/metamask-controller.js` - Main controller orchestrating all functionality
- `scripts/controllers/` - Individual controllers (preferences, transactions, etc.)
- **`ui/`** - React-based user interface
- `pages/` - Main UI screens (home, settings, confirmations, etc.)
- `components/` - Reusable React components
- `hooks/` - Custom React hooks
- `ducks/` - Redux state management (actions, reducers, selectors)
- `selectors/` - Redux state selectors
- **`shared/`** - Code shared between background and UI
- `constants/` - Application constants and enums
- `lib/` - Utility libraries and helpers
- `modules/` - Business logic modules
- `types/` - TypeScript type definitions
- **[`app/`](./app/)** - Browser extension core functionality
- [`scripts/background.js`](./app/scripts/background.js) - Main background script (service worker in MV3)
- [`scripts/contentscript.js`](./app/scripts/contentscript.js) - Content script injected into web pages
- [`scripts/inpage.js`](./app/scripts/inpage.js) - Provider API injected into page context
- [`scripts/metamask-controller.js`](./app/scripts/metamask-controller.js) - Main controller orchestrating all functionality
- [`scripts/controllers/`](./app/scripts/controllers/) - Individual controllers (preferences, transactions, etc.)
- **[`ui/`](./ui/)** - React-based user interface
- [`pages/`](./ui/pages/) - Main UI screens (home, settings, confirmations, etc.)
- [`components/`](./ui/components/) - Reusable React components
- [`hooks/`](./ui/hooks/) - Custom React hooks
- [`ducks/`](./ui/ducks/) - Redux state management (actions, reducers, selectors)
- [`selectors/`](./ui/selectors/) - Redux state selectors
- **[`shared/`](./shared/)** - Code shared between background and UI
- [`constants/`](./shared/constants/) - Application constants and enums
- [`lib/`](./shared/lib/) - Utility libraries and helpers
- [`modules/`](./shared/modules/) - Business logic modules
- [`types/`](./shared/types/) - TypeScript type definitions

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed size-M team-design-system All issues relating to design system in Extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants