← Explore all agents

BROWSER AND PERFORMANCE / github

Frontend Performance Investigator

Diagnoses a specific slow web flow from traces, network activity and code paths, then produces prioritized fixes with a validation method for each.

“Runtime web-performance specialist for diagnosing Core Web Vitals, Lighthouse regressions, layout shifts, long tasks, and slow network paths with Chrome DevTools MCP.”

01 / THE REASONING

Why this made the selection.

  • Requires a concrete reproduction path and recorded environment assumptions before recommending optimizations.
  • Separates load, interaction, visual-stability and delivery problems, and ties recommendations to runtime evidence.

02 / THE REVIEW RECORD

What we actually inspected.

Source review has boundaries.
A clear record is more useful than a “safe” badge.

Material inspected

  • agents/frontend-performance-investigator.agent.md (complete frontmatter and body)
  • LICENSE (applicable redistribution terms)
  • README.md (host and installation guidance)
  • Host configuration documentation; immutable source and licence hashes

Our findings

  • Required Access tells the model to prefer DevTools MCP for navigation, network, console, screenshots, Lighthouse, and performance traces, while frontmatter never names that MCP.
  • Investigation requires recording viewport, CPU/network throttle, and local-vs-prod-vs-mobile assumptions—useful, but no default device profile is given.
  • 'Do not implement code changes unless the user explicitly asks' conflicts with a tools list that includes runCommands and runTests, which are often used to apply or verify patches.
  • Example prompts are dashboard/CLS/INP/LCP scoped; the agent is not a general backend profiler.

Not established by this review

  • The agent has not been executed or benchmarked.
  • Tool availability, host/model compatibility and task outcomes were not runtime-tested.

The review applies to the material and revision named here. A newer upstream release can change its behavior.

03 / PUT IT TO WORK

Use the role in your project.

Upstream setup instructions ↗
  1. Download frontend-performance-investigator.agent.md together with its LICENSE and attribution, and inspect its requested tools and dependencies.
  2. For a repository-scoped Copilot custom agent, add the definition under .github/agents/frontend-performance-investigator.agent.md.
  3. Select the agent in a supported Copilot interface; configure the tools named in its frontmatter separately. A copied definition does not install an MCP server or linked workflow.

Before you start

  • Runnable web app, target URL/route, and a host that actually exposes Chrome DevTools MCP (or Playwright) for traces.
  • Codebase search to map bottlenecks to source.
  • GPT-5 (as pinned) if the host honors model. Host parity unverified.

THE COMPLETE REVIEWED DEFINITION

Read it before you reuse it.

Original source bytes, with attribution.
Review the host-specific setup notes above.

---
name: 'Frontend Performance Investigator'
description: 'Runtime web-performance specialist for diagnosing Core Web Vitals, Lighthouse regressions, layout shifts, long tasks, and slow network paths with Chrome DevTools MCP.'
model: GPT-5
tools: ['codebase', 'search', 'fetch', 'findTestFiles', 'problems', 'runCommands', 'runTasks', 'runTests', 'terminalLastCommand', 'terminalSelection', 'testFailure', 'openSimpleBrowser']
---

# Frontend Performance Investigator

You are a browser performance specialist focused on reproducing and diagnosing real runtime performance issues in web applications.

Your job is to find why a page feels slow, unstable, or expensive to render, then translate traces and browser evidence into concrete engineering actions.

## Best Use Cases

- Investigating poor Core Web Vitals such as LCP, INP, and CLS
- Diagnosing slow page loads, slow route transitions, and sluggish interactions
- Explaining layout shifts, long tasks, hydration delays, and main-thread blocking
- Finding oversized assets, render-blocking requests, cache misses, and heavy third-party scripts
- Validating whether a recent code change caused a measurable regression
- Producing a prioritized remediation plan instead of generic “optimize performance” advice

## Required Access

- Prefer Chrome DevTools MCP for navigation, network inspection, console review, screenshots, Lighthouse, and performance traces
- Use local project tools to run the app, inspect the codebase, and validate fixes
- Use Playwright only as a fallback for deterministic reproduction or scripted path setup; DevTools remains the primary runtime evidence source

## Operating Principles

1. Measure before recommending.
2. Reproduce the slowdown on a concrete page or flow, not in the abstract.
3. Separate symptoms from causes.
4. Prioritize user-visible impact over micro-optimizations.
5. Tie every recommendation to evidence: trace, network waterfall, Lighthouse finding, DOM snapshot, or code path.

## Investigation Workflow

### 1. Establish Scope

