discover-analytics-patterns
Skill0 starsChanged 8 months agoMITView on GitHub
Map existing analytics SDK implementations in a codebase to understand naming conventions and instrumentation patterns. Uses mcp__Amplitude__get_event_properties.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- rittmananalytics/wire-plugintheir own version, first seen Jun 10, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- rittmananalytics/wire-plugin★ 9same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository190 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- accessibility-auditSkill
- accessibility-complianceSkill
- ado-api-cliSkill
- ado-artifactsSkill
- ado-container-deploymentsSkill
- ado-organizationSkill
- ado-pipeline-designSkill
- ado-pipeline-optimizationSkill
- ado-pipeline-securitySkill
- ado-pipelines-opsSkill
- ado-release-managementSkill
- ado-security-policiesSkill
- ado-work-trackingSkill
- adr-writingSkill
- agentic-ai-patternsSkill
- agentic-evalSkill
- agentic-memorySkill
- agentic-reliabilitySkill
- agentic-securitySkill
- ai-data-moatSkill
- ai-harnessSkill
- ai-product-designSkill
- ai-product-monetizationSkill
- ai-product-positioningSkill
- ai-product-retentionSkill
- ai-product-validationSkill
- ai-safety-guardrailsSkill
- add-analytics-instrumentationSkill
- analyze-account-healthSkill
- analyze-ai-topicsSkill
- analyze-chartSkill
- analyze-dashboardSkill
- analyze-experimentSkill
- analyze-feedbackSkill
- compare-user-journeysSkill
- create-chartSkill
- create-dashboardSkill
- daily-briefSkill
- debug-replaySkill
- diagnose-errorsSkill
- diff-intakeSkill
- discover-event-surfacesSkill
- discover-opportunitiesSkill
- instrument-eventsSkill
- investigate-ai-sessionSkill
- monitor-ai-qualitySkill
- monitor-reliabilitySkill
- replay-ux-auditSkill
- review-agent-insightsSkill
- taxonomySkill
- weekly-briefSkill
- what-would-lenny-doSkill
- analytics-reportingSkill
- api-contract-testingSkill
- api-designSkill
- authentication-patternsSkill
- blockchain-auditSkill
- brainstormingSkill
- brand-voiceSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 8 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Before adding new analytics instrumentation to an unfamiliar codebase
- Distinctive: line 11
When onboarding to a project that has existing analytics — understand what's there before adding more
- Very specific: line 12
When instrument-events needs to know the project's SDK style and naming convention
- Distinctive: line 13
When auditing whether analytics calls are consistent across the codebase
- Distinctive: line 14
When migrating from one analytics SDK to another (need to catalog current state)
- Distinctive: line 15
When a new engineer asks "how do we send analytics events here?"
- Distinctive: line 43
Search for every place analytics events are sent:
- Distinctive: line 87
Document any caveats: some properties use camelCase even when event names use snake_case (common in mixed teams).
- Distinctive: line 118
Document the wrapper API so new instrumentation uses the same pattern, not the raw SDK.
- Very specific: line 187
After output, state: "Pattern documented.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Discover Analytics Patterns
When to Use
- Before adding new analytics instrumentation to an unfamiliar codebase
- When onboarding to a project that has existing analytics — understand what's there before adding more
- When
instrument-eventsneeds to know the project's SDK style and naming convention - When auditing whether analytics calls are consistent across the codebase
- When migrating from one analytics SDK to another (need to catalog current state)
- When a new engineer asks "how do we send analytics events here?"
Core Jobs
1. Search for Analytics SDK Imports and Initialization
Scan the codebase for analytics SDK usage:
Common SDKs to look for:
- Amplitude:
@amplitude/analytics-browser,amplitude-js,@amplitude/node - Mixpanel:
mixpanel-browser,mixpanel - Segment:
@segment/analytics-next,analytics.js - PostHog:
posthog-js - Custom wrappers: look for files named
analytics.ts,tracking.ts,events.ts,telemetry.ts
Search patterns:
import.*amplitude
import.*mixpanel
import.*segment
import.*analytics
require.*analyticsFind the initialization file: where is init() or load() called? What API key pattern is used? What default properties are set at init time?
2. Find All Track / LogEvent / Identify Calls
Search for every place analytics events are sent:
Amplitude patterns:
amplitude.track('event_name', { prop: value })
amplitude.logEvent('event_name', { prop: value })
client.track({ event_type: 'event_name', event_properties: {} })Generic patterns:
analytics.track('event_name', properties)
trackEvent('event_name', properties)
logEvent('event_name', properties)
sendEvent('event_name', properties)Collect: file path, line number, event name, properties passed. Build a full inventory.
3. Extract Event Names and Property Patterns
From the collected tracking calls, catalog:
Event names:
- List all unique event names found
- Identify the naming convention:
camelCase,snake_case,Title Case,kebab-case, or mixed - Flag inconsistencies: events that don't follow the dominant pattern
Property patterns:
- What properties appear most frequently? (These are likely "super properties" or universal context)
- What properties are event-specific?
- Are properties passed as inline objects or imported from a separate constants file?
- Are there TypeScript interfaces or types defined for event properties?
4. Identify Naming Convention
Determine the single authoritative naming convention:
Dominant pattern: snake_case (found in 47/52 events)
Exceptions: 5 events use camelCase (legacy, pre-2024)
Recommendation: use snake_case for all new eventsDocument any caveats: some properties use camelCase even when event names use snake_case (common in mixed teams).
5. Map Universal vs. Event-Specific Properties
Universal properties (appear in >80% of events) — likely set via super properties or middleware:
// These are probably set once at init or login:
{
user_id: string,
platform: 'web' | 'ios' | 'android',
app_version: string,
environment: 'production' | 'staging'
}Event-specific properties — only relevant for particular events. Catalog by category:
- Page events:
page_name,referrer_url,page_section - Action events:
button_label,element_id,interaction_type - Commerce events:
item_id,price,currency,quantity
6. Identify Helper Functions or Wrappers
Most codebases wrap the raw SDK. Find:
- Analytics service class or singleton
- Event constants file (exported event name strings)
- Property builder utilities
- Type-safe wrappers with TypeScript interfaces
Document the wrapper API so new instrumentation uses the same pattern, not the raw SDK.
Example finding:
// src/analytics/index.ts — use this, not amplitude directly
import { track } from '@/analytics';
track('checkout_completed', { order_id, total });7. Document the Pattern for Use in instrument-events
Produce an instrumentation guide:
instrumentation_guide:
sdk: "Amplitude Browser SDK v2"
entry_point: "src/analytics/index.ts"
naming_convention: snake_case
event_constants_file: "src/analytics/events.ts"
universal_properties:
set_at_init: [user_id, platform, app_version]
set_at_login: [user_plan, user_role, account_id]
example_call: |
import { track } from '@/analytics';
import { Events } from '@/analytics/events';
track(Events.CHECKOUT_COMPLETED, {
order_id: order.id,
total: order.totalAmount,
payment_method: order.paymentMethod,
});
type_definitions_file: "src/analytics/types.ts"
naming_inconsistencies:
- "legacy_click_event uses camelCase — do not follow this pattern"MCP Tools
mcp__Amplitude__get_event_properties— cross-reference discovered event names with Amplitude's recorded schema to verify events are actually reaching Amplitude and what properties Amplitude has recorded
Key Concepts
- SDK entry point: The file where analytics is initialized — often wraps the raw SDK with project-specific config
- Super properties: Properties set once (at init or login) that are automatically included in every event
- Event constants: A file or object exporting all event name strings — prevents typos and enables type-safety
- Naming convention: The canonical pattern for event names in this codebase — new instrumentation must match it
- Wrapper pattern: A custom function/class around the raw SDK — almost always exists in mature codebases; always prefer it over raw SDK calls
Output Format
A YAML instrumentation guide with:
instrumentation_guide:
sdk: <SDK name and version>
entry_point: <file path to analytics module>
naming_convention: <snake_case|camelCase|Title Case>
event_constants_file: <file path or null>
universal_properties: {set_at_init: [...], set_at_login: [...]}
example_call: <code snippet showing correct usage>
type_definitions_file: <file path or null>
naming_inconsistencies: <list of exceptions to document>
total_events_found: <count>After output, state: "Pattern documented. This guide is the style reference for instrument-events."
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

