Skip to content

feat(platform): add Extension runtime architecture, debugging skills - #44

Open
MajorLift wants to merge 6 commits into
MetaMask:mainfrom
MajorLift:add/platform-skills
Open

feat(platform): add Extension runtime architecture, debugging skills#44
MajorLift wants to merge 6 commits into
MetaMask:mainfrom
MajorLift:add/platform-skills

Conversation

@MajorLift

@MajorLift MajorLift commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Adds a platform domain: the extension's runtime architecture and the failure modes specific to it.

The MV3 service-worker lifecycle, extension architecture, and runtime-error triage apply to metamask-extension and nowhere else — they have no counterpart in Mobile or Core, which is why they need a domain rather than a corner of coding.

Skills

  • extension-errors-debugging — triage an extension runtime error to root cause. Ships a metamask-extension overlay.
  • extension-lifecycle-decoupling — decouple work from the MV3 service-worker lifecycle, so a suspended worker doesn't strand it.

Knowledge

  • extension-architecture — the process/context model the two skills reason over.
  • mv3-service-worker — lifecycle, suspension, and what survives it.

Notes

  • New domain with no CODEOWNERS entry/domains/platform/ falls to the * catch-all. Tell me which team should own it and I'll add the line.
  • No CHANGELOG entry. Per CONTRIBUTING, that file tracks consumer-facing changes to the @metamask/skills CLI package; skill-only PRs don't add one.
  • Both skills are experimental. Commits GPG-signed.

CHANGELOG.md tracks consumer-facing changes to the `@metamask/skills` package,
per CONTRIBUTING's "CLI / tooling changes" section. No merged skill-only PR adds
an entry (MetaMask#80, MetaMask#78, MetaMask#70, MetaMask#62, MetaMask#61 all touch zero changelog lines).

It was also the sole source of this branch's conflict with `main`, since every
skill PR edits the same `[Unreleased]` block.
@MajorLift MajorLift changed the title Add platform domain plus testing and utility skills feat(platform): add extension runtime, benchmark, and profiling skills Jul 30, 2026
@MajorLift
MajorLift marked this pull request as draft July 30, 2026 14:03
@MajorLift MajorLift changed the title feat(platform): add extension runtime, benchmark, and profiling skills feat(platform): add Extension platform, architecture, profiling skills Jul 30, 2026
`benchmark-design` and `browser-extension-profiling` both cover E2E benchmarking
with statistical rigor, and they sat in different domains here while the rest of
the measurement work — `data-analysis`, `react-render-proof` — lives in the
performance PR. Splitting one subject across two PRs made both harder to review.

Moves `benchmark-design`, its `benchmark-statistical-hygiene` knowledge, and
`browser-extension-profiling`. Neither skill referenced the other by path, so
nothing needed rewriting.

What remains is the extension-runtime work this PR is named for.
Generic scripting guidance — paginate an API, handle rate limits, retry
transient errors — with no MetaMask specificity and no relationship to this PR's
extension-runtime subject. `coding/` otherwise holds MetaMask internals.

Nothing referenced it and it referenced nothing, so removal is self-contained.
The content stays in this branch's history if it is wanted later.
@MajorLift MajorLift changed the title feat(platform): add Extension platform, architecture, profiling skills feat(platform): add Extension architecture, debugging skills Jul 30, 2026
The keepalive row was the one entry here resting on a live implementation detail
rather than on an absent handler or persistent storage, and it was cited as
`background.js:750-758` — a line range that drifts. If the interval grows past
the idle timeout or the keepalive is removed, the conclusion inverts from
"eviction is prevented" to "eviction happens routinely", and a skill still
asserting the first is worse than no skill.

Replaces the line range with a symbol grep (`saveTimestamp`,
`SAVE_TIMESTAMP_INTERVAL_MS`), names the two conditions the conclusion depends
on — sub-idle-timeout interval, and an extension API call rather than a bare
timer — and records what was verified, against which commit.
@MajorLift
MajorLift marked this pull request as ready for review July 30, 2026 18:15
@MajorLift

MajorLift commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Context budget

What this PR costs an agent, measured from an install rather than read from the diff. Three tiers, and only the first is unavoidable.

Skill Frontmatter Selected + refs & knowledge
extension-errors-debugging 84 chars ~1,355 tok ~1,355 tok
extension-lifecycle-decoupling 90 chars ~1,178 tok ~1,178 tok

Frontmatter is the only tier paid unconditionally — every agent loads it on every run once the skill is installed, used or not, because it is what the agent reads to decide relevance. The 28 skills across the eleven open skill PRs sit at a median of ~1,716 tokens selected and ~1,860 with references followed. All are within the 1,536-character description budget.

Selected is paid only when the agent picks the skill. + refs & knowledge is the ceiling if every bundled reference is then read; it is a worst case, not an expectation.

Method

tools/install --repo metamask-extension --maturity experimental against this branch at 45f78e127, measured per installed skill directory. Repo overlays are merged into the emitted SKILL.md, so they land in the selected tier rather than being missed by a source-byte count. Token figures are bytes/4 — a proxy for scale, not accounting.

These figures are pinned to the commit above and drift on every push; #96 tracks automating them.

@MajorLift MajorLift changed the title feat(platform): add Extension architecture, debugging skills feat(platform): add Extension runtime architecture, debugging skills Aug 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant