Agent skill

Analyze Performance

by r3bl-org in r3bl-org/r3bl-open-core

Establish performance baselines and detect regressions using flamegraph analysis.

Apache-2.0Auto-check passedDevelopment

Install Analyze Performance

skills CLI
$ npx skills add r3bl-org/r3bl-open-core --skill analyze-performance -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install r3bl-org/r3bl-open-core analyze-performance --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/r3bl-org/r3bl-open-core.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/analyze-performance .claude/skills/analyze-performance && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
analyze-performance
GitHub stars
485
Token cost
~2k tokens
SKILL.md length
700 words
Files
2
Skills in repo
25
Repo updated
First seen
Licence
Apache-2.0

At a glance

Establish performance baselines and detect regressions using flamegraph analysis.

  • Works in 9 steps: Generate Current Flamegraph → Compare with Baseline → Analyze Differences → …
  • Optimizing performance-critical code
  • SKILL.md covers When to Use, Instructions, Optional: Update Baseline and Understanding Flamegraph Format, plus 9 more sections
  • Calls git and cargo

What it does

Analyze Performance is an agent skill from r3bl-org/r3bl-open-core. Establish performance baselines and detect regressions using flamegraph analysis. Use when optimizing performance-critical code, investigating performance issues, or before creating commits with performance-sensitive changes.

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 1 other file (for example `baseline-management.md`).

It sits in Development. The repository describes itself as: TUI framework and developer productivity apps in Rust 🦀. The licence is Apache-2.0.

When your agent uses it

  • Optimizing performance-critical code
  • Investigating performance issues
  • Before creating commits with performance-sensitive changes

Example prompts

  • “/analyze-performance”

Workflow steps

9 steps, taken from the step headings in SKILL.md.

  1. Generate Current Flamegraph
  2. Compare with Baseline
  3. Analyze Differences
  4. Prepare Regression Report
  5. Present to User
  6. Allocations in Hot Paths
  7. Excessive Cloning
  8. Deep Call Stacks
  9. I/O in Critical Paths

What it can do on your machine

Read from SKILL.md and the folder at commit 89db352. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • cargo

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Analyze Performance loads about 2k tokens when it runs. Until then it costs about 61 tokens; SKILL.md has 700 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~61
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from r3bl-org/r3bl-open-core at commit 89db352, republished under its Apache-2.0 licence (© r3bl-org). 700 words, ~2,039 tokens.

Download SKILL.mdSave it as .claude/skills/analyze-performance/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
analyze-performance
description
Establish performance baselines and detect regressions using flamegraph analysis. Use when optimizing performance-critical code, investigating performance issues, or before creating commits with performance-sensitive changes.

Performance Regression Analysis with Flamegraphs

When to Use

  • Optimizing performance-critical code
  • Detecting performance regressions after changes
  • Establishing performance baselines for reference
  • Investigating performance issues or slow code paths
  • Before creating commits with performance-sensitive changes
  • When user says "check performance", "analyze flamegraph", "detect regressions", etc.

Instructions

Follow these steps to analyze performance and detect regressions:

Step 1: Generate Current Flamegraph

Run the automated benchmark script to collect current performance data:

bash
./run.fish run-examples-flamegraph-fold --benchmark

What this does:

  • Runs an 8-second continuous workload stress test
  • Samples at 999Hz for high precision
  • Tests the rendering pipeline with realistic load
  • Generates flamegraph data in: tui/flamegraph-benchmark.perf-folded

Implementation details:

  • The benchmark script is in script-lib.fish
  • Uses an automated testing script that stress tests the rendering pipeline
  • Simulates real-world usage patterns
Step 2: Compare with Baseline

Compare the newly generated flamegraph with the baseline:

Baseline file:

tui/flamegraph-benchmark-baseline.perf-folded

Current file:

tui/flamegraph-benchmark.perf-folded

The baseline file contains:

  • Performance snapshot of the "current best" performance state
  • Typically saved when performance is optimal
  • Committed to git for historical reference
