discover-analytics-patterns
БесплатноБез исполняемых скриптовНе проверенDiscovers how analytics tracking calls are actually written in this codebase — the concrete SDK calls, function signatures, and import patterns used to send…
от amplitude★ 50 звёзд на GitHubОб этом скилле
discover-analytics-patterns
Your goal is to find out how this codebase sends analytics events — not which events exist, but the specific code patterns engineers use to fire a tracking call. This output helps engineers add new events that look consistent with the rest of the codebase. It should also tell downstream skills how event names and property names are typically written in code here.
When determining naming conventions in this skill, use the following sources in strict order of preference:
- Customer directives in
.amplitude/instrumentation-agent-context.md(and any files it references), if present — explicit conventions the customer wants followed, so they override everything below. - Events and properties observed from the Amplitude MCP server
- Real tracking call sites in the codebase
- The
taxonomyskill at../taxonomy/SKILL.md
Step 0: Read repo instrumentation context
Before anything else, check for .amplitude/instrumentation-agent-context.md
(repo root, or the subdirectory you're instrumenting). If it exists, read it and
any repo-relative files it references. Any naming conventions, property
standards, or SDK/wrapper patterns it states are customer directives — they
take precedence over everything you infer below; record them and skip inference
for whatever they cover. If it's absent, just continue — the instrument-events
skill owns prompting the user to add one.
Step 1: Find tracking calls
Use two approaches based on what's available.
If the Amplitude MCP is connected
Inspect the connected catalog and use its current taxonomy reader to fetch a
sample of event names from the project. Follow only the reader's advertised
schema. When it supports caller attribution, identify this skill with the
name from its YAML frontmatter. Use those results to choose a few
representative non-system product events, then use its
event-property read capability to inspect real property names. This is your
primary naming reference.
Do not infer naming conventions from bracket-prefixed Amplitude system names
such as [Amplitude], [Guides-Surveys], [Assistant], [Experiment] for either events or properties. Exclude those from
pattern detection. If the MCP sample is dominated by Amplitude system names or otherwise does not provide enough evidence, fall back to codebase
inference for naming.
Then search the codebase for the sampled non-system event names using Grep to locate the actual tracking call sites.
If the Amplitude MCP is not available (fallback)
Search the codebase for these signals using Grep. Cast a wide net — you can narrow down after:
| What to search for | Why |
|---|---|
\.track\( |
Generic .track() method calls |
ampli\. |
Ampli typed SDK calls (e.g. ampli.myEvent(...)) |
amplitude\.track|amplitude\.logEvent |
Direct Amplitude SDK calls |
sendEvent |
Custom wrapper method names |
from.*amplitude|import.*amplitude|require.*amplitude |
Import statements |
https://api2\.amplitude\.com/2/httpapi |
HTTP API calls |
Also actively look for custom analytics wrappers — a codebase often wraps the
raw SDK in a utility like trackEvent(), track(), or a React hook like
useAnalytics() or useTracking(). Search for these by looking for functions
that call into Amplitude internally. Treat each wrapper as its own pattern,
separate from the underlying SDK call, even if it ultimately calls
amplitude.track() underneath. Engineers who encounter the wrapper will use
it, not the raw SDK — so it's the more important pattern to document.
To find wrappers: search for files that import the Amplitude SDK, then check whether any of those files export a function or hook that other parts of the codebase import and use for tracking.
Exclude test files (.test., .spec., __tests__) and mock files unless they
are the only place a pattern appears.
Step 2: Group by pattern
Two call sites use the same pattern if they share the same:
- Library/SDK/function being called
- Method name
- Argument structure (even if the event name or properties differ)
For example, these are the same pattern:
amplitude.track('Page Viewed', { page: '/home' })
amplitude.track('Button Clicked', { label: 'signup' })
But these are different patterns — always keep them separate:
amplitude.track('Page Viewed', { page: '/home' }) // direct SDK — one pattern
ampli.pageViewed({ page: '/home' }) // Ampli typed method — dif
Установить discover-analytics-patterns в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл discover-analytics-patterns?
Discovers how analytics tracking calls are actually written in this codebase — the concrete SDK calls, function signatures, and import patterns used to send events. Use this skill whenever you need to understand the existing analytics instrumentation patterns before adding new tracking, when someone asks "how do we track events here?", "show me the analytics setup", "what's the analytics pattern in this codebase?", or any time the instrument-events or discover-event-surfaces skills are about to run and you need to know the correct coding style to follow. Outputs a deduplicated list of patterns with generalized examples and the file paths where each pattern appears, plus the dominant event and property naming conventions inferred from those call sites. Always use this skill before writing any analytics instrumentation code.
Как установить скилл discover-analytics-patterns?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл discover-analytics-patterns запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic