Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/README.skills.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ See [CONTRIBUTING.md](../CONTRIBUTING.md#adding-skills) for guidelines on how to
| [arize-trace](../skills/arize-trace/SKILL.md) | INVOKE THIS SKILL when downloading or exporting Arize traces and spans. Covers exporting traces by ID, sessions by ID, and debugging LLM application issues using the ax CLI. | `references/ax-profiles.md`<br />`references/ax-setup.md` |
| [aspire](../skills/aspire/SKILL.md) | Aspire skill covering the Aspire CLI, AppHost orchestration, service discovery, integrations, MCP server, VS Code extension, Dev Containers, GitHub Codespaces, templates, dashboard, and deployment. Use when the user asks to create, run, debug, configure, deploy, or troubleshoot an Aspire distributed application. | `references/architecture.md`<br />`references/cli-reference.md`<br />`references/dashboard.md`<br />`references/deployment.md`<br />`references/integrations-catalog.md`<br />`references/mcp-server.md`<br />`references/polyglot-apis.md`<br />`references/testing.md`<br />`references/troubleshooting.md` |
| [aspnet-minimal-api-openapi](../skills/aspnet-minimal-api-openapi/SKILL.md) | Create ASP.NET Minimal API endpoints with proper OpenAPI documentation | None |
| [async-profiler](../skills/async-profiler/SKILL.md) | Install, run, and analyze async-profiler for Java β€” low-overhead sampling profiler producing flamegraphs, JFR recordings, and allocation profiles. Use for: "install async-profiler", "set up Java profiling", "Failed to open perf_events", "what JVM flags for profiling", "capture a flamegraph", "profile CPU/memory/allocations/lock contention", "profile my Spring Boot app", "generate a JFR recording", "heap keeps growing", "what does this flamegraph mean", "how do I read a flamegraph", "interpret profiling results", "open a .jfr file", "what's causing my CPU hotspot", "wide frame in my profile", "I see a lot of GC / Hibernate / park in my profile". Use this skill any time a Java developer mentions profiling, flamegraphs, async-profiler, JFR, or wants to understand JVM performance. | `README.md`<br />`analyze`<br />`profile`<br />`scripts/analyze_collapsed.py`<br />`scripts/collect.sh`<br />`scripts/install.sh`<br />`scripts/run_profile.sh`<br />`setup` |
| [automate-this](../skills/automate-this/SKILL.md) | Analyze a screen recording of a manual process and produce targeted, working automation scripts. Extracts frames and audio narration from video files, reconstructs the step-by-step workflow, and proposes automation at multiple complexity levels using tools already installed on the user machine. | None |
| [autoresearch](../skills/autoresearch/SKILL.md) | Autonomous iterative experimentation loop for any programming task. Guides the user through defining goals, measurable metrics, and scope constraints, then runs an autonomous loop of code changes, testing, measuring, and keeping/discarding results. Inspired by Karpathy's autoresearch. USE FOR: autonomous improvement, iterative optimization, experiment loop, auto research, performance tuning, automated experimentation, hill climbing, try things automatically, optimize code, run experiments, autonomous coding loop. DO NOT USE FOR: one-shot tasks, simple bug fixes, code review, or tasks without a measurable metric. | None |
| [aws-cdk-python-setup](../skills/aws-cdk-python-setup/SKILL.md) | Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment prerequisites, create new CDK projects, manage dependencies, and deploy to AWS. | None |
Expand Down
72 changes: 72 additions & 0 deletions skills/async-profiler/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# async-profiler

Install, run, and analyze async-profiler for Java β€” a low-overhead sampling profiler producing flamegraphs, JFR recordings, and allocation profiles.

## What it does

- Installs async-profiler automatically for macOS or Linux
- Captures CPU time, heap allocations, wall-clock time, and lock contention
- Produces interactive flamegraphs, JFR recordings, and collapsed stack traces
- Interprets profiling output: identifies hotspots, GC pressure, lock contention, N+1 Hibernate patterns

## Compatibility

Requires Python 3.7+ for the analysis script. async-profiler works on macOS and Linux with a running JVM process.
Comment thread
vetler marked this conversation as resolved.

## Installation

**GitHub Copilot CLI:**

Point Copilot at the skill directory from within a session:
```
/skills add /path/to/async-profiler
```

Or copy manually to your personal skills directory (`~/.copilot/skills/` or `~/.agents/skills/` depending on your version):
```bash
cp -r async-profiler ~/.copilot/skills/
# or
cp -r async-profiler ~/.agents/skills/
```

**Claude Code:**
```bash
cp -r async-profiler ~/.claude/skills/async-profiler
```

**OpenCode:**
```bash
cp -r async-profiler ~/.config/opencode/skills/async-profiler
```

## Trigger phrases

- "install async-profiler"
- "capture a flamegraph"
- "profile my Spring Boot app"
- "heap keeps growing"
- "what does this flamegraph mean"
- "I see a lot of GC in my profile"

## Bundled scripts

| Script | Purpose |
|---|---|
| `scripts/install.sh` | Auto-detect platform, download and verify async-profiler |
| `scripts/run_profile.sh` | Wrap `asprof` with defaults, timestamp output |
| `scripts/collect.sh` | Background collection: start all-event profiling, stop and retrieve flamegraphs |
| `scripts/analyze_collapsed.py` | Ranked self-time/inclusive-time table for `.collapsed` files |

## Directory structure

```
async-profiler/
β”œβ”€β”€ SKILL.md # Entry point β€” routes to sub-guides
β”œβ”€β”€ scripts/ # Bundled scripts
β”œβ”€β”€ setup/
β”‚ └── SKILL.md # Installation and configuration
β”œβ”€β”€ profile/
β”‚ └── SKILL.md # Running profiling sessions
└── analyze/
└── SKILL.md # Interpreting profiling output
```
136 changes: 136 additions & 0 deletions skills/async-profiler/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
---
name: async-profiler
description: 'Install, run, and analyze async-profiler for Java β€” low-overhead sampling profiler producing flamegraphs, JFR recordings, and allocation profiles. Use for: "install async-profiler", "set up Java profiling", "Failed to open perf_events", "what JVM flags for profiling", "capture a flamegraph", "profile CPU/memory/allocations/lock contention", "profile my Spring Boot app", "generate a JFR recording", "heap keeps growing", "what does this flamegraph mean", "how do I read a flamegraph", "interpret profiling results", "open a .jfr file", "what''s causing my CPU hotspot", "wide frame in my profile", "I see a lot of GC / Hibernate / park in my profile". Use this skill any time a Java developer mentions profiling, flamegraphs, async-profiler, JFR, or wants to understand JVM performance.'
compatibility: Requires Python 3.7+ for the analyze_collapsed.py script.
Comment thread
vetler marked this conversation as resolved.
---

# async-profiler

async-profiler is a production-safe, low-overhead sampling profiler for Java
that avoids the safepoint bias of standard JVM profilers. It can capture CPU
time, heap allocations, wall-clock time, and lock contention, and produce
interactive flamegraphs, JFR recordings, and collapsed stack traces.

## Installing this skill

### IntelliJ IDEA (Junie or GitHub Copilot)

Skills live in a `.claude/skills/`, `.agents/skills/`, or `.github/skills/`
directory, either in your project repo or in your home directory.

**Project-level β€” recommended for teams** (commit so everyone gets it):
```bash
# From your project root:
mkdir -p .github/skills
cd .github/skills
unzip /path/to/async-profiler.skill
git add async-profiler
git commit -m "Add async-profiler skill"
```

**Global β€” personal use across all projects:**
```bash
mkdir -p ~/.claude/skills
cd ~/.claude/skills
unzip /path/to/async-profiler.skill
```

> **Note for GitHub Copilot users:** There is a known issue where the Copilot
> JetBrains plugin does not reliably pick up skills from the global `~/.copilot/skills`
> directory. Use the project-level `.github/skills/` location to be safe.

Alternatively, install the **Agent Skills Manager** plugin from the JetBrains
Marketplace (*Settings β†’ Plugins β†’ Marketplace* β†’ "Agent Skills Manager") for
a UI that installs skills without unzipping manually.

---

## Using this skill in IntelliJ IDEA

### With Junie (JetBrains AI)

Junie is JetBrains' native coding agent, available in the AI Chat panel.

1. Open the AI Chat panel (*View β†’ Tool Windows β†’ AI Chat*, or the chat icon
in the right toolbar)
2. In the agent dropdown at the top of the chat, select **Junie**
3. Choose a mode:
- **Code mode** β€” Junie can run terminal commands, write files, and execute
the profiling scripts directly. Use this when you want it to actually run
`scripts/install.sh` or `scripts/run_profile.sh` for you.
- **Ask mode** β€” read-only; Junie analyzes and explains but won't touch
files. Use this when you want help interpreting a flamegraph or JFR file.
4. Just ask naturally β€” Junie loads the skill automatically when your question
matches the description. You don't need to invoke it by name.

Example prompts that will trigger this skill in Junie:
- *"My Spring Boot app is using too much CPU. Help me capture a flamegraph."*
- *"I have this JFR file β€” open it and tell me what's slow."*
- *"Install async-profiler on this machine and set up the JVM flags."*

In Code mode, Junie will run `scripts/install.sh`, execute `scripts/run_profile.sh`
with the right flags, and then walk you through the results β€” all without
leaving IntelliJ.

### With GitHub Copilot in IntelliJ

1. Enable agent mode: *Settings β†’ GitHub Copilot β†’ Chat β†’ Agent* β†’ turn on
**Agent mode** and **Agent Skills**
2. Open the Copilot Chat panel and make sure the mode selector shows **Agent**
3. Ask naturally β€” Copilot loads the skill when your prompt matches

Example prompts:
- *"Profile my running Java app and show me where the CPU is going."*
- *"Analyze this collapsed stack file and tell me what's allocating the most."*

GitHub Copilot's agent mode can also run the bundled scripts on your behalf β€”
it will propose the terminal command and ask for confirmation before executing.

### GitHub Copilot CLI

```bash
# Copilot CLI
mkdir -p ~/.copilot/skills
cd ~/.copilot/skills
unzip /path/to/async-profiler.skill

# Or, if your version uses ~/.agents/skills/:
mkdir -p ~/.agents/skills
cd ~/.agents/skills
unzip /path/to/async-profiler.skill
```
Comment thread
vetler marked this conversation as resolved.

Run `/skills list` to confirm it loaded. Then just ask naturally in the terminal.

---

## Bundled scripts

This skill includes four ready-to-run scripts in `scripts/`:

| Script | What it does |
|---|---|
| `scripts/install.sh` | Auto-detects platform, downloads the right binary, verifies install |
| `scripts/run_profile.sh` | Wraps `asprof` with defaults, timestamps output, prints opening instructions |
| `scripts/collect.sh` | Agent-friendly background collection: start all-event profiling, do other work, then stop and get all flamegraphs |
| `scripts/analyze_collapsed.py` | Ranked self-time / inclusive-time table for `.collapsed` files, with filters |

Always offer to run these scripts on the user's behalf when relevant.

## How to use this skill

This skill has three sub-guides. Read the one that matches what the user needs:

| Situation | Read |
|---|---|
| User needs to install or configure async-profiler, or is hitting setup errors | `setup/SKILL.md` |
| User wants to run a profiling session (capture flamegraph, JFR, etc.) | `profile/SKILL.md` |
| User has profiling output and wants to understand or interpret it | `analyze/SKILL.md` |

**When the conversation spans multiple phases** (e.g., the user just ran a
profile and now wants to understand the output), read whichever sub-guide is
most relevant to the current question. If the user needs both setup *and*
profiling guidance in one message, read `setup/SKILL.md` first and summarize
the setup steps before moving to `profile/SKILL.md`.

Read the relevant sub-guide now before responding.
Loading
Loading