Step 3: Analyze Differences

Compare the two flamegraph files to identify regressions or improvements:

Key metrics to analyze:

  1. Hot path changes

    • Which functions appear more/less frequently?
    • New hot paths that weren't in baseline?
  2. Sample count changes

    • Increased samples = function taking more time
    • Decreased samples = optimization working!
  3. Call stack depth changes

    • Deeper stacks might indicate unnecessary abstraction
    • Shallower stacks might indicate inlining working
  4. New allocations or I/O

    • Look for memory allocation hot paths
    • Unexpected I/O operations
Step 4: Prepare Regression Report

Create a comprehensive report analyzing the performance changes:

Report structure:

markdown
# Performance Regression Analysis

## Summary
[Overall performance verdict: regression, improvement, or neutral]

## Hot Path Changes
- Function X: 1500 → 2200 samples (+47%) ⚠️ REGRESSION
- Function Y: 800 → 600 samples (-25%) ✅ IMPROVEMENT
- Function Z: NEW in current (300 samples) 🔍 INVESTIGATE

## Top 5 Most Expensive Functions

### Baseline
1. render_loop: 3500 samples
2. paint_buffer: 2100 samples
3. diff_algorithm: 1800 samples
...

### Current
1. render_loop: 3600 samples (+3%)
2. paint_buffer: 2500 samples (+19%) ⚠️
3. diff_algorithm: 1700 samples (-6%) ✅
...

## Regressions Detected
[List of functions with significant increases]

## Improvements Detected
[List of functions with significant decreases]

## Recommendations
[What should be investigated or optimized]
Step 5: Present to User

Present the regression report to the user with:

  • ✅ Clear summary (regression, improvement, or neutral)
  • 📊 Key metrics with percentage changes
  • ⚠️ Highlighted regressions that need attention
  • 🎯 Specific recommendations for optimization
  • 📈 Overall performance trend

Optional: Update Baseline

When to update the baseline:

Only update when you've achieved a new "best" performance state:

  1. After successful optimization work
  2. All tests pass
  3. Behavior is correct
  4. Ready to lock in this performance as the new reference

How to update:

bash
# Replace baseline with current
cp tui/flamegraph-benchmark.perf-folded tui/flamegraph-benchmark-baseline.perf-folded

# Commit the new baseline
git add tui/flamegraph-benchmark-baseline.perf-folded
git commit -m "perf: Update performance baseline after optimization"

See baseline-management.md for detailed guidance on when and how to update baselines.

Understanding Flamegraph Format

The .perf-folded files contain stack traces with sample counts:

main;render_loop;paint_buffer;draw_cell 45
main;render_loop;diff_algorithm;compare 30

Format:

  • Semicolon-separated call stack (deepest function last)
  • Space + sample count at end
  • More samples = more time spent in that stack

Performance Optimization Workflow

1. Make code change
   ↓
2. Run: ./run.fish run-examples-flamegraph-fold --benchmark
   ↓
3. Analyze flamegraph vs baseline
   ↓
4. ┌─ Performance improved?
  │  ├─ YES → Update baseline, commit
  │  └─ NO  → Investigate regressions, optimize
  └→ Repeat

Additional Performance Tools

For more granular performance analysis, consider:

cargo bench

Run benchmarks for specific functions:

bash
cargo bench

When to use:

  • Micro-benchmarks for specific functions
  • Tests marked with #[bench]
  • Precise timing measurements
Show full SKILL.md (287 more words)Show less
cargo flamegraph

Generate visual flamegraph SVG:

bash
cargo flamegraph

When to use:

  • Visual analysis of call stacks
  • Identifying hot paths visually
  • Sharing performance analysis

Requirements:

  • flamegraph crate installed
  • Profiling symbols enabled
Manual Profiling

For deep investigation:

bash
# Profile with perf
perf record -F 999 --call-graph dwarf ./target/release/app

# Generate flamegraph
perf script | stackcollapse-perf.pl | flamegraph.pl > flame.svg

