You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .agents/skills/perps-core-sync/SKILL.md
+33-29Lines changed: 33 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ description: Sync the perps controller from mobile to the core monorepo with cha
7
7
8
8
## Purpose
9
9
10
-
Use this skill to sync `app/controllers/perps/` from mobile to `packages/perps-controller/src/` in the core monorepo. The sync is driven by `scripts/perps/validate-core-sync.sh` — a 9-step pipeline (preflight, conflict check, copy, install, verify, eslint fix, build, lint, write sync state).
10
+
Use this skill to sync `app/controllers/perps/` from mobile to `packages/perps-controller/src/` in the core monorepo. The sync is driven by `scripts/perps/validate-core-sync.sh` — a 13-step pipeline that validates not only source sync but also the built publish artifact safety for extension consumers.
11
11
12
12
Use when:
13
13
@@ -58,37 +58,39 @@ Options:
58
58
-`--skip-test` — skip the test step for faster iteration
59
59
-`--verbose` — show full output for every step (useful for debugging)
|`__DEV__` found | Mobile code uses `__DEV__` guard | Replace with `false` in the mobile source file, or route through `PerpsPlatformDependencies` for environment-aware behavior. Fix in mobile, then re-sync. |
83
-
| Mobile imports (Engine, react-native, Sentry, DevLogger) | Direct platform import in controller | Route through `PerpsPlatformDependencies` (DI). All platform services must come through the `infrastructure` constructor param. Fix in mobile. |
84
-
| Suppression delta increase | Sync introduces new ESLint violations | Fix violations in mobile first (e.g., `'x' in y` → `hasProperty(y, 'x')` from `@metamask/utils`). Re-run sync after fixing. |
85
-
| Build failure | Missing tsconfig references, missing dependencies, type errors | Check `packages/perps-controller/tsconfig.json` references. Ensure new imports have corresponding `dependencies` in `package.json`. |
86
-
| Lint failure after fix | Auto-fix didn't resolve all issues | Re-run the eslint fix step. If persistent, check for new rule violations that need manual fixes in mobile. |
87
-
| Format fix failure | oxfmt can't auto-fix some files | Check for syntax errors that prevent parsing. Core uses `oxfmt` (not prettier) for TS formatting. |
88
-
| Test failure | Test fixtures missing new DI dependencies | Add mocks for new `PerpsPlatformDependencies` fields (e.g., `diskCache`) in `tests/defer-eligibility.test.ts`. |
89
-
| Changelog check failure |`CHANGELOG.md` not updated | Add entries under `## [Unreleased]` with `### Added`, `### Fixed`, `### Changed` sections linking to the PR. |
90
-
| Conflict check: behind origin/main | Someone pushed perps-controller changes to main |`cd <core-path> && git merge origin/main` before re-running sync. |
91
-
| Conflict check: checksum mismatch | Core source was hand-edited since last sync | Review the edits. Either port them back to mobile or discard and re-sync. |
|`__DEV__` found | Mobile code uses `__DEV__` guard | Replace with `false` in the mobile source file, or route through `PerpsPlatformDependencies` for environment-aware behavior. Fix in mobile, then re-sync. |
84
+
| Mobile imports (Engine, react-native, Sentry, DevLogger) | Direct platform import in controller | Route through `PerpsPlatformDependencies` (DI). All platform services must come through the `infrastructure` constructor param. Fix in mobile. |
85
+
| Suppression delta increase | Sync introduces new ESLint violations | Fix violations in mobile first (e.g., `'x' in y` → `hasProperty(y, 'x')` from `@metamask/utils`). Re-run sync after fixing. |
86
+
| Build failure | Missing tsconfig references, missing dependencies, type errors | Check `packages/perps-controller/tsconfig.json` references. Ensure new imports have corresponding `dependencies` in `package.json`. |
87
+
| Lint failure after fix | Auto-fix didn't resolve all issues | Re-run the eslint fix step. If persistent, check for new rule violations that need manual fixes in mobile. |
88
+
| Format fix failure | oxfmt can't auto-fix some files | Check for syntax errors that prevent parsing. Core uses `oxfmt` (not prettier) for TS formatting. |
89
+
| Test failure | Test fixtures missing new DI dependencies | Add mocks for new `PerpsPlatformDependencies` fields (e.g., `diskCache`) in `tests/defer-eligibility.test.ts`. |
90
+
| Publish artifact verification failure | Built Core dist lost the MYX webpack-ignore safeguard | Restore the `myxModulePath` workaround in mobile `PerpsController.ts`, rebuild Core, and confirm `dist/PerpsController.{mjs,cjs}` still contains `webpackIgnore: true`. |
91
+
| Changelog check failure |`CHANGELOG.md` not updated | Add entries under `## [Unreleased]` with `### Added`, `### Fixed`, `### Changed` sections linking to the PR. |
92
+
| Conflict check: behind origin/main | Someone pushed perps-controller changes to main |`cd <core-path> && git merge origin/main` before re-running sync. |
93
+
| Conflict check: checksum mismatch | Core source was hand-edited since last sync | Review the edits. Either port them back to mobile or discard and re-sync. |
92
94
93
95
## Post-Sync
94
96
@@ -131,6 +133,8 @@ After all 12 steps pass:
131
133
132
134
6.**Use `--verbose` when debugging** — without it, step output is captured to temp files and only shown on failure. With `--verbose`, all output streams to the terminal.
133
135
136
+
7.**Treat extension-consumer safety as a hard invariant.** If `packages/perps-controller/package.json` excludes `dist/providers/MYXProvider*`, the built `dist/PerpsController.{mjs,cjs}` must still preserve the `webpackIgnore` safeguard so extension bundlers never statically resolve the missing file.
Copy file name to clipboardExpand all lines: .github/pull-request-template.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,6 +63,17 @@ Feature: my feature name
63
63
-[ ] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable
64
64
-[ ] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors.
65
65
66
+
#### Performance checks (if applicable)
67
+
68
+
-[ ] I've tested on Android
69
+
- Ideally on a mid-range device; emulator is acceptable
70
+
-[ ] I've tested with a power user scenario
71
+
- Use these [power-user SRPs](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/edit-v2/401401446401?draftShareId=9d77e1e1-4bdc-4be1-9ebb-ccd916988d93) to import wallets with many accounts and tokens
72
+
-[ ] I've instrumented key operations with Sentry traces for production performance metrics
73
+
- See [`trace()`](/app/util/trace.ts) for usage and [`addToken`](/app/components/Views/AddAsset/components/AddCustomToken/AddCustomToken.tsx#L274) for an example
74
+
75
+
For performance guidelines and tooling, see the [Performance Guide](https://consensyssoftware.atlassian.net/wiki/spaces/TL1/pages/400085549067/Performance+Guide+for+Engineers).
76
+
66
77
## **Pre-merge reviewer checklist**
67
78
68
79
-[ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
0 commit comments