Profile Dart Code logo

Profile Dart Code

Community
kevmoo
profile-dart-code

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.

Overview

Publisherkevmoo
Repositorydash_skills
Skill nameprofile-dart-code
Stars
148
Forks
16
Bundled files
4
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 4 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by kevmoo on GitHub. Read the source before you install it.

Installation

Install the Profile Dart Code AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/kevmoo/dash_skills/tree/main/skills/profile-dart-code
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/kevmoo/dash_skills.git /tmp/dash_skills
mkdir -p .claude/skills
cp -r /tmp/dash_skills/skills/profile-dart-code .claude/skills/profile-dart-code
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Profile Dart Code in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Profile Dart Code on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Profile Dart Code is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

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.

When NOT to use (Abstention Guardrails)

Do NOT profile using this skill when:

  • Pure I/O-Bound Bottlenecks: The performance bottleneck is network latency, database queries, or disk I/O wait rather than CPU execution.
  • Flutter UI Applications: The target is a Flutter application requiring frame profiling, raster thread inspection, or widget rebuild tracking (use Flutter DevTools or widget_inspector).
  • Short-Lived Micro-Benchmarks: Micro-benchmarks running for only a few milliseconds where VM warmup and sampling overhead skew results (use package:benchmark_harness or package:bench_press instead).
  • Target Does Not Run Cleanly: If the target script fails to compile or crashes on startup, fix functional bugs before attempting CPU profiling.

Workflow

  1. Ensure clean compilation: Make sure the target Dart script runs cleanly (dart run <script.dart>).
  2. 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.
  3. 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:

bash
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

  1. 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.
  2. Look for Hidden Overhead: Watch out for implicit object allocations (_copyData, iterator wrappers, closure creation) inside tight loops.
  3. Verify Optimizations Empirically: Always record baseline sample counts and execution duration (time -v) before and after applying optimizations.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Profile Dart Code AI skill do?

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.

Why use Profile Dart Code on TypingMind?

Because you install it once and use it with any model. Profile Dart Code is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Profile Dart Code in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/kevmoo/dash_skills/tree/main/skills/profile-dart-code. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Profile Dart Code?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Profile Dart Code?

As many as you like. As long as a model supports skills, you can use Profile Dart Code with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Profile Dart Code AI skill free?

Yes. It is published on GitHub by kevmoo under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