chore(skills): switch to public MetaMask/skills with optional Consensys overlay#30180
Conversation
…ys overlay - scripts/skills-sync.sh: prefer METAMASK_SKILLS_DIR (public, no auth), fall back to CONSENSYS_SKILLS_DIR. Multi-source aware via the public tools/sync. - scripts/skills-postinstall.sh: auto-clone MetaMask/skills into .skills-cache and install on every `yarn install`. Best-effort — skipped on CI or when SKILLS_SKIP_POSTINSTALL=1, silent on offline. - .gitignore: add .skills-cache/, update comments to reference public canonical. - package.json: add postinstall hook that runs skills-postinstall.sh.
|
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. |
Cross-platform consistency with other scripts/*.mjs. Engineers on Windows without WSL/Git Bash can now run `yarn skills` and the postinstall hook without bash on the wrapper level (bash is still used for the actual install/sync from the skills repo, but that's invoked via spawnSync). Behavior is unchanged: same env var precedence, same cache location, same skip rules.
CI default-skip stays. Jobs that genuinely need skills installed (agent- driven review bots, e2e jobs that hit skills, etc.) can set SKILLS_FORCE_POSTINSTALL=1 to override.
Matches the parallel extension PR (#42488) and the mobile repo's existing TS-first stance. Mobile uses node 20 (no native TS) so the scripts run via the already-installed `tsx` direct dep — same runner the e2e scripts use.
Per Cursor Bugbot review: - skills-postinstall.mts: `git clone` now pins `--branch main` so the initial clone matches the fetch/reset path (`origin/main`). Avoids drift if the default branch ever changes. - skills-postinstall.mts: `--target` is now `process.cwd()` (absolute) to match `--source`. Prior `.` would break if the installer ever `cd`s internally. - .skills.local.example: documents METAMASK_SKILLS_DIR + CONSENSYS_SKILLS_DIR env vars and the install-all default per upstream change.
CI `yarn allow-scripts` rejected the new postinstall hook because the root package wasn't in the allowScripts allowlist. Adding "$root$": true matches the extension repo convention and unblocks postinstall on CI.
Zero-config defaults per @gauthierpetetin feedback on the ext PR. The postinstall hook already clones MetaMask/skills into .skills-cache/metamask-skills. The wrapper now picks that up automatically when METAMASK_SKILLS_DIR is unset, injecting METAMASK_SKILLS_DIR=<cache> into the spawned bash so tools/sync sees the source. Engineers run `yarn install && yarn skills` with no shell rc edit. Env var still wins as override for engineers who keep a separate clone.
mkdirSync/statSync/existsSync can throw (EPERM, read-only FS, file-vs-dir conflict on .skills-cache). The script promises 'never fails the install' but an uncaught throw would propagate as non-zero exit and break `yarn install` for every engineer. Wrap main body in try/catch, log warning, exit 0.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 84c221b. Configure here.
geositta
left a comment
There was a problem hiding this comment.
@abretonc7s Thanks for setting this up. From what I can tell, the new zero config path has two correctness gaps that will make local setup behave differently from the documented contract.
On stock macOS, postinstall invokes the skills installer with Bash 3.2 even though the installer requires Bash 4 syntax, so the install is skipped while yarn install still succeeds. Separately, postinstall installs all domains directly through tools/install, ignoring the .skills.local domain selection that yarn skills saves and honors. The .skills.local.example path guidance also needs to match what the TypeScript wrapper can resolve.
Am requesting changes so the automatic setup path and the manual yarn skills path use the same shell selection and source/domain resolution semantics.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
None of these changes touch app source code, controllers, navigation, UI components, test infrastructure, or any user-facing functionality. The postinstall script is a no-op on CI. No E2E tests or performance tests are needed. Performance Test Selection: |
|




Description
Follow-up to #29853. Switches
yarn skillsto the new publicMetaMask/skillsrepo, with the privateConsensys/skillsrepo available as an optional overlay for internal-only material. Adds apostinstallhook so engineers get an auto-updated skill set on everyyarn install— no manualyarn skillsneeded.Why public
git clonea private repo or set engineer-managed env vars. The public repo solves this with a one-liner curl bootstrap (no SSH, no auth).postinstall(Ramon's ask in#engineering-mobile).Engineer experience (zero-config)
Override only if you keep a separate clone:
Changes
scripts/skills-sync.mts— multi-source aware wrapper (was bash, ported to node.mtsfor cross-platform consistency). Resolution order:METAMASK_SKILLS_DIR→CONSENSYS_SKILLS_DIR→ auto-fallback to.skills-cache/metamask-skills. When the cache is used, injectsMETAMASK_SKILLS_DIR=<cache>so the bash sync underneath sees the source.scripts/skills-postinstall.mts(new) — auto-clonesMetaMask/skillsinto.skills-cache/metamask-skillsand runs the installer on everyyarn install. Layered withCONSENSYS_SKILLS_DIRwhen set. Best-effort: skipped on CI, onSKILLS_SKIP_POSTINSTALL=1, or when offline. Opt back in on CI withSKILLS_FORCE_POSTINSTALL=1..gitignore— adds.skills-cache/, updates comments to reference public canonical.package.json— addspostinstallhook + lavamoat"$root$": trueallowScripts entry;skillsscript usestsx scripts/skills-sync.mts(node 20 has no native TS)..skills.local.example— documents new zero-config default + optional env-var override.Companion PRs
MetaMask/skills(merged) — public source of truth, install CLI, multi-sourcesync, cloud-agentbootstrap.Consensys/skills#9— private overlay only; repo retained for future internal material.MetaMask/metamask-extension#42488— parallel extension migration.MetaMask/decisions#162— ADR amendment.Out of scope
Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
No UI change — agent tooling and repo wiring only.
Before
N/A
After
N/A
Pre-merge author checklist
Performance checks (if applicable)
Pre-merge reviewer checklist
Note
Medium Risk
Medium risk because it changes install-time behavior via a new
postinstallscript (runsgitand writes to.skills-cache/) and updates Lavamoat allow-scripts, which could impact developer/CI installs if misconfigured.Overview
Updates agent-skills tooling to prefer the public
MetaMask/skillssource (optionally layered withConsensys/skills) and replaces the oldbash-onlyscripts/skills-sync.shwith atsxwrapper that auto-detects sources via env vars or.skills.local.Adds a best-effort
postinstallhook that clones/updatesMetaMask/skillsinto.skills-cache/(skipped on CI unless opted in) and updates docs/config templates plus.gitignore/Lavamoat settings to support the new zero-config workflow.Reviewed by Cursor Bugbot for commit ca9187e. Bugbot is set up for automated code reviews on this repo. Configure here.