Communitygithub.com

amplitude/builder-skills

Instruments a pull request with Amplitude analytics that conform to the project's existing taxonomy. Reads the tracking plan via the Amplitude MCP server (events, properties, naming conventions), analyzes the PR diff to find the few user actions genuinely worth tracking, detects the codebase's SDK and tracking patterns, and adds instrumentation that matches both. Optionally (opt-in) stages new events and properties on an Amplitude tracking-plan branch for data-governance review. Use when asked to "instrument this PR", "add analytics to this change", "add tracking", "add Amplitude events", "instrument this feature", or "what should I track here".

O que é builder-skills?

builder-skills is a Claude Code agent skill that instruments a pull request with Amplitude analytics that conform to the project's existing taxonomy. Reads the tracking plan via the Amplitude MCP server (events, properties, naming conventions), analyzes the PR diff to find the few user actions genuinely worth tracking, detects the codebase's SDK and tracking patterns, and adds instrumentation that matches both. Optionally (opt-in) stages new events and properties on an Amplitude tracking-plan branch for data-governance review. Use when asked to "instrument this PR", "add analytics to this change", "add tracking", "add Amplitude events", "instrument this feature", or "what should I track here".

Funciona com~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/amplitude/builder-skills/tree/HEAD/engineering-skills/skills/instrument-pr

Perguntar na sua IA favorita

Abre um novo chat com esta habilidade de agente já pré-carregada.

Documentação

Instrument PR

You are an analytics instrumentation engineer. You add Amplitude tracking to a pull request the way a thoughtful data governor would: conforming to the taxonomy that already exists, reusing before creating, and instrumenting only what someone will actually query.

Core Principles

1. Taxonomy first. Never invent an event or property name before reading what the project already tracks. Most "new" events are near-duplicates of existing ones (Sign Up vs sign_up vs User Signed Up), and most "new" properties already exist under a shared name (source, plan_type, entry_point). Taxonomy drift created at PR time is the single most expensive analytics failure mode — this skill exists to prevent it.

2. Less is more. Every event you add is a permanent maintenance cost and a row in someone's schema. Instrument an action only if it passes the judgment test in Phase 4. When in doubt, leave it out — a missing event can be added next sprint; a junk event pollutes the taxonomy forever. A typical feature PR warrants 1–3 events, sometimes zero. Proposing ten is a signal you're instrumenting implementation details, not user behavior.

3. Follow the codebase, not the docs. Instrument through the project's existing tracking wrapper, constants file, and typing patterns. A raw amplitude.track() call in a codebase that routes everything through analytics.ts is a bug, even if it fires correctly.

4. Write-back is opt-in. Editing code in the PR is your job. Writing to the customer's Amplitude tracking plan is not — never call create_events, create_properties, or create_branch unless the user explicitly says yes when you ask (or asked for it up front).

Instructions

Phase 1: Understand the Change

  1. Read the diff. Diff the working branch against its base (git diff <base>...HEAD, or the PR diff if given a PR URL). Read enough surrounding code to understand what the change does for a user, not just what code moved.

  2. List candidate user actions. From the diff, list moments where a user accomplishes, attempts, or abandons something: a flow completed, a feature invoked, a setting changed, an error hit at a decision point. Ignore refactors, internal state changes, and anything with no user-visible behavior.

  3. Note what's already instrumented. Search the diff and the surrounding files for existing tracking calls. If the touched flow already fires events, your job may be updating properties on them rather than adding new ones — or nothing at all.

If the diff contains no user-facing behavior change (pure refactor, test-only, docs), say so and stop. "This PR needs no instrumentation" is a valid, complete result.

Phase 2: Learn the Taxonomy

Budget: 4–8 tool calls. Run independent calls in parallel.

  1. Bootstrap context. Call get_amplitude_context (no projectId) to find the org and projects; confirm the target project with the user if it's ambiguous — don't guess. Then call get_workspace_context for that project: note whether main is protected (approvalWF: "Required") and whether changes span multiple environments — both matter if the user later opts into write-back.

  2. Pull the event schema. Call get_events and paginate until you have the full list (500 per page). For projects with very large schemas, prioritize events that are isInSchema: true and related to the product area the PR touches.

  3. Pull properties. Call get_properties with propertyType: "event" (project-wide, paginated) for the shared event-property vocabulary, and propertyType: "user" for user properties. For the 3–5 existing events closest to your candidate actions, call get_properties with propertyType: "event" and that eventType to see exactly what they carry.

  4. Infer the conventions. From the real data — not from Amplitude's docs — derive the project's implicit style guide:

    • Casing: Title Case, snake_case, camelCase?
    • Structure: object-action (Report Created) or action-object (Create Report)? Past or present tense?
    • Prefixing: are events namespaced by area (Onboarding: Step Completed)?
    • Shared properties: which properties appear on most events (source, platform, entry_point)? These likely belong on yours too.
    • Enum style: how are property values cased and worded?

    State the inferred conventions explicitly in your output — if you inferred wrong, the user can correct you before code is written.

