New advertisers: 50% off your first month with code FIRSTMONTHSee slots
anthropics avatar

product-tracking-skills

Seven-skill workflow that takes a SaaS codebase from tracking audit to working analytics instrumentation code.

GitHub stars
36.5K

What it does

  • Adds 7 skills (product-tracking-audit-current-tracking, product-tracking-design-tracking-plan, product-tracking-implement-tracking, and more) plus the tracking-watchdog agent
  • Covers the full lifecycle: business case, product model, current-state audit, tracking plan, SDK guide, code generation, and feature updates
  • Enforces dot.notation event names and snake_case properties, and flags PII in event properties and blocking calls
  • Designed for B2B SaaS teams whose analytics tools return unreliable answers because instrumentation is inconsistent or missing

AI agent skills that make SaaS products data-ready for product analytics — from codebase scan to tracking plan to working instrumentation code.

Add marketplace

/plugin marketplace add anthropics/knowledge-work-plugins

Run it inside Claude Code once, then install the plugin below.

Install

/plugin install product-tracking-skills@knowledge-work-plugins

Run it inside Claude Code after adding the marketplace.

Files

Discovered from source

Audit

You are a product telemetry engineer capturing the current state of tracking in a codebase. Your job is to describe reality — not judge it, not recommend fixes, not design the ideal state.

Reference Index

FileWhat it coversWhen to read
references/output-formats.mdTemplates for all output filesWriting current-state.yaml, audit report, current-implementation.md
references/sdk-comparison.mdSide-by-side SDK differencesIdentifying which SDK is in use
references/implementation-architecture.mdCentralized definitions, queue-based deliveryUnderstanding instrumentation patterns
references/anti-patterns.mdPII in properties, noise events, redundancyNoting hygiene issues (but not recommending)
references/common-mistakes.md19 frequent instrumentation mistakesIdentifying patterns in findings
references/identity-and-groups.mdIdentify/group call patternsChecking identity management
references/segment.mdSegment SDK specificsAuditing Segment implementation
references/amplitude.mdAmplitude SDK specificsAuditing Amplitude implementation
references/mixpanel.mdMixpanel SDK specificsAuditing Mixpanel implementation
references/posthog.mdPostHog SDK specificsAuditing PostHog implementation
references/accoil.mdAccoil integration specificsAuditing Accoil implementation

Goal

Produce a current-state tracking plan — a reverse-engineered description of what's actually tracked in the codebase. This is a factual inventory, not a gap analysis.

Output: .telemetry/current-state.yaml + .telemetry/audits/YYYY-MM-DD.md

Prerequisites

Check before starting:

  1. .telemetry/ folder — If it doesn't exist, create it: mkdir -p .telemetry/audits
  2. .telemetry/product.md — If this file exists, read it for product context (entity model, feature areas) to make the audit more targeted. If it doesn't exist, proceed anyway — the audit can run without it, but suggest: "No product model found. Consider running the product-tracking-model-product skill first for richer context (e.g., 'model this product') — but I can audit the codebase without it."

Context inheritance: Read .telemetry/product.md first if it exists. Present what you found as confirmation, not as new questions: "From the product model, I see this is a [language] [framework] codebase targeting [destinations]. Using [language]-appropriate detection patterns." Only ask if something is missing or ambiguous.

Framing: Describe Reality

This phase is deliberately non-judgmental. The outputs should read like a census, not a report card.

  • "The codebase tracks 14 events across 6 files" — good
  • "The codebase is missing critical events" — bad (that's design's job to decide)
  • "Event names use mixed casing: camelCase in auth, snake_case elsewhere" — good (observation)
  • "Event names should be standardized to snake_case" — bad (that's a recommendation)

Why? The audit is an input to design. Design decides what should change. Separating observation from judgement keeps the audit reusable and unbiased.

Audit Process

1. Detect SDK

Ask which SDK is used, or detect automatically:

Segment: analytics.track(, analytics.identify(, analytics.group( Amplitude: amplitude.track(, amplitude.setUserId(, logEvent( Mixpanel: mixpanel.track(, mixpanel.identify(, mixpanel.people.set( PostHog: posthog.capture(, posthog.identify( Generic: track(, trackEvent(, logEvent(

Greenfield shortcut: If no analytics SDK is detected in dependencies and no tracking calls are found in the codebase, this is a greenfield project. Skip the full audit process and produce a minimal current-state file:

# Current State: greenfield (no tracking detected)
# Scanned: YYYY-MM-DD
# SDK: none

events: []
identity:
  identify_calls: []
  group_calls: []
patterns:
  naming_style: n/a
  centralized: n/a

Write this to .telemetry/current-state.yaml, note "Greenfield — no existing tracking detected" in conversation, and suggest proceeding directly to the product-tracking-design-tracking-plan skill (e.g., "design tracking plan"). No audit report file is needed.

Skip .telemetry/current-implementation.md for greenfield projects — there's no implementation to describe.

If an SDK is detected, read the matching SDK reference before proceeding with the full audit.

2. Find All Tracking Calls

Scan the codebase systematically:

# Adjust pattern for detected SDK
rg "analytics\.(track|identify|group|page)" --type js --type ts -n

For each tracking call, extract:

  • Event name (the string passed to track/capture)
  • Properties (the object passed alongside)
  • File and line number
  • Context (what user action triggers this)

3. Verify Live vs Orphaned

This step is mandatory. For every event definition found, verify it is actually called somewhere in the codebase:

  • LIVE — the event function is imported and called in at least one place
  • ORPHANED — the event is defined but never imported or called

Search for imports and call sites of each event function. Do not assume an event is live just because it is defined. Many codebases accumulate dead event definitions over time.

Report the LIVE/ORPHANED status for every event. Summarize orphan counts by domain at the end of the audit.

4. Find Identity Management

Look for:

  • identify() calls — where, when, what traits
  • group() calls — where, when, what traits
  • page() / screen() calls — if present
  • Reset/logout handling

For B2C products, group() calls may not exist — this is expected, not a gap. Focus on identify() and event patterns.

5. Map the Current State

Build the reverse-engineered tracking plan in .telemetry/current-state.yaml. See references/output-formats.md for the full YAML template. The file captures events (with name, status, locations, properties), identity management calls, and observed patterns.

6. Note Hygiene Observations (No Recommendations)

Record factual observations about patterns:

  • Duplicates: "Two calls to button_clicked in different files with different property shapes"
  • Inconsistencies: "Event names use camelCase in auth module, snake_case in billing module"
  • Scattered calls: "Tracking calls found in 23 files with no central wrapper"
  • Missing context: "No group() calls found — events lack account context"

These are observations, not recommendations. State the fact, not the fix.

7. Capture Current Instrumentation Architecture

Document how analytics is currently wired — not what events are tracked (that's in current-state.yaml), but how the SDK is set up and calls are routed. Write this to .telemetry/current-implementation.md. This is a standalone file that the product-tracking-generate-implementation-guide skill will read as input.

Capture (as factual observations):

  • SDK and version — which package, which version
  • Initialization — where and how the SDK is initialized
  • Client vs server — where are tracking calls made? Browser, server, or both?
  • Call routing — direct SDK calls, centralized wrapper, queue-based, or scattered?
  • Identity management — how identify/group calls are made (direct, on login, on page load?)
  • Environment variables — what config keys are used
  • Error handling — try/catch present? Non-blocking?
  • Shutdown/flush — handled or not?

This is the same non-judgmental framing as the rest of the audit. Describe how it works, not whether it's right. See references/output-formats.md for the full template.

8. Generate Current-State Summary

Produce a human-readable summary alongside the YAML.

Output

Output Formats

Detailed templates for all output files are in references/output-formats.md.

.telemetry/current-state.yaml — Machine-readable reverse-engineered tracking plan. Events with names, status (LIVE/ORPHANED), locations, properties. Identity management. Observed patterns.

.telemetry/audits/YYYY-MM-DD.md — Human-readable audit report with event inventory table, identity management summary, observed patterns, and hygiene notes.

.telemetry/current-implementation.md — How analytics is currently wired: SDK version, initialization, client vs server, call routing, identity management, env vars, error handling, shutdown/flush.

Behavioral Rules

  1. Describe, don't prescribe. State what exists. Don't say what should exist — that's design's job. Never use checkmarks, warning icons, "Strong", "Gaps", or "Recommendations" framing. If you find yourself writing "should" or "missing", rephrase as an observation.

  2. Be exhaustive. Find every tracking call. A missed event is a wrong census.

  3. Verify every event is live. For each event definition, confirm it is actually called. Mark as LIVE or ORPHANED. This is not optional — orphan detection is a core audit deliverable.

  4. Preserve exact names. Record event names exactly as they appear in code, including casing and formatting. Don't normalize them.

  5. Note properties observed. Record actual property keys as a YAML list: properties: [key1, key2]. Do not use shorthand like { key1, key2 } — the output must be valid, parseable YAML.

  6. Infer categories loosely. You can tag events with inferred categories (lifecycle, core_value, etc.) to help organize the inventory, but mark these as inferred.

  7. Can be rerun cheaply. The audit should be fast to re-execute. If the codebase changes, just run it again.

  8. Don't read the tracking plan. The audit captures reality independent of any ideal. If .telemetry/tracking-plan.yaml exists, don't compare against it — that comparison happens in design.

  9. Write to files, summarize in conversation. Write detailed event inventories to the output files. Show only a concise summary in conversation (event counts, key patterns, orphan stats). Never paste more than 20 lines of raw data into the chat.

  10. One audit report, one location. Output goes to .telemetry/audits/YYYY-MM-DD.md only. Do not create duplicate files at other paths.

  11. Present decisions, not deliberation. Reason silently. The user should see findings, not your search process.

  12. Describe what works. The current implementation section should highlight patterns worth preserving, not just document everything. If the existing implementation uses a clean centralized wrapper, note it — the implementation guide should build on what works rather than starting from scratch.

  13. Note group hierarchy potential. If the codebase reveals entity relationships (accounts → workspaces → projects), note which analytics systems handle group hierarchy well (Segment, Mixpanel, and PostHog support multi-level groups natively; Amplitude requires workarounds). This observation helps the design phase choose the right architecture.

SDK Detection Quick Reference

SDKPatternPackageReference
Segmentanalytics.track(@segment/analytics-node, @segment/analytics-nextreferences/segment.md
Amplitudeamplitude.track(, logEvent(@amplitude/analytics-browser, @amplitude/analytics-nodereferences/amplitude.md
Mixpanelmixpanel.track(mixpanel-browser, mixpanelreferences/mixpanel.md
PostHogposthog.capture(posthog-js, posthog-nodereferences/posthog.md
AccoilVia Segment or direct API@segment/analytics-nodereferences/accoil.md

Read the matching guide before auditing — each SDK has different identity management, group calls, and configuration patterns.

Adapt detection patterns to the codebase language. The patterns above use JavaScript conventions. Read .telemetry/product.md for the tech stack, then adjust:

  • Ruby: Check Gemfile for analytics-ruby, segment, ahoy_matey, posthog-ruby. Search for Analytics.track(, Ahoy.track(.
  • Python: Check requirements.txt / pyproject.toml for analytics-python, posthog, mixpanel, amplitude-analytics. Search for analytics.track(, posthog.capture(.
  • Go: Check go.mod for analytics SDKs. Search for SDK-specific method calls.
  • Java: Check pom.xml / build.gradle for analytics dependencies.

Lifecycle

model → audit → design → guide → implement ← feature updates
         ^

Next Phase

After audit, suggest the user run:

  • product-tracking-design-tracking-plan — decide what should be tracked, using current state as input (e.g., "design tracking plan", "what should we track?", "create tracking plan")

Readme

Product Tracking Skills

Your analytics tool isn't the problem. Your product tracking is.

Most SaaS products have inconsistent events, missing context, and no real tracking plan. You're paying for Amplitude, Mixpanel, or PostHog — they work fine. You still can't answer basic questions because the instrumentation feeding them is broken.

Product Tracking Skills scans your codebase, audits what's tracked, and generates the instrumentation needed to make your analytics tools actually work — for 25+ platforms, in any AI agent tool.

License: MIT GitHub stars

Works in: Claude Code · OpenAI Codex · VS Code · any tool with AI agent support

Ships as both a Claude Code plugin and an OpenAI plugin — one set of skills, two manifests.


See It In Action

Open your codebase in any AI agent tool and start talking:

You: audit tracking
AI:  [Finds every tracking call, identifies gaps and issues]
     Found 14 events across 8 files. Saved to .telemetry/current-state.yaml

You: design tracking plan
AI:  [Designs best-practice tracking plan, produces delta from current state]
     22 events. Delta: add 10, rename 3, change 4, remove 1. Review and adjust.

You: implement tracking
AI:  [Generates typed wrapper functions, delivery infrastructure, event constants]
     Tracking code ready in tracking/

Seven skills and a tracking watchdog agent. Your analytics tools finally work.


The Problem

Most B2B products have one of these situations:

No tracking. You know you need it. It's been on the backlog for six months. It never happens.

Broken tracking. 14 events across 23 files. Some camelCase, some snake_case. No account context. Three events that do the same thing. Five that nobody uses.

Decayed tracking. Someone set it up 18 months ago. Twelve features have shipped since. None were instrumented. The tracking plan — if one exists — is a lie.

In all three cases, your CS team can't see which accounts are healthy. Your product team can't measure feature adoption. You can't give investors real usage numbers. The analytics tool you're paying for works fine — it just can't help when the tracking feeding it is missing, inconsistent, or broken.


What These Skills Do

They fix the instrumentation layer feeding your analytics tools — so your product is properly tracked and any analytics tool downstream can answer real questions about how customers use your product.

The focus is users, accounts, features, and lifecycle events. The raw signals your product emits. Not vanity pageviews. Not generic clicks. Semantic events with meaning, properties, and account attribution.

What They Don't Do

  • Define KPIs or success metrics
  • Build dashboards or reports
  • Interpret what the data means
  • Replace any analytics tool

The boundary is deliberate. This produces instrumentation. What happens downstream — scoring, dashboards, alerts — belongs to tools like Amplitude, PostHog, Mixpanel, or Accoil.

Data and Credentials

The skills read and write files in your repository, and nothing else. They don't run your tracking code, send events, call analytics APIs or read API keys, and they send nothing to Accoil or any other service.

The destination references in skills/*/references/ contain example code for your application. Each example reads that destination's own key from your app's environment (for example process.env.SEGMENT_WRITE_KEY) and sends events only to that destination's API. The generic HTTP example sends to the endpoint you configure in ANALYTICS_ENDPOINT. Keep these keys in your app's secrets management, never in source code.


What's Inside

These aren't thin prompts. Each skill includes a built-in reference library:

  • 19 common instrumentation mistakes and how to detect them
  • Anti-pattern detection — PII in event properties, noise events, redundant tracking, blocking calls
  • Naming conventions — dot.notation for event names (report.created), snake_case for properties and traits (signup_source)
  • B2B entity modeling — two-entity model, group hierarchies, instance vs user-level tracking
  • 7 category templates — opinionated starting points for B2B SaaS, AI/ML, dev tools, and more
  • Instrumentation references for 25 analytics destinations — product analytics, CDPs, product adoption, web analytics, error monitoring, feature flags, and session tools

The skills encode the kind of knowledge that usually lives in a senior analytics engineer's head — except it doesn't walk out the door when they leave.


How It Works

Seven skills plus a background tracking watchdog. Each skill produces artifacts that feed the next. Everything version-controlled in your repo.

Business Case ──▶ Model ──▶ Audit ──▶ Design ──▶ Instrument ──▶ Implement ──▶ Maintain
PhaseWhat HappensYou Get
Business CaseBuilds a stakeholder-ready case for why product telemetry matters — blind spots, business value, effort involved.telemetry/business-case.md
ModelScans your codebase to understand the product — entities, features, value flow.telemetry/product.md
AuditReverse-engineers current tracking. Every event, property, identity call. No judgment..telemetry/current-state.yaml
DesignDesigns an opinionated tracking plan + explicit delta from current state.telemetry/tracking-plan.yaml + delta.md
InstrumentTranslates the plan into SDK-specific guidance with template code.telemetry/instrument.md
ImplementGenerates real typed wrapper functions, identity management, delivery infrastructuretracking/ directory
MaintainUpdates tracking when features ship. Versioned with changelog.Updated plan + changelog.md

Tracking Watchdog (Background Agent)

Once your tracking plan is in place, the tracking-watchdog agent runs in the background while you develop. It monitors code changes for new features and modified user flows, compares them against your tracking plan, and suggests new events or properties when it finds coverage gaps.

It stays quiet when there's nothing to report. When it does speak up, it tells you exactly what event to add, what properties to include, and which entity level to attribute to — then recommends using the instrument-new-feature skill to make the changes.

This is how tracking stays current as your product evolves, without anyone remembering to check.


Who Is This For?

Founders who know they need product analytics but it's been on the backlog for six months. You can go from zero to a complete tracking plan with working code in a single session.

Product engineers who inherited tracking that's scattered, inconsistent, and undocumented. You get a structured system: audit what exists, design what should exist, generate typed code to close the gap.

Platform engineers wiring up multiple tools — analytics, error monitoring, feature flags, session replay — who want consistent identity and event naming across all of them instead of six different instrumentation patterns scattered across the codebase.

CS and product teams who need feature adoption data and account health signals. You can't run the skills yourself, but you can hand engineering a clear process: "Run these skills. Get us the data we need."

If you're a B2B SaaS team and you can't answer "which features does account X actually use?" — or your Sentry errors have no user context, or your LaunchDarkly targeting is based on guesswork — start here.


Supported Destinations

Instrumentation references for 25+ destinations across 8 categories. Each reference documents real SDK call patterns, authentication, constraints, and common pitfalls.

Product Analytics & CDPs

Full identify → group → track lifecycle. Primary destinations for product usage data.

PlatformBrowserNode.js
Segment@segment/analytics-next@segment/analytics-node
Amplitude@amplitude/analytics-browser@amplitude/analytics-node
Mixpanelmixpanel-browsermixpanel
PostHogposthog-jsposthog-node
RudderStack@rudderstack/analytics-js@rudderstack/rudder-sdk-node

B2B Engagement Platforms

Account-level engagement scoring and lifecycle signals.

PlatformBrowserServer
Accoiltracker.js (CDN)Direct API
CustomerScore.ioTracker snippet (CDN)Direct API
Intercom@intercom/messenger-js-sdkintercom-client
Journy—@journyio/sdk

Web Analytics

Page-level and event tracking.

PlatformIntegration
Google Analytics (GA4)gtag.js / GTM
PlausibleScript tag / Events API
FathomScript tag / Events API
Simple AnalyticsScript tag / Events API
Usermavenusermaven-js / HTTP API
Microanalytics, Cabin, CloudflareScript tag

Error & Performance Monitoring

User context for debugging. Identify calls attach user/account info to error reports.

PlatformBrowserServer
Sentry@sentry/browser@sentry/node
New RelicBrowser agentNode agent
Azure Application Insights@microsoft/applicationinsights-webapplicationinsights

Feature Flags & Experimentation

Targeting attributes and experiment exposure tracking.

PlatformBrowserServer
LaunchDarklylaunchdarkly-js-client-sdk@launchdarkly/node-server-sdk
Statsig@statsig/js-client@statsig/statsig-node-core

Product Adoption Platforms

In-app guidance plus product analytics with user and company (account) profiles.

PlatformBrowserServer
Userpilotuserpilot (npm) / script tagHTTP API (identify, companies, track, bulk); also via Segment / RudderStack

Session & Behavior Tools

Session recording and feedback with user identification.

PlatformIntegration
HotjarScript tag / Identify API

Tag Management & Architecture

PlatformUse Case
Google Tag ManagerContainer-based deployment for multiple destinations
Generic HTTPAny destination with an HTTP/REST API

Different tools serve different roles. The skills know what each destination supports and generate the right instrumentation for each. One audit covers all destinations. One tracking plan defines the events.

Want to add a destination? See the destination reference template.


Category Templates

The design phase picks the best starting template for your product type. All extend b2b-saas-core.

TemplateBest For
b2b-saas-coreGeneric B2B SaaS baseline
ai-ml-toolsAI/ML products, generation, models
developer-toolsAPIs, SDKs, CLI tools
collaboration-toolsTeam workspaces, real-time collab
form-buildersForm creation, submissions
security-productsSecurity events, alerts, compliance
analytics-platformsAnalytics products tracking their own usage

Design Principles

Opinionated defaults. dot.notation for event names (user.signed_up). snake_case for properties and traits (signup_source). Properties over events. Minimalist coverage. We take positions so you don't have to debate them.

Audit before design. Capture reality first, then decide intent. The audit describes what exists. Design is where opinions live.

Delta-driven. The diff between current state and tracking plan is the implementation backlog. "Add 10, rename 3, change 4, remove 1." No ambiguity.

B2B-first. Users and accounts are first-class. Group hierarchy (account → workspace → project) is built in. Every event attributed to the correct level.

Maintainable. Tracking decays when features ship without instrumentation. The maintain phase prevents that. Versioning, deprecation, and changelogs are built in.


What You Get

Everything lives in .telemetry/ in your repo. Version-controlled. Survives across sessions and engineers. Nothing in someone's head. Nothing in a third-party tool.

.telemetry/
├── business-case.md        # Why add telemetry — stakeholder-ready
├── product.md              # What your product does, entities, value flow
├── current-state.yaml      # What's tracked today (from audit)
├── tracking-plan.yaml      # What should be tracked
├── delta.md                # Current → target diff (the backlog)
├── instrument.md           # SDK-specific instrumentation guide
├── changelog.md            # How the plan evolved over time
└── audits/
    └── 2026-02-13.md       # Timestamped audit snapshots

Skills Reference

Each skill is self-contained with its own references/ directory. Trigger them with natural language.

SkillTry saying...
product-tracking-business-case"write a business case for analytics" or "why add tracking?"
product-tracking-model-product"model this product" or "understand this codebase"
product-tracking-audit-current-tracking"audit tracking" or "what's currently tracked?"
product-tracking-design-tracking-plan"design tracking plan" or "what should we track?"
product-tracking-generate-implementation-guide"create instrumentation guide"
product-tracking-implement-tracking"implement tracking" or "generate code"
product-tracking-instrument-new-feature"instrument this feature"
tracking-watchdog (agent)Runs automatically in background during feature development

Installation

Option 1: CLI Install (Recommended)

Use npx skills to install skills directly:

# Install all skills
npx skills add accoil/product-tracking-skills

# Install specific skills
npx skills add accoil/product-tracking-skills --skill audit design

# List available skills
npx skills add accoil/product-tracking-skills --list

This automatically installs to your .claude/skills/ directory.

Option 2: Claude Code Plugin

Install via Claude Code's built-in plugin system:

# Add the marketplace
/plugin marketplace add accoil/product-tracking-skills

# Install all skills
/plugin install product-tracking-skills

Option 3: OpenAI Codex

The repo includes an OpenAI plugin manifest (plugin.json, packaged as product-tracking) and per-skill Codex metadata (skills/*/agents/openai.yaml). The OpenAI plugin directory listing is in review; until it's live, install the skills directly — Codex discovers skills in .agents/skills:

git clone https://github.com/accoil/product-tracking-skills.git
mkdir -p ~/.agents/skills   # or $REPO_ROOT/.agents/skills for a single repo
cp -r product-tracking-skills/skills/* ~/.agents/skills/

The background tracking watchdog is Claude Code–only; the seven skills work in both.

Option 4: Clone and Copy

Clone the repo and copy the skills folder:

git clone https://github.com/accoil/product-tracking-skills.git
cp -r product-tracking-skills/skills/* .claude/skills/

Once installed, open your codebase in any AI agent tool and start with a prompt like this:

Example Prompt

Use the product-tracking skills to model this product, audit the current tracking,
and design a complete tracking plan. Our tracking destination is Segment — use the
Segment library. Track at the account and user level. Give me a complete, product 
analytics tracking plan.

This runs the full skill chain — model, audit, design — and produces a tracking plan in .telemetry/ ready for implementation.


Feedback

Found a bug? Have a suggestion? Open an issue.


Changelog

See CHANGELOG.md for version history and Releases for full notes.

License

MIT — free for any use. Built by Accoil.

Details

Marketplace
anthropics/knowledge-work-plugins
Source
https://github.com/Accoil/product-tracking-skills.git
Category
Community
Listed since
Apr 7, 2026

More from anthropics/knowledge-work-plugins

All 123

Similar to product-tracking-skills

More Data Science & Analytics