skills/amplitude/add-analytics-instrumentation/SKILL.md
End-to-end instrumentation workflow orchestrating diff-intake → discover-event-surfaces → instrument-events. Uses mcp__Amplitude__get_event_properties, mcp__Amplitude__get_project_context.
npx skillsauth add kienbui1995/magic-powers add-analytics-instrumentationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Ask (or infer from context) what the user has provided:
| Input Type | How to Detect | Ingestion Path |
|-----------|--------------|----------------|
| PR URL | github.com/.../pull/NNN | Fetch diff via GitHub API |
| Branch name | feat/, fix/, etc. | Run git diff main...branch |
| File or directory | /src/... path | Read files directly |
| Feature description | Free text | Search codebase for relevant files |
Confirm: "I'll instrument the [checkout flow / PR #234 / feat/new-onboarding] — is that right?"
For PR or branch input:
diff-intake skill logic to produce the structured YAML briefnew_surfaces, removed_surfaces, changed_behaviorsFor file/directory input:
For feature description input:
Validation: Confirm the brief captures what the user expected. Show a 3-bullet summary:
Pass the YAML brief to the discover-event-surfaces skill logic:
Show results grouped by priority:
CRITICAL (funnel steps — must track):
- checkout_confirmation_viewed
- order_placed
HIGH (key engagement — should track):
- shipping_address_submitted
- promo_code_applied
MEDIUM (informational — nice to have):
- order_details_expanded
Ask: "Does this list look complete? Are there events you'd add or remove before I write the specs?"
For each approved event candidate, invoke instrument-events logic to produce the full spec:
For each event, present:
Format as sequential steps an engineer can follow:
## Event 1: checkout_confirmation_viewed
WHY: Measures how many users successfully reach order confirmation
(critical for purchase funnel conversion rate).
WHERE: src/pages/checkout/ConfirmationPage.tsx — in useEffect after order loads
WHAT TO ADD:
useEffect(() => {
if (!order?.id) return;
track(Events.CHECKOUT_CONFIRMATION_VIEWED, {
order_id: order.id,
order_total: order.totalAmount,
payment_method: order.paymentMethod,
items_count: order.items.length,
});
}, [order]);
PROPERTIES:
order_id (string, required): "ord_abc123"
order_total (number, required, USD): 49.99
payment_method (string, required): credit_card | paypal | apple_pay
items_count (number, required): 3
After presenting all event specs:
Also offer: "Would you like me to add these events to your Amplitude tracking plan taxonomy?"
mcp__Amplitude__get_event_properties — check existing events before proposing new ones; match property naming to existing schemamcp__Amplitude__get_project_context — confirm the Amplitude project and get project ID for any schema lookupsThree-phase output:
Phase 1 — Brief Summary (after diff-intake):
Found N changes across X files.
New surfaces: <list>
Changed behaviors: <list>
Estimated events needed: N
Phase 2 — Event Candidate Review (after discover-event-surfaces):
Grouped by priority (CRITICAL / HIGH / MEDIUM / LOW)
Await user confirmation before proceeding
Phase 3 — Implementation Specs (after instrument-events):
One section per event with: WHY / WHERE / WHAT TO ADD / PROPERTIES
Followed by: offer to implement or export
content-media
Use when designing for XR (AR/VR/MR), choosing interaction modes, or adapting 2D UI patterns for spatial computing
testing
Use when creating new skills, editing existing skills, or verifying skills work before deployment
development
Use when you have a spec or requirements for a multi-step task, before touching code
development
Use when executing a structured workflow — select and run a feature, bugfix, refactor, research, or incident template with correct agent and model assignments per phase.