feat: add metamask-connect agent skill (skills.sh)#334
Merged
Conversation
Colocate the MetaMask Connect SDK agent skill in the SDK repo so it versions with the code and is installable via `npx skills add MetaMask/connect-monorepo`, with skills.sh install analytics. Single progressive-disclosure skill (Agent Skills format), mirroring MetaMask/smart-accounts-kit#264: a routing SKILL.md points into references/ (conventions, troubleshooting) and workflows/ (per-stack setup, sign/send for EVM + Solana, multichain invokeMethod, migration). Ported from MetaMask/skills#50 (now closed); source-verified against the published @metamask/connect-* packages.
- Correct the @wagmi/connectors metaMask() optional peer range from the
stale ^1.3.0 to the current ^2.1.0 across setup-wagmi, setup-wagmi-connector,
migrate-from-sdk, and migrate-wagmi-connector. The old guidance ("do not
install 2.x") was inverted and would produce the peer mismatch it warned
against; now points readers at `npm info @wagmi/connectors peerDependencies`.
- Fix setup-evm-react-native: createEVMClient is not a singleton (only the
multichain core is); each call returns a fresh wrapper.
- Align Solana sign/send prerequisites with setup-solana-react: createSolanaClient
need not resolve before first render (wallet registers ~1s later).
Add a Content Security Policy section to conventions.md covering the required relay WebSocket and QR data: URI origins, optional analytics / Stencil style allowances, and a minimal example. Add pointers from the browser-specific setup guides (EVM, Solana, multichain) and a dedicated troubleshooting entry so a CSP-blocked relay (which presents as a hung connection) is diagnosable.
Add workflows/setup-node.md covering headless integration: terminal ASCII QR connect via MetaMask Mobile, createMultichainClient as the recommended Node entry point (connect-multichain/connect-solana ship node builds; connect-evm delegates to the multichain node build), EVM/Solana signing through invokeMethod, the in-memory default storage caveat (no persistence across restarts) and how to supply a custom StoreClient, and the absence of polyfill/CSP requirements. Wire it into SKILL.md with a routing row and a "When to use" bullet.
Wrap the long Buffer.from(...).toString('base64') line in the Solana
invokeMethod example so it satisfies the repo's prettier (lint:misc)
80-col rule. Resolves the failing Lint CI job.
…oss-cutting blocks Reduce documentation drift surface by giving each topic a single canonical home, per the Agent Skills guidance (focused reference files, TOCs >300 lines) and mirroring MetaMask/smart-accounts-kit#264's domain-split refs. - Split the 610-line conventions.md into 7 focused, domain-organized references (evm, events, multichain, solana, react-native, csp, testing), each with its own table of contents. conventions.md is now a 93-line always-on core (import paths, config, supportedNetworks, singleton, error handling, connection state) plus a topic index routing to the rest. - Repoint the CSP cross-links in setup-evm-browser, setup-solana-browser, setup-multichain, and troubleshooting at the new canonical csp.md. - Point the two React Native setup workflows at react-native.md as the canonical polyfill/Metro reference (keeping their runnable recipes). - Update SKILL.md's always-on pointer to describe the core + focused refs. All skills/**/*.md pass prettier (3.6.2) and every internal link/anchor resolves.
jiexi
reviewed
Jun 18, 2026
jiexi
reviewed
Jun 18, 2026
jiexi
reviewed
Jun 18, 2026
jiexi
reviewed
Jun 18, 2026
Point migrate-from-sdk and setup-wagmi-connector workflows at the existing references/react-native.md instead of a non-existent rule.
Co-authored-by: jiexi <jiexiluan@gmail.com>
Address review feedback on conventions.md import-paths section: - State that the wagmi metaMask() connector comes from wagmi/connectors with connect-evm as an optional peer; connect-evm ships no wagmi entrypoint. - Trim the multichain dependency bullet: drop the imprecise ^1.0.0 pin and 2.0.0 history, keep the load-bearing "installed transitively" fact.
Address review feedback: - conventions: merge duplicate dapp.url bullets; add Solana disconnect scope behavior; enumerate the EVM methods that are rejected. - solana: rewrite the Chrome Android note to be actionable (the wallet-adapter beforeunload patch is internal and not inherited by consumers); reframe the RN section as a third-party adapter limitation with the multichain/invokeMethod path. - events: reframe intro so it doesn't read as EVM-only; add a Solana state-changes section pointing at core.stateChanged. - multichain: trim the bundle/lazy-transport section to the one actionable guardrail.
jiexi
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a top-level
skills/directory with a singlemetamask-connectAgent Skill for building dApps with this SDK (@metamask/connect-evm,@metamask/connect-multichain,@metamask/connect-solana) and the wagmimetaMask()connector.Why colocate here
npx skills add MetaMask/connect-monorepoand tracked on skills.sh, matching the MetaMask embedded-wallets "build with AI" pattern.MetaMask/skillsinto the SDK repo for the same reasons.Format notes
SKILL.md(uppercase), frontmattername(matches the folder) +description, on-demandreferences/+workflows/linked by relative paths one level fromSKILL.md.references/conventions.mdfolds the MetaMask Connect Cursor plugin's always-on rules into one doc, so non-Cursor agents installing vianpx skillsstill get the guardrails.skills/is outside thepackages/*,playground/*,integrations/*globs, so it isn't built by turbo or published to npm.yarn lint:miscclean).Provenance
Ported from MetaMask/skills#50 (now closed in favor of colocation). Every workflow was source-verified against the published
@metamask/connect-*packages.Ownership
Covered by the existing
* @MetaMask/wallet-integrationsCODEOWNERS rule. Happy to add@MetaMask/mobile-platformas a co-owner ofskills/if preferred.Notes