Add Analytics Instrumentation Skill
- Installs
- 72.7k
- Repo stars
- 49
- Security scans passed
- 3/3
- Repo updated
- Nov 25, 2026
TL;DR
add-analytics-instrumentation is a skill that takes a PR, branch, file, or feature and returns an analytics tracking plan with exact file locations, tracking code, and event properties.
Install if
Developers who ship a PR or feature and need to know which events to track and where, without designing the plan by hand.
Skip if
Skip it for style, docs, or chore changes that need no tracking, or when you only want to write tracking code for a known event list.
npx skills add https://github.com/amplitude/mcp-marketplace --skill add-analytics-instrumentationTry it first through the Skillselion MCP - nothing to install, nothing on disk.
1. Add the remote connector:
claude mcp add --transport http skillselion https://mcp.skillselion.com/mcp2. Ask your agent:
Use Skillselion load_skill to load skill:amplitude/mcp-marketplace#add-analytics-instrumentation (Add Analytics Instrumentation) and follow it.Try it first through the Skillselion MCP - nothing to install, nothing on disk.
1. Add this URL as a custom connector (Claude.ai, ChatGPT or Cursor):
https://mcp.skillselion.com/mcp2. Ask your agent:
Use Skillselion load_skill to load skill:amplitude/mcp-marketplace#add-analytics-instrumentation (Add Analytics Instrumentation) and follow it.On this page
- What add-analytics-instrumentation covers
- add-analytics-instrumentation by the numbers
- What does the Add Analytics Instrumentation skill produce?
- What files ship with add-analytics-instrumentation?
- Which skills are related to add-analytics-instrumentation?
- Add Analytics Instrumentation skill FAQ
- More in this repo
What add-analytics-instrumentation covers
- Accepts a PR, branch, file or directory, or a plain feature description
- Chains diff-intake, discover-event-surfaces and instrument-events in one run
- Outputs a trackingPlan with file, function, tracking code and properties
- Stops with a clear error if the PR, branch or files cannot be read
add-analytics-instrumentation by the numbers
| All-time installs | 72,677 (72.7k) | skills.sh registry |
|---|---|---|
| Repo stars | ★ 49 | GitHub |
| Security audit | 3 / 3 scanners passed | skills.sh audit |
| Repo last updated | November 25, 2026 | GitHub |
| Repository | amplitude/mcp-marketplace ↗ | |
Data as of Nov 29, 2026 (Skillselion catalog sync)
- 4 input types: PR, branch, file or directory, feature
- 3-step pipeline from change brief to tracking plan
What add-analytics-instrumentation says it does
You are the orchestrator for the analytics instrumentation pipeline.
Invoke the `diff-intake` skill with the user's PR or branch reference.
If any step fails (e.g., the PR doesn't exist, git commands error, no files to
What does the Add Analytics Instrumentation skill produce?
You get a trackingPlan listing each critical event with its file, function, tracking code, properties, and target Amplitude project.
- A change_brief YAML block
- An event_candidates YAML block
- A trackingPlan JSON for each critical event
What files ship with add-analytics-instrumentation?
add-analytics-instrumentation
You are the orchestrator for the analytics instrumentation pipeline. Your job is to figure out what the user wants to instrument, gather the relevant code, and run the pipeline to produce a tracking plan.
Pipeline
Step 0: Capture intent
Before running anything, determine what the user wants to instrument. There are four input types — infer the type from what the user has already provided in the conversation. Only ask if it's genuinely ambiguous.
| Input type | How to recognize it | Example |
|---|---|---|
| PR | A PR URL, PR number, or phrases like "this PR", "my PR" | instrument PR #42, https://github.com/org/repo/pull/42 |
| Branch | A branch name or "this branch", "my branch", "current branch" | instrument feature/checkout, add tracking to this branch |
| File / Directory | A file path, directory path, or glob pattern | instrument src/components/Checkout.tsx, add analytics to src/payments/ |
| Feature | A natural-language description of functionality, not a specific code reference | instrument the onboarding flow, add tracking to the checkout experience |
Inference rules:
- If the user provided a URL or
#number→ PR - If the user provided something that looks like a branch name (contains
/, no file extension, matches a git branch) → Branch - If the user provided a path that exists on disk (file or directory) → File / Directory
- If none of the above match and the input is descriptive → Feature
- If the conversation already contains a PR link, branch name, or file path from earlier messages, use that instead of asking again
If ambiguous, ask the user:
What would you like to instrument? 1. A specific file or directory 2. A PR 3. A branch 4. A feature (describe it and I'll find the relevant code)
Once you know the input type, proceed to the appropriate step:
- PR or Branch → go to Step 1 (diff-intake)
- File / Directory → go to Step 1a (direct file read)
- Feature → go to Step 1b (feature search)
Step 1: diff-intake skill (PR or Branch)
Invoke the diff-intake skill with the user's PR or branch reference.
It produces a change_brief YAML block.
Capture the full YAML output — step 2 consumes it verbatim. Skip to Step 2.
Step 1a: Direct file read (File / Directory)
Skip diff-intake entirely — there's no diff to analyze. Instead, build the change_brief YAML yourself by reading the files directly.
- Resolve the input. If a directory, find all source files in it (skip tests, config, lock files, generated code). If a single file, just use that.
- Read each file and summarize what it does — focus on user-facing behavior, not implementation details.
- Scan for existing instrumentation using the same patterns as diff-intake:
track(,trackEvent(,logEvent(,amplitude.track(,ampli., and analytics-related imports. - Build the
change_briefYAML withanalytics_scope: high(the user explicitly asked to instrument these files, so assume they want tracking). Setprimary: featandclassification.types: [feat]. Populatefile_summary_mapwith each file's summary, layer, and existing instrumentation.
Proceed to Step 2 with the YAML you built.
Step 1b: Feature search (Feature)
The user described a feature in natural language. Your job is to find the relevant code, then build a change_brief.
- Search git commit history to find related commits. Use
git log --all --grep="<patterns>". This will find relevant commits. Then read the git commit body to understand the feature and relevant files. If the results are good, then proceed to generating thechange_briefYAML - Search the codebase for files related to the described feature. Use a combination of:
- Grep for keywords from the feature description (component names, route paths, function names, domain terms)
- Glob for likely file paths (e.g.,
**/checkout/**,**/onboarding/**) - Read route definitions, navigation configs, or index files to find entry points
- Build the
change_briefYAML.
Proceed to Step 2 with the YAML you built.
Step 2: discover-event-surfaces
Invoke the discover-event-surfaces skill, passing the change_brief YAML from step 1.
It produces an event_candidates YAML block. If there are zero candidates, stop and tell the user the change has user-facing impact but no events worth instrumenting were identified.
If event_candidates is empty, stop here and tell the user there's nothing to instrument.
Capture the full YAML output — step 3 consumes it.
Step 3: instrument-events
Invoke the instrument-events skill, passing the event_candidates YAML from step 2.
It produces a trackingPlan JSON with exact file locations, tracking code, and property definitions for every critical (priority 3) event.
Presenting the result
After step 3 completes, present the tracking plan to the user. Walk through each event briefly:
- What it tracks and why it matters
- Which Amplitude project(s) it routes to (
appId/appIds) — call this out when the repo has an.amplitude/instrumentation-agent.yamland events span more than one project - Where the tracking call goes (file + function)
- What properties it sends
Then ask if they want to adjust anything or proceed to implementation.
Error handling
If any step fails (e.g., the PR doesn't exist, git commands error, no files to analyze), surface the error clearly and stop. Don't try to continue with incomplete data.
Which skills are related to add-analytics-instrumentation?
Add Analytics Instrumentation skill FAQ
Who is the Add Analytics Instrumentation skill for?
Developers who ship a PR or feature and need to know which events to track and where, without designing the plan by hand. Skip it for style, docs, or chore changes that need no tracking, or when you only want to write tracking code for a known event list.
When should I use add-analytics-instrumentation?
A user asks to instrument a PR, add tracking to a branch, or says what analytics a file or feature needs.
What inputs does add-analytics-instrumentation accept?
It accepts a PR link or number, a branch name, a file or directory path, or a plain description of a feature. It infers the type and only asks when the input is unclear.
What steps does it run?
It builds a change brief with diff-intake, finds event candidates with discover-event-surfaces, then runs instrument-events to write the trackingPlan JSON.
What happens if a step fails?
It shows the error and stops. It does not continue with incomplete data, for example when the PR does not exist or git commands fail.
Is Add Analytics Instrumentation safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.
Add a add-analytics-instrumentation badge
Show developers this skill is listed on Skillselion. Paste this into your README.