End-to-end instrumentation workflow orchestrating diff-intake → discover-event-surfaces → instrument-events. Uses mcp__Amplitude__get_event_properties, mcp__Amplitude__get_project_context.
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