Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Add `performance/profiling-regression-proposal`: an evidence-only skill that proposes follow-up actions after MetaMask Mobile CI has already classified a Hermes CPU-profile regression.
- Support explicit-only workflow skills through native invocation controls, preserve repository overlays, and prune managed retired skill names during sync.
- Distribute the Perps static review as generated per-client checklists with source-tracked criteria, repository overlays, and optional analyzer context export.
- Distribute Perps static review as a shared execution checklist with repository overlays, source-tracked client rules and per-rule evidence outcomes, without a duplicate template catalog.
- Add `navigation` skill with a repo-agnostic base and a MetaMask Mobile overlay for `Routes` and `NavigationService`. Marked `base: true` so it installs even when its domain is filtered out.
- Add `feature-flags` skill with a repo-agnostic base and a MetaMask Mobile overlay for version-gated remote flags. Marked `base: true` so it installs even when its domain is filtered out. ([#147](https://github.com/MetaMask/skills/pull/147))
- Add `analytics` skill (`platform/analytics`, moved from `coding`) with a repo-agnostic base and a MetaMask Mobile overlay for the canonical tracking API. Marked `base: true` so it installs even when its domain is filtered out. ([#140](https://github.com/MetaMask/skills/pull/140))
Expand Down Expand Up @@ -53,7 +53,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **Breaking:** frontmatter key `mandatory` renamed to `base`. Update any skill still using `mandatory:`. ([#135](https://github.com/MetaMask/skills/pull/135))
- **Breaking:** `postinstall` now syncs by default. It previously required `SKILLS_AUTO_UPDATE=1`; the opt-out is now `SKILLS_AUTO_UPDATE=0`. An explicitly empty `SKILLS_AUTO_UPDATE=` keeps its old meaning (off) rather than being read as unset. ([#135](https://github.com/MetaMask/skills/pull/135))
- `base:` truthiness is consistent across all four implementations. The linter alone accepted `on`/`off`, so `base: on` linted clean while the installer skipped the skill. ([#135](https://github.com/MetaMask/skills/pull/135))
- perps: `perps-review-pr` is a thin wrapper over `mm-harness review checklist --domain perps`; the perps review knowledge (anti-patterns, mobile/extension map, shared-package analysis) and the other perps knowledge files now live only in `MetaMask/experimental-metamask-recipe-perps` (`review/`, `docs/knowledge/`), so `domains/perps/knowledge/` and the skill's `repos/` overlay are removed and the sibling perps skills reference the library.
- Rewrite `CONTRIBUTING.md` and skill template for MetaMask/skills layout.
- `swaps-cpu-profile-audit` now audits the whole capture instead of swaps-owned files only: non-swaps frames that ran while the user was on a swaps screen are classified by their relation to the swaps call stacks (called by swaps, hosts the swaps screen, or concurrent with it), bucketed into named context areas, and reported alongside swaps rows. Every reported row carries an `Owned by swaps` column, and fix depth is gated on it. New `--context-min-pct` and `--swaps-only` analyzer flags.
- `swaps-cpu-profile-audit` reports swaps-owned areas, non-swaps areas on the swaps path, and non-swaps areas running concurrently as separate tables, so the per-area swaps detail is no longer diluted by context rows. The swaps table gained an inclusive-time column, and the report explains that self time on a leaf means a screen can trigger heavy work while showing ~0 ms of its own. Non-swaps rows in the fix table are now capped to the few that matter.
Expand Down
2 changes: 2 additions & 0 deletions domains/perps/skills/perps-review-pr/agents/openai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
policy:
allow_implicit_invocation: false
85 changes: 85 additions & 0 deletions domains/perps/skills/perps-review-pr/references/core.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# core review rules

<a id="public-controller-contracts-must-be-versioned-and-migration-aware"></a>

## Public Controller Contracts Must Be Versioned and Migration-Aware

A change to controller state shape, method signatures, event names or payloads, or package exports ships with a client migration plan and package-level consumer-style tests.

- [ ] **State shape changes without client migration** — Mobile/Extension selectors and hooks may break.
- [ ] **Method signature changes without compatibility plan** — exported controller methods need backward compatibility or coordinated client changes.
- [ ] **Event name/payload drift** — clients and metrics rely on stable events.
- [ ] **Package export changes without package-level tests** — changing exports must include consumer-style assertions.

<a id="package-release-metadata-must-match-contract-impact"></a>

## Package Release Metadata Must Match Contract Impact

The changelog entry and the semver bump match the contract impact, and a bump PR names the package version and the consumers it was checked against.

- [ ] **Public API/state change without changelog** — clients need migration context.
- [ ] **Breaking change released as minor/patch** — semver must match impact.
- [ ] **Controller package and client integration out of sync** — sync/bump PRs should state package version and consumer compatibility.

<a id="hyperliquid-multi-sig-account-handling-in-hyperliquidprovider"></a>

## HyperLiquid Multi-Sig Account Handling in HyperLiquidProvider

Every user-scoped exchange write in `HyperLiquidProvider` needs both a proactive info probe placed right before the write and a message classifier in its `catch`; HyperLiquid rejects every single-signer write for a multi-sig account, and neither guard alone is sufficient.

- [ ] **Catch-path classifier without proactive probe** — burns a doomed write on every entry
for a multi-sig account. The error is caught, but the round-trip and any side-effects
(recording premature state, logging) have already occurred.
- [ ] **Proactive probe without catch-path classifier** — can race the multi-sig conversion
window and fails open: the probe returns normal, the write fires during the transition,
and the error is unhandled.
- [ ] **Probe placed too early** — placing the probe immediately after `userAbstraction` (rather
than immediately before the write) means already-unified multi-sig accounts are probed on
every call, and the probe result can cause the account to be recorded as `enabled: false`
before the unified path has had a chance to short-circuit. The correct placement is
**after** the already-compatible short-circuit, the defer branch, and the unknown-mode
bail — right before the write that would otherwise fail.

<a id="ensureunifiedaccountenabled-retry-vs-permanent-failure-cache-semantics"></a>

## `#ensureUnifiedAccountEnabled` — Retry vs Permanent-Failure Cache Semantics

An attempted unified-account setup that fails either sets the retry flag (`#unifiedAccountSetupNeedsRetry`, transient) or caches `{ attempted: true, enabled: false }` in `TradingReadinessCache` (permanent), never both; the deferred-signing, feature-disabled, and unknown-mode paths intentionally return without touching either.

- [ ] **Permanent account-shape condition cached as retryable** — if a condition that can never
resolve (e.g. the account is already a confirmed multi-sig) sets the retry flag instead
of caching `{ attempted: true, enabled: false }`, the client re-runs the failing path on
every Perps tab entry indefinitely. This is the root cause of the recurring Perps-tab
error: set the retry flag only for transient failures that a subsequent attempt might
recover from; cache permanent failures as final without setting the retry flag.
- [ ] **Retryable flag + permanent condition** — verify that each attempted-setup path through
`#ensureUnifiedAccountEnabled` that returns without enabling the account either (a) sets
the retry flag and returns without caching, or (b) caches `{ attempted: true, enabled:
false }` and does *not* set the retry flag. Both flags active on the same path is a loop.
- [ ] **Deferred or skipped path treated as a failure** — the defer-until-action, feature-disabled,
and unknown-mode returns leave the cache untouched on purpose so the next entry re-evaluates;
caching them as attempted suppresses the migration when the user later trades.

<a id="metered-benefits-need-a-strict-improvement"></a>

## Metered Benefits Need a Strict Improvement

A winning fee source and an actual reduction in the charged fee are separate
conditions. Do not spend a metered allowance on a tie. Check the resolver and
every downstream consumption marker against the same economic predicate, with
explicit equality and quantization-boundary cases.

<a id="read-only-account-guards-cover-every-write"></a>

## Read-only Account Guards Cover Every Write

Inventory exchange calls, transfers, cancellation, withdrawals and registered
venue-key paths before claiming an account is read-only. Guard the narrow shared
write boundary before local side effects; preserve setup needed for authenticated
reads. A missing public export is a contract defect even when internal tests pass.

<a id="evidence-expected-before-core-perps-review"></a>

## Evidence Expected Before Core Perps Review

The PR carries a contract impact matrix (state, methods, events, exports, constants), a Mobile/Extension compatibility note or paired PR links, provider abstraction and fallback tests, and grep evidence that no client import or environment global entered the package.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading