What is the Add Analytics Instrumentation skill?
Add Analytics Instrumentation is a data analysis skill by amplitude for Claude Code, Cursor, Codex and other AI coding agents. End-to-end analytics instrumentation workflow for a PR, branch, file, directory, or feature. Reads the code, discovers what events should be tracked, and produces a concrete instrumentation plan — all in one shot.
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.
What the SKILL.md covers
- Pipeline
- Step 0: Capture intent
- Step 1: diff-intake skill (PR or Branch)
- Step 1a: Direct file read (File / Directory)
- Step 1b: Feature search (Feature)
- Step 2: discover-event-surfaces
- Step 3: instrument-events
- Presenting the result
- Error handling
- Author
- amplitude
- Pack
- amplitude/mcp-marketplace (30 skills)
- Category
- Data analysis, #187 of 229
- Alyn Score
- 55 / 99
- Files
- 1
- License
- MIT
- Last updated
- 5 days ago
- Works with
- Claude Code, Claude, Cursor, Codex, Gemini CLI, Copilot
Add Analytics Instrumentation compared to similar skills
| Skill | Alyn Score | GitHub stars | Updated |
|---|---|---|---|
| Add Analytics Instrumentation · amplitude | 55 | 48 | 5 days ago |
| Analytics · Corey Haines | 90 | 62k | 2 days ago |
| Workflow · zhinkgit | 48 | 812 | 8 days ago |
| Create Plan · foryourhealth111-pixel | 64 | 3.8k | 17 days ago |
Install Add Analytics Instrumentation
Pick your agent. Every command is ready to paste.
npx alyn-cli add add-analytics-instrumentationDetects your agents (Claude Code, Cursor, Codex and 70+ more) and installs to the right folder. Add -g to install globally.
npx skills add amplitude/mcp-marketplace --skill add-analytics-instrumentationOr use the open skills CLI directly.
01
Install it
Run the command above, or upload the folder in Claude.
02
Ask naturally
Describe the task. Your agent loads add-analytics-instrumentation when the request matches its description.
03
Name it if needed
If it does not trigger, say “use the add-analytics-instrumentation skill”. In Codex, type $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?
- A specific file or directory
- A PR
- A branch
- 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.
Tips for Add Analytics Instrumentation
- • Start a fresh session after installing so your agent picks up the new skill.
- • It is part of a pack with 30 skills. Install only the ones you need with --skill to keep triggers precise.
- • If two skills overlap, mention the one you want by name.
Questions about Add Analytics Instrumentation
What does the Add Analytics Instrumentation skill do?
End-to-end analytics instrumentation workflow for a PR, branch, file, directory, or feature. Reads the code, discovers what events should be tracked, and produces a concrete instrumentation plan — all in one shot.
How do I install Add Analytics Instrumentation?
Run "npx alyn-cli add add-analytics-instrumentation" in your project. The Alyn CLI installs it for Claude Code, Cursor, Codex and 70+ other agents. In Claude on the web, upload the skill folder as a ZIP under Customize > Skills.
Does Add Analytics Instrumentation work in Cursor and Codex?
Yes. Add Analytics Instrumentation uses the open SKILL.md format, so it works in Claude Code, Claude, Cursor, OpenAI Codex, Gemini CLI, GitHub Copilot and other agents that support agent skills.
What is inside the Add Analytics Instrumentation skill?
The SKILL.md covers Pipeline, Step 0: Capture intent, Step 1: diff-intake skill (PR or Branch), Step 1a: Direct file read (File / Directory), Step 1b: Feature search (Feature), Step 2: discover-event-surfaces.
What is a good alternative to Add Analytics Instrumentation?
Analytics by Corey Haines is the highest-ranked similar skill from another creator, with an Alyn Score of 90 compared to 55 for Add Analytics Instrumentation.
Is Add Analytics Instrumentation free?
Add Analytics Instrumentation is open source on GitHub under the MIT license. It is free to install; check the license before commercial use.
Who made Add Analytics Instrumentation?
Add Analytics Instrumentation is published by amplitude in the amplitude/mcp-marketplace repository, together with 29 other skills.

