agentleFS
DataArtDataArt/artisyn-log-hub/.claude/skills/post-impl-check-performance-no-auto/SKILL.md

post-impl-check-performance-no-auto

Skill12 starsChanged 7 days agoMITView on GitHub

Performance audit of a task's code changes: N+1 queries, slow operations, memory leaks, bundle size. Manual-only (-no-auto): run when explicitly asked.

The file

Files
SKILL.md

You are performing a performance audit of the code changes introduced by a task.

Task: $ARGUMENTS

Locate the changed files (skip if the caller already provided them): read the task's impl-plan.md — glob docs/tasks/todo/$ARGUMENTS/impl-plan.md, fallback docs/tasks/done/$ARGUMENTS/impl-plan.md. Task folders are named <YYYY-MM-DD>-<slug> and the caller passes that whole folder name; if it was given only a partial id, widen to docs/tasks/*/*$ARGUMENTS*/impl-plan.md. (Do not glob a bare directory such as docs/tasks/todo/$ARGUMENTS/; the Glob tool only matches files, so a directory-only pattern returns nothing even when the folder exists.) Read it for the created/modified files; if no plan exists, use git diff --name-only HEAD~1 HEAD plus git status --short. Read each identified file, focusing on repository/service query logic, controllers/routes (pagination, filtering), frontend components (render logic), and package.json dependency changes.

Audit categories

N+1 Queries

  • Loops (.forEach, for...of, .map) that call repository methods or make DB queries inside each iteration
  • Loading related entities one at a time instead of using JOIN or eager loading
  • Sequential await calls inside a loop that could be batched with Promise.all

Missing Pagination on List Endpoints

  • List endpoints (GET /resource) that return all records without .take(), .limit(), LIMIT, or pagination parameters
  • Missing page/limit or cursor query parameters on list routes

Synchronous Operations That Should Be Async

  • CPU-intensive operations blocking the event loop (large data transformations, sorting, parsing)
  • File system reads done synchronously (readFileSync, existsSync in request paths)
  • Synchronous cryptographic operations on large data

Memory Leaks

  • Event listeners added without corresponding cleanup (.removeEventListener, .off, useEffect cleanup)
  • Closures holding large arrays or buffers beyond their useful lifetime
  • Streams not properly closed; intervals/timeouts not cleared on component destruction

Expensive Computations in Render Functions (Frontend)

  • Complex filtering/sorting/mapping computed directly in render without memoization
  • Large transformations recalculated on every render tick
  • Missing useMemo (or equivalent) for expensive derived values

Large Bundle Additions

  • New dependencies that are known to be large when a lighter alternative exists
  • Entire libraries imported when only one function is needed
  • Dynamic imports missing for lazy-loadable routes or heavy components

Missing Database Query Result Limits

  • Queries without .take(), LIMIT, or equivalent that could return unbounded result sets
  • Aggregation queries running over entire tables without date/scope filters

Severity and reporting

  • HIGH: direct throughput/scalability impact under real load (N+1 in a list endpoint, unbounded result set on a hot path, leak in a long-running service)
  • MEDIUM: noticeable degradation under moderate load or large data (sync file read in request path, missing pagination on a growing table, expensive render computation)
  • LOW: limited-impact optimization opportunity (suboptimal import style, missing memoization on a rarely-rendered component)

Report each finding as [SEVERITY] <file>:<line> — <description>, then a one-line count summary. If none: No performance issues found.

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.