Common Performance Issues to Look For

When analyzing flamegraphs, watch for:

1. Allocations in Hot Paths
render_loop;Vec::push;alloc::grow 500 samples  ⚠️

Problem: Allocating in tight loops Fix: Pre-allocate or use capacity hints

2. Excessive Cloning
process_data;String::clone 300 samples  ⚠️

Problem: Unnecessary data copies Fix: Use references or Cow<str>

3. Deep Call Stacks
a;b;c;d;e;f;g;h;i;j;k;l;m 50 samples  ⚠️

Problem: Too much abstraction or recursion Fix: Flatten, inline, or optimize

4. I/O in Critical Paths
render_loop;write;syscall 200 samples  ⚠️

Problem: Blocking I/O in rendering Fix: Buffer or defer I/O

Reporting Results

After performance analysis:

  • ✅ No regressions → "Performance analysis complete: no regressions detected!"
  • ⚠️ Regressions found → Provide detailed report with function names and percentages
  • 🎯 Improvements found → Celebrate and document what worked!
  • 📊 Mixed results → Explain trade-offs and recommendations

Supporting Files in This Skill

This skill includes additional reference material:

  • baseline-management.md - Comprehensive guide on when and how to update performance baselines: when to update (after optimization, architectural changes, dependency updates, accepting trade-offs), when NOT to update (regressions, still debugging, experimental code, flaky results), step-by-step update process, baseline update checklist, reading flamegraph differences, example workflows, and common mistakes. Read this when:
    • Deciding whether to update the baseline → "When to Update" section
    • Performance improved and want to lock it in → Update workflow
    • Unsure if baseline update is appropriate → Checklist
    • Need to understand flamegraph diff signals → "Reading Flamegraph Differences"
    • Avoiding common mistakes → "Common Mistakes" section
  • check-code-quality - Run before performance analysis to ensure correctness
  • write-documentation - Document performance characteristics
  • /check-regression - Explicitly invokes this skill
  • perf-checker - Agent that delegates to this skill