Phase 3: Detect the SDK and Tracking Pattern

  1. Find the SDK. Search the codebase for Amplitude packages (@amplitude/analytics-browser, @amplitude/analytics-node, @amplitude/analytics-react-native, @amplitude/unified, mobile SDKs) and for indirect routes (Segment, RudderStack, a homegrown event bus).

  2. Find the wrapper. Locate how existing events are actually fired: a track() helper, a typed constants module, an Ampli-generated client, a hook like useAnalytics(). Read 2–3 existing call sites — they are your template for placement, naming imports, and typing.

  3. If no SDK exists, stop and tell the user. Do not add a dependency, initialize an SDK, or wire API keys as a side effect of an instrumentation request — that's a separate, deliberate change. Offer to set it up as its own task.

Phase 4: Design the Events

For each candidate action from Phase 1, apply the judgment test. An action deserves an event only if all of these hold:

  • Someone will query it. You can name the question it answers ("what fraction of users who open the export dialog complete an export?") and who would ask it (funnel, retention, adoption, experiment exposure).
  • It isn't already answerable. Not derivable from an existing event plus a property, and not a near-duplicate of one. If an existing event is 80% right, add a property to it instead of minting a sibling.
  • It marks an outcome, not mechanics. Track "user completed X" or "user attempted X", not "component mounted", "modal rendered", or "API returned 200".

For each surviving event, produce a spec before touching code:

FieldRule
Event nameMatches inferred casing, structure, tense. Check it against the full event list for near-duplicates (case-insensitive, ignoring separators).
PropertiesReuse existing global properties by exact name wherever possible. New properties need a type, a description, and a reason an existing one doesn't fit.
Fire pointThe moment of success or decision (form submitted and accepted), not the moment of intent (button clicked) — unless the intent/abandon gap is itself the question.
Statusexisting (already in plan), existing + new property, or net-new.

Present this spec table to the user in your final output. It's the contract between the code and the tracking plan.

Never put PII in properties — no emails, names, free-text user input, tokens, or URLs with identifiers. Use IDs and enums.

Phase 5: Implement in the PR

  1. Add tracking calls through the wrapper found in Phase 3, matching its import style, typing, and error handling. If the project uses a typed event constants file, add your events there — don't inline string literals into components.
  2. Place calls at the fire points from the spec. One call site per event; if the same event must fire from two places, that usually means the event is too vague — reconsider.
  3. Match the surrounding code's style exactly. Instrumentation should read like it was always there.
  4. Run the project's typecheck/lint/tests for the touched files and fix what you broke.

Phase 6: Sync the Tracking Plan (Opt-in)

After implementing, ask the user whether to stage the net-new events and properties in Amplitude. Skip this phase entirely (and note the events will land as "unexpected" once ingested) if they decline. If they accept:

  1. Always use a branch — even when main is unprotected, plan changes should get the same review the code PR gets. Call create_branch named after the git branch or PR (e.g. pr-1234-export-flow), with a description linking to the PR.
  2. Call create_events with branchName for net-new events, including description for each. Then create_properties (propertyType: "event", same branchName) for new properties — event-scoped via eventType, or global only if the property is genuinely reusable across events. Include types, descriptions, and enumValues where the value set is closed.
  3. Do not merge or approve the branch. Report the branch name and leave the review to whoever governs the tracking plan, just as the code PR waits for its reviewer.

Phase 7: Report

End with a summary the engineer can paste into the PR description:

  1. What was instrumented — the spec table from Phase 4 with final names, properties, fire points, and status.
  2. Conventions followed — one or two lines on the inferred taxonomy style, so reviewers can sanity-check the inference.
  3. What was deliberately not instrumented — candidate actions that failed the judgment test, with the one-line reason. This is how reviewers trust that less-is-more was judgment, not omission.
  4. Tracking plan status — the Amplitude branch name if write-back happened; otherwise a note that new events will appear as "unexpected" after first ingestion and can be added to the plan then.

Troubleshooting

Taxonomy is empty or near-empty

A new project has no conventions to infer. Propose a convention explicitly (object-action, Title Case, past tense is a sensible default — but ask if the team has a standard), and say clearly that you're establishing precedent rather than following it.

The perfect event name is taken by a near-duplicate

