Skip to main content
skill CX Codex

performance · yonatangross — Claude Code skill: what it does, how to install

This skill helps diagnose slow web pages, React renders, backend requests, and LLM inference across a performance review.

MIT 233 installs ★ 305 updated 2026-11-14

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add yonatangross/orchestkit --skill performance -a claude-code
Open on GitHub

What performance does

The skill covers web, backend, and LLM performance through nine groups of rules. It guides checks for Core Web Vitals, React rendering, lazy loading, image formats, bundle size, backend profiles, Redis caching, and TanStack Query data fetching. LLM guidance includes vLLM, quantization, and speculative decoding.

Its 23 rules address LCP, INP, and CLS, plus React Compiler, list virtualization, React.lazy, Suspense, AVIF/WebP, optimistic updates, and rollback. Local profiling examples use portless, agent-browser, and Lighthouse; the rule files live under rules/.

Claude Code requires version 2.1.277 or newer. The skill is not user-invocable, so it has no slash-command entry point; the model can apply it to requests about page speed, bundle weight, or backend latency.

What it helps with

  • diagnose poor LCP, INP, or CLS results
  • trace unnecessary React renders
  • split routes and defer component loading
  • profile Python backend code and bundle size
  • tune caching and LLM inference

Example prompts for the agent

  • Review this page for LCP, INP, and CLS issues, then suggest concrete fixes.
  • Inspect the slow React renders and decide where virtualization or memoization is needed.
  • Profile the local app with agent-browser and report on loading and bundle size.

How to install performance

1Skills CLI (Vercel)

npx skills add yonatangross/orchestkit --skill performance -a claude-code

2Manually: put the files in place

~/.claude/skills/performance/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/performance/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about performance

How do I install performance in Claude Code?

Run npx skills add yonatangross/orchestkit --skill performance -a claude-code, then check ~/.claude/skills/performance/SKILL.md.

What does the performance skill do?

It helps review frontend, backend, and LLM performance, covering Core Web Vitals, React rendering, loading, images, caching, queries, profiling, and inference.

Which Claude Code versions does it support?

Claude Code 2.1.277 or newer is required. The skill is not exposed as a user slash command and is selected from the request context.

Source text

SKILL.md · MIT
---
name: performance
license: MIT
compatibility: "Claude Code 2.1.277+."
description: "Performance patterns: Core Web Vitals, React renders, lazy loading, images, backend profiling, LLM inference. Use when improving page speed, slow renders, bundle size or backend latency."
user-invocable: false
disable-model-invocation: false
effort: high
metadata:
  owner-agent: "frontend-performance-engineer"
  category: document-asset-creation
  version: "2.1.0"
  author: "OrchestKit"
  complexity: "high"
  tags: "performance, core-web-vitals, lcp, inp, cls, react-compiler, virtualization, lazy-loading, code-splitting, image-optimization, avif, profiling, vllm, quantization, inference, caching, redis, prompt-caching, tanstack-query, prefetching, optimistic-updates, sustainability, carbon-footprint, page-weight"
allowed-tools: "Read Glob Grep WebFetch WebSearch"
---

# Performance

Comprehensive performance optimization patterns for frontend, backend, and LLM inference.

## Quick Reference

| Category | Rules | Impact | When to Use |
|----------|-------|--------|-------------|
| [Core Web Vitals](#core-web-vitals) | 4 | CRITICAL | LCP, INP, CLS optimization with 2026 thresholds |
| [Render Optimization](#render-optimization) | 3 | HIGH | React Compiler, memoization, virtualization |
| [Lazy Loading](#lazy-loading) | 3 | HIGH | Code splitting, route splitting, preloading |
| [Image Optimization](#image-optimization) | 2 | HIGH | AVIF/WebP formats, responsive images |
| [Profiling & Backend](#profiling--backend) | 3 | MEDIUM | React DevTools, py-spy, bundle analysis |
| [LLM Inference](#llm-inference) | 3 | MEDIUM | vLLM, quantization, speculative decoding |
| [Caching](#caching) | 2 | HIGH | Redis cache-aside, prompt caching, HTTP cache headers |
| [Query & Data Fetching](#query--data-fetching) | 2 | HIGH | TanStack Query prefetching, optimistic updates, rollback |
| [Sustainability](#sustainability) | 1 | MEDIUM | Page weight budgets, lazy loading, optimized formats, dark mode |

**Total: 23 rules across 9 categories**

## Core Web Vitals

Google's Core Web Vitals with 2026 stricter thresholds.

| Rule | File | Key Pattern |
|------|------|-------------|
| LCP Optimization | `rules/cwv-lcp.md` | Preload hero, SSR, fetchpriority="high" |
| INP Optimization | `rules/cwv-inp.md` | scheduler.yield, useTransition, requestIdleCallback |
| INP Advanced | `rules/cwv-inp-advanced.md` | Layout thrashing, third-party scripts, rAF patterns |
| CLS Prevention | `rules/cwv-cls.md` | Explicit dimensions, aspect-ratio, font-display |

### 2026 Thresholds

| Metric | Current Good | 2026 Good |
|--------|--------------|-----------|
| LCP | <= 2.5s | <= 2.0s |
| INP | <= 200ms | <= 150ms |
| CLS | <= 0.1 | <= 0.08 |

## Render Optimization

React render performance patterns for React 19+.

| Rule | File | Key Pattern |
|------|------|-------------|
| React Compiler | `rules/render-compiler.md` | Auto-memoization, "Memo" badge verification |
| Manual Memoization | `rules/render-memo.md` | useMemo/useCallback escape hatches, state colocation |
| Virtualization | `rules/render-virtual.md` | TanStack Virtual for 100+ item lists |

## Lazy Loading

Code splitting and lazy loading with React.lazy and Suspense.

| Rule | File | Key Pattern |
|------|------|-------------|
| React.lazy + Suspense | `rules/loading-lazy.md` | Component lazy loading, error boundaries |
| Route Splitting | `rules/loading-splitting.md` | React Router 7.x, Vite manual chunks |
| Preloading | `rules/loading-preload.md` | Prefetch on hover, modulepreload hints |

## Image Optimization

Production image optimization for modern web applications.

| Rule | File | Key Pattern |
|------|------|-------------|
| Format Selection | `rules/images-formats.md` | AVIF/WebP, quality 75-85, picture element |
| Responsive Images | `rules/images-responsive.md` | sizes prop, art direction, CDN loaders |

Next.js `Image` component usage and the v16 image config defaults are first-party territory; see "Upstream coverage (do not restate)" below.

## Profiling & Backend

Profiling tools and backend optimization patterns.

| Rule | File | Key Pattern |
|------|------|-------------|
| React Profiling | `rules/profiling-react.md` | DevTools Profiler, flamegraph, render counts |
| Backend Profiling | `rules/profiling-backend.md` | py-spy, cProfile, memory_profiler, flame graphs |
| Bundle Analysis | `rules/profiling-bundle.md` | vite-bundle-visualizer, tree shaking, performance budgets |

## LLM Inference

High-performance LLM inference with vLLM, quantization, and speculative decoding.

| Rule | File | Key Pattern |
|------|------|-------------|
| vLLM Deployment | `rules/inference-vllm.md` | PagedAttention, continuous batching, tensor parallelism |
| Quantization | `rules/inference-quantization.md` | AWQ, GPTQ, FP8, INT8 method selection |
| Speculative Decoding | `rules/inference-speculative.md` | N-gram, draft model, 1.5-2.5x throughput |

## Caching

Backend Redis caching and LLM prompt caching for cost savings and performance.

| Rule | File | Key Pattern |
|------|------|-------------|
| Redis & Backend | `rules/caching-redis.md` | Cache-aside, write-through, invalidation, stampede prevention |
| HTTP & Prompt | `rules/caching-http.md` | HTTP cache headers, LLM prompt caching, semantic caching |

## Query & Data Fetching

TanStack Query v5 patterns for prefetching and optimistic updates.

| Rule | File | Key Pattern |
|------|------|-------------|
| Prefetching | `rules/query-prefetching.md` | Hover prefetch, route loaders, queryOptions, Suspense |
| Optimistic Updates | `rules/query-optimistic.md` | Optimistic mutations, rollback, cache invalidation |

## Sustainability

Digital sustainability patterns for reducing carbon footprint and energy usage.

| Rule | File | Key Pattern |
|------|------|-------------|
| Sustainability UX | `rules/sustainability-ux.md` | Page weight budgets, AVIF/WebP, lazy loading, dark mode |

## Local Profiling Target

When profiling a local app (Lighthouse, Core Web Vitals, bundle analysis), use Portless named URLs for stable, self-documenting targets:

```bash
# Discover services
portless list
# app → app.localhost (port 3000)

# Profile with agent-browser (preferred for visual metrics)
agent-browser open "https://app.localhost"
agent-browser profiler start
agent-browser wait --load networkidle
agent-browser profiler stop /tmp/profile.json

# Lighthouse via agent-browser
agent-browser open "https://app.localhost"
agent-browser screenshot /tmp/perf-baseline.png

# Or direct Lighthouse CLI
npx lighthouse https://app.localhost --output=json --output-path=/tmp/lighthouse.json
```

Named URLs are stable across restarts and self-documenting in performance reports. Install Portless with `npm i -g portless`.

## Quick Start Example

```tsx
// LCP: Priority hero image with SSR
import Image from 'next/image';

export default async function Page() {
  const data = await fetchHeroData();
  return (
    <Image
      src={data.heroImage}
      alt="Hero"
      priority
      placeholder="blur"
      sizes="100vw"
      fill
    />
  );
}
```

## Key Decisions

| Decision | Recommendation |
|----------|----------------|
| Memoization | Let React Compiler handle it (2026 default) |
| Lists 100+ items | Use TanStack Virtual |
| Image format | AVIF with WebP fallback (30-50% smaller) |
| LCP content | SSR/SSG, never client-side fetch |
| Code splitting | Per-route for most apps, per-component for heavy widgets |
| Prefetch strategy | On hover for nav links, viewport for content |
| Quantization | AWQ for 4-bit, FP8 for H100/H200 |
| Bundle budget | Hard fail in CI to prevent regression |

## Common Mistakes

1. Client-side fetching LCP content (delays render)
2. Images without explicit dimensions (causes CLS)
3. Lazy loading LCP images (delays largest paint)
4. Heavy computation in event handlers (blocks INP)
5. Layout-shifting animations (use transform instead)
6. Lazy loading tiny components < 5KB (overhead > savings)
7. Missing error boundaries on lazy components
8. Using GPTQ without calibration data
9. Not benchmarking actual workload patterns
10. Only measuring in lab environment (need RUM)

## Related Skills

- `ork:react-server-components-framework` - Server-first rendering
- `ork-extras:vite-advanced` - Build optimization
- `browser-tools` - Visual profiling with agent-browser + Portless
- `caching` - Cache strategies for responses
- `ork-extras:monitoring-observability` - Production monitoring and alerting
- `ork:database-patterns` - Query and index optimization
- `ork-extras:llm-integration` - Local inference with Ollama

## Capability Details

### lcp-optimization
**Keywords:** LCP, largest-contentful-paint, hero, preload, priority, SSR
**Solves:**
- Optimize hero image loading
- Server-render critical content
- Preload and prioritize LCP resources

### inp-optimization
**Keywords:** INP, interaction, responsiveness, long-task, transition, yield
**Solves:**
- Break up long tasks with scheduler.yield
- Defer non-urgent updates with useTransition
- Optimize event handler performance

### cls-prevention
**Keywords:** CLS, layout-shift, dimensions, aspect-ratio, font-display
**Solves:**
- Reserve space for dynamic content
- Prevent font flash and image pop-in
- Use transform for animations

### react-compiler
**Keywords:** react-compiler, auto-memo, memoization, React 19
**Solves:**
- Enable automatic memoization
- Identify when manual memoization needed
- Verify compiler is working

### virtualization
**Keywords:** virtual, TanStack, large-list, scroll, overscan
**Solves:**
- Render 100+ item lists efficiently
- Dynamic height virtualization
- Window scrolling patterns

### lazy-loading
**Keywords:** React.lazy, Suspense, code-splitting, dynamic-import
**Solves:**
- Route-based code splitting
- Component lazy loading with error boundaries
- Prefetch on hover and viewport

### image-optimization
**Keywords:** next/image, AVIF, WebP, responsive, blur-placeholder
**Solves:**
- Next.js Image component patterns
- Format selection and quality settings
- Responsive sizing and CDN configuration

### profiling
**Keywords:** profiler, flame-graph, py-spy, DevTools, bundle-analyzer
**Solves:**
- Profile React renders and backend code
- Generate and interpret flame graphs
- Analyze and optimize bundle size

### inp-advanced
**Keywords:** INP, scheduler-yield, layout-thrashing, third-party-scripts, requestAnimationFrame
**Solves:**
- Break long tasks with scheduler.yield()
- Audit and defer blocking third-party scripts
- Avoid synchronous layout thrashing in event handlers
- Optimize form submissions, dropdowns, accordions, filters

### sustainability
**Keywords:** sustainability, carbon-footprint, page-weight, green-ux, dark-mode, lazy-loading
**Solves:**
- Enforce page weight budgets (< 1MB)
- Eliminate auto-playing videos and heavy decorative animations
- Serve optimized image formats (AVIF/WebP)
- Implement cursor-based pagination to prevent over-fetching

### llm-inference
**Keywords:** vllm, quantization, speculative-decoding, inference, throughput
**Solves:**
- Deploy LLMs with vLLM for production
- Choose quantization method for hardware
- Accelerate generation with speculative decoding

## Upstream coverage (do not restate)

These topics used to be restated in this skill's references, checklists, and examples. They are owned by first-party sources now; consult those instead of re-adding tutorials here. The ork-specific floors and scars that survived the cut live in `references/ork-delta.md`.

| Topic | First-party source |
|-------|--------------------|
| Core Web Vitals mechanics, audit checklists, before/after examples | skill: web-perf / cloudflare:web-perf (Chrome DevTools MCP); https://web.dev/vitals/ |
| Real User Monitoring with the web-vitals library | skill: web-perf; https://github.com/GoogleChrome/web-vitals |
| Next.js Image component, v16 image config defaults, image CDN loaders | skills: vercel:nextjs + vercel:next-upgrade; https://nextjs.org/docs/app/api-reference/components/image |
| Image format selection and optimization checklists | skill: vercel:nextjs; https://web.dev/learn/images |
| React Compiler migration, memoization escape hatches, state colocation | skill: vercel-react-best-practices; https://react.dev/learn/react-compiler |
| React DevTools Profiler workflow, render audits | skill: vercel-react-best-practices; https://react.dev/reference/react/Profiler |
| TanStack Virtual list/grid virtualization patterns | https://tanstack.com/virtual/latest/docs/introduction |
| Route-based code splitting (React Router, Vite manual chunks) | https://reactrouter.com/ and https://vite.dev/guide/build |
| Generic profiling workflows (Lighthouse, py-spy, bundle analyzers) | skill: web-perf; https://github.com/benfred/py-spy |
| Redis and HTTP caching strategy patterns | skill: upstash-redis-js; https://redis.io/docs/latest/ |
| vLLM deployment, quantization, speculative decoding, edge inference | https://docs.vllm.ai/ |
| Full-stack performance audit walkthrough | https://developer.chrome.com/docs/lighthouse/; ork delta in `references/ork-delta.md` + `examples/orchestkit-performance-wins.md` |

## References

Load on demand with `Read("references/<file>")`:
| File | Content |
|------|---------|
| `ork-delta.md` | OrchestKit floors, scars, and house decisions for this skill |
| `cc-prompt-cache-guide.md` | CC 2.1.72 prompt cache optimization, stable-first prompt structure |
| `database-optimization.md` | Postgres indexing and N+1 fixes backing the recorded audit wins |

Real production before/after evidence (cache hierarchy, cost math): `examples/orchestkit-performance-wins.md`.

© OrchestKit · MIT · yonatangross/orchestkit

Similar skills

All skills for Frontend and UI →

performance by other authors comes first.

performance millionco This skill measures React runtime performance for one repeatable interaction and ties browser delays to component renders. CX Codex +1 314installs performance daveebbelaar performance — a skill for Claude Code that measures CPU, memory, and energy usage in macOS apps. It identifies causes of freezes and helps offload tasks from the main thread to the GPU. CX Codex +1 1,000installs performance plugin87 This Claude Code skill guides UI performance work against Core Web Vitals. It activates for slow interactions, animation jank, layout shifts, and loading problems. CX Codex +1 562installs performance rshankras performance diagnoses slow apps, hangs, and memory leaks using Instruments; spots unnecessary SwiftUI re-renders and view identity issues. CX Codex +1 212installs performance cognitedata performance is a Claude Code skill that finds and fixes performance issues in Flows apps. It activates for requests about slow pages, re-renders, CDF queries, bundles, or memory leaks. CX Codex +1 1,900installs performance-optimization addyosmani performance-optimization — an agent skill that measures before it changes code: Core Web Vitals budgets, N+1 queries, missing indexes and slow endpoints. CX Codex +1 82,600installs performance-engineer SuperClaude-Org performance-engineer profiles bottlenecks and speeds up web apps through before-and-after measurements. Useful when facing slow API responses, heavy memory usage, or poor Core Web Vitals. CX Codex ★ 23,950repo stars auditing-performance spencerpauly auditing-performance — a skill that audits app performance: bundle size, rendering, database queries and Core Web Vitals. Useful when pages load slowly or the UI stutters. CX Codex +1 518installs application-performance-performance-engineer Seth Hobson The application-performance-performance-engineer subagent helps investigate application bottlenecks through profiling, traces, and load-test results. Use it for performance and scalability work. CX Codex ★ 42,780repo stars performance-profiling curiositech performance-profiling guides performance analysis across Node.js and React, covering flame graphs, heap snapshot diffing, and event loop saturation. CX Codex +1 148installs performance-optimizer davila7 The performance-optimizer skill helps locate slow points in code, databases, and APIs, then compare measurements before and after changes. Use it when a page, query, or endpoint feels slow. CX Codex +1 70installs

From the same set86

The whole set →
memory-fabric memory-fabric is a Claude Code skill that orchestrates knowledge graph retrieval, parses queries, deduplicates facts, and ranks results. It runs when designing or debugging agent memory mechanics. CX Codex +1 244installs multimodal-llm multimodal-llm — a skill for Claude Code and Codex that routes tasks across vision, speech, and video models. The agent activates it when handling image analysis, audio transcription, or video generation APIs. CX Codex +1 243installs database-patterns The database-patterns skill guides schema design, Alembic migrations, and database versioning. It fits work on normalization, migration branches, and schema drift. CX Codex +1 238installs architecture-patterns architecture-patterns enforces clean architecture, backend layer boundaries, and directory limits. Triggers when designing module boundaries or running refactoring tasks. CX Codex +1 236installs github-operations The github-operations skill handles GitHub issues, pull requests, milestones, and Projects v2 with gh, REST, and GraphQL patterns. It activates for GitHub resource management. CX Codex +1 230installs remember remember is a Claude Code skill that forwards a typed command to memory to store a decision or pattern in a knowledge graph. It runs when /ork:remember is entered. CX Codex +1 229installs animation-motion-design animation-motion-design — a Claude Code skill for interface animation with Motion and the View Transitions API. It comes into play for page changes, gesture-driven controls, and prefers-reduced-motion support. CX Codex +1 228installs web-research-workflow The web-research-workflow skill picks a web access method, extracts page content, and tracks competitor changes. Use it for research, documentation capture, and site monitoring. CX Codex +1 228installs

Project sponsors

Companies that keep this analytics open