Skip to content
Skills Library
Data & analytics · Review & audit

segment-tracking-plan

/segment-tracking-plan

Compare the analytics calls in a codebase (track, identify, group, page, screen) with a Segment Protocols tracking plan. Finds events missing from the plan, plan events the code never sends, and property mismatches, and can export the plan to a file. Use when the user asks whether their instrumentation matches the tracking plan, about Protocols violations, or to export a tracking plan.

Repository
segment-cli ↗
Licence
MIT
Last repository change
06.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 06.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Compare the analytics calls in a codebase (track, identify, group, page, screen) with a Segment Protocols tracking plan. Finds events missing from the plan, plan events the code never sends, and property mismatches, and can export the plan to a file. Use when the user asks whether their instrumentation matches the tracking plan, about Protocols violations, or to export a tracking plan.

Original author description

Compare the analytics calls in a codebase (track, identify, group, page, screen) with a Segment Protocols tracking plan. Finds events missing from the plan, plan events the code never sends, and property mismatches, and can export the plan to a file. Use when the user asks whether their instrumentation matches the tracking plan, about Protocols violations, or to export a tracking plan.

How it works

  1. 1. Pick the tracking plan
  2. 2. Fetch the rules
  3. 3. Find the analytics calls in the code
  4. 4. Compare and report
Original SKILL.md headings · 45 lines, 549 words
SKILL.md preview
---
name: segment-tracking-plan
description: Compare the analytics calls in a codebase (track, identify, group, page, screen) with a Segment Protocols tracking plan. Finds events missing from the plan, plan events the code never sends, and property mismatches, and can export the plan to a file. Use when the user asks whether their instrumentation matches the tracking plan, about Protocols violations, or to export a tracking plan.
license: MIT
compatibility: Requires the segment CLI (npm install -g csangani/segment-cli), logged in to a workspace with Protocols. See the segment-setup skill.
allowed-tools: Bash(segment read *) Bash(segment describe *) Bash(segment search *) Bash(segment auth status) Bash(segment auth status *) Grep Glob Read
---

# Tracking plan check

Compare the instrumentation in the current repository with a Segment tracking plan, using the `segment` CLI. This is read-only against Segment. Change the plan only if the user asks afterwards, following the write rules in the segment-api skill. If the user names a workspace profile, add `--profile NAME` to every `segment` command.

## 1. Pick the tracking plan

Run `segment read listTrackingPlans --all --fields id,name,type,updatedAt`.

- Exit 1 with HTTP 403/404 means Protocols isn't enabled or the token lacks access. Stop and say so.
- Match the plan the user named. Otherwise, if there is exactly one `LIVE` plan, use it. Otherwise ask the user which one.

## 2. Fetch the rules

Run `segment read listRulesFromTrackingPlan trackingPlanId=<id> --all --out <tmp>/rules.json`, using a temp directory, then work from that file. Each rule has `type` (`TRACK`, `IDENTIFY`, `GROUP`, `PAGE`, `SCREEN`, `COMMON`), `key` (the event name for TRACK rules), `jsonSchema`, `version`, and an optional `deprecatedAt`.

From each rule's `jsonSchema`, collect the event's property names and which are required. The properties usually sit at `jsonSchema.properties.properties`; identify traits sit at `jsonSchema.properties.traits`, and context at `jsonSchema.properties.context`. If a rule has several `version`s, use the highest that isn't deprecated. A short `node -e` script over the file is the easiest way to build this index.

If the user asks to export the plan, write it to `tracking-plan.<slug>.json` in the repository, sorted by type then key, and mention the path.

## 3. Find the analytics calls in the code

Scan the path the user gave, otherwise the repository root. Skip `node_modules`, build output, vendored code, and test fixtures unless asked. Search for the common Segment call shapes:

- Analytics.js / React / Next: `analytics.track("Event", {...})`, `analytics.identify(`, `analytics.page(`, `analytics.group(`, and wrappers such as `useAnalytics().track(` or `segment.track(`.
- Node (`@segment/analytics-node`): `analytics.track({ event: "Event", properties: {...} })`.
- Python: `analytics.track(user_id, "Event", {...})` or `analytics.track(user_id=..., event="Event", properties=...)`.
- iOS / Android / React Native / Flutter: `.track("Event"`, `.track(name: "Event"`, `Analytics.with(context).track(`, `.screen(`.
- Typewriter or other generated clients: calls such as `typewriter.orderCompleted({...})`. Map camelCase function names back to plan event names.
- Project-specific wrappers, for example `trackEvent(EVENTS.CHECKOUT_STARTED, ...)`. When the event name is a constant, resolve it to its string value. If a call's name is built dynamically, list it under "couldn't resolve" rather than guessing.

For each call, record: event name, file:line, and the property keys passed when they're literal.

## 4. Compare and report

Match event names exactly (Segment is case- and whitespace-sensitive), then show near-misses separately. Report in this order:

1. **Sent but not in the plan.** These will be flagged or blocked as violations. Include file:line, and the closest plan event if there's a near-match by case, spacing, or tense.
2. **Required properties missing** in calls to planned events, and **properties not in the event's schema** when it disallows `additionalProperties`.
3. **In the plan but never sent from this code.** These may come from another codebase or service, so present them as "not found here", not as dead.
4. **Deprecated rules** still being sent.
5. **Couldn't resolve:** dynamic event names that need a human to check.

End with counts (planned events, events found in code, matched, and each issue category). Then offer next steps: fix the code, or ask whether to propose plan changes via `updateRulesInTrackingPlan`, which needs explicit confirmation of the exact rules.

Versions

The database has no other skills named segment-tracking-plan.

Database snapshot: 13.11.2026 · package version ac720c8cdf0e (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 85segment-cdp
    Expert patterns for Segment Customer Data Platform including Analytics.js, server-side tracking, tracking plans with Protocols, identity resolution, destinations configuration, and data governance best practices. Use when: segment, analytics.js, customer data platform, cdp, tracking plan.
  • 90punkmetrics-tracking-implementation
    Use when implementing an approved tracking plan or event catalog in code, adding or fixing analytics events, writing tests that prove event counts, or loading, updating or reading events, descriptions and properties in an external tracking-plan tool (spreadsheet, Avo, Amplitude…
  • 95product-tracking-generate-implementation-guide
    Translate a tracking plan into an SDK-specific instrumentation guide. Shows how to make identify, group, and track calls using the target analytics SDK with real template code, architecture guidance, and constraint documentation. Outputs .telemetry/instrument.md. Covers 24…
  • 100product-tracking-design-tracking-plan
    Design an opinionated target tracking plan and produce an explicit delta from current state to target. Combines the product model, current-state audit, and telemetry best practices to decide what events, properties, entities, and group hierarchies should exist. Outputs…
  • 95product-tracking-design-tracking-plan
    Design an opinionated target tracking plan and produce an explicit delta from current state to target. Combines the product model, current-state audit, and telemetry best practices to decide what events, properties, entities, and group hierarchies should exist. Outputs…
  • 100product-tracking-generate-implementation-guide
    Translate a tracking plan into an SDK-specific instrumentation guide. Shows how to make identify, group, and track calls using the target analytics SDK with real template code, architecture guidance, and constraint documentation. Outputs .telemetry/instrument.md. Covers 25…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.