Skip to content

chore: centralize agent skills via Consensys/skills#29853

Merged
abretonc7s merged 16 commits into
mainfrom
feat/centralize-agent-skills
May 12, 2026
Merged

chore: centralize agent skills via Consensys/skills#29853
abretonc7s merged 16 commits into
mainfrom
feat/centralize-agent-skills

Conversation

@abretonc7s

@abretonc7s abretonc7s commented May 7, 2026

Copy link
Copy Markdown
Contributor

Description

Per ADR #57. Removes committed agent skills/rules now provided by the centralized Consensys/skills repo. Adds yarn skills to install them on demand.

  • All committed agent skills/commands/rules deleted from .cursor/, .claude/, and .agents/. Synced sets land via yarn skills; nothing under those dirs is tracked anymore.
  • .gitignore blocks the agent dirs entirely. Only .cursor/BUGBOT.md, .cursor/hooks.json, and .cursor/worktrees.json are carved out (IDE/bugbot config that must stay tracked).
  • yarn skills calls scripts/skills-sync.sh, which requires CONSENSYS_SKILLS_DIR to be set; falls back to setup instructions if not configured.
  • .skills.local (per-engineer SKILLS_DOMAINS= config) is gitignored; .skills.local.example is committed as a template.

Kept (in-repo, not under agent dirs)

  • docs/ trees (perps, predict, readme), AGENTS.md files
  • docs/testing/{unit-testing,e2e-testing,component-view-tests}.md (see next section)

In-repo testing guides (docs/testing/)

.cursor/BUGBOT.md is read by Cursor's BUGBOT service, which cannot run yarn skills to fetch the centralized mms-* set. Several AGENTS.md files also mark the testing guides ALWAYS-mandatory and need a stable in-repo path.

To keep BUGBOT enforcement working without re-importing the deleted skill structure, the three test guides live as plain docs under docs/testing/:

  • docs/testing/unit-testing.md
  • docs/testing/e2e-testing.md
  • docs/testing/component-view-tests.md (consolidated SKILL.md + 3 references)

The same guidance also reaches IDE harnesses via Consensys/skills + yarn skills. These docs are the canonical fallback for tools that can't run the sync.

Engineer setup (one time)

git clone git@github.com:Consensys/skills.git ~/dev/Consensys/skills
export CONSENSYS_SKILLS_DIR=~/dev/Consensys/skills   # add to shell rc

Then in this repo:

yarn skills                              # interactive prompt
SKILLS_DOMAINS=perps,testing yarn skills # non-interactive

Companion PRs

Out of scope

  • Postinstall auto-trigger.
  • TS rewrite of CLI.
  • Personal-skills tooling.

Changelog

CHANGELOG entry: null

Related issues

Fixes:

Manual testing steps

Feature: yarn skills sync from Consensys/skills

  Scenario: engineer installs skills with CONSENSYS_SKILLS_DIR set
    Given the engineer has cloned Consensys/skills locally
    And CONSENSYS_SKILLS_DIR points to that clone
    When the engineer runs `SKILLS_DOMAINS=perps yarn skills`
    Then 2 perps skills are installed under `.claude/skills/`
    And `git status --short` reports a clean working tree
    And `cat .claude/skills/mms-fix-perps-bug/SKILL.md` shows the managed banner

  Scenario: engineer runs yarn skills without CONSENSYS_SKILLS_DIR
    Given CONSENSYS_SKILLS_DIR is unset
    When the engineer runs `yarn skills`
    Then the script prints setup instructions and exits non-zero
    And no files are written under `.claude/`, `.cursor/`, or `.agents/`

  Scenario: tracked Cursor config carve-outs remain
    Given the repo is freshly checked out
    Then `.cursor/BUGBOT.md`, `.cursor/hooks.json`, and `.cursor/worktrees.json` are tracked
    And no other files under `.cursor/`, `.claude/`, or `.agents/` are tracked

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)

  • I've tested on Android
    • Ideally on a mid-range device; emulator is acceptable
  • I've tested with a power user scenario
    • Use these power-user SRPs to import wallets with many accounts and tokens
  • I've instrumented key operations with Sentry traces for production performance metrics

For performance guidelines and tooling, see the Performance Guide.

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

Low Risk
Low risk since changes are limited to developer/agent tooling, but could disrupt local workflows if CONSENSYS_SKILLS_DIR isn’t configured or the sync script behaves unexpectedly.

Overview
Removes the previously committed agent skills/commands/rules under .agents/skills/ and .claude/ (and related Cursor command stubs), shifting to an external, on-demand install model.

