performance-gate

Verify performance implications were considered and no obvious anti-patterns exist. Issues result in WARNINGS.

25 stars

Best use case

performance-gate is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Verify performance implications were considered and no obvious anti-patterns exist. Issues result in WARNINGS.

Teams using performance-gate should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/performance-gate/SKILL.md --create-dirs "https://raw.githubusercontent.com/ComeOnOliver/skillshub/main/skills/aiskillstore/marketplace/danielpodolsky/performance-gate/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/performance-gate/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How performance-gate Compares

Feature / Agentperformance-gateStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Verify performance implications were considered and no obvious anti-patterns exist. Issues result in WARNINGS.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Gate 4: Performance Review

> "Code that works is step one. Code that scales is step two."

## Purpose

This gate catches performance anti-patterns before they cause problems. The focus is on obvious issues, not micro-optimizations.

## Gate Status

- **PASS** — No obvious performance issues
- **WARNING** — Issues found that could cause problems at scale

---

## Gate Questions

### Question 1: Scalability
> "What happens when there are 10,000 items? 1,000,000?"

**Looking for:**
- Awareness of data growth
- Pagination for large datasets
- Efficient data structures
- No unnecessary loops

### Question 2: Query Efficiency
> "How many database queries does this operation make?"

**Looking for:**
- No N+1 queries
- Bulk operations where appropriate
- Indexes on queried columns
- Awareness of query cost

### Question 3: Re-render Awareness (Frontend)
> "When this state changes, what components re-render?"

**Looking for:**
- Awareness of render triggers
- Appropriate memoization
- State placement optimization
- No expensive computations in render

---

## Performance Checklist

### Database Operations
- [ ] No N+1 queries (queries inside loops)
- [ ] Pagination for list endpoints
- [ ] Indexes on frequently queried columns
- [ ] SELECT only needed columns (not SELECT *)

### Frontend Rendering
- [ ] Expensive computations use useMemo
- [ ] Event handlers use useCallback where needed
- [ ] Large lists use virtualization
- [ ] Heavy components are lazy loaded

### API & Network
- [ ] Response payloads are minimal
- [ ] Large data is paginated
- [ ] Caching headers where appropriate
- [ ] No redundant API calls

### General
- [ ] No nested loops (O(n²)) without justification
- [ ] No blocking operations
- [ ] Cleanup of intervals/timeouts
- [ ] Reasonable memory usage

---

## Response Templates

### If PASS

```
✅ PERFORMANCE GATE: PASSED

Performance considerations look good:
- Data fetching is efficient
- No obvious N+1 patterns
- Appropriate pagination in place

Moving to the next gate...
```

### If WARNING

```
⚠️ PERFORMANCE GATE: WARNING

Found [X] performance concerns:

**Issue 1: [N+1 Query / Inefficient Loop]**
Location: `file.ts:42`
Question: "This makes [N] queries. Can we batch into 1?"

**Issue 2: [Missing Pagination]**
Location: `file.ts:88`
Question: "What happens with 100,000 records?"

**Issue 3: [Expensive Render]**
Location: `Component.tsx:15`
Question: "Does this need to recalculate on every render?"

These may not matter now, but will become problems as the app grows.
```

---

## Common Issues to Check

### 1. The N+1 Query Problem
```
❌ const users = await User.findAll();
   for (const user of users) {
     user.posts = await Post.findByUserId(user.id);
   }
   // 1 + N queries!

✅ const users = await User.findAll({
     include: [{ model: Post }]
   });
   // 1 query with JOIN
```

### 2. Fetching Everything
```
❌ // Returns 10,000 users with 50 fields each
   GET /api/users

✅ // Paginated with only needed fields
   GET /api/users?page=1&limit=20&fields=id,name,email
```

### 3. Expensive Render Calculations
```
❌ function UserList({ users }) {
     // Runs on every render
     const sorted = users.sort((a, b) => a.name.localeCompare(b.name));
     return <ul>{sorted.map(...)}</ul>;
   }

✅ function UserList({ users }) {
     const sorted = useMemo(
       () => [...users].sort((a, b) => a.name.localeCompare(b.name)),
       [users]
     );
     return <ul>{sorted.map(...)}</ul>;
   }
```

### 4. Inline Functions Causing Re-renders
```
❌ function Parent() {
     return <Child onClick={() => doSomething()} />;
     // New function every render → Child re-renders
   }

✅ function Parent() {
     const handleClick = useCallback(() => doSomething(), []);
     return <Child onClick={handleClick} />;
   }
```

### 5. Missing Cleanup
```
❌ useEffect(() => {
     const interval = setInterval(fetchData, 5000);
     // Memory leak! Runs forever
   }, []);

✅ useEffect(() => {
     const interval = setInterval(fetchData, 5000);
     return () => clearInterval(interval);
   }, []);
```

---

## Socratic Performance Questions

Instead of pointing out the fix, ask:

1. "How many queries does this endpoint execute for 100 users?"
2. "If I add 10,000 more items, what breaks?"
3. "Does this array get re-sorted on every render?"
4. "What clears this interval when the component unmounts?"
5. "Do we need all 50 columns from this table?"

---

## Big O Quick Reference

| Pattern | Complexity | 10,000 items | Concern Level |
|---------|------------|--------------|---------------|
| Map lookup | O(1) | 1 op | Fine |
| Single loop | O(n) | 10,000 ops | Usually fine |
| Nested loop | O(n²) | 100M ops | Warning |
| Triple loop | O(n³) | 1T ops | Critical |

---

## Performance Red Flags

| Flag | Question | Why |
|------|----------|-----|
| Query in a loop | "Can we batch?" | N+1 problem |
| No pagination | "What at scale?" | Memory/time explosion |
| SELECT * | "Need all fields?" | Wasted bandwidth |
| setInterval no cleanup | "What clears this?" | Memory leak |
| Inline object/function in JSX | "New reference?" | Unnecessary re-renders |
| Array.sort() in render | "Cached?" | Runs every render |

---

## When to NOT Worry

Not everything needs optimization:

- **Small datasets**: Don't paginate 20 items
- **Rare operations**: One-time admin scripts can be slow
- **Prototype phase**: Get it working first
- **Micro-optimizations**: Focus on algorithms, not `for` vs `forEach`

The gate is about catching **obvious** issues, not micro-optimization.

Related Skills

validating-performance-budgets

25
from ComeOnOliver/skillshub

Validate application performance against defined budgets to identify regressions early. Use when checking page load times, bundle sizes, or API response times against thresholds. Trigger with phrases like "validate performance budget", "check performance metrics", or "detect performance regression".

analyzing-query-performance

25
from ComeOnOliver/skillshub

This skill enables Claude to analyze and optimize database query performance. It activates when the user discusses query performance issues, provides an EXPLAIN plan, or asks for optimization recommendations. The skill leverages the query-performance-analyzer plugin to interpret EXPLAIN plans, identify performance bottlenecks (e.g., slow queries, missing indexes), and suggest specific optimization strategies. It is useful for improving database query execution speed and resource utilization.

providing-performance-optimization-advice

25
from ComeOnOliver/skillshub

Provide comprehensive prioritized performance optimization recommendations for frontend, backend, and infrastructure. Use when analyzing bottlenecks or seeking improvement strategies. Trigger with phrases like "optimize performance", "improve speed", or "performance recommendations".

profiling-application-performance

25
from ComeOnOliver/skillshub

Execute this skill enables AI assistant to profile application performance, analyzing cpu usage, memory consumption, and execution time. it is triggered when the user requests performance analysis, bottleneck identification, or optimization recommendations. the... Use when optimizing performance. Trigger with phrases like 'optimize', 'performance', or 'speed up'.

performance-testing

25
from ComeOnOliver/skillshub

This skill enables Claude to design, execute, and analyze performance tests using the performance-test-suite plugin. It is activated when the user requests load testing, stress testing, spike testing, or endurance testing, and when discussing performance metrics such as response time, throughput, and error rates. It identifies performance bottlenecks related to CPU, memory, database, or network issues. The plugin provides comprehensive reporting, including percentiles, graphs, and recommendations.

detecting-performance-regressions

25
from ComeOnOliver/skillshub

This skill enables Claude to automatically detect performance regressions in a CI/CD pipeline. It analyzes performance metrics, such as response time and throughput, and compares them against baselines or thresholds. Use this skill when the user requests to "detect performance regressions", "analyze performance metrics for regressions", or "find performance degradation" in a CI/CD environment. The skill is also triggered when the user mentions "baseline comparison", "statistical significance analysis", or "performance budget violations". It helps identify and report performance issues early in the development cycle.

performance-lighthouse-runner

25
from ComeOnOliver/skillshub

Performance Lighthouse Runner - Auto-activating skill for Frontend Development. Triggers on: performance lighthouse runner, performance lighthouse runner Part of the Frontend Development skill category.

performance-baseline-creator

25
from ComeOnOliver/skillshub

Performance Baseline Creator - Auto-activating skill for Performance Testing. Triggers on: performance baseline creator, performance baseline creator Part of the Performance Testing skill category.

optimizing-cache-performance

25
from ComeOnOliver/skillshub

Execute this skill enables AI assistant to analyze and improve application caching strategies. it optimizes cache hit rates, ttl configurations, cache key design, and invalidation strategies. use this skill when the user requests to "optimize cache performance"... Use when optimizing performance. Trigger with phrases like 'optimize', 'performance', or 'speed up'.

aggregating-performance-metrics

25
from ComeOnOliver/skillshub

This skill enables Claude to aggregate and centralize performance metrics from various sources. It is used when the user needs to consolidate metrics from applications, systems, databases, caches, queues, and external services into a central location for monitoring and analysis. The skill is triggered by requests to "aggregate metrics", "centralize performance metrics", or similar phrases related to metrics aggregation and monitoring. It facilitates designing a metrics taxonomy, choosing appropriate aggregation tools, and setting up dashboards and alerts.

exa-performance-tuning

25
from ComeOnOliver/skillshub

Optimize Exa API performance with search type selection, caching, and parallelization. Use when experiencing slow responses, implementing caching strategies, or optimizing request throughput for Exa integrations. Trigger with phrases like "exa performance", "optimize exa", "exa latency", "exa caching", "exa slow", "exa fast".

evernote-performance-tuning

25
from ComeOnOliver/skillshub

Optimize Evernote integration performance. Use when improving response times, reducing API calls, or scaling Evernote integrations. Trigger with phrases like "evernote performance", "optimize evernote", "evernote speed", "evernote caching".