agentleFS
PradnyeshpPradnyeshp/Claude-Skills/.claude/skills/profile/SKILL.md

profile

Skill2 starsChanged 4 months agoMITView on GitHub

Profile a program to find where it actually spends time or memory — capture a CPU/heap profile under a realistic workload, read the hot paths, and point to the real bottleneck before optimizing. Use when the user says "profile this", "where does the time go", "find the hotspot", "why is this using so much memory", "capture a flamegraph", "which function is slow", or "find the bottleneck before I optimize".

30 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use apply, status 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.
  • rhowardstoneSkill

    apply

    Research-backed job application workflow emphasizing relationship-building over mass applications

    Also in 3 projects that use this

  • AnthropicSkill

    status

    Case status summary by audience — client-facing (plain language), internal (for the professor), or court-ready (formal caption format per local rules). Same facts, different framing and depth. Use when a student needs to update the client, brief the professor, or prepare a court status report.

    Also in 3 projects that use this

  • Microsoft AzureSkill

    docs

    Also in 3 projects that use this

  • VercelSkill

    setup

    Set up Vercel CLI and project configuration. Use when the user says "set up Vercel", "configure Vercel", "link to Vercel", or "vercel init".

    Also in 3 projects that use this

  • GoogleSkill

    tdd

    Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 24 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Prefer a sampling profiler for realistic CPU cost (low overhead) and an allocation/heap profiler for memory.

    line 26
  2. Distinctive:

    Always measure before optimizing — identify the hotspot from a profile rather than intuition.

    line 33
  3. Distinctive:

    Read self vs. cumulative time (and retained vs.

    line 36

“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

Language, runtime & profiler signals

!grep -rilE "pprof|py-spy|cProfile|line_profiler|memory_profiler|clinic|0x|--prof|--inspect|perf|flamegraph|criterion|pytest-benchmark|scalene|austin" --include='*.*' package.json pyproject.toml go.mod Gemfile Cargo.toml Makefile 2>/dev/null | grep -vE 'node_modules|\.git|dist|build' | head -8

Instructions

Find where the code in $ARGUMENTS truly spends its time or memory by measuring, not guessing. Profiling locates the bottleneck; fixing it is the optimize skill's job and confirming the win is the benchmark skill's. Reuse whatever profiler already fits the project's language/runtime.

Method

  1. Pin down what and which resource. Decide CPU time vs. wall-clock (I/O-bound) vs. memory/allocations — they need different tools and lead to different fixes. Identify the smallest reproducible entrypoint that exhibits the problem.
  2. Profile under a realistic workload. A profile of a trivial or cold run is misleading — use representative input size, a warm cache/JIT where relevant, and enough iterations/duration that the hot code dominates the sample. For a server, profile while it's under load (drive it with the real path).
  3. Pick the profiler that fits:
    • Node: node --prof + --prof-process, --cpu-prof/--heap-prof, Clinic.js, or 0x for a flamegraph; --inspect + DevTools for heap snapshots.
    • Python: cProfile + snakeviz/pstats for CPU, py-spy/austin to sample a running process, line_profiler for per-line, memory_profiler/scalene/tracemalloc for memory.
    • Go: runtime/pprof or net/http/pprof, then go tool pprof (-http for a flamegraph); go test -cpuprofile/-memprofile.
    • Native/other: perf + FlameGraph, valgrind --tool=callgrind, or the platform sampler. Prefer a sampling profiler for realistic CPU cost (low overhead) and an allocation/heap profiler for memory; note that instrumenting profilers can distort timings.
  4. Read the profile for the real cost. Look at cumulative/total time and self time, and follow the flamegraph's widest frames. Distinguish a genuine hot leaf from a function that's merely on the path. For memory, separate live retained heap (leak/bloat) from transient allocation churn (GC pressure).
  5. Report the bottleneck, don't fix blindly. State the top few hotspots with their share of time/allocations, the workload used, and where the evidence points (CPU in a parser, GC from per-row allocation, a synchronous I/O stall, an N+1). Hand off the fix to optimize and re-measure with benchmark — optimizing without a profile is guessing.
  6. Clean up artifacts. Profiles, flamegraph SVGs, and isolate-*.log files shouldn't be committed — add them to .gitignore if they'll recur (see the gitignore skill).

Rules

  1. Always measure before optimizing — identify the hotspot from a profile rather than intuition; report evidence, not a guess.
  2. Profile a realistic, warmed, sufficiently long workload; a cold or toy run misattributes cost.
  3. Match the tool to the resource: sampling profiler for CPU cost, heap/allocation profiler for memory, wall-clock for I/O-bound — and note when an instrumenting profiler is distorting timings.
  4. Read self vs. cumulative time (and retained vs. transient memory) so you blame the true hot code, not a frame merely on the path.
  5. End with the top hotspots and their share, the workload profiled, the suspected cause, and a handoff to optimize/benchmark; don't commit profiler output.

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.