mcpbeat Sign in

Profile Dart Code Agent Skill

|- Profile Dart command-line applications using the VM Service protocol to capture CPU samples and identify performance bottlenecks. Helps agents automate CPU profiling, generate function call breakdown summaries, and export JSON profiles without a browser or DevTools.

3k tokens
context cost
the whole folder, loaded on every use
4
files
ships runnable scripts
0
copies elsewhere
how many repositories repackaged it
139
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/kevmoo/dash_skills --skill profile-dart-code

The instruction itself

7 sections, as written by the author

Dart CPU Profiling

Guidelines and automated tools for capturing CPU profiles and identifying

bottlenecks in Dart command-line applications.

When to use this skill

  • When asked to profile, optimize, or benchmark CPU execution of a Dart script

or CLI tool.

  • When investigating hot loops, heavy function calls, or unexpected execution

overhead.

Workflow

  • Ensure clean compilation: Make sure the target Dart script runs cleanly

(dart run <script.dart>).

  • Run Profiler Script: Use the automated profiling helper script inside

this skill directory to launch the target app with VM Service observability

enabled, capture CPU samples, and output top-consuming functions.

  • Analyze & Optimize: Review the self and total sample percentages

reported by the tool to pinpoint bottlenecks (e.g., excessive object

allocation, costly hashing, virtual dispatch overhead).

Running the Profiler Helper Script

This repository includes a zero-dependency (using only official vm_service)

profiling script that launches any Dart file, connects to the VM Service, waits

for execution to complete (--pause-isolates-on-exit), retrieves CPU samples,

and prints a clean summary while exporting the full JSON profile.

Run it from any working directory:

dart run <dash_skills_repo>/skills/profile-dart-code/scripts/bin/profile.dart --out=cpu_profile.json -- <path_to_target.dart> [target_arguments...]

Script Arguments

  • -o, --out=<file>: Output file path to save the raw JSON CPU profile

(default: cpu_profile.json).

  • -p, --period=<micros>: Sampling interval in microseconds (default: 1000µs

= 1ms). Minimum 50µs.

  • -- <target.dart> [args...]: The Dart script to profile, followed by any

arguments passed to main().

> [!WARNING]

> Potential Hangs: When profiling or debugging Dart targets using VM services,

> target exceptions or connection issues can cause the process to hang

> indefinitely. Ensure your target script handles timeouts, and monitor the

> process output.

Example Output

Connecting to VM service at ws://127.0.0.1:8181/ws...
Target execution paused at exit. Retrieving CPU profile samples...

=== Top CPU Functions (Self Samples) ===
 1. _PuzzleSmart._shiftSlice (self: 34.2%, total: 41.0%)
 2. _countInversions (self: 18.5%, total: 18.5%)
 3. shortestPaths (self: 12.1%, total: 98.4%)

Saved complete JSON profile to: cpu_profile.json

Best Practices for Interpreting Profiles

  • Focus on Self % vs. Total %: High self % indicates where CPU time is

spent directly inside a function's own body (math, loop branching, array

indexing). High total % with low self % indicates a dispatcher or outer

orchestration loop.

  • Look for Hidden Overhead: Watch out for implicit object allocations

(_copyData, iterator wrappers, closure creation) inside tight loops.

  • Verify Optimizations Empirically: Always record baseline sample counts

and execution duration (time -v) before and after applying optimizations.

Other skills for the same job

different authors, same section of the catalogue
MCP Builder
by anthropics
vendor ×13

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

30k tokens scripts
Changelog Generator
by frostant
×9

Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.

774 tokens
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
MCP Builder
by JayZeeDesign
×7

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

37k tokens scripts
Vercel React Native Skills
by vercel-labs
vendor ×6

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

39k tokens
Vercel React Best Practices
by ratacat
×5

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

34k tokens
Next Best Practices
by vercel-labs
vendor ×4

Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling

20k tokens
Using Git Worktrees
by ZhanlinCui
×4

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification

1k tokens

How to use it

Copy the folder

Take kevmoo/profile-dart-code from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.