# metrickit

A skill that steers MetricKit work on iOS and iPadOS: production metrics, diagnostic reports, and how to keep them from slipping away.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3100 installs · ★ 1237
- Author: dpearson2699
- License: LicenseRef-Unknown · policy=link-only · description only; the file stays with the author
- Source: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/metrickit/SKILL.md
- Updated: 2026-07-31
- HTML: https://affpapa.org/en/nevibecode/skills/metrickit

## What it does

The skill lays out a collection pipeline for MetricKit telemetry. You keep one `MetricManager` alive for the app's lifetime and run a single consumer task for metric reports, another for diagnostics. Handing the same sequence to a second listener gets you an arbitrary slice of reports, so branch out only once a report is safely on disk.

Reports are split by kind on the way in: crashes, hangs, CPU exceptions, disk writes, launches and memory exceptions, the last one new in iOS 27. An `@unknown default` arm keeps a future category from breaking ingestion. Custom signpost metrics, launch timing and reliable upload each get their own section, and `references/metrickit-patterns.md` holds the longer patterns for ingestion and for the compatibility path.

Expect a beta warning. The iOS 27 surface is written against Apple's beta documentation and nobody compiled it with Xcode 27 yet. Build against the shipping Xcode 27 SDK before you ship. Keep `MXMetricManager` confined to an explicit iOS 26 branch.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill metrickit -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/metrickit/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/metrickit/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill metrickit -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/metrickit/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill metrickit -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/metrickit/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install dpearson2699/swift-ios-skills metrickit
```

2. **Manually: put the files in place**
- File: `.github/skills/metrickit/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill metrickit -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/metrickit
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/metrickit/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill metrickit -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/metrickit/SKILL.md

## When to use it
- catch hangs and crashes from production devices
- persist each report before parsing it
- add custom signpost intervals to the daily report
- measure app launch outside Instruments
- keep iOS 27 and iOS 26 ingestion paths apart

## Example prompts
- Wire up MetricKit ingestion in `MetricsService` with a single long-lived `MetricManager`.
- Walk through the `HangDiagnostic` from the latest report and show the call stack.
- Add an iOS 26 compatibility branch that still goes through `MXMetricManager`.

## Similar
- [vercel-react-native-skills](https://affpapa.org/en/nevibecode/skills/vercel-react-native-skills.md) — skill · 255200 installs
- [animate-expo](https://affpapa.org/en/nevibecode/skills/animate-expo.md) — skill · 137900 installs
- [mobile-native](https://affpapa.org/en/nevibecode/skills/mobile-native.md) — skill · 86600 installs
- [aso](https://affpapa.org/en/nevibecode/skills/aso.md) — skill · 75400 installs
- [swiftui-pro](https://affpapa.org/en/nevibecode/skills/swiftui-pro.md) — skill · 35200 installs
- [orca-emulator](https://affpapa.org/en/nevibecode/skills/orca-emulator.md) — skill · 5800 installs

From the same set: [dpearson2699/swift-ios-skills](https://affpapa.org/en/nevibecode/by/dpearson2699/swift-ios-skills.md) — 86 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
