Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add TalissonVitorino/kmp-ios-skills --skill perfetto-sqlgit clone --depth 1 https://github.com/TalissonVitorino/kmp-ios-skillsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/talissonvitorino/kmp-ios-skills/perfetto-sql)<a href="https://agentmods.dev/skills/talissonvitorino/kmp-ios-skills/perfetto-sql"><img src="https://agentmods.dev/badge/skills/talissonvitorino/kmp-ios-skills/perfetto-sql/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/talissonvitorino/kmp-ios-skills/perfetto-sql"><img src="https://agentmods.dev/badge/skills/talissonvitorino/kmp-ios-skills/perfetto-sql.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00075 | $0.02596 |
| Opus 5 | $0.00037 | $0.01298 |
| Sonnet 5 | $0.00015 | $0.00519 |
| Haiku 4.5 | $0.00007 | $0.00260 |
Grade A, and why
perfetto-sql scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
Perform a direct file check at the top level of your workspace (e.g., `ls trace_processor`). If missing, download `https://get.perfetto.dev/trace_processor` directly into the root workspace (`curl -LO`), make it executab Copies of this mod
1 near-identical copy found in the catalogue:
- perfetto-sql — 95% identical, 2 lines differ
How it starts
The opening of the file, as written. The whole thing — 145 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Guidelines and Hints
-
Idempotency: Ensure queries are idempotent to prevent "already exists" errors during multiple executions.
- For Perfetto objects, always use
CREATE OR REPLACE:CREATE OR REPLACE PERFETTO TABLE,CREATE OR REPLACE PERFETTO VIEW,CREATE OR REPLACE PERFETTO FUNCTION,CREATE OR REPLACE PERFETTO MACRO. - For SQLite Virtual Tables (such as
SPAN_JOIN),CREATE OR REPLACEis not supported. Explicitly drop them first:DROP TABLE IF EXISTS my_table; CREATE VIRTUAL TABLE my_table USING SPAN_JOIN(...); - For standard SQLite indexes, prepend
DROP INDEX IF EXISTS index_name;.
- For Perfetto objects, always use
-
SPAN_JOINwill crash if intervals within the same input table overlap. Always use thePARTITIONED {column}(for example,PARTITIONED upid) clause to isolate intervals. -
Intermediate tables fed into a
SPAN_JOINmust be materialized usingCREATE PERFETTO TABLE, notCREATE VIEW. -
Trace Boundaries (
dur = -1): Slices or thread states that don't finish before the trace ends are recorded withdur = -1. When calculating a bounding box (for example,ts + dur) or summing durations (SUM(dur)), handle incomplete durations using:IIF(dur = -1, trace_end() - ts, dur). -
Robust State Transitions: Avoid manual timestamp arithmetic (for example,
ts + dur = next.ts) to join adjacent events. Rely on standard library modules (for example,sched.runnable,linux.perf.counters,intervals.overlap) which safely handle trace gaps and preemptions. -
Unique Identifiers: When writing SQL queries in Perfetto, you must join tables using
utid(unique thread ID) orupid(unique process ID) instead of the regulartidorpid. Why it's useful : The operating system recyclesTIDsandPIDs, whileUTIDsandUPIDsremain unique for the lifetime of the trace, which prevents incorrect joins. -
Safe Argument Extraction: Use
EXTRACT_ARG(arg_set_id, 'key')to extract dictionary or JSON-like properties from slices or tracks. Don't attempt string parsing. -
String Matching (Always use GLOB): Use
GLOBinstead ofLIKE.LIKEcauses performance bottlenecks and treats underscores (_) as wildcards, leading to bugs.- Exact matches: Use
=. - Substring matches: Use
GLOBwith*(for example,name GLOB '*RenderThread*'). - Case-insensitive matches: Use
LOWER(name) GLOBand make sure the search string is fully lowercase (for example,LOWER(name) GLOB '*renderthread*'). Use this when dealing with inconsistent trace capitalization (for example,WakeLockversuswakelock).
- Exact matches: Use
-
Calculating Time Overlaps: To calculate the overlap duration between two time intervals
[start1, end1]and[start2, end2]:Precedence Rule: Always prefer using
SPAN_JOINor standard library functions (for example,intervals.overlap) to calculate overlaps between two different sets of intervals . Avoid manual arithmetic if a standard library feature orSPAN_JOINcan achieve the same result. Use the following logic if no built-in alternative exists.-
Condition: The intervals overlap if
start1 < end2andstart2 < end1. -
Duration: The overlap duration is calculated as
MIN(end1, end2) - MAX(start1, start2)Important: Incomplete Perfetto slices have a duration of -1 (
dur = -1). Always calculate the effective end time usingts + IIF(dur = -1, trace_end() - ts, dur)before applying this logic.
-
-
Query
android_thread_slices_for_all_startupsfor app startup requests. -
Join
counter_trackwithcounterto get values of counter with a specific name. -
When querying for a CPU frequency counter, include the
linux.cpu.frequencymodule and use thecpu_frequency_counterstable. -
When looking for events around a specific timestamp, start with 100ms as the window size.
-
Always prefix column names with table or view alias, that is:
{alias}.{column_name}. -
To calculate the total time spent in slices matching a specific name pattern (for example,
*{name_pattern}*), you must sum their durations. Why it's useful : This helps quantify the total impact of a specific function or feature on performance across multiple calls. Here is an example query (note the safe handling of incomplete slices):sql SELECT count(*) as total_count, sum(IIF(slice.dur = -1, trace_end() - slice.ts, slice.dur)) / 1000000.0 as total_dur_ms FROM slice WHERE slice.name GLOB '*{name_pattern}*';
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 12d ago First seen · 145 lines · 75 tokens per session scan A 34e8a19e9815
perfetto-sql is a skill published in the GitHub repository TalissonVitorino/kmp-ios-skills (12 stars, last pushed 18d ago), licensed MIT. It adds 75 tokens to every session and 2,596 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
compose-multiplatform
Use when building one shared Compose UI in Kotlin across Android, iOS, and desktop — commonMain @Composables, expect/actual, source-set placement, native interop, multiplatform ViewModel/navigation/Koin. NOT a single-platform native build (that is kotlin-android / swift-ios), and NOT Dart/Flutter cross-platform UI…
cmp-new
Scaffold a new MOBILE app — Android + iOS from one Kotlin/Compose Multiplatform codebase — from a bare "create a mobile app" to a green, verified build. Guardrails first: if the user already chose a different framework (React Native, Expo, Flutter, SwiftUI, native), do NOT redirect them here; if they only asked a…
npm-publish
Publish the create-cmp CLI to npm as the create-cmp-cli package. Use this when the user asks to "publish create-cmp to npm", "release a new version", "ship create-cmp-cli", "npm publish this", "cut a release", or wants npx create-cmp-cli to work. Runs unattended when a granular npm token is installed in the user's…
cmp-firebase-connect
Wire a freshly scaffolded CMP/KMP app to its OWN real Firebase project — the #1 post-scaffold manual step. Use this when the user wants to connect their app to Firebase, or asks "connect my app to firebase", "set up google-services.json", "wire firebase", "create a firebase project for this app", "replace the…
add-feature
Add a new conforming vertical-slice feature (Screen + ViewModel + UseCase + Repository + spec + tests + golden tree + nav route + DI wiring) to this Compose Multiplatform app, cloned deterministically from the project's configured exemplar feature (qa/approvals.json's exemplarFeature — home by default). Use this when…
cmp-audit
Adversarial audit of one subsystem of a Kotlin/Compose Multiplatform app against its spec AND against platform semantics — the class of defect desktop-tier tests cannot see (alarms, notifications, PendingIntents, reboot, process death, DST). Use this when the user says "audit the notifications", "double check X for…