skills/performance-analyzer/SKILL.md
Automatically analyze performance issues when user mentions slow pages, performance problems, or optimization needs. Performs focused performance checks on specific code, queries, or components. Invoke when user says "this is slow", "performance issue", "optimize", or asks about speed.
npx skillsauth add kanopi/cms-cultivator performance-analyzerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Automatically analyze and suggest performance improvements for specific code.
Fast code is user-friendly code. Every millisecond counts.
Activate this skill when the user:
Before analyzing performance, determine:
Measure first:
Don't optimize without data - Profile to find real bottlenecks
Core Web Vitals targets:
General targets:
Prioritize fixes by impact:
Common patterns:
User reports performance issue
↓
Measure baseline (Lighthouse, profiler)
↓
Identify bottleneck (queries/assets/processing)
↓
Assess impact (all users vs. edge case)
↓
Recommend specific optimizations
↓
Provide before/after metrics
What to check:
Example Response:
## Query Performance Issue: N+1 Problem
**Current Code:**
```php
$users = User::loadMultiple();
foreach ($users as $user) {
$profile = $user->get('field_profile')->entity; // N+1!
}
Problem: Loading 100 users triggers 101 queries (1 + 100)
Solution: Use EntityQuery with eager loading
$query = \Drupal::entityQuery('user')
->accessCheck(TRUE);
$uids = $query->execute();
$users = User::loadMultiple($uids);
// Preload profiles in one query
$profile_ids = [];
foreach ($users as $user) {
$profile_ids[] = $user->get('field_profile')->target_id;
}
$profiles = Profile::loadMultiple($profile_ids);
Impact: Reduces queries from 101 to 2 (~98% improvement)
### 2. Asset Optimization
**What to check:**
- Large unoptimized images
- Unminified CSS/JS
- Blocking resources
- Missing lazy loading
- No CDN usage
### 3. Caching Analysis
**What to check:**
- Missing cache tags
- Cache invalidation issues
- No page cache
- Expensive uncached operations
### 4. Core Web Vitals
**Quick checks:**
- **LCP** (Largest Contentful Paint): Target < 2.5s
- **INP** (Interaction to Next Paint): Target < 200ms
- **CLS** (Cumulative Layout Shift): Target < 0.1
## Response Format
```markdown
## Performance Analysis
**Component**: [What was analyzed]
**Issue**: [Performance problem]
**Impact**: [How it affects users]
### Current Performance
- Metric: [value]
- Grade: [A-F]
### Optimization Recommendations
1. **[Recommendation]** (Priority: High)
- Current: [problem]
- Improved: [solution]
- Expected gain: [percentage/time]
2. **[Next recommendation]**
...
### Code Example
[Provide optimized code]
Problem: Lazy loading causing N+1
// Bad
foreach ($nodes as $node) {
$author = $node->getOwner()->getDisplayName(); // N+1
}
// Good
$nodes = \Drupal::entityTypeManager()
->getStorage('node')
->loadMultiple($nids);
User::loadMultiple(array_column($nodes, 'uid')); // Preload
Problem: Inefficient WP_Query
// Bad
$posts = new WP_Query(['posts_per_page' => -1]); // Loads everything
// Good
$posts = new WP_Query([
'posts_per_page' => 20,
'fields' => 'ids', // Only IDs
'no_found_rows' => true, // Skip counting
'update_post_meta_cache' => false,
'update_post_term_cache' => false,
]);
This Skill: Focused code-level analysis
/audit-perf Command: Comprehensive site audit
💡 Database: Index foreign keys, avoid SELECT * 💡 Caching: Cache expensive operations, use cache tags 💡 Assets: Optimize images, minify CSS/JS, lazy load 💡 Queries: Limit results, use eager loading, avoid N+1
tools
Strategist-focused site audit for discovery and pre-discovery. Given a site URL and optional qualitative research data, navigates the site via CoWork, audits against all 21 UX Laws from lawsofux.com, reviews content hierarchy, synthesises qualitative data, runs Lighthouse, and produces two deliverables — a Project Knowledge Summary (Markdown for Claude Desktop Projects) and a polished, iterable HTML Artifact for client sharing. Use when a strategist, UX lead, or PM asks for a discovery audit, UX laws audit, content hierarchy review, pre-discovery site review, "audit this site for strategy", "strategist audit", "UX audit", or pastes a site URL with discovery context. Not for developer audits — use accessibility-audit, performance-audit, or live-site-audit for those.
development
Provide story point estimation guidance with hour calculations for software development tasks. Uses Fibonacci sequence (1, 2, 3, 5, 8, 13, 21, 34+) and converts story points to hours. Includes platform-specific adjustments and velocity calculations.
tools
Perform a full QA review of a Teamwork task by reading the task and all its comments for context, extracting the multi-dev URL, generating dynamic validation steps tailored to the task type, and using CoWork browser automation to execute those steps on the multi-dev environment. Produces a structured validation report with pass/fail per step, screenshots, internal notes, and a client-facing summary — all shown in chat. Use this skill whenever the user asks to QA, test, validate, or review a Teamwork task or multi-dev environment — even if they just say "can you QA this?" or paste a Teamwork link. Also triggers for phrases like "run QA on", "check the multi-dev", "validate this task", "test the dev link", or "review the ticket". Works across Drupal/CMS updates, WordPress/plugin updates, bug fixes, new feature development, and general web development tasks.
tools
Generate a client-facing project heartbeat / status update message for a Kanopi project, ready to be posted as a Teamwork message. Use this skill whenever the user asks to write, draft, generate, or send a project update, heartbeat, status update, or progress report to a client. Also triggers when the user says things like "time for a project update", "draft the heartbeat", "write up the update for [project]", or "it's been two weeks, let's send an update". Always use this skill — even if the user doesn't say "heartbeat" — whenever the intent is to summarise recent project activity for a client audience.