# Instrument Events

> From prioritized event_candidates YAML, generates a concrete tracking plan with exact code locations, Mixpanel SDK calls, and property definitions.

- Skill: `rpatel05/instrument-events` (Agent Skill)
- Install (CLI): `npx skillmds@latest add rpatel05/instrument-events`
- Raw SKILL.md: https://api.skillmd.com/api/skills/rpatel05/instrument-events/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: rpatel05 (https://skillmd.com/u/rpatel05)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/rpatel05/instrument-events

---


# instrument-events

Generate implementation-ready tracking plan from event candidates.

## Input

Consumes `event_candidates` YAML from `discover-event-surfaces`.

## What it does

1. Reviews existing analytics patterns in codebase
2. For each priority 3 event:
   - Determines exact file and function location
   - Generates Mixpanel SDK tracking call
   - Defines property schema
3. Outputs trackingPlan JSON

## Output Format

```json
{
  "trackingPlan": [
    {
      "eventName": "Payment Method Selected",
      "file": "src/checkout/PaymentForm.tsx",
      "function": "handlePaymentMethodChange",
      "code": "mixpanel.track('Payment Method Selected', { payment_method: method, checkout_step: 2 });",
      "properties": {
        "payment_method": "string (credit_card | paypal | apple_pay)",
        "checkout_step": "number"
      }
    }
  ]
}
```

## Usage

Invoked by `add-analytics-instrumentation` as Step 3 (final step).

This is the deliverable given to engineering for implementation.