Additional Resources

  • Flamegraph format: tui/*.perf-folded files
  • Benchmark script: script-lib.fish
  • Visual flamegraphs: Use flamegraph.pl to generate SVGs

© r3bl-org, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file in .agents/skills/analyze-performance of r3bl-org/r3bl-open-core.

  • SKILL.md
  • baseline-management.md

Open the folder on GitHubat commit 89db352

Compare with similar skills

Analyze Performance next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Analyze Performance compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Analyze Performance this skillr3bl-org/r3bl-open-core485—~2kAutomated safety check: PassApache-2.0
Vercel Composition Patternssupabase/supabase111k58 repos~726Automated safety check: PassMIT
Finishing a Development Branchobra/superpowers297k5 repos~1.9kAutomated safety check: PassMIT
Typescript Advanced Typesrolling-scopes/rsschool-app10k25 repos~4.2kAutomated safety check: PassMPL-2.0
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Code Review ChecklistshareAI-lab/learn-claude-code78k5 repos~1.1kAutomated safety check: PassMIT

Similar skills

  • Official

    React composition patterns that scale. An agent skill from supabase/supabase.

    111k GitHub starsUsed in 58 repos~726 tokens
    DevelopmentAuto-check passed
  • Walks the last step of a branch: confirm tests pass, detect the git environment, ask how to integrate, carry out your choice and clean up the worktree.

    297k GitHub starsUsed in 5 repos~1.9k tokens
    DevelopmentAuto-check passed
  • Typescript Advanced Types

    rolling-scopes/rsschool-app

    Master TypeScript's advanced type system including generics, conditional types, mapped types, template literals, and utility types for building type-safe applications.

    10k GitHub starsUsed in 25 repos~4.2k tokens
    DevelopmentAuto-check passed
  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Code Review Checklist

    shareAI-lab/learn-claude-code

    Reviews code against a five-part checklist covering security, correctness, performance, maintainability and testing, and reports findings in a fixed format.

    78k GitHub starsUsed in 5 repos~1.1k tokens
    DevelopmentAuto-check passed
  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed

More from r3bl-org/r3bl-open-core

All 25 skills in this repo
  • Analyze Log Files

    r3bl-org/r3bl-open-core

    Analyze log files by stripping ANSI escape sequences first. An agent skill from r3bl-org/r3bl-open-core.

    485 GitHub stars~632 tokensUpdated today
    Auto-check: notes
  • Check Bounds Safety

    r3bl-org/r3bl-open-core

    Apply type-safe bounds checking patterns using VPIndex/VPLength types instead of usize.

    485 GitHub stars~4.1k tokensUpdated today
    Auto-check passed
  • Release Crate

    r3bl-org/r3bl-open-core

    Publish a crate release to crates.io with changelog, standalone release notes, git tag, and GitHub release.

    485 GitHub stars~2.4k tokensUpdated today
    Auto-check passed
  • Organize Modules

    r3bl-org/r3bl-open-core

    Apply private modules with public re-exports (barrel export) pattern for clean API design.

    485 GitHub stars~5.8k tokensUpdated today
    Auto-check passed
  • Check Code Quality

    r3bl-org/r3bl-open-core

    Run comprehensive Rust code quality checks including compilation, linting, documentation, and tests.

    485 GitHub stars~3.8k tokensUpdated today
    Auto-check passed
  • Check Test Coverage

    r3bl-org/r3bl-open-core

    Audit and verify test coverage for a specific file or module, ensuring all custom logic branches, state transitions, and boundary conditions are covered while strictly eliminating dependency test…

    485 GitHub stars~1.7k tokensUpdated today
    Auto-check passed

Categories

Questions about Analyze Performance

What does Analyze Performance do?

Establish performance baselines and detect regressions using flamegraph analysis. Analyze Performance is an agent skill from r3bl-org/r3bl-open-core. Establish performance baselines and detect regressions using flamegraph analysis.

When should I use Analyze Performance?

Analyze Performance fits situations like: optimizing performance-critical code; investigating performance issues; before creating commits with performance-sensitive changes.

How do I install Analyze Performance in Claude Code?

Run `npx skills add r3bl-org/r3bl-open-core --skill analyze-performance -a claude-code`. Or copy the skill folder (.agents/skills/analyze-performance in r3bl-org/r3bl-open-core) into .claude/skills/analyze-performance in your project. Claude Code loads it when a task matches its description.

How do I install Analyze Performance in Codex?

Run `npx skills add r3bl-org/r3bl-open-core --skill analyze-performance -a codex`. Or copy the skill folder (.agents/skills/analyze-performance in r3bl-org/r3bl-open-core) into .agents/skills/analyze-performance in your project. Codex loads it when a task matches its description.

Can I use Analyze Performance in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add r3bl-org/r3bl-open-core --skill analyze-performance -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/analyze-performance, .gemini/skills/analyze-performance, .github/skills/analyze-performance and .opencode/skills/analyze-performance in your project.

What does Analyze Performance need to run?

Going by SKILL.md and its folder, Analyze Performance needs the command-line tools its instructions call (git and cargo).

Does Analyze Performance access the network?

SKILL.md contains no URLs. Its commands use git, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Analyze Performance safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Analyze Performance use?

Analyze Performance is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Analyze Performance use?

About 2k tokens (SKILL.md is roughly 8.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Analyze Performance?

Skills that share tags, products or a category with Analyze Performance: Vercel Composition Patterns (supabase/supabase, 111k stars), Finishing a Development Branch (obra/superpowers, 297k stars), Typescript Advanced Types (rolling-scopes/rsschool-app, 10k stars) and PR Babysitter (openinterpreter/openinterpreter, 69k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Analyze Performance?

r3bl-org (a GitHub organization) maintains it in r3bl-org/r3bl-open-core, which has 485 GitHub stars. The repository holds 25 skills in this directory. The repository was last updated on October 8, 2026.

Source: r3bl-org/r3bl-open-core on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.