Skip to content

Skills for Claude Code and other AI Agents#4

Open
rudolfolah wants to merge 3 commits into
mainfrom
claude-skills
Open

Skills for Claude Code and other AI Agents#4
rudolfolah wants to merge 3 commits into
mainfrom
claude-skills

Conversation

@rudolfolah

Copy link
Copy Markdown
Owner

A set of skills that can be used by Claude Code and other AI agents. To ensure that most of the skills are usable, I used Oh My Pi with GPT 5.5 and GPT 5.6 Sol to generate programs and outfit them with performance profiling tools, only tested on a MacBook Pro. If the skills do not work, please create an issue.

Skills:

  • Browser JavaScript Profiling
  • JavaScript Profiling (Node.js)
  • GPU Profiling
  • Game Profiling: Godot and Unity
  • JVM Profiling
  • Python Profiling
  • Python CPU Profiling: cProfile, py-spy, yappi, pyinstrument
  • Python DTrace Profiling
  • Python Memory Profiling
  • Systems Profiling: gprof, Tracy, Valgrind, Apple Instruments


Use this skill when the subject is JavaScript running in a browser page: page-load cost, interaction latency, rendering jank, long tasks, layout/paint work, or objects retained by a page. The primary reference is the [Chrome DevTools Performance features reference](https://developer.chrome.com/docs/devtools/performance/reference).

This is **browser-page profiling**, not Node.js process profiling. The existing JavaScript/Node.js skill covers `node --cpu-prof`, `node --heap-prof`, `--trace-gc`, V8 heap APIs, and server-side tools. Do not use those Node flags as a substitute for recording a page: they profile a Node process and its isolate. A Node `.cpuprofile` or `.heapprofile` can be opened in DevTools, but it is not a browser Performance trace and does not include the page's renderer, network, layout, paint, or user interaction. Use the Performance and Memory panels below for a browser page.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The skill needs to be independent and should not reference other skills.

Suggested change
This is **browser-page profiling**, not Node.js process profiling. The existing JavaScript/Node.js skill covers `node --cpu-prof`, `node --heap-prof`, `--trace-gc`, V8 heap APIs, and server-side tools. Do not use those Node flags as a substitute for recording a page: they profile a Node process and its isolate. A Node `.cpuprofile` or `.heapprofile` can be opened in DevTools, but it is not a browser Performance trace and does not include the page's renderer, network, layout, paint, or user interaction. Use the Performance and Memory panels below for a browser page.
This is **browser-page profiling**, not Node.js process profiling. Node.js flags include `node --cpu-prof`, `node --heap-prof`, `--trace-gc`, V8 heap APIs, and server-side tools. Do not use those Node flags as a substitute for recording a page: they profile a Node process and its isolate. A Node `.cpuprofile` or `.heapprofile` can be opened in DevTools, but it is not a browser Performance trace and does not include the page's renderer, network, layout, paint, or user interaction. Use the Performance and Memory panels below for a browser page.


| Question | First workflow | Main evidence |
| --- | --- | --- |
| Why is an interaction or animation janky? | Performance panel, runtime recording | Main-thread tasks, frames, interactions, scripting, style/layout, paint, and user-timing markers |

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A skill could be added for profiling React apps.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are MCPs for Unity and Godot, those can be referenced:

Use the Unity MCP if available.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be split into supporting files, for NVIDIA, AMD, Android, Intel, Metal.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deno and Bun have support for --cpu-prof

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the references to Python 3.11 and .python-version should be removed. DTrace has been supported since Python 3.6.

@@ -0,0 +1,76 @@
# Python Profiling Skill

Use this skill when investigating CPU time, wall-clock latency, Python allocations, process memory, object growth, or interpreter-level events in the examples under `python/`. The repository compares multiple profilers around `python/program.py`; choose the narrowest tool that can answer the question instead of running every profiler by default.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Use this skill when investigating CPU time, wall-clock latency, Python allocations, process memory, object growth, or interpreter-level events in the examples under `python/`. The repository compares multiple profilers around `python/program.py`; choose the narrowest tool that can answer the question instead of running every profiler by default.
Use this skill when investigating CPU time, wall-clock latency, Python allocations, process memory, object growth, or interpreter-level events. Choose the narrowest tool that can answer the question instead of running every profiler by default.

Comment on lines +6 to +8

The examples target the Python version in `python/.python-version` and use the virtual environment described in `python/README.md`:

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The examples target the Python version in `python/.python-version` and use the virtual environment described in `python/README.md`:

Comment on lines +25 to +36
`program.py` fetches a Wikipedia page over HTTPS before parsing it. Treat a non-empty top-ten word list as the baseline preflight; `[]` means the intended parsing workload did not run and the resulting profile is not useful. The current target calls `requests.get(...)` without a descriptive `User-Agent` or `raise_for_status()`, so Wikimedia may return its small HTTP 403 robot-policy response and the program may silently print `[]`. If that happens, stop before profiling and make the workload valid: preferably use a checked-in/local fixture, or update the request to use a policy-compliant descriptive `User-Agent` and fail on non-success responses. Do not compare a rejection-response profile with a successful-page profile.

Even with a successful response, network, DNS, TLS, server, and response-size variance can dominate timings. For repeatable comparisons, keep the input and environment fixed; never treat one network run as a reliable regression measurement.

The repository's comparison runner is:

```bash
./timing.sh
```

It invokes cProfile, tracemalloc, Memray, pyinstrument, yappi, Filprofiler, psutil, and guppy3. Profiling changes both runtime and memory behavior, so compare profiles only under the same Python build, dependency versions, input, warm-up state, and command-line options.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`program.py` fetches a Wikipedia page over HTTPS before parsing it. Treat a non-empty top-ten word list as the baseline preflight; `[]` means the intended parsing workload did not run and the resulting profile is not useful. The current target calls `requests.get(...)` without a descriptive `User-Agent` or `raise_for_status()`, so Wikimedia may return its small HTTP 403 robot-policy response and the program may silently print `[]`. If that happens, stop before profiling and make the workload valid: preferably use a checked-in/local fixture, or update the request to use a policy-compliant descriptive `User-Agent` and fail on non-success responses. Do not compare a rejection-response profile with a successful-page profile.
Even with a successful response, network, DNS, TLS, server, and response-size variance can dominate timings. For repeatable comparisons, keep the input and environment fixed; never treat one network run as a reliable regression measurement.
The repository's comparison runner is:
```bash
./timing.sh
```
It invokes cProfile, tracemalloc, Memray, pyinstrument, yappi, Filprofiler, psutil, and guppy3. Profiling changes both runtime and memory behavior, so compare profiles only under the same Python build, dependency versions, input, warm-up state, and command-line options.
Profiling changes both runtime and memory behavior, so compare profiles only under the same Python build, dependency versions, input, warm-up state, and command-line options.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant