metamask-docs / rules
Cursor rule865 starsChanged 16 days agoApache-2.0View on GitHub
Workflow rules for contributors and reviewers covering sidebar updates, redirects, verification, and PR expectations.
We split this contributor-workflow.mdc into the rules it gives an agent
7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Every new documentation page must be added to the appropriate sidebar file:
- Very specific: line 28
Every deleted, renamed, or moved page must have a redirect added in vercel.json.
- Very specific: line 31
Follow the trailing-slash rules in vercel-redirects.mdc: use a slash-terminated source only (no duplicate no-slash entry), and a …
- Distinctive: line 36
Do not state as fact any API behavior, parameter, or return value that you have not verified against the codebase or published reference.
- Distinctive: line 42
Place images in the product's designated asset folder:
- Very specific: line 52
When a change affects the structure, naming, or conventions of a product area, update the corresponding .cursor/rules/ file in the same PR.
- Very specific: line 76
After npm install, Husky installs a Git pre-commit hook that runs lint-staged using the rules in package.json.
≈ “Common” is an estimate: at least 1 in 5 of the 6,350 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
--- description: Workflow rules for contributors and reviewers covering sidebar updates, redirects, verification, and PR expectations. alwaysApply: true --- # Contributor workflow See [CONTRIBUTING.md](CONTRIBUTING.md) for the full contribution process. The rules below highlight the requirements that are most often missed. ## Sidebar updates Every new documentation page must be added to the appropriate sidebar file: | Product | Sidebar file | | ------------------ | ------------------------- | | MetaMask Connect | `mm-connect-sidebar.js` | | Embedded Wallets | `ew-sidebar.js` | | Smart Accounts Kit | `gator-sidebar.js` | | Agent Wallet | `agent-wallet-sidebar.js` | | Agent Wallet | `agent-wallet-sidebar.js` | | Snaps | `snaps-sidebar.js` | Infura API and dashboard documentation is maintained in [docs.infura](https://github.com/INFURA/docs.infura), not in this repository. Link to `https://docs.infura.io/` from MetaMask docs when referencing Infura APIs or the Infura dashboard. ## Redirects Every deleted, renamed, or moved page must have a redirect added in `vercel.json`. Docusaurus is configured with `onBrokenLinks: 'throw'`, so broken internal links will fail the build. Follow the trailing-slash rules in `vercel-redirects.mdc`: use a **slash-terminated `source`** only (no duplicate no-slash entry), and a slash-terminated `destination` for normal paths. ## Factual accuracy Do not state as fact any API behavior, parameter, or return value that you have not verified against the codebase or published reference. If you are uncertain, add a review comment or admonition noting the uncertainty. This rule applies to both human and AI-assisted contributions. ## Images Place images in the product's designated asset folder: - `metamask-connect/*/_assets/` - `static/img/embedded-wallets/` (Embedded Wallets product images) - `smart-accounts-kit/assets/` - `snaps/assets/` - `static/img/` (for site-wide assets) ## Update rule files for structural changes When a change affects the structure, naming, or conventions of a product area, update the corresponding `.cursor/rules/` file in the same PR. Examples of changes that require a rule update: - Renaming a product or changing its branding (update the product rule file and `terminology.mdc`). - Adding, removing, or renaming top-level content folders (update the product rule file and `content-types.mdc` if a new folder pattern is introduced). - Changing the parameter documentation format in a reference section (update the product rule file and `content-types.mdc`). - Moving image storage to a different directory (update `contributor-workflow.mdc` and the product rule file). - Adding a new product area to the repository (create a new `product-*.mdc` rule file and add the product to the table in `contributor-workflow.mdc` and `AGENTS.md`). - Changing sidebar file names or adding new sidebar files (update the sidebar table above and the product rule file). - Introducing new shared partials or generated-content patterns (update the product rule file). Keeping rule files current prevents stale guidance from producing incorrect contributions. ## CI linting Pull requests run **`npm run format:check`** (Prettier against `.prettierrc` and `.prettierignore`). Run **`npm run format`** locally to fix style before pushing. Generated Snaps API pages under `snaps/reference/snaps-api/` are excluded from formatting in git (see `.prettierignore`). After **`npm install`**, [Husky](https://typicode.github.io/husky/) installs a Git **`pre-commit`** hook that runs [**`lint-staged`**](https://github.com/lint-staged/lint-staged) using the rules in `package.json`. Staged files matching those patterns are auto-formatted with Prettier (and other commands in `lint-staged`, such as ESLint on `src/`). Restage if the hook edits files. Hooks are local only and are not required for CI to pass. Pull requests are checked by a Vale-based linter ([docs-spelling-check](https://github.com/Consensys/github-actions/tree/main/docs-spelling-check)) that enforces Microsoft style, Consensys terminology, and spelling. Fix any linter warnings before requesting review. If a warning is a false positive, add the term to the Vale vocabulary file rather than rewriting valid technical language. > **Warning:** Do not wire Vale into the Husky `pre-commit` hook (`lint-staged` in `package.json`). > Vale is intentionally CI-only. It frequently reports false positives on valid technical content > (for example, code identifiers like `wagmi-tab`, product names, and intentional ellipses) and lints > the entire staged file rather than just your diff, so running it on commit blocks unrelated, > pre-existing content and stalls otherwise-valid commits. Let the PR CI run Vale; contributors can > still run it on demand with `npm run docs:ci`. ## Pull requests - Summarize what changed and why in the PR description. Do not just list files. - Link the related issue using `fixes #<number>` when applicable. - Preview locally with `npm start` before requesting review. ## Cross-product links See the **Links** section in `markdown-formatting.mdc`.
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 3,978 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository15 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .cursor/rules/content-types.mdcCursor rule
- .cursor/rules/editorial-voice.mdcCursor rule
- .cursor/rules/markdown-formatting.mdcCursor rule
- .cursor/rules/product-agent-wallet.mdcCursor rule
- .cursor/rules/product-embedded-wallets.mdcCursor rule
- .cursor/rules/product-infura.mdcCursor rule
- .cursor/rules/product-metamask-connect.mdcCursor rule
- .cursor/rules/product-smart-accounts-kit.mdcCursor rule
- .cursor/rules/product-snaps.mdcCursor rule
- .cursor/rules/terminology.mdcCursor rule
- .cursor/rules/vercel-redirects.mdcCursor rule
- static/llms.txtllms.txt
- author-pageSkill
- style-reviewSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