Adds yarn skills (via scripts/skills-sync.sh) to delegate syncing to Consensys/skills using CONSENSYS_SKILLS_DIR, and updates .gitignore to fully ignore agent-managed directories while carving out tracked Cursor config files like .cursor/BUGBOT.md.

Updates .cursor/BUGBOT.md to reference the new in-repo testing docs under docs/testing/ instead of the removed rule paths.

Reviewed by Cursor Bugbot for commit a7d327f. Bugbot is set up for automated code reviews on this repo. Configure here.

Per ADR #57. Removes committed skills/rules now provided by Consensys/skills.
Ignores agent dirs so engineers can mix synced (`mms-*`) and personal skills
locally without git noise.

Engineer entrypoint: `yarn skills` (calls scripts/skills-sync.sh, which
delegates to Consensys/skills/tools/sync). Requires CONSENSYS_SKILLS_DIR
env var; fails fast with setup instructions if unset.

Removed (covered by mms- inject set):
- 6 .cursor/rules/*.mdc (general-coding, e2e-testing, unit-testing,
  pr-creation, ui-development, deeplink-handler guidelines)
- 2 .cursor/commands/ (create-ab-test, create-deeplink-handler)
- 5 .claude/skills/ (ab-testing-implementation, component-view-test,
  e2e-test, performance-testing, pr-changelog)
- 2 .claude/commands/ (create-ab-test, create-deeplink-handler)
- 13 .agents/skills/ (the same 5 above plus pr-codeowners, pr-create,
  pr-description, pr-issue-search, pr-manual-testing,
  pr-readiness-check, pr-review-queue, pr-title)

Kept (not centralized — internal):
- .claude/skills/perps-core-sync, repo-skill-authoring
- .cursor/skills/worktree-create
- .claude/commands/{commit,lint-staged,setup-*,unit-test*,
  generate-claude-rules,create-bug}.md
- All docs/ trees (perps, predict, readme), AGENTS.md files

Companion PRs:
- Consensys/skills#2 (source of truth + CLI)
- MetaMask/decisions#162 (ADR amendment)
- MetaMask/metamask-extension#42488 (parallel migration)
@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

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.

@metamaskbotv2 metamaskbotv2 Bot added the team-perps Perps team label May 7, 2026
@abretonc7s abretonc7s marked this pull request as draft May 7, 2026 10:26
@abretonc7s abretonc7s marked this pull request as ready for review May 7, 2026 14:16

@gambinish gambinish left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like there are some unit tests that are failing, but overall I like this type of removal from the source code 👍

One request: if we haven't already documented how to set this up these skills in the repo itself in a README.md, can we please do this? It looks like some of this was documented in the PR description, but it should really be in the repo's README.md from devs to reference easily.

Comment thread .gitignore
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 43.28%. Comparing base (4797726) to head (133464f).

Additional details and impacted files
@@             Coverage Diff             @@
##             main   #29853       +/-   ##
===========================================
- Coverage   81.50%   43.28%   -38.22%     
===========================================
  Files        5328     5328               
  Lines      141146   141146               
  Branches    32157    32157               
===========================================
- Hits       115046    61101    -53945     
- Misses      18239    74306    +56067     
+ Partials     7861     5739     -2122     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Centralization moved testing guides into Consensys/skills, but
.cursor/BUGBOT.md, AGENTS.md, and tests/**/AGENTS.md mark these refs
ALWAYS-mandatory and Cursor's bugbot service cannot run yarn skills.
Restore unit-testing, e2e-testing, and component-view-tests guides
under docs/testing/ as canonical in-repo copies; rewire all refs.
@abretonc7s abretonc7s requested review from a team as code owners May 8, 2026 09:35
Comment thread scripts/skills-sync.sh
@abretonc7s

Copy link
Copy Markdown
Contributor Author

@gambinish — added an "AI Agent Skills (yarn skills)" section to README.md (Development Tools) in 9e65162. Covers one-time setup of CONSENSYS_SKILLS_DIR and the run commands. The script itself prints the same instructions when the env var is unset.

