feat(coding): add Mobile selector-patterns skill - #153
Conversation
Give agents a description-triggered guide for authoring and consuming Redux selectors. MCWP-472 asked for an always-on rule; this repo ships opt-in skills, so discovery is the description plus install/use pointers. Co-authored-by: Cursor <cursoragent@cursor.com>
ReviewChecked out the branch, ran the linter and installer dry-runs, and verified every Mobile claim against a Verified clean
Blockers1. The example snippet doesn't compile. In Repo precedent avoids this deliberately: 2. The flagship example violates the skill's own rules. 3. "Copy from 4. The Factory table contradicts the 1 and 2 make agents emit bad code; 3 and 4 make them emit inconsistent code. Non-blocking
On CONTRIBUTING's "is it a duplicate?" testOverlap with |
Use tokensController as the copy-from exemplar, narrow inputs before createDeepEqualSelector, and put the install command on discovery pointers. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed the review on this follow-up commit. Blockers
Nits
|
Drop restated deadly patterns from Factory and Reject so the catalog lives only in mm-selector-memoization.md. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Follow-up on CONTRIBUTING’s “is it a duplicate?” note. Reject now keeps authoring-only bullets (UI |
Description
Opt-in
coding/selector-patternsskill with a MetaMask Mobile overlay. Agents get a description-triggered guide for authoring and consuming Redux selectors: namedselect<Feature><Thing>selectors,createSelector/createDeepEqualSelector, leaf reads ofstate.engine.backgroundState,useSelector(selectX)in UI, and collocated tests with at least two state variants. Version-gated flag selectors stay onfeature-flags. Memoization audits stay onperformance.Install/use pointers were added on the Mobile overlays for
coding-guidelines,controller-integration(step 11 rewritten so object/array outputs can usecreateDeepEqualSelector), andperformance.MCWP-472 asked for an always-on Cursor rule (
alwaysApply: true). This repo ships opt-in skills, so discovery is the description plus those install/use pointers.Fixes: https://consensyssoftware.atlassian.net/browse/MCWP-472
Type of Change
Skill Details (if adding a new skill)
Provider Name: MetaMask
Skill Name: selector-patterns
Brief Description: Redux selector authoring for MetaMask Mobile: named
select<Feature><Thing>selectors inapp/selectors/,createSelector/createDeepEqualSelector, leaf reads ofstate.engine.backgroundState, anduseSelector(selectX)in UI. Use when adding, updating, or asking about selectors.Checklist
Testing
yarn audit:skills—coding/selector-patternshad no schema errors./tools/install --repo metamask-mobile --include coding/selector-patternsmobile-skill-consumerproduct tickets (Contacts address-book count; Onboarding password-set store read). Product diffs were discarded after capture.Important
Skill-test report from two Mobile consumer runs : skill-test-selector-patterns.local.md
Additional Context
CODEOWNERS:
@MetaMask/extension-platform@MetaMask/mobile-platform@MetaMask/core-platform(/domains/coding/,/domains/performance/)Made with Cursor