agentleFS
CodeWithBehnamCodeWithBehnam/cc-docs/skills/perf-audit/SKILL.md

perf-audit

Skill2 starsChanged 9 months agoMITView on GitHub

Find performance bottlenecks in the codebase. Analyzes hot code paths, database queries, memory allocation patterns, and algorithmic complexity. Use when the user asks about performance, says "why is this slow", "find bottlenecks", "optimize this", or "perf audit".

17 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use a11y-audit, security-audit and 3 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.
  • renfei-designSkill

    a11y-audit

    Audit Figma designs for WCAG accessibility issues — color contrast, minimum font size, touch target sizing, and missing text alternatives. Use when asked to check accessibility, audit contrast ratios, find a11y issues, verify WCAG compliance, or review designs for accessibility problems. Scans nodes, analyzes offline, and annotates issues in Figma.

    Also in 5 projects that use this

  • CloudflareSkill

    security-audit

    Security guidance and vulnerability review for codebases, APIs, services, CLI tools, libraries, and daemons. Use for security questions, focused reviews, vulnerability research, security audits, or pen tests. Run the complete workflow only for explicit codebase audit or pen-test requests, full/comprehensive/end-to-end reviews, or requested report artifacts.

    Also in 5 projects that use this

  • Google CloudSkill

    triage

    Gather context on a change or bug and plan the implementation.

    Also in 5 projects that use this

  • GoogleSkill

    code-review

    Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.

    Also in 5 projects that use this

  • NVIDIASkill

    research

    Before designing a feature, research how comparable libraries solve the problem, check best practices, known pitfalls, and upstream changes. Use when starting a new feature, investigating an unfamiliar area, or the user asks to research something.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

10 rules. 0 are common, 9 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 13 edited versions we read keep these.

  • 9

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Look for linear searches in code paths that run frequently

    line 26
  2. Distinctive:

    Check for repeated computation that could be cached or memoized

    line 28
  3. Very specific:

    Look for missing SELECT column lists (selecting all columns when only a few are needed)

    line 33
  4. Distinctive:

    Check for missing indexes by looking at frequently-queried fields

    line 36
  5. Distinctive:

    Look for large collections built up and never released

    line 41
  6. Distinctive:

    Look for large in-memory caches with no eviction policy

    line 44
  7. Distinctive:

    Look for single-threaded bottlenecks in otherwise concurrent code

    line 50
  8. Distinctive:

    Look for render-blocking operations in UI code

    line 56
  9. Distinctive:

    Look for missing HTTP cache headers on static or rarely-changing responses

    line 61
  10. Distinctive:

    If the bottleneck is unclear, suggest specific profiling commands or tools appropriate for the detected language/framework.

    line 89

“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Context

  • Repository: !git rev-parse --show-toplevel 2>/dev/null || pwd
  • Target: $ARGUMENTS
  • Languages detected: !find . -type f \( -name "*.py" -o -name "*.ts" -o -name "*.js" -o -name "*.go" -o -name "*.rb" -o -name "*.java" \) -not -path '*/node_modules/*' -not -path '*/.venv/*' | sed 's/.*\.//' | sort | uniq -c | sort -rn | head -8

Task

Perform a performance audit of the codebase (or the area specified in $ARGUMENTS). Investigate all of the following categories:

1. Algorithmic Complexity

  • Find loops with nested loops over the same data (O(n^2) or worse)
  • Look for linear searches in code paths that run frequently
  • Identify cases where sorting is done inside loops
  • Check for repeated computation that could be cached or memoized

2. Database and I/O

  • Find N+1 query patterns: loops that execute one query per iteration
  • Look for missing SELECT column lists (selecting all columns when only a few are needed)
  • Find queries that load entire tables and filter in memory
  • Identify blocking I/O in async/concurrent code
  • Check for missing indexes by looking at frequently-queried fields
  • Find repeated reads of the same data within a request lifecycle (missing request-scoped caching)

3. Memory

  • Look for large collections built up and never released
  • Find code that loads entire files into memory when streaming would work
  • Identify object creation in hot loops (prefer pre-allocation or pools)
  • Look for large in-memory caches with no eviction policy

4. Concurrency

  • Find serial execution of independent I/O calls that could be parallelized
  • Identify overly broad locks that block unrelated operations
  • Look for single-threaded bottlenecks in otherwise concurrent code

5. Frontend-Specific (if applicable)

  • Find synchronous blocking calls on the main thread
  • Identify large payloads returned from APIs where pagination or field selection would help
  • Look for render-blocking operations in UI code

6. Caching Opportunities

  • Identify expensive computations or queries that repeat with the same inputs
  • Look for missing HTTP cache headers on static or rarely-changing responses
  • Find cases where results could be memoized at the function level

For each area, read the relevant source files to understand the actual code before reporting. Avoid reporting hypothetical issues - only report things confirmed by reading the code.

Output Format

Performance Summary

One paragraph: overall assessment of where the performance risks are concentrated.

Findings

For each issue:

  • ID: PERF-001, PERF-002, ...
  • Category: Algorithmic / Database / Memory / Concurrency / Caching
  • Severity: Critical (likely user-visible) / High / Medium / Low
  • File: path/to/file.py:42
  • Description: what the issue is and why it is slow
  • Evidence: the specific code or pattern
  • Recommendation: concrete fix with expected improvement

Quick Wins

Improvements that are low-risk and can be made immediately, ranked by expected impact.

Larger Investments

Improvements that require significant refactoring or design changes but have high potential impact.

Profiling Suggestions

If the bottleneck is unclear, suggest specific profiling commands or tools appropriate for the detected language/framework.

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.