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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- 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.
- 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))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Evidence schema

The caller provides a single JSON object. Field names may evolve, but the
security boundary does not: only values present in this object may appear as
facts in the proposal.

```json
{
"runId": "123",
"runUrl": "https://github.com/example/actions/runs/123",
"currentSha": "abc",
"previousRunId": "122",
"previousSha": "def",
"findings": [
{
"scenario": "Perps add funds",
"owner": "team-name",
"jsWorkMs": 12600,
"baselineMedianJsWorkMs": 3000,
"ratio": 4.2,
"baselineRuns": 3
}
],
"frames": [
{
"scenario": "Perps add funds",
"name": "usePerpsOrderForm",
"url": "app/example.ts",
"line": 40,
"selfMs": 800
}
],
"pullsOverlappingTheProfile": [
{
"number": 123,
"title": "Example",
"url": "https://github.com/example/pull/123",
"files": [
{
"path": "app/example.ts",
"patch": "+changed line"
}
]
}
],
"pullsMergedWithNoProfileFile": [
{
"number": 124,
"title": "Unrelated",
"url": "https://github.com/example/pull/124"
}
]
}
```

`pullsOverlappingTheProfile` is computed by deterministic tooling before model
invocation. The model must not promote entries from
`pullsMergedWithNoProfileFile` based on titles or prior knowledge.
76 changes: 76 additions & 0 deletions domains/performance/skills/profiling-regression-proposal/skill.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
name: profiling-regression-proposal
description: >-
Proposes follow-up actions for an already-classified Hermes CPU-profile
regression using only the profiling evidence supplied by the caller. Use
after deterministic tooling has identified a slow scenario and correlated
hot-frame paths with files from recently merged pull requests.
maturity: stable
---

# Profiling Regression Proposal

Produce a short, evidence-bound proposal after deterministic profiling tooling
has already classified a run. This skill interprets evidence; it does not decide
whether a regression exists.

## When To Use

Use this skill only when the caller supplies structured evidence containing:

- findings produced by a deterministic threshold;
- hot frames extracted from generated CPU-profile reports;
- recently merged pull requests separated by whether their changed files
overlap those hot-frame paths.

Do not use source-tree searches, repository knowledge, issue history, PR titles,
or general performance heuristics as additional evidence.

## Workflow

1. Treat the supplied evidence object as the only source of truth.
2. Do not change, second-guess, or reapply the caller's regression threshold.
3. Mention a file, function, timing, ratio, run, or owner only when it appears
in the evidence.
4. Connect a pull request to a finding only when the caller places it in the
profile-overlap collection. A title that mentions the affected feature is
not evidence.
5. A changed file may be discussed only when its path already occurs in a hot
frame from the generated profile.
6. Pull requests in the no-profile-overlap collection may be named only to say
the supplied profile cannot implicate them.
7. Do not infer source files, behavior, ownership, causes, or fixes from
unsymbolicated frames.
8. Several scenarios crossing the threshold in one run are one run-level
anomaly, not automatically several independent bugs.
9. If no pull request overlaps a profiled path, say so and stop. Do not choose a
likely culprit.
10. Describe every proposed action as a hypothesis to validate by rerunning the
same profile, never as a confirmed root cause.

## Output

Return Slack mrkdwn:

- first line:
`*AI proposal (profiling evidence only; not a root cause)*`;
- at most six bullets;
- one sentence per bullet;
- pull-request links formatted as `<url|#number>`;
- no general disclaimer beyond the required first line.

Good:

> PR #123 changed a file that appears as a hot frame; rerun the same scenario
> with that change isolated and compare the frame's self time.

Not allowed:

> PR #123 is the cause because its title mentions Perps.

The title is routing context, not profiling evidence.

## Failure behavior

Return no proposal when the evidence is missing or malformed. Never fill gaps
with repository knowledge or generic optimization advice.
Loading