Skip to content
bitdrift Instrumentation

bitdrift InstrumentationSkill

Released
PolyForm-Shield-1.0.0
Repository Docs

Summary

Adds the bitdrift Capture SDK to an iOS, Android or React Native app and wires up logging, network monitoring, screen views and TTI correctly.

Features

  • Detects Android, iOS or React Native from files in the repo
  • Installs the Capture SDK or extends an existing integration
  • Independent instrumentation categories: logs, network, screen views, TTI, fields, spans
  • Nine-point validation report with concrete code fixes
  • Fetches live API details via the bd-docs skill

Install This Skill

Add this skill to your favorite AI agent in a few steps.

Any AI agent

This skill is plain instructions — it works with any assistant that accepts custom instructions or system prompts.

  1. Copy the skill content with the button below.
  2. Paste it into your agent's instruction file or system prompt (for example AGENTS.md, .cursorrules, or a custom instructions field).
  3. Ask the agent to apply the skill whenever the task matches.

Skill Content

Markdown Content

Copy this content and use it with your preferred AI agent

# bitdrift Instrumentation

Guides integration of the bitdrift Capture SDK into mobile apps. The SDK logs everything locally on-device; the bitdrift control plane dynamically decides what to upload.

## How this skill uses docs

Use $bd-docs to fetch live API details from docs.bitdrift.io at each step. The platform reference files indicate what to look up — $bd-docs handles the mechanics of discovery and fetching.

## Workflow summary

Detect platform → Check if SDK is installed → Read platform reference → If new install: add dependency + `Logger.start()` → Add instrumentation categories the user needs.

## Step 1 — Detect platform

Identify the target platform from the user's project:

| Signal | Platform |
|--------|----------|
| `build.gradle`, `build.gradle.kts`, `.kt`, `.java`, `AndroidManifest.xml` | **Android** |
| `.xcodeproj`, `.xcworkspace`, `Package.swift`, `Podfile`, `.swift`, `.m`/`.h` | **iOS** |
| `package.json` with `react-native`, `metro.config.js`, `App.tsx`/`App.js` | **React Native** |

If the project contains files for multiple platforms (e.g., both Android and React Native in a monorepo), ask the user which target to instrument.

## Step 2 — Determine SDK status

Check whether the bitdrift Capture SDK is already installed by searching the project for:

| Platform | SDK already present if you find… |
|----------|----------------------------------|
| Android | `io.bitdrift:capture` in `build.gradle`/`build.gradle.kts`, or `import io.bitdrift.capture` in source |
| iOS | `capture-ios` in `Package.swift` or `BitdriftCapture` in `Podfile`, or `import Capture` in source |
| React Native | `@bitdrift/react-native` in `package.json`, or `import { init } from '@bitdrift/react-native'` in source |

## Step 3 — Read the platform reference and proceed

Read the platform reference file, then follow the appropriate path:

| Platform | Reference file |
|----------|---------------|
| Android (Kotlin/Java) | `references/android.md` in this skill directory |
| iOS (Swift/Objective-C) | `references/ios.md` in this skill directory |
| React Native | `references/react-native.md` in this skill directory |

Each reference file has two sections:

- **New installation** — Add the SDK dependency and call `Logger.start()`. Follow this when the SDK is not yet present. Once the SDK is running, proceed to the instrumentation categories below.
- **Instrumentation categories** — Standalone enhancements (log forwarding, network monitoring, screen views, TTI, fields, spans, etc.). Each is independent — jump directly to whichever one the user needs. These apply whether the user just finished a new install or already had the SDK set up.

## Validation checklist (all platforms)

When asked to validate an integration, check all items and produce a report with PASS/FAIL/WARNING per check, plus concrete code fixes for failures.

| # | Check |
|---|-------|
| 1 | SDK dependency present and up to date |
| 2 | Logger initialized early in app lifecycle |
| 3 | Session strategy configured |
| 4 | Network monitoring active |
| 5 | Screen tracking on every screen |
| 6 | TTI tracked |
| 7 | Crash reporter linked with session URL |
| 8 | Entity ID set after login via `setEntityID` / `setEntityId` (iOS/Android only; enables `bd entity` targeting) |
| 8a | User identity fields set after login via `addField` |
| 9 | dSYM/ProGuard mapping upload configured (if applicable) |

Usage Instructions

Learn how to use this skill with different AI agents.

Generic Instructions

Install the whole bitdrift skill pack into any agent:

npx skills add bitdriftlabs/bd-skills

Then ask your agent to instrument or audit a mobile project, for example: "Add bitdrift to this Android app and track screen views and TTI", or "Validate our existing bitdrift integration".

Description

Instrumenting a mobile app for observability is the kind of task that is easy to do halfway: the SDK gets added, Logger.start() gets called, and six months later nobody can explain why sessions have no screen names in them. This official bitdrift skill turns that into a checklist an agent can actually follow.

It starts by detecting the target platform from real signals in the repository — build.gradle and AndroidManifest.xml for Android, .xcodeproj and Package.swift for iOS, a react-native dependency and metro.config.js for React Native — and asks which target you mean when a monorepo contains more than one. It then checks whether the Capture SDK is already present before touching anything, and reads a platform-specific reference for the install path or for the individual instrumentation categories: log forwarding, network monitoring, screen views, time-to-interactive, custom fields and spans. Each category is independent, so it can be used to extend an existing integration rather than only to bootstrap a new one.

The most useful part is the validation mode. Ask it to check an existing integration and it produces a PASS/FAIL/WARNING report against nine specific checks — SDK version, early initialisation, session strategy, network monitoring, screen tracking, TTI, crash reporter linkage with a session URL, entity ID and identity fields set after login, and dSYM or ProGuard mapping upload — with concrete code fixes for each failure.

It is designed to pair with bitdrift's bd-docs skill so API details are fetched live from the documentation rather than recalled from training data. Note the licence: bd-skills is published under PolyForm Shield 1.0.0, which is source-available rather than open source.

Related Skills

Skill: Convex

by Convex

New

Convex's official top-level agent skill — routes an agent to the right convex-* skill for the task and to a served capability catalogue that stays current without a reinstall.

Official Shopify skill for theme development in Liquid — teaches an agent the modern theme architecture of sections, blocks and snippets, and validates generated templates and schemas.

1 views

Shopify's official skill for writing Admin GraphQL queries and mutations — it searches the live API docs and validates every operation against the schema before handing you code.

1 views

Planning skill that interrogates your use case before any code is written, then recommends the right Twilio Conversations stack — ConversationRelay, Memory, Intelligence, Orchestrator, TaskRouter — and the implementation skills to follow.

1 views
Browse all skills →