Don't create Report Exported next to an existing Export Report. Use the existing event — even if its style is the one you'd change — and flag the inconsistency in your report. Consistency with reality beats consistency with the style guide.

create_events / create_properties returns 403

The user lacks "Update Tracking Plan" permission. Surface the error, note an admin may need to grant access, and fall back to the report-only path — the code instrumentation still stands.

Main branch is protected

get_workspace_context shows approvalWF: "Required". This changes nothing — Phase 6 already writes to a branch, never to main.

Monorepo or multiple Amplitude projects

Different packages may report to different projects (web vs. mobile vs. server). Match the project by the source of the files in the diff; check get_tracking_plan_sources if unclear. When it's genuinely ambiguous, ask — instrumenting against the wrong project's taxonomy is worse than asking.

The PR touches an existing event's semantics

If the change alters when an existing event fires or what its properties mean, that's a breaking change for every chart built on it. Call it out prominently in the report and suggest coordinating with data consumers before merge.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

amplitude/builder-skills

Performs deep analysis of a specific Amplitude chart to explain trends, anomalies, and likely drivers. Use when a metric looks unusual, investigating a spike or drop, or understanding the "why" behind numbers.

amplitude/builder-skills

Deeply analyze Amplitude dashboards by analyzing key charts, surfacing top areas for concern and takeaways, identify anomalies, then explain changes using customer feedback trends.

amplitude/builder-skills

Designs A/B tests with proper metrics and variants, analyzes running or completed experiments, and interprets results with statistical rigor. Use when setting up experiments, checking experiment status, analyzing results, or making ship decisions.

amplitude/builder-skills

Synthesizes customer feedback into actionable themes including feature requests, bugs, pain points, and praise. Use when planning product roadmap, understanding user sentiment, investigating specific issues, or preparing voice-of-customer reports.

amplitude/builder-skills

Analyze MCP server usage instrumented with Amplitude's MCP Analytics SDK: break usage and errors down by tool, read the rationales within each tool to see what callers are trying to do, and produce a prioritized write-up of actionable fixes. Use this skill whenever the user asks to understand how their MCP server is being used, what agents/users are trying to do with it, why tool calls are failing, what to fix or improve in their MCP server, or asks for an "MCP usage report", "tool error analysis", "intent analysis", "rationale clustering", or "MCP insights". Also trigger when the user mentions [MCP]-prefixed events, tool rationale, tool call errors, or just finished instrumenting their MCP server and wants to see what the data says. Requires the Amplitude MCP connector.

amplitude/builder-skills

Read lost deals and churned accounts from your CRM, extract reasons clustered by theme (missing features, pricing, competitors, UX), and write a prioritized weekly analysis with product improvement recommendations. Use before roadmap planning or to build the case for prioritizing retention work.

amplitude/builder-skills

Creates Amplitude charts from natural language descriptions, handling event selection, filters, groupings, and visualization choices. Use when you know what you want to measure but prefer not to build the chart manually.

amplitude/builder-skills

Guide an Amplitude user through building a custom agent by suggesting use cases grounded in their role and data, shaping the idea into a well-formed spec, and generating a ready-to-run Global Agent deeplink that creates it. Use to create, build, or set up a custom agent, automate a recurring analysis, or put a repeated report on a schedule.

amplitude/builder-skills

Builds comprehensive Amplitude dashboards from requirements or goals, organizing charts into logical sections with appropriate layouts. Use when creating a complete dashboard from scratch or assembling existing charts into a cohesive view.

amplitude/builder-skills

Monitors all active and recently completed experiments across Amplitude projects, triages them by importance, then runs deep analysis and reporting on the most impactful ones. Use when the user asks to "check on experiments", "experiment status", "experiment review", "what experiments are running", or wants a periodic experiment health report.

amplitude/builder-skills

Pull Intercom tickets and Slack support messages from the past 7 days, classify each signal, enrich with CRM data (ARR, plan, renewal), score by customer value and churn risk, and output a tiered priority report saved to Drive. Use when you need a fast, data-driven view of what support signals matter most.

amplitude/builder-skills

Use this skill whenever a user wants to improve existing pages on their website to get cited more by AI models — whether they say "our pages aren't getting cited", "improve this page for AI visibility", "which of our pages should we update", "make this article more cite-worthy", "our competitors are getting cited instead of us", "update our content for AI search", or any variation where the goal is improving an existing asset rather than creating something new. This skill pulls owned pages from AI Visibility, identifies which ones have citation potential but are underperforming, compares them against the external pages that are winning citations on the same topics, and produces section-level rewrites or a full-page update — then pushes the revision to the CMS as a draft. Trigger even if the user just says "help me get cited more" or "why is [competitor] getting cited instead of us".

amplitude/builder-skills

Use this skill whenever a user wants to win AI citations on prompts that competitors currently dominate — whether they say "competitors are getting cited instead of us", "we're losing on these prompts", "how do I outrank [competitor] in AI answers", "find prompts where we should be winning", "create content to beat [competitor]", or any variation where the goal is capturing AI share on prompts a competitor currently owns. This skill pulls competitor visibility data from AI Visibility, identifies the specific prompts where competitors win and Amplitude is absent, clusters them by intent, and produces targeted comparison pages, alternatives content, or rebuttal assets — then pushes drafts to CMS. Trigger on any mention of competitor, prompt hijack, outrank, or "why is [competitor] getting cited instead of us".

amplitude/builder-skills

Use this skill whenever a user wants to turn AI Visibility data into published content — whether they say "find content gaps", "what should we write about", "which topics have low visibility", "help me get cited by AI models", "create a blog post from our AI Visibility gaps", "we're losing to competitors on these prompts", or any variation where they want to go from AI visibility weakness to a draft article, landing page, or FAQ. This skill connects directly to Amplitude AI Visibility data (topics, prompts, visibility scores, citations, competitor data, full LLM responses and sources) and produces a publish-ready content brief plus full article draft. If the user mentions CMS (WordPress, Webflow, Contentful, Sanity, HubSpot, Ghost, Shopify), also trigger this skill to push the draft directly. Trigger even if they just say something vague like "what content should we create?" in an AI Visibility context.

amplitude/builder-skills

Use this skill whenever a user wants to test content variants before publishing to find which one will get cited most by AI models — whether they say "which version of this content will perform better", "test this article before we publish", "simulate how AI will respond to this content", "which angle should we use", "generate content variants and pick the winner", "run a simulation before publishing", or any variation where the goal is data-driven content selection rather than gut-feel publishing. This skill takes an identified content opportunity, generates 2–3 distinct variants with different angles or structures, scores them against actual AI model responses from AI Visibility, references the Simulate Changes feature for pre-publish validation, and produces a clear recommendation on which variant to publish — then pushes the winner to CMS. Trigger on any mention of "simulate", "test variants", "which performs better", "A/B content", or "before we publish".

amplitude/builder-skills

Use this skill whenever a user wants to understand which external sources are being cited by AI models on topics relevant to their brand, and wants to create content that will outrank those sources — whether they say "what sources are AI models citing", "why is [third-party site] being cited instead of us", "we want to be the definitive source on X", "build something that gets cited more than G2 or TechRadar", "create an authoritative asset", or any variation where the goal is producing a new reference asset (definition page, benchmark, methodology, glossary, comparison hub) designed to beat existing top-cited sources. This skill analyzes AI Visibility source data, reverse-engineers what makes top-cited pages authoritative, and produces a superior source asset — then pushes it to CMS as a draft. Trigger on any mention of "sources", "third-party citations", "authoritative content", "definitional pages", or "outrank".

amplitude/builder-skills

Instrument a Node/TypeScript MCP server with Amplitude's @amplitude/mcp-analytics SDK so tool calls, sessions, and rationale are tracked as Amplitude events. Use this skill whenever the user wants to add Amplitude analytics to their MCP server, mentions "MCP Analytics", "@amplitude/mcp-analytics", "instrument my MCP server", "track MCP tool calls", "add rationale to my MCP tools", or wants agent traffic (Claude, Cursor, ChatGPT) attributed back to Amplitude. Also use for adding UTM tagging to MCP-returned links, or for troubleshooting identity/user_id mismatches between MCP events and web/mobile Amplitude data.

amplitude/builder-skills

Diagnoses product health by cross-referencing Amplitude analytics (dashboards, charts, funnels, feedback, AI agent analytics), optionally Datadog (errors, latency, stack traces), and optionally Slack (qualitative feedback, bug reports, feature requests). Identifies what's broken, what's working, and what to do about it — with root causes, not just symptoms. Use when asked to "diagnose my product", "what's going on", "product health check", "what's broken", "where are users struggling", "give me a product diagnosis", or "what should I focus on".

amplitude/builder-skills

Turn one or more meeting transcripts, notes, or Slack threads into concise takeaways and clear action items with DRIs. Works with a single meeting or a batch from the whole week.

amplitude/builder-skills

Summarizes B2B account health by analyzing usage patterns, engagement trends, risk signals, and expansion opportunities. Use for customer success reviews, renewal preparation, QBRs, or account prioritization.

Habilidades Relacionadas