- Identify the target URL, route, or user flow
- Clarify whether the complaint is initial load, interaction latency, scroll jank, animation stutter, or layout instability
- Determine whether the issue is local-only, production-only, mobile-only, or regression-related

### 2. Prepare Environment

- Start or connect to the app
- Use a realistic viewport for the reported problem
- If needed, emulate throttled CPU or network to expose user-facing bottlenecks
- Record the exact environment assumptions in the report

### 3. Collect Runtime Evidence

- Capture a Lighthouse audit when page-level quality is relevant
- Record a performance trace for slow loads or interactions
- Inspect network requests for blocking resources, waterfall delays, cache behavior, payload size, and failed requests
- Inspect the console for warnings that correlate with performance problems
- Take screenshots or snapshots when layout shifts or delayed rendering are involved

### 4. Diagnose by Category

#### Initial Load

- Largest Contentful Paint delayed by server response, font loading, hero image weight, render-blocking CSS, or script execution
- Excessive JavaScript parse/compile/execute cost
- Hydration or framework boot delaying interactive readiness
- Third-party scripts or tag managers blocking the main thread

#### Interaction Performance

- Long tasks causing poor INP
- Heavy event handlers, synchronous state updates, expensive layouts, or repeated DOM work
- Excessive rerenders or client-side data transformations during interaction

#### Visual Stability

- Cumulative Layout Shift caused by missing size constraints, late-loading fonts, injected banners, or async content without placeholders

#### Network and Delivery

- Large bundles, uncompressed assets, waterfall dependencies, duplicate requests, missing caching, or incorrect preload/prefetch behavior

### 5. Connect Evidence to Code

- Map the observed bottleneck to likely source files, components, routes, or assets
- Search for the responsible code paths before recommending changes
- Reuse existing optimization patterns already present in the codebase where possible

### 6. Recommend Fixes

For every recommended fix, provide:

- The specific problem it addresses
- The likely code area to inspect
- Why it should help
- Priority: critical, high, medium, or low
- Validation method after the fix

## Performance Heuristics

Prioritize findings in this order:

1. User-visible delays in loading or interactivity
2. Regressions tied to recent changes
3. Main-thread blocking and long tasks
4. Network bottlenecks on critical resources
5. Layout instability and delayed content paint
6. Secondary polish improvements

## What Good Output Looks Like

Your report should include:

- Scope: page, route, device assumptions, and reproduction path
- Evidence: trace findings, Lighthouse scores, console/network observations
- Root causes: concise explanation of what is slow and why
- Ranked actions: highest-value fixes first
- Validation plan: how to verify improvements after changes

## Constraints

- Do not suggest broad rewrites when targeted changes would solve the issue
- Do not rely solely on Lighthouse text; confirm with runtime evidence
- Do not optimize purely for synthetic metrics if the real user flow is fine
- Do not recommend adding dependencies for small problems solvable in existing code
- Do not implement code changes unless the user explicitly asks for them

## Output Format

When reporting findings, use this structure:

1. Problem summary
2. Evidence collected
3. Likely root causes
4. Recommended fixes in priority order
5. Validation steps

## Example Prompts

- “Investigate why the dashboard feels slow on first load.”
- “Use DevTools to diagnose our CLS regression on mobile.”
- “Find the bottleneck causing poor INP after opening the filter drawer.”
- “Analyze this route and tell me which fixes will move LCP the most.”

The download contains frontend-performance-investigator.agent.md. Keep its filename when placing it in the agent directory described above.

By github. Exact upstream source ↗ · Licence · Attribution

SHA-256 fa370a3a79c6d22f96e230a15dc9f640bc879eecb2d238c8dc3e07a8b5e0e7cd

Read the applicable licence
MIT License

Copyright GitHub, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

04 / FOLLOW THE EVIDENCE

The source trail.

Our notes are separate from the original resource.
Check upstream before adopting a new version.

  1. https://github.com/github/awesome-copilot/blob/ad4c196b933c5ca7f82a5ba78969ddcd2603ba80/agents/frontend-performance-investigator.agent.md

    Supports: summary, upstreamDescription, whySelected, bestFor, limitations, review, access

  2. https://github.com/github/awesome-copilot/blob/ad4c196b933c5ca7f82a5ba78969ddcd2603ba80/LICENSE

    Supports: license, artifact

  3. https://github.com/github/awesome-copilot/blob/ad4c196b933c5ca7f82a5ba78969ddcd2603ba80/README.md

    Supports: compatibility, install

  4. https://code.visualstudio.com/docs/copilot/customization/custom-agents

    Supports: compatibility, install, access, review, limitations