Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
5aeaf86
Add async-profiler skill
vetler Apr 15, 2026
689b52e
Merge branch 'staged' into add-async-profiler-skill-staged
vetler Apr 16, 2026
427364c
Merge branch 'staged' into add-async-profiler-skill-staged
vetler Apr 20, 2026
5804c27
fix(async-profiler): align skill layout with spec
vetler May 2, 2026
af7ff5b
Merge staged into async-profiler branch
vetler May 2, 2026
461b660
fix(async-profiler): address review feedback
vetler May 2, 2026
4ef1ab3
fix(readme): make generated ordering deterministic
vetler May 2, 2026
4e80619
revert(readme): keep generator unchanged
vetler May 2, 2026
54b346f
docs(readme): align generated instructions order
vetler May 2, 2026
d819191
fix(async-profiler): address remaining review notes
vetler May 2, 2026
b36aef4
fix(async-profiler): harden collect session state
vetler May 2, 2026
888feb2
fix(async-profiler): address latest review feedback
vetler May 2, 2026
586556c
fix(async-profiler): align scripts with docs
vetler May 2, 2026
f680062
fix(async-profiler): address latest copilot feedback
vetler May 2, 2026
28f62da
fix(async-profiler): address latest review feedback
vetler May 2, 2026
1056f37
fix(async-profiler): improve install detection
vetler May 2, 2026
c3a8836
docs(async-profiler): refine profiling guidance
vetler May 2, 2026
3b0d2ee
fix(async-profiler): tighten collapsed guidance
vetler May 2, 2026
fe61bec
fix(async-profiler): quote suggested file paths
vetler May 2, 2026
910f761
fix(async-profiler): tolerate missing installed asprof
vetler May 2, 2026
89d453c
fix(async-profiler): remove unused base_dir
vetler May 2, 2026
ffa6021
fix(async-profiler): reject incompatible all-event formats
vetler May 2, 2026
38a5bec
Potential fix for pull request finding
vetler May 2, 2026
cd1c4d2
fix(async-profiler): tighten troubleshooting and cleanup
vetler May 2, 2026
8fe901b
fix(async-profiler): tighten path and stderr handling
vetler May 2, 2026
d790d48
fix(async-profiler): handle invalid inputs more safely
vetler May 2, 2026
2526245
fix(async-profiler): align wrapper CLI with asprof
vetler May 2, 2026
237df2a
docs(async-profiler): fix attach troubleshooting example
vetler May 2, 2026
bb2e8ca
fix(async-profiler): validate wrapper inputs earlier
vetler May 2, 2026
f761acc
fix(async-profiler): harden collect session state
vetler May 2, 2026
8425417
fix(async-profiler): tighten stop fallback and command echo
vetler May 3, 2026
682a3d8
fix(async-profiler): validate collect subcommands earlier
vetler May 3, 2026
4616081
fix(async-profiler): improve post-run guidance
vetler May 3, 2026
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 @@ -53,6 +53,7 @@ See [CONTRIBUTING.md](../CONTRIBUTING.md#adding-skills) for guidelines on how to
| [arize-trace](../skills/arize-trace/SKILL.md)<br />`gh skills install github/awesome-copilot arize-trace` | 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)<br />`gh skills install github/awesome-copilot aspire` | 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)<br />`gh skills install github/awesome-copilot aspnet-minimal-api-openapi` | Create ASP.NET Minimal API endpoints with proper OpenAPI documentation | None |
| [async-profiler](../skills/async-profiler/SKILL.md)<br />`gh skills install github/awesome-copilot async-profiler` | 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 />`references/analyze.md`<br />`references/profile.md`<br />`references/setup.md`<br />`scripts/_asprof_lib.sh`<br />`scripts/analyze_collapsed.py`<br />`scripts/collect.sh`<br />`scripts/install.sh`<br />`scripts/run_profile.sh` |
| [audit-integrity](../skills/audit-integrity/SKILL.md)<br />`gh skills install github/awesome-copilot audit-integrity` | Shared audit integrity framework for all AppSec agents β€” enforces output quality, intellectual honesty, and continuous improvement through anti-rationalization guards, self-critique loops, retry protocols, non-negotiable behaviors, self-reflection quality gates (1-10 scoring, β‰₯8 threshold), and a self-learning system with lesson/memory governance for security analysis agents. | `references/anti-rationalization-guard.md`<br />`references/clarification-protocol.md`<br />`references/non-negotiable-behaviors.md`<br />`references/retry-protocol.md`<br />`references/self-critique-loop.md`<br />`references/self-learning-system.md`<br />`references/self-reflection-quality-gate.md` |
| [automate-this](../skills/automate-this/SKILL.md)<br />`gh skills install github/awesome-copilot automate-this` | 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)<br />`gh skills install github/awesome-copilot autoresearch` | 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 |
Expand Down
71 changes: 71 additions & 0 deletions skills/async-profiler/README.md
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We don't need this file in the repo - README's aren't part of the spec for agent skills, so we surface them nowhere and thus shouldn't be included.

Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# 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.
Comment thread
vetler marked this conversation as resolved.
Comment thread
vetler marked this conversation as resolved.
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 |
Comment thread
vetler marked this conversation as resolved.
| `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 focused reference guides
β”œβ”€β”€ README.md # Human-readable overview and installation help
β”œβ”€β”€ references/
β”‚ β”œβ”€β”€ setup.md # Installation and configuration
β”‚ β”œβ”€β”€ profile.md # Running profiling sessions
β”‚ └── analyze.md # Interpreting profiling output
└── scripts/ # Bundled scripts
Comment thread
vetler marked this conversation as resolved.
```
Comment thread
vetler marked this conversation as resolved.
140 changes: 140 additions & 0 deletions skills/async-profiler/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
---
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.
Comment thread
vetler marked this conversation as resolved.
Comment thread
vetler marked this conversation as resolved.
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.

`scripts/_asprof_lib.sh` is an internal shared helper sourced by the profiling wrappers so async-profiler discovery and versioned-install lookup stay consistent across `run_profile.sh` and `collect.sh`.

## How to use this skill

This skill keeps detailed guidance in `references/` so the root `SKILL.md`
stays focused and loads quickly. Read only the guide that matches the user's
current need:

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

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

Read the relevant reference now before responding.
Loading
Loading