Skip to content

Add performance audit skill and tool to AI command#2973

Open
youknowriad wants to merge 2 commits intotrunkfrom
audit-site-performance
Open

Add performance audit skill and tool to AI command#2973
youknowriad wants to merge 2 commits intotrunkfrom
audit-site-performance

Conversation

@youknowriad
Copy link
Copy Markdown
Contributor

@youknowriad youknowriad commented Apr 3, 2026

Related issues

Related STU-1482

How AI was used in this PR

This PR was authored with AI assistance. All code has been reviewed for correctness, type safety, and adherence to existing patterns.

Proposed Changes

  • Add audit_performance MCP tool that measures Core Web Vitals (TTFB, FCP, LCP, CLS), page weight, DOM size, request count, and JS/CSS/image/font asset breakdowns for running WordPress sites
  • Add /need-for-speed skill (SKILL.md) that guides the AI agent to interpret results against Web Vitals thresholds and provide WordPress-specific optimization recommendations
  • Add /need-for-speed to the slash command autocomplete list
  • Uses the existing shared Playwright browser and Performance API — no new dependencies

Testing Instructions

  • Run npm run cli:build
  • Start a local site: studio site start <site-name>
  • Run studio ai and type /need-for-speed — verify it appears in autocomplete
  • The AI should audit the site's homepage and return performance metrics with recommendations

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

youknowriad and others added 2 commits April 3, 2026 19:40
Adds an `audit_performance` MCP tool and `/audit` skill that measure
Core Web Vitals (TTFB, FCP, LCP, CLS), page weight, DOM size, and
JS/CSS/image/font asset breakdowns for local WordPress sites using the
existing shared Playwright browser. No new dependencies required.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@youknowriad youknowriad requested a review from mtias April 3, 2026 18:54
@wpmobilebot
Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 6d75961 vs trunk

app-size

Metric trunk 6d75961 Diff Change
App Size (Mac) 1271.62 MB 1271.63 MB +0.01 MB ⚪ 0.0%

site-editor

Metric trunk 6d75961 Diff Change
load 1644 ms 1887 ms +243 ms 🔴 14.8%

site-startup

Metric trunk 6d75961 Diff Change
siteCreation 8182 ms 8175 ms 7 ms ⚪ 0.0%
siteStartup 4869 ms 4858 ms 11 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

{ name: 'model', description: __( 'Switch the AI model' ) },
{ name: 'provider', description: __( 'Switch the AI provider' ) },
{ name: 'exit', description: __( 'Exit the chat' ) },
// Skills (handled by the AI agent, not the CLI directly)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need this comment?

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.

3 participants