Comment thread .gitignore
Bare `.claude/{skills,commands}/` directory ignores blocked re-adding
the kept files (`perps-core-sync`, `repo-skill-authoring`, 9 commands)
after an accidental `git rm`. Switch to `*` patterns and explicit `!`
carve-outs to match the `.cursor/` carve-out shape.
@abretonc7s abretonc7s enabled auto-merge May 8, 2026 09:48
@abretonc7s abretonc7s added no changelog required No changelog entry is required for this change no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed labels May 8, 2026
@metamaskbotv2 metamaskbotv2 Bot added the INVALID-PR-TEMPLATE PR's body doesn't match template label May 8, 2026
Comment thread .gitignore
abretonc7s added 2 commits May 8, 2026 17:51
`.skills.local` is auto-generated per engineer by `yarn skills` and
holds the local `SKILLS_DOMAINS=` preference. Ignore it and ship a
documented `.skills.local.example` so engineers know how to set it.
matallui
matallui previously approved these changes May 8, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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 dc1764b. Configure here.

Comment thread AGENTS.md

@racitores racitores left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Leave the review with request changes just to make sure that questions are clarified

Comment thread .agents/skills/component-view-test/references/navigation-mocking.md Outdated
Comment thread .agents/skills/component-view-test/references/reference.md Outdated
Comment thread .agents/skills/component-view-test/references/writing-tests.md Outdated
Comment thread README.md

@racitores racitores left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comments agreed. Missed files will be added in the shared skills repo

racitores
racitores previously approved these changes May 8, 2026
@abretonc7s abretonc7s dismissed stale reviews from matallui and racitores via 4114357 May 11, 2026 09:54
@abretonc7s

Copy link
Copy Markdown
Contributor Author

@jvbriones — added a short note in 4114357. Kept it minimal: "Keep that checkout on mainyarn skills syncs from whatever revision is checked out there." Didn't claim auto-pull since the local wrapper just delegates to tools/sync.

@metamaskbotv2 metamaskbotv2 Bot removed the INVALID-PR-TEMPLATE PR's body doesn't match template label May 12, 2026
Move check-ab-testing-compliance.sh out of the deleted .agents/ tree
into scripts/ so the unit test and BUGBOT can run it without yarn skills.
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: None (no tests recommended)
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: low
  • AI Confidence: 97%
click to see 🤖 AI reasoning details

E2E Test Selection:
This PR contains exclusively non-app changes:

  1. Documentation files: README.md, AGENTS.md, tests/AGENTS.md, tests/component-view/AGENTS.md, tests/docs/README.md, docs/ directory files - pure documentation with no code impact.

  2. AI agent skill files (.agents/, .claude/, .cursor/ directories): These are AI coding assistant configuration files (skills, commands, rules) used by tools like Claude, Cursor, and OpenAI Codex. They have no impact on the app runtime or test infrastructure.

  3. tests/scripts/check-ab-testing-compliance.test.ts: A single-line path fix updating the script reference from .agents/skills/ab-testing-implementation/scripts/check-ab-testing-compliance.sh to scripts/check-ab-testing-compliance.sh. This is a unit test for a shell script, not an E2E test.

  4. scripts/check-ab-testing-compliance.sh and scripts/skills-sync.sh: Utility scripts for A/B testing compliance checking and skills synchronization - not related to app functionality or E2E tests.

  5. package.json: The diff shows deleted .agents/skills/ files (reorganization of AI tooling), not changes to app dependencies.

  6. .gitignore: Minor configuration change.

None of these changes affect:

  • App source code (no app/ directory changes)
  • E2E test infrastructure (no tests/e2e/ or tests/page-objects/ changes)
  • Controllers, Engine, or any core modules
  • UI components or user flows
  • Performance-sensitive code paths

No E2E tests need to run for this PR.

Performance Test Selection:
No performance-sensitive code changes. All changes are documentation, AI agent skill files, and utility scripts with no impact on app rendering, data loading, or user flows.

View GitHub Actions results

@sonarqubecloud

Copy link
Copy Markdown

@abretonc7s abretonc7s self-assigned this May 12, 2026
@abretonc7s abretonc7s added this pull request to the merge queue May 12, 2026
Merged via the queue into main with commit 2d9e958 May 12, 2026
79 of 101 checks passed
@abretonc7s abretonc7s deleted the feat/centralize-agent-skills branch May 12, 2026 16:47
@github-actions github-actions Bot locked and limited conversation to collaborators May 12, 2026
@metamaskbotv2 metamaskbotv2 Bot added the release-7.78.0 Issue or pull request that will be included in release 7.78.0 label May 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no changelog required No changelog entry is required for this change no-changelog no-changelog Indicates no external facing user changes, therefore no changelog documentation needed release-7.78.0 Issue or pull request that will be included in release 7.78.0 size-XL team-perps Perps team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants