agentleFS
GlamgarOnDiscordGlamgarOnDiscord/claude-saas-blueprint/.claude/skills/perf/SKILL.md

perf

Skill2 starsChanged 6 months agoMITView on GitHub

Audit et optimisation des performances SaaS. Bottlenecks DB, bundle, Server Components, background jobs. Next.js + Supabase.

21 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use incident, security and 6 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • JkudjoSkill

    incident

    Production incident response — structured triage, hypothesis tree, safe remediation, incident record

    Also in 4 projects that use this

  • 0xSeroSkill

    security

    Also in 5 projects that use this

  • Microsoft AzureSkill

    test

    Also in 5 projects that use this

  • OpenAISkill

    observability

    Vercel Observability expert guidance — Drains (logs, traces, speed insights, web analytics), Web Analytics, Speed Insights, runtime logs, custom events, OpenTelemetry integration, and monitoring dashboards. Use when instrumenting, debugging, or optimizing application performance and user experience on Vercel.

    Also in 3 projects that use this

  • Microsoft AzureSkill

    docs

    Also in 4 projects that use this

  • MicrosoftSkill

    api-design

    Guide for designing and documenting RESTful APIs. Use when asked to design an API, create endpoints, or document an API.

    Also in 4 projects that use this

  • +1 more from Azure

The file

Files
SKILL.md

Phase 1 — Identifier les bottlenecks

Lancer d'abord :

python scripts/project_health.py   # vue globale

Web App (Next.js) :

  • Server Components vs Client Components inutiles ("use client" abusif ?)
  • Re-renders inutiles (props instables, Context trop large)
  • N+1 queries (boucle avec query DB à chaque itération)
  • Images non optimisées (pas de next/image)
  • Composants lourds non lazy-loadés (dynamic(() => import(...)))
  • Bundle size : analyser next build output — alerter si JS client > 500KB
  • Pas de cache() sur les Server Components qui refetch les mêmes données

API + DB :

  • Index manquants sur FK et champs de recherche fréquents
  • Endpoints sans pagination (retournent tout)
  • Opérations lentes dans le handler (email, PDF, webhook) → doivent être async
  • Connection pooling Supabase : utiliser le pooler (port 6543), pas direct

Background jobs :

  • Emails, webhooks, exports PDF, traitements IA → ne JAMAIS bloquer le handler
  • Solutions recommandées : Trigger.dev v4 ou Inngest (voir docs/integrations/ai-tools-2026.md)
  • Pattern : POST /api/invoice → créer job → return 202 → Trigger.dev exécute en fond

Edge :

  • Endpoints légers (auth check, redirects) → Edge Runtime (export const runtime = 'edge')
  • DB géo-distribuée pour faible latence globale : Turso (SQLite edge) ou Neon (serverless Postgres)

Phase 2 — Quick wins (par ordre d'impact)

  1. Index DB manquants — impact immédiat, 0 code à changer
    CREATE INDEX ON public.invoices (organization_id, created_at DESC);
  2. Pagination sur tous les endpoints de liste (limit + cursor)
  3. Lazy load composants lourds (éditeurs, charts, maps)
  4. Cache React Query : staleTime: 5 * 60 * 1000 sur les queries stables
  5. next/image pour toutes les images + formats WebP/AVIF
  6. Debounce les inputs de recherche (300ms)
  7. Passer en async les opérations lentes (email → Resend en background)

Phase 3 — Optimisations avancées

  • Streaming + Suspense : perceived performance sur les pages lentes
  • ISR : contenu semi-statique avec revalidate
  • PgBouncer / Supabase pooler : connection pooling DB (déjà intégré Supabase)
  • Trigger.dev : background jobs pour tâches IA longues (génération, analyse)

Output

Rapport avec :

  • Bottlenecks identifiés par sévérité (CRITICAL / WARNING / INFO)
  • Quick wins appliqués immédiatement
  • Recommandations pour les optimisations avancées + estimation d'impact

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.