Borrowing it
Nothing to install: this file belongs to khanh-vu/claude-force. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/khanh-vu/claude-force/main/.claude/skills/performance-optimization-patterns/SKILL.mdgit clone --depth 1 https://github.com/khanh-vu/claude-forceWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/khanh-vu/claude-force/performance-optimization-patterns)<a href="https://agentmods.dev/skills/khanh-vu/claude-force/performance-optimization-patterns"><img src="https://agentmods.dev/badge/skills/khanh-vu/claude-force/performance-optimization-patterns/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/khanh-vu/claude-force/performance-optimization-patterns"><img src="https://agentmods.dev/badge/skills/khanh-vu/claude-force/performance-optimization-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.04105 |
| Opus 5.5 | $0.00000 | $0.01642 |
| Sonnet 5.5 | $0.00000 | $0.00821 |
| Haiku 4.5 | $0.00000 | $0.00411 |
Grade A, and why
performance-optimization-patterns scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
const fetchPromise = fetch(event.request).then((networkResponse) => { How it starts
The opening of the file, as written. The whole thing — 651 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Performance Optimization Patterns
Comprehensive patterns and techniques for optimizing Core Web Vitals (LCP, INP, CLS) and overall web performance.
Core Web Vitals Optimizer
from typing import Dict, List
import json
class CoreWebVitalsOptimizer:
"""Analyze and optimize Core Web Vitals"""
def __init__(self):
self.thresholds = {
"lcp": {"good": 2.5, "needs_improvement": 4.0},
"inp": {"good": 200, "needs_improvement": 500},
"cls": {"good": 0.1, "needs_improvement": 0.25},
}
def analyze_lcp(self, lcp_value: float) -> Dict:
"""
Analyze LCP (Largest Contentful Paint) and provide recommendations
Good: < 2.5s | Needs Improvement: 2.5-4.0s | Poor: > 4.0s
"""
recommendations = []
if lcp_value > self.thresholds["lcp"]["good"]:
recommendations.extend([
{
"priority": "high",
"issue": "Slow LCP",
"recommendations": [
"Optimize largest image (use WebP/AVIF format)",
"Implement CDN for faster asset delivery",
"Preload critical resources with <link rel='preload'>",
"Remove render-blocking resources",
"Use server-side rendering (SSR) for above-fold content",
"Optimize server response time (TTFB < 600ms)",
"Implement lazy loading for below-fold images"
]
}
])
status = self._get_status(lcp_value, "lcp")
return {
"metric": "LCP",
"value": lcp_value,
"unit": "seconds",
"status": status,
"recommendations": recommendations
}
def analyze_inp(self, inp_value: float) -> Dict:
"""
Analyze INP (Interaction to Next Paint) and provide recommendations
Good: < 200ms | Needs Improvement: 200-500ms | Poor: > 500ms
"""
recommendations = []
if inp_value > self.thresholds["inp"]["good"]:
recommendations.extend([
{
"priority": "high",
"issue": "Slow INP",
"recommendations": [
"Reduce JavaScript execution time",
"Implement code splitting to reduce bundle size",
"Defer non-critical JavaScript",
"Use web workers for heavy computations",
"Optimize event handlers and listeners",
"Debounce/throttle expensive operations",
"Break up long tasks (< 50ms chunks)",
"Optimize third-party scripts"
]
}
])
status = self._get_status(inp_value, "inp")
return {
"metric": "INP",
"value": inp_value,
"unit": "milliseconds",
"status": status,
"recommendations": recommendations
}
def analyze_cls(self, cls_value: float) -> Dict:
"""
Analyze CLS (Cumulative Layout Shift) and provide recommendations
Good: < 0.1 | Needs Improvement: 0.1-0.25 | Poor: > 0.25
"""
recommendations = []
if cls_value > self.thresholds["cls"]["good"]:
recommendations.extend([
{
"priority": "high",
"issue": "High CLS",
"recommendations": [
"Set explicit width and height on images and videos",
"Reserve space for ads and embeds",
"Avoid inserting content above existing content",
"Use CSS aspect-ratio for responsive media",
"Preload fonts to prevent FOIT/FOUT",
"Use font-display: swap for web fonts",
"Avoid animations that trigger layout shifts"
]
}
])
status = self._get_status(cls_value, "cls")
return {
"metric": "CLS",
"value": cls_value,
"unit": "score",
"status": status,
"recommendations": recommendations
}
def _get_status(self, value: float, metric: str) -> str:
"""Determine if metric passes/fails"""
threshold = self.thresholds[metric]
if value <= threshold["good"]:
return "good"
elif value <= threshold["needs_improvement"]:
return "needs_improvement"
else:
return "poor"
def generate_optimization_plan(self, vitals: Dict) -> Dict:
"""Generate complete optimization plan"""
plan = {
"lcp": self.analyze_lcp(vitals.get("lcp", 0)),
"inp": self.analyze_inp(vitals.get("inp", 0)),
"cls": self.analyze_cls(vitals.get("cls", 0))
}
# Overall status
statuses = [plan["lcp"]["status"], plan["inp"]["status"], plan["cls"]["status"]]
if all(s == "good" for s in statuses):
plan["overall_status"] = "passing"
elif any(s == "poor" for s in statuses):
plan["overall_status"] = "failing"
else:
plan["overall_status"] = "needs_improvement"
return plan
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 651 lines · 0 tokens per session scan A c4753840cef8
performance-optimization-patterns is a skill published in the GitHub repository khanh-vu/claude-force (6 stars, last pushed 11mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 4,105 tokens. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
anti-slop-design
Autonomous Principal Design Technologist. Cures vibe-coded software from AI frontend slop using curated token archetypes and 7-axis quality gating.
chakra-ui-builder
Build responsive, accessible UI components and layouts using Chakra UI v3, install or configure Chakra UI in new and existing projects, and design scalable themes using tokens, semantic tokens, recipes, and slot recipes. Use this skill whenever a user asks to build, create, or generate any UI component, page, form…
visual-ralph
Visual Ralph orchestration for frontend UI from generated references, static references, or live URL targets, using $ultragoal with built-in visual verdict and pixel-diff evidence until the implementation matches and leaves a reproducible design system.
open-design-setup
Prepare or repair a project's prototyping environment so open-design can build prototypes with the project's own component library and render them through the project's toolchain. Use when the library target is needed and docs/design/prototyping.md is missing, stale, or failing; excludes HTML-only design work and…
edit-site
Plans, coordinates and customizes PAC CLI-downloaded Standard or Enhanced data model non-SPA Power Pages sites created from Microsoft templates or manually in Design Studio. Use for requests involving pages, localized content, navigation, assets, snippets, site markers, Liquid/web templates, page layouts, or styling.…
frontend-visual-qa
Audits rendered UI and specific task/object-link handoffs; excludes ordinary source citations alone. Audits already-rendered UI and Markdown/Obsidian image layout — web app, deck/slide, dashboard, design-system, or Electron/native app — via real-browser/native-app journeys and a Playwright sweep. Use after UI…