agentleFS
elfrostelfrost/ai-patchlab/.agents/skills/performance/SKILL.md

performance

Skill1 starsChanged 2 months agoMITView on GitHub

Identify performance bottlenecks via static pattern hunting plus optional runtime profiling. Combines Claude's two-stage Karpathy pipeline (researcher + performance-profiler per ADR-016) into one inline pass.

45 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use web-quality-audit, core-web-vitals and 10 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.
  • RodrigoTomeESSkill

    web-quality-audit

    Comprehensive web quality audit covering performance, accessibility, SEO, and best practices. Use when asked to "audit my site", "review web quality", "run lighthouse audit", "check page quality", or "optimize my website".

    Also in 5 projects that use this

  • thisisAhsanIqbalSkill

    core-web-vitals

    Audits HTML patterns that affect Core Web Vitals (LCP, CLS, INP). Checks for layout shift causes, largest contentful paint blockers, and interaction responsiveness issues. Use when optimising page performance or fixing Google PageSpeed Insights warnings.

    Also in 6 projects that use this

  • kpbraySkill

    best-practices

    Applies Power BI best practices, BPA rules, and enterprise standards. Use for quality validation, naming conventions, and performance optimization.

    Also in 5 projects that use this

  • ElasticSkill

    accessibility

    Accessibility guidance for Kibana. Use this skill when working with or reviewing EUI components, resolving a11y-related (@elastic/eui) ESLint issues, and ensuring proper use of ARIA attributes, focus management, keyboard interactions, and accessible naming conventions.

    Also in 13 projects that use this

  • pproencaSkill

    refactoring

    Code refactoring best practices based on Martin Fowler's catalog and Clean Code principles. This skill should be used when refactoring existing code, improving code structure, reducing complexity, eliminating code smells, or reviewing code for maintainability. Triggers on tasks involving extract method, rename, decompose conditional, reduce coupling, or improve readability.

    Also in 7 projects that use this

  • BlockSkill

    debugging

    Debugging guidelines and best practices

    Also in 10 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 24 edited versions we read keep these.

  • 2

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Default scope: src/ (or $ARGUMENTS if provided).

    line 11
  2. Very specific:

    If user opts in to runtime profiling: python -m cProfile -o /tmp/profile.out src/main.py then parse with pstats

    line 25
  3. Distinctive:

    Ask the user before applying

    line 32
  4. Distinctive:

    Don't optimize prematurely — focus on measurable bottlenecks

    line 43

“Common” is measured: kept by at least 6 in 10 of the 24 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

Performance

Inline two-stage analysis: gather candidate hot paths first (mechanical grep), then prioritize and deepen on the top targets.

Phase 1: Gather candidates

Default scope: src/ (or $ARGUMENTS if provided). Look for likely-slow patterns:

  • Sync I/O inside async def (requests.get, time.sleep, open() without aiofiles)
  • N+1 query patterns (DB call inside a loop)
  • Sequential await calls that could be asyncio.gather
  • Compiled regexes or client instantiations inside loops
  • Unbounded list / str growth in loops
  • Missing connection pooling (new aiomysql connection per request)
  • Blocking calls in async handlers

For each candidate: file:line + function name + sample.

Phase 2: Prioritize + deep analysis

  1. Rank candidates by likely impact
  2. For top candidates, examine call frequency and data volumes
  3. If user opts in to runtime profiling: python -m cProfile -o /tmp/profile.out src/main.py then parse with pstats
  4. Correlate static findings with runtime hotspots

Phase 3: Report + act

Produce ranked recommendations with concrete fix proposals (not "use async" — show the exact replacement).

For quick wins (1-line fixes like time.sleep -> asyncio.sleep):

  • Ask the user before applying
  • Apply + run validation (ruff check, pytest)

For structural changes (N+1 fixes, async refactors, pooling):

  • Suggest creating a PRP via the generate-prp skill

Rules

  • Static analysis is safe and always runs
  • Runtime profiling requires explicit user approval (modifies execution)
  • Quick wins can be auto-applied with validation
  • Structural changes belong in a PRP
  • Don't optimize prematurely — focus on measurable bottlenecks

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.