claude-force: Skill for Claude Code

.claude/skills/performance-optimization-patterns/SKILL.md

performance-optimization-patterns is a skill for Claude Code from khanh-vu/claude-force. It costs 0 tokens per session (4,105 once invoked), scanned A, original, MIT.

Patterns for improving website performance using Core Web Vitals. These measures describe how quickly the main content appears, how quickly a page responds to interaction, and whether the layout moves unexpectedly.

In plain words
What is it for?
Use it to analyze LCP, INP, and CLS measurements and apply fixes such as optimizing images, improving asset delivery, and reducing layout instability.
Why use it?
They help identify slow loading, delayed interaction, and shifting page elements that make websites difficult to use.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is khanh-vu/claude-force's own configuration. It tells Claude Code how to work on claude-force itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything claude-force configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/khanh-vu/claude-force/main/.claude/skills/performance-optimization-patterns/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/khanh-vu/claude-force

Made for: Claude Code.

Wrote 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.

agentmods badge for performance-optimization-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/khanh-vu/claude-force/performance-optimization-patterns/github.svg)](https://agentmods.dev/skills/khanh-vu/claude-force/performance-optimization-patterns)
Your own site
<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.

agentmods 80×15 button for performance-optimization-patterns

Your own site · 80×15
<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>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,105 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce 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

Measured 2mo ago against content hash c4753840cef8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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) => {
.claude/skills/performance-optimization-patterns/SKILL.md · 651 lines

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

Read the full file on GitHub · 651 lines

Changes

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.

  1. 2mo ago First seen · 651 lines · 0 tokens per session scan A c4753840cef8

Subscribe to this mod's changes

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.

Related

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.

sickn33/agentic-awesome-skills · 34 tokens

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…

chakra-ui/chakra-ui · 214 tokens

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.

Yeachan-Heo/oh-my-codex · 52 tokens

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…

compozy/compozy · 67 tokens

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.…

microsoft/power-platform-skills · 104 tokens

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…

daymade/claude-code-skills · 125 tokens