Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add rules/metamask/metamask-connect-cursor-plugin/react-native-polyfillsgit clone --depth 1 https://github.com/MetaMask/metamask-connect-cursor-pluginWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.01177 | $0.01177 |
| Opus 5 | $0.00589 | $0.00589 |
| Sonnet 5 | $0.00235 | $0.00235 |
| Haiku 4.5 | $0.00118 | $0.00118 |
Grade A, and why
react-native-polyfills scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 106 lines — stays where its author put it; the contents beside it link to each section on GitHub.
React Native Polyfills for MetaMask Connect
Per-Package Polyfill Requirements
Different integrations need different polyfills. Do not blindly copy the full set:
| Polyfill | connect-evm / connect-solana (standalone) | + wagmi |
|---|---|---|
react-native-get-random-values |
RN < 0.72 only (see below) | RN < 0.72 only |
Buffer |
Safety net only (self-polyfilled by connect-multichain) | Safety net only |
window object |
Required for correct deeplink/platform detection | Required |
Event |
Not required | Required (wagmi uses DOM events) |
CustomEvent |
Not required | Required (wagmi uses DOM events) |
Import Order (Critical)
// Entry file (_layout.tsx / index.js) — order is critical
import 'react-native-get-random-values'; // MUST be first (if used)
import './polyfills'; // window shim, and Event/CustomEvent if using wagmi
Incorrect order causes crypto.getRandomValues is not a function at runtime.
react-native-get-random-values
- Required only for React Native < 0.72 — Hermes 0.72+ exposes
globalThis.crypto.getRandomValuesnatively - Still recommended as an explicit safety net — especially if any dependency has its own minimum RN version assumptions
- Must be the very first import in the entry file, before anything that touches crypto
Buffer Polyfill
@metamask/connect-multichainself-polyfillsBuffervia its React Native entry point — not needed for the SDK itself- Still recommended to set
global.Buffer = Bufferinpolyfills.tsas a safety net for peer deps (e.g.eciesjs,@solana/web3.js) that may load before connect-multichain - Install:
npm install buffer
window Object Polyfill
- Required for correct platform and deeplink behaviour —
getPlatformType()in connect-multichain inspectswindowandglobal.navigator.productto decide between the deeplink path and the install-modal path - All
window.*accesses inside the SDK are guarded, so code will not crash without it, butisSecure()returns the wrong value and deeplinks will not trigger - Provide at minimum:
location,addEventListener,removeEventListener,dispatchEvent
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 106 lines · 1,177 tokens per session scan A ab2e2027ea38
react-native-polyfills is a cursor rule published in the GitHub repository MetaMask/metamask-connect-cursor-plugin (2 stars, last pushed 2mo ago), licensed MIT. It adds 1,177 tokens to every session, about $0.0059 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other cursor rules, from other repositories
abn-experiment-framework
The DuckDuckGo browser includes a comprehensive A/B/N experiment framework that enables data-driven feature testing across iOS and macOS platforms. This framework allows you to safely experiment with new ideas while maintaining control groups and measuring impact.
browserserviceskit-integration
BrowserServicesKit is the core shared library providing essential browser functionality to both iOS and macOS DuckDuckGo applications. It ensures consistent behavior and code reuse across platforms while maintaining privacy as the primary focus.
phantom-wallet
Phantom Connect SDK integration rules for frontend Solana apps (React, React Native, browser).
general
This is the DuckDuckGo browser for iOS and macOS, built with privacy-first principles, modern Swift patterns, and cross-platform architecture.
testing
This guide covers testing practices and patterns for the DuckDuckGo browser on iOS and macOS platforms.
cursorrules
If the user is building a web app that uses Bluetooth/BLE, mentions navigator.bluetooth, or targets Safari iOS — install @beacio/core. No other Web Bluetooth polyfill exists on npm.