feat: add the metamask-extension base skill set - #136
Conversation
NicolasMassart
left a comment
There was a problem hiding this comment.
One concern before treating the proposed Extension set as the default base.
| --- | ||
| name: perf-rendering | ||
| description: Rendering performance optimization | ||
| base: true |
There was a problem hiding this comment.
suggestion: fix the perf trigger descriptions before making these base
The PR already calls out that the four perf-* descriptions are too thin to self-trigger.
That seems at odds with #135's rationale for the base-description guard: a base skill permanently consumes listing context, so installing one that rarely triggers gives us the cost without much benefit.
Could we either improve these descriptions in this PR before marking them base, or leave the perf skills opt-in until that cleanup is done?
There was a problem hiding this comment.
Agreed — and as of c30fa37 on #135 this is no longer a judgment call, it's a build failure.
That commit turns the base-description floor from a warning into an error (@Qbandev's point below: warnings never set a non-zero exit, so "CI warns until it's rewritten" wasn't actually a ratchet). Since this branch is stacked on feat/base-skills-mobile, it inherits that on the next rebase. Verified by linting this branch's content with the post-#135 linter:
$ SKILLS_LINT_ROOT=<clone of feat/base-skills-extension> node .github/scripts/lint-skill-entry.mjs
coding/controller-guidelines
error: `description` is only 35 chars; a base skill needs enough trigger cues …
performance/perf-hooks-effects error: … only 36 chars …
performance/perf-react-compiler error: … only 36 chars …
performance/perf-rendering error: … only 34 chars …
performance/perf-state-management error: … only 39 chars …
52 skill(s) checked, 5 error(s), 90 warning(s)
$ echo $?
1
So of your two options, "improve the descriptions in this PR" and "leave them opt-in until the cleanup" are now the only two — marking them base as-is can't merge.
One correction to the framing: it's 5 skills, not 4. controller-guidelines has the identical defect at 35 chars but was presented in the inclusion table without the caveat. Credit to @Qbandev for catching that one.
|
Verified against a clone of The thin-description problem covers 5 of the 6 skills, not 4. "CI warns on each until rewritten, so the TODO cannot rot" doesn't hold. The "~670 tokens/session" figure appears to be characters. Suggestion: mark |
|
This list overlaps almost entirely with the list of skill pointers we have in extension's ### Coding Guidelines
- **Controller Patterns:** [.cursor/rules/mms-controller-guidelines/RULE.md](./.cursor/rules/mms-controller-guidelines/RULE.md)
- **Unit Testing:** [.cursor/rules/mms-extension-testing/RULE.md](./.cursor/rules/mms-extension-testing/RULE.md) → `references/unit.md`
- **E2E Testing:** [./test/e2e/AGENTS.md](./test/e2e/AGENTS.md) and [.cursor/rules/mms-extension-testing/RULE.md](./.cursor/rules/mms-extension-testing/RULE.md) → `references/e2e.md`
- **E2E CI Decision Tree:** [.github/guidelines/E2E_DECISION_TREE.md](./.github/guidelines/E2E_DECISION_TREE.md)
- **E2E Deprecated Patterns:** [./test/e2e/AGENTS.md](./test/e2e/AGENTS.md)
- **CI Workflows:** [.github/AGENTS.md](./.github/AGENTS.md)
- **Front-End Performance:**
- [Rendering Performance](.cursor/rules/mms-perf-rendering/RULE.md) - Start here (keys, memoization, virtualization)
- [Hooks & Effects](.cursor/rules/mms-perf-hooks-effects/RULE.md) - useEffect best practices
- [React Compiler & Anti-Patterns](.cursor/rules/mms-perf-react-compiler/RULE.md) - React Compiler considerations
- [State Management](.cursor/rules/mms-perf-state-management/RULE.md) - Redux optimization
- **Pull Requests:** [.cursor/rules/mms-pr-guidelines/RULE.md](./.cursor/rules/mms-pr-guidelines/RULE.md)
- **General Coding:** [.cursor/rules/mms-coding-guidelines/RULE.md](./.cursor/rules/mms-coding-guidelines/RULE.md)
- **Official Guidelines:** [.github/guidelines/CODING_GUIDELINES.md](./.github/guidelines/CODING_GUIDELINES.md)
Setting aside the fact that the file badly needs to be cleaned up, I think it's a good indication that this PR covers the category of skills that need to be "accessible by default." However, there's another category of critical skills that need to be "discoverable by default", a) because they otherwise would not be human-invoked or agent-searched due to lack of awareness, or b) because they actively correct agent (or human) predispositions that are erroneous. From experience reviewing extension PRs, these skills have contributed useful or even mission-critical interventions, and would be valuable to include as base skills:
Together they add 6,964 characters of always-loaded description, against 1,528 for the eleven The additional skills can be added in a follow-up once they've been merged, but I think they're critical to include. |
| name: controller-guidelines | ||
| description: BaseController development patterns | ||
| base: true |
There was a problem hiding this comment.
If we're only choosing one controller-related skill for extension it should probably be controller-integration(https://github.com/MetaMask/skills/blob/main/domains/coding/skills/controller-integration/repos/metamask-extension.md), since writing controllers is not a client-side concern, while integrating them comes up very frequently.
We can probably fit in both if wider understanding of controller internals seems valuable to have by default (or better yet have controller-integration reference sections of controller-guidelines so relevant information can be pulled by the agent as needed), but either way controller-integration would need to be included.
There was a problem hiding this comment.
Agreed on the priority, and the good news is that half of it is already done: controller-integration is base in #135, not here. It carries a repos/metamask-extension.md overlay, so extension engineers get it from that PR regardless of what happens to this one. This thread is therefore only about whether controller-guidelines should be base in addition.
That question is now forced by CI. controller-guidelines is one of five skills failing the base-description floor that #135 (c30fa37) promoted from a warning to an error:
coding/controller-guidelines
error: `description` is only 35 chars ("BaseController development patterns");
a base skill needs enough trigger cues to be selected (aim for 120+)
So it can't be marked base as written, independent of the design question.
Your parenthetical is probably the best resolution: have controller-integration reference the relevant sections of controller-guidelines so the agent pulls internals on demand. That keeps the content reachable without spending a second always-on listing slot, and it matches the shape Mobile uses — one entrypoint plus on-demand references — which @Qbandev independently raised about the four separate perf-* slots. Same structural fix for both.
Your point about writing controllers not being a client-side concern is also the stronger argument for why it should be on-demand rather than always-on, so those line up.
|
All three verified, and the second one is now implemented upstream in #135. 1. Five skills, not four. Confirmed exactly, including your character counts. Reproduced by linting this branch's content with the post-#135 linter:
2. "CI warns until rewritten" doesn't hold. Correct, and fixed. c30fa37 on #135 moves the base-description rule from That was the most useful thing in your review — a ratchet that never fails a job isn't a ratchet. 3. Characters vs tokens. Confirmed. I get 691 chars ≈ 173 tokens summing 4. Missing On the suggestion — mark |
|
The accessible/discoverable split is the most useful framing anyone has put on this, and I think it's right. Three practical notes for the follow-up: They'll each need to clear the 120-char floor — and that's now an error, not a warning. c30fa37 on #135 promoted Your set is arguably the better argument for the rule than the rule's own rationale: a skill that exists specifically to be discovered by someone unaware of the problem is precisely the one where a 35-char label is fatal. Putting the budgets on one scale. The PR body's "~670 tokens" turned out to be a character count (@Qbandev caught it); real figures, all
So the discoverable set is larger than the other two combined. That doesn't argue against it — the incident history you're describing is a much stronger justification than 1.7k tokens is a cost — but it does mean it deserves its own decision rather than riding in as an increment, which is what you're proposing anyway. Sequencing. Those four domains ( On the |
9e0a80a to
b0edb06
Compare
|
Pushed Both caveats are now addressed. Descriptions were 34–39 chars; they're now 247–339 and each ends with a That mitigates caveat #2 rather than solving it. Consolidating to a single entrypoint with on-demand references, the shape Mobile's @NicolasMassart — your suggestion is now enforced rather than advisory. Worth knowing it was 5 skills, not 4: @Qbandev — all three points landed. The "CI warns so the TODO cannot rot" mitigation was indeed false, and that's the finding that changed the code: #135 promotes the floor from a warning to an error, so these descriptions are load-bearing rather than optional. The "~670 tokens" figure was a character count; the ten base skills now cost 3,257 chars ≈ 814 tokens. @MajorLift — took the second option on controllers. Both stay base, and Two things worth flagging on this branch:
Still open: nothing is measured. The case for these descriptions is mechanical, not the result of a triggering experiment. |
Mark the ten skills every metamask-extension engineer needs as `base`, so a fresh clone lands exactly those. Four are already shared with Mobile (coding-guidelines, ui-development, controller-integration, pr-guidelines); this adds the six Extension-only ones. Depends on the `base` flag introduced for Mobile — merge that first. Extension base set: coding-guidelines, ui-development, controller-integration, pr-guidelines, extension-testing, controller-guidelines, perf-rendering, perf-hooks-effects, perf-react-compiler, perf-state-management. The four `perf-*` skills cover the same cross-cutting concern that makes Mobile's `performance` base; Extension's guidance is split across four skills rather than consolidated into one. Their descriptions are 34-39 characters and will not self-trigger yet — CI warns on each until they are rewritten. The content behind them (17-25KB each) is reachable by name in the meantime. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The description is the whole trigger surface for a base skill — it installs for every engineer in every applicable repo, so one that cannot self-select is a permanent listing slot that never fires. Two problems with the set as it stood. Descriptions were topic labels, not trigger conditions. "Rendering performance optimization" (34 chars) says what the skill is about but never when to reach for it, and nobody phrases the problem that way — they say the list stutters when they scroll. Every description now leads with concrete coverage and ends with a `Use when ...` clause in the vocabulary someone actually uses to describe the symptom. The four perf skills were also mutually indistinguishable: "my component re-renders too much" matched all of them equally, so selection was arbitrary and the model could pull ~20KB scattershot. Each now names its siblings explicitly, so whichever fires routes onward instead of competing. This mitigates the four-slots-for-one-concern problem rather than solving it; consolidating to a single entrypoint with on-demand references, as Mobile does, remains the structural fix. Kept deliberately short. The pre-existing descriptions average ~358 chars and do the job; a first pass at these averaged ~650, which is context every engineer pays for on every session. Trimming the coverage inventories and keeping the `Use when ...` clauses brought the extension base set from 5,341 chars (~1,335 tokens) to 2,981 (~745) with no loss of trigger vocabulary. Also here: - `controller-guidelines` gets a real description and stays base. Authoring a controller is rarer on a client than integrating one, so `controller-integration` is the more valuable of the pair — but both earn a slot, and the two now cross-reference so the split is discoverable rather than confusing. - `controller-integration`'s extension reference gains a section pointing at `controller-guidelines` for the authoring internals. - `perf-react-compiler` now routes to `perf-hooks-effects` rather than `perf-rendering`; its content is dependency-array territory. - Fixed `required- reading` and `conventional- commit`, stray hyphens that were rendering in the listing. Nothing here is measured. The argument is mechanical — the description is the selection surface, symptoms were absent, siblings were undifferentiated — not the result of a triggering experiment. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
b0edb06 to
073b468
Compare
The description is the whole trigger surface for a base skill — it installs for every engineer in every applicable repo, so one that cannot self-select is a permanent listing slot that never fires. Two problems with the set as it stood. Descriptions were topic labels, not trigger conditions. "Rendering performance optimization" (34 chars) says what the skill is about but never when to reach for it, and nobody phrases the problem that way — they say the list stutters when they scroll. Every description now leads with concrete coverage and ends with a `Use when ...` clause in the vocabulary someone actually uses to describe the symptom. The four perf skills were also mutually indistinguishable: "my component re-renders too much" matched all of them equally, so selection was arbitrary and the model could pull ~20KB scattershot. Each now names its siblings explicitly, so whichever fires routes onward instead of competing. This mitigates the four-slots-for-one-concern problem rather than solving it; consolidating to a single entrypoint with on-demand references, as Mobile does, remains the structural fix. Kept deliberately short. The pre-existing descriptions average ~358 chars and do the job; a first pass at these averaged ~650, which is context every engineer pays for on every session. Trimming the coverage inventories and keeping the `Use when ...` clauses brought the extension base set from 5,341 chars (~1,335 tokens) to 2,981 (~745) with no loss of trigger vocabulary. Also here: - `controller-guidelines` gets a real description and stays base. Authoring a controller is rarer on a client than integrating one, so `controller-integration` is the more valuable of the pair — but both earn a slot, and the two now cross-reference so the split is discoverable rather than confusing. - `controller-integration`'s extension reference gains a section pointing at `controller-guidelines` for the authoring internals. - `perf-react-compiler` now routes to `perf-hooks-effects` rather than `perf-rendering`; its content is dependency-array territory. - Fixed `required- reading` and `conventional- commit`, stray hyphens that were rendering in the listing. Nothing here is measured. The argument is mechanical — the description is the selection surface, symptoms were absent, siblings were undifferentiated — not the result of a triggering experiment. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…ask/skills into feat/base-skills-extension
Stacked on
feat/base-skills-mobile. Thebaseflag this PR sets is introduced there — merge #135 first, then this retargets tomainautomatically.What
Marks the 10 skills every
metamask-extensionengineer needs asbase, so a fresh clone lands exactly those.Four are already shared with Mobile and land in #135 —
coding-guidelines,ui-development,controller-integration,pr-guidelines. This PR adds the six Extension-only ones:extension-testingcontroller-guidelinesperf-renderingperf-hooks-effectsuseEffectmisuse, dependency arrays, cascading effectsperf-react-compilerperf-state-managementAlways-on cost: 3,257 characters ≈ 814 tokens per session across all ten.
Descriptions
Both caveats from the original version are addressed.
Descriptions now state trigger conditions, not topics. They were 34–39 characters —
"Rendering performance optimization"says what a skill is about but never when to reach for it, and nobody phrases the problem that way; they say the list stutters when they scroll. Each now leads with concrete coverage and ends with aUse when …clause in symptom vocabulary.The original mitigation here — "CI warns on each until rewritten, so the TODO cannot rot" — was false, as @Qbandev demonstrated: the linter only sets a non-zero exit on errors, so a warning sat invisibly inside a green check. #135 promotes the base-description floor to an error, which is what makes this PR's descriptions load-bearing rather than optional.
The four
perf-*skills now route to each other. They were mutually indistinguishable — "my component re-renders too much" matched all four equally, so selection was arbitrary and the model could pull ~20KB scattershot. Each now names its siblings, so whichever fires hands off rather than competing.This mitigates the four-slots-for-one-concern problem; it does not solve it. Consolidating to a single entrypoint with on-demand references, as Mobile's
performancedoes, remains the structural fix and is still worth doing separately.Nothing here is measured. The argument is mechanical — the description is the selection surface, symptoms were absent, siblings were undifferentiated — not the result of a triggering experiment.
Scope
Proposed from the catalogue rather than from working in
metamask-extension, so it still needs owner review on:extension-testingis genuinely the right single testing entrypointResolved since the original: @MajorLift confirmed
controller-guidelinesandcontroller-integrationshould both be base, withcontroller-integrationthe more valuable for client work since integrating controllers is routine and authoring them is not. They now cross-reference each other, andcontroller-integration's Extension reference gains a section pointing at the authoring guidance.Known Extension gaps (not addressed here)
pr-workflowskills are Mobile-only, includingcreate-pr. Extension gets PR standards but no PR automation. Overlay work on existing skills — likely the cheapest high-value win.component-scaffoldequivalent