performance-optimization

Diagnose and fix latency, database, bundle, and rendering bottlenecks with measured verification.

1|Updated Sep 10, 2026
One-click install
npx skills add https://github.com/thienty1207/Hotel_Staff --skill performance-optimization-thienty1207
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: performance-optimization
Source: https://github.com/thienty1207/Hotel_Staff/tree/main/.baron/core/skills/performance-optimization
Command: npx skills add https://github.com/thienty1207/Hotel_Staff --skill performance-optimization-thienty1207

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Performance work often becomes guesswork: code gets optimized without evidence, regressions ship silently, and no one can prove users are better off. This Skill enforces a measure-first loop so every optimization has a baseline, a named bottleneck, a verified fix, and a guard against regression. ## Core Features & Use Cases - Structured Investigation Loop: Follows a five-step cycle of measure, identify, fix, verify, and guard, with a symptom-to-measurement table covering slow page loads, laggy interactions, slow APIs, memory growth, and intermittent latency. - Bottleneck Classification and Fixes: Categorizes issues into database, network/API, frontend loading, frontend rendering, caching, CPU/memory, concurrency, and tooling, with concrete anti-pattern fixes such as resolving N+1 queries, bounding list endpoints, and reducing bundle size. - Core Web Vitals Guidance: Provides LCP, INP, and CLS thresholds and routes web-facing tasks to a web performance auditor when browser rendering review is needed. - Use Case: A dashboard endpoint feels slow in production. Use this Skill to baseline response time, identify an N+1 query pattern, apply a batched query fix, verify with before/after query counts, and add a query-count budget as a regression guard. ## Quick Start Ask the AI to investigate why a specific page or API endpoint is slow and produce a measured before-and-after performance report.

Frequently Asked Questions about performance-optimization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix a slow API endpoint or database query?

Start by measuring request timing and database query timing to establish a baseline. Common fixes include batching N+1 queries, adding pagination to unbounded endpoints, adding indexes matched to query shape, and moving expensive synchronous work out of the request path.

How to improve Core Web Vitals like LCP, INP, and CLS?

Target LCP at or under 2.5 seconds, INP at or under 200 milliseconds, and CLS at or under 0.1. Prioritize the LCP resource, break up long tasks for better INP, and set explicit media dimensions to stabilize layout.

What causes N+1 queries and how do I detect them?

N+1 queries occur when code fetches related records inside a loop instead of batching. Detect them by counting queries per request on list pages; fix them with joins, preloading, or a data loader pattern.

When should I not optimize performance?

Avoid optimizing code that is not on a measured hot path or cosmetic-only work with no loading, rendering, or resource impact. Optimizing without a baseline produces unverifiable changes and adds complexity without proven user benefit.

Why does adding a cache sometimes make things worse?

Caching without invalidation rules, size limits, and stampede control creates stale-data bugs and unbounded memory growth. Every cache needs a TTL or invalidation policy and a defined maximum size or eviction strategy.