evo-nextjs-api-optimization

SkillDev tools

Identifies and fixes performance anti-patterns in Next.js API routes including artificial delays, N+1 sequential fetch patterns, missing caching headers, and unnecessary data processing.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the evo-nextjs-api-optimization skill

What this skill tells your AI

The instructions your AI receives, as published by openlair/openskill in tasks-evolved/react-performance-debugging/environment/skills/evo-nextjs-api-optimization/SKILL.md and read by ahel’s review.

Optimizes Next.js API routes by:

  1. Removing artificial delays (setTimeout in production)
  2. Parallelizing sequential awaits with Promise.all
  3. Adding caching headers (Cache-Control)
  4. Optimizing data fetching patterns

Key Patterns

Sequential Awaits → Promise.all

Anti-pattern:

const user = await fetchUser();
const products = await fetchProducts();
const reviews = await fetchReviews();

Fix:

const [user, products, reviews] = await Promise.all([
  fetchUser(),
  fetchProducts(),
  fetchReviews(),
]);

Artificial Delays

Remove await new Promise(resolve => setTimeout(...)) from production routes.

Cache-Control Headers

Add appropriate Cache-Control headers to API responses.

Usage

import sys
sys.path.insert(0, '/app/environment/skills/evo-nextjs-api-optimization/scripts')
from utils import find_sequential_awaits, fix_sequential_awaits, find_artificial_delays, apply_api_fixes

# Analyze a file
issues = find_sequential_awaits('/app/src/app/page.tsx')
# Apply fixes
apply_api_fixes('/app/src/app/page.tsx')

Signals

GitHub stars
89
Forks
4
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
evo-nextjs-api-optimization
Source
github.com/openlair/openskill