agentleFS
Trystan-SATrystan-SA/product-engineer-skills/skills/instrument-feature/SKILL.md

instrument-feature

Skill2.1k starsChanged 11 days agoMITView on GitHub

Design and implement product analytics for a feature — a tracking plan with event names, properties and funnel definitions, wired into the analytics tool the project already uses (PostHog, Amplitude, Segment, Mixpanel, GA4, RudderStack, Snowplow or an in-house wrapper), then verified to fire once with the right data. Use when a feature needs metrics, when asked to add tracking, analytics or events, or when a brief, adoption plan or A/B test needs events that don't exist yet.

Trending

More talk lately.thin dataabout the whole repository

Jan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 4 mentionsDec 2026: 0 mentions
Jan 2026Jul 2026Dec 2026
Mentions a month of the Trystan-SA/product-engineer-skills repository that our weekly crawl found: only 4 in all, so this is a hint, not a trend. There is no adoption data for this file yet.

The file

We split this skill into the rules it gives an agent

10 rules. About 0 are common, 7 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Search the codebase for the tracking layer: SDK calls (posthog.capture, amplitude.track, analytics.track, mixpanel.track, gtag('event', …

    line 12
  2. Very specific:

    Read 10 to 20 existing events to learn the conventions: naming style (Invoice Sent, invoice_sent, invoice:sent), standard properties, how …

    line 14
  3. Distinctive:

    If the project has no analytics at all, stop and ask which tool to use.

    line 16
  4. Distinctive:

    Every event must answer at least one question.

    line 28
  5. Distinctive:

    No personal data: no emails, names, free-text input, or anything the privacy policy doesn't cover.

    line 43
  6. Distinctive:

    If an experiment is running or planned, log exposure when the user actually sees the variant, not when the flag is evaluated at app start.

    line 50
  7. Distinctive:

    Use the SDK's debug mode, the tool's live event view, or a test that spies on the wrapper.

    line 56
  8. Distinctive:

    Check double clicks, back navigation, and retries after errors.

    line 57
  9. Distinctive:

    If the project tests its analytics wrapper, add assertions for the new events.

    line 58
  10. Very specific:

    Write tracking-plan.md to the feature folder (the table, funnel definitions and verification notes), along with the code changes.

    line 66

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Instrument Feature

You can't improve what you can't see, and you can't trust data that was tracked carelessly. This skill writes a small tracking plan tied to the questions the team needs answered, implements it with the project's existing tools and conventions, and checks that it works.

Phase 1: Find the analytics setup

Search the codebase for the tracking layer: SDK calls (posthog.capture, amplitude.track, analytics.track, mixpanel.track, gtag('event', rudderanalytics.track, Snowplow trackers), server-side SDKs, and above all the project's own wrapper (a track() helper, a useAnalytics hook, an events.ts file). If there's a wrapper, always go through it.

Read 10 to 20 existing events to learn the conventions: naming style (Invoice Sent, invoice_sent, invoice:sent), standard properties, how user and account identity are set (identify, group), and where events are typed or documented.

If the project has no analytics at all, stop and ask which tool to use. Adding a tracking vendor is a product, legal and privacy decision.

Phase 2: Start from the questions

List the questions the data must answer, from brief.md, adoption-plan.md and experiment.md in the feature folder (docs/product/<feature-slug>/) when they exist:

  • The primary and guardrail metrics from the brief
  • Each funnel stage from the adoption plan (exposed, tried, activated, repeated)
  • Which entry point brought the user
  • Where users leave the flow, and which errors they hit
  • Exposure to each experiment variant

Every event must answer at least one question. "Track everything" produces a lot of data and few answers.

Phase 3: Write the tracking plan

EventFires when (exact trigger)Where in codePropertiesAnswers
Invoice Creation StartedUser opens the new-invoice formInvoiceForm.tsx, once per visitentry_point, client_countTried; entry-point split
Invoice SentServer confirms the invoice was sentinvoices.service.ts, after send succeedsamount_bucket, currency, is_first_invoiceValue moment (activation)
Invoice Send FailedSend rejectedsame, error brancherror_code, stepDrop-offs

Rules:

  • Follow the project's naming convention. Without one, use Object Action in the past tense (Invoice Sent), Title Case, with the noun the product UI uses.
  • Track outcomes where they happen. Fire value moments server-side after success when possible: reliable, unaffected by ad blockers, and not double-counted by re-renders. Track UI intent (opened, clicked) client-side.
  • Properties serve the breakdowns you'll need: entry_point, plan, variant, platform. Prefer enums and buckets to free text.
  • No personal data: no emails, names, free-text input, or anything the privacy policy doesn't cover. Use IDs.
  • Identity: events must attach to the same user — and account, for B2B — as the product's other events.

Phase 4: Implement

Add events through the project's wrapper, with types if the project types its events (extend the event union or schema). Put UI events in event handlers or in effects that run once per occurrence — never in render bodies, where re-renders and development double-mounts duplicate them. Put server events after the operation commits, not before.

If an experiment is running or planned, log exposure when the user actually sees the variant, not when the flag is evaluated at app start. Many flag SDKs log exposure automatically on evaluation; check before adding a duplicate.

Phase 5: Verify

Trigger each event and confirm it fires once, with the right properties and identity:

  • Use the SDK's debug mode, the tool's live event view, or a test that spies on the wrapper.
  • Check double clicks, back navigation, and retries after errors.
  • If the project tests its analytics wrapper, add assertions for the new events.

Phase 6: Define the analysis

Write funnel and metric definitions precise enough to build in the tool: steps, conversion window, counting unit (users or accounts), and filters (eligible users only). If the analytics tool is reachable from your environment (an API, a CLI or a connected integration), offer to create the funnel and dashboard; otherwise give the exact configuration.

Output

Write tracking-plan.md to the feature folder (the table, funnel definitions and verification notes), along with the code changes. Summarize: events added, how each was verified, and the questions the data still can't answer.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.