К основному содержанию
скилл CX Codex

measure-instrumentation-spec — скилл для Claude Code: спека аналитики

Скилл описывает, какие события аналитики трекать, когда они срабатывают и какие свойства несут. Пригодится до старта разработки фичи.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add product-on-purpose/pm-skills --skill measure-instrumentation-spec -a claude-code
Открыть на GitHub

Что делает measure-instrumentation-spec

Скилл ведёт агента по шагам: сначала формулируются вопросы, на которые должны ответить данные, потом список событий, триггеры, свойства с типами и примерами, пользовательские атрибуты и раздел про PII. На выходе — документ по шаблону из references/TEMPLATE.md с разделами Overview, Event Inventory, User Properties, PII & Privacy Considerations, Implementation Notes и Testing Checklist. Готовый пример лежит в references/EXAMPLE.md.

Отдельный блок касается трейсов. Если фича сохраняет вход или выход модели, контекст поиска либо вызов инструмента, скилл требует назвать классы данных, решить, что вырезается до отправки и что до записи в хранилище, кто читает трейсы и логируются ли чтения, сколько они живут и как до них доходит запрос на удаление. Триггер здесь — сам факт захвата, а не то, кто написал текст.

Скилл не подходит, когда нужен дашборд поверх событий — для этого есть measure-dashboard-requirements. Если фича ещё не описана и потоков для инструментирования нет, сначала deliver-prd. Анализ уже собранных данных — тоже другая история.

Какие задачи решает

  • зафиксировать события аналитики до того, как инженеры начнут писать код
  • описать триггеры так, чтобы «клик по кнопке» и «успешная отправка формы» не слились в одно событие
  • добавить к событиям типы свойств и примеры значений
  • отметить свойства с персональными данными и решить, как с ними обращаться
  • проверить существующий трекинг на дыры и расхождения в названиях

Примеры запросов агенту

  • Составь instrumentation spec для новой фичи оплаты: события, триггеры, свойства
  • Проверь текущий трекинг онбординга и покажи, каких событий не хватает
  • Опиши, какие классы данных попадают в трейсы и что вырезается до записи

Как установить measure-instrumentation-spec

1Через Skills CLI (Vercel)

npx skills add product-on-purpose/pm-skills --skill measure-instrumentation-spec -a claude-code

2Вручную: положить файлы

~/.claude/skills/measure-instrumentation-spec/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/measure-instrumentation-spec/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о measure-instrumentation-spec

Как установить measure-instrumentation-spec в Claude?

Выполните npx skills add product-on-purpose/pm-skills --skill measure-instrumentation-spec -a claude-code. Файл скилла появится по пути ~/.claude/skills/measure-instrumentation-spec/SKILL.md.

Что делает measure-instrumentation-spec?

Помогает агенту собрать спеку инструментирования: цели аналитики, инвентарь событий, триггеры, свойства, пользовательские атрибуты, раздел про PII и чек-лист для QA.

Чем он отличается от measure-dashboard-requirements?

Этот скилл описывает сами события и их свойства. Дашборд, который строится поверх этих событий, задаётся отдельным скиллом measure-dashboard-requirements.

Исходный текст

SKILL.md · Apache-2.0
---
name: measure-instrumentation-spec
description: Specifies what analytics events to track, when they fire, and what properties to include, as a contract between product and engineering that prevents undertracked features. Use before engineering builds a feature or when auditing existing tracking for gaps. For the dashboard built on top of these events, use measure-dashboard-requirements instead.
license: Apache-2.0
metadata:
  phase: measure
  version: "3.0.0"
  updated: 2026-08-21
  category: validation
  frameworks: [triple-diamond, lean-startup, design-thinking]
  author: product-on-purpose
---
<!-- PM-Skills | https://github.com/product-on-purpose/pm-skills | Apache 2.0 -->
# Instrumentation Spec

An instrumentation spec defines what analytics events to track, when to fire them, and what properties to include. It serves as a contract between product and engineering, ensuring consistent data collection that enables accurate measurement. Good instrumentation specs prevent the "we can't answer that question because we didn't track it" problem.

## When to Use

- Before engineering implements a new feature
- When defining analytics requirements for experiments
- When auditing existing tracking for gaps or inconsistencies
- When onboarding a new analytics tool
- Before launch to ensure measurement is in place

## When NOT to Use

- You are specifying the dashboard built on top of the events -> use `measure-dashboard-requirements`
- You need experiment-specific metrics and variants, not product-wide tracking -> use `measure-experiment-design`
- The feature itself is not yet specified (no flows to instrument) -> use `deliver-prd` first
- You are analyzing data you already collect -> use `measure-experiment-results` or `measure-survey-analysis`

## Instructions

When asked to create an instrumentation spec, follow these steps:

1. **Define Analytics Goals**
   Start with the questions you need to answer. What will you measure? What decisions will this data inform? This prevents over-instrumentation while ensuring nothing important is missed.

2. **Identify Events to Track**
   List each user action or system event that should be tracked. Follow consistent naming conventions (typically `noun_verb` or `verb_noun` in snake_case). Each event should represent a distinct, meaningful action.

3. **Specify Event Triggers**
   For each event, describe exactly when it fires. Be precise: "When user clicks Submit button" vs. "When form is submitted successfully." These are different events with different meanings.

4. **Define Event Properties**
   List the properties (attributes) attached to each event. Include property name, data type, description, and example values. Properties provide context that makes events useful.

5. **Document User Properties**
   Identify persistent user-level attributes that should be associated with all events (e.g., subscription tier, account creation date). These enable segmentation in analysis.

6. **Address PII and Privacy**
   Flag any properties that contain personally identifiable information. Document how PII should be handled - hashing, encryption, or exclusion.

   *When any model input, output, retrieval context, or tool call is captured*, extend this section to cover the trace as well. The trigger is capture, not authorship: it fires whether the sensitive text was typed by a user, retrieved from a tenant's documents, carried in a system prompt, passed to or returned from a tool, read out of an uploaded file or a batch job, or generated by the model itself. A feature with no direct user input can still write a customer's contract text into a trace store.

   A trace is not an event: an event carries properties you chose in advance, while a trace carries free text that can contain anything, including data no property schema anticipated. Decide and record:

   - **Data classes captured.** Name them (user text, retrieved documents, system prompt, tool arguments and results, file contents, model output). "The trace" is not an answer.
   - **Minimization, at both boundaries.** What is dropped or redacted *before the trace leaves the process*, and separately what is dropped *before it is stored*. A redactor that runs only at the storage layer has already sent the raw text over the wire.
   - **Access.** Who can read traces, and whether reads are logged. Trace stores are routinely the least-governed copy of the most sensitive data a feature handles.
   - **Retention and deletion.** How long, what deletes them, and how a deletion request reaches a trace that was copied into an evaluation set.
   - **Consent and opt-out.** Whether the subject agreed, and what the feature does when they decline.
   - **Sampling.** What fraction is captured and how that sample is chosen. A uniform sample is the wrong instrument for finding rare failures; if traces exist to diagnose bad output, oversample the flagged cases and say so.

7. **Create Testing Checklist**
   Define how QA should verify that tracking is implemented correctly. Include steps to validate events fire at the right times with correct properties.

## Output Format

Use the template in `references/TEMPLATE.md` to structure the output. A complete spec fills every template section: Overview; Event Inventory; User Properties; PII & Privacy Considerations; Implementation Notes; and Testing Checklist.

## Quality Checklist

Before finalizing, verify:

- [ ] Event names follow consistent naming convention
- [ ] Each event has a clear, unambiguous trigger
- [ ] Properties include data types and example values
- [ ] PII is identified and handling is documented
- [ ] Events map to the analytics questions you need to answer
- [ ] Testing checklist enables QA verification
- [ ] If any model input, output, retrieval context, or tool call is captured: the data classes are named, minimization is decided at both the egress and the storage boundary, access and read-logging, retention and deletion, consent, and sampling are all decided, not deferred

## Examples

See `references/EXAMPLE.md` for a completed example.

© product-on-purpose · Apache-2.0 · product-on-purpose/pm-skills

Похожие скиллы

Все скиллы по теме «Данные и базы» →
discover-analytics-patterns amplitude Скилл находит реальные шаблоны аналитики в кодовой базе: вызовы SDK, обёртки, импорты и правила имён. Нужен перед добавлением новых событий. CX Codex +1 42 800установок instrument-events amplitude Превращает YAML с кандидатами в события в план инструментирования: где именно в коде поставить вызовы трекинга и какие свойства передавать. CX Codex +1 42 800установок arize-instrumentation arize Скилл подключает трассировку Arize AX к LLM-приложению: определяет стек, ставит автоинструментацию и проверяет, что трейсы доходят. CX Codex +1 3 400установок instrument-product-analytics PostHog Добавляет в код вызовы PostHog, чтобы отслеживать действия пользователей. Пригодится после новой фичи или разбора пул-реквеста. CX Codex +1 666установок metrics-dashboard phuryn Скилл помогает спроектировать дашборд метрик продукта с North Star Metric, input-метриками, health-метриками и бизнес-метриками. Нужен, когда вы определяете KPI, настраиваете product analytics или строите план мониторинга данных. CX Codex +1 3 000установок metrics-review официальный anthropics Разбирает продуктовые метрики, строит иерархию от North Star до L1 и оформляет отчёт со скоркартом и списком действий. CX Codex +1 2 900установок

Из того же набора68

measure-experiment-design Собирает документ с параметрами эксперимента: варианты, метрики, размер выборки и срок. Нужен, когда гипотеза уже сформулирована, а тест ещё не запущен. CX Codex +1 754установок deliver-release-notes Превращает список изменений в релиз-ноты, которые читают пользователи: что нового, что улучшили, что починили. CX Codex +1 751установок foundation-persona Собирает персону покупателя или пользователя по шаблону v2.5: с метками уверенности, списком допущений и открытыми вопросами. Пригодится перед PRD, запуском и спорами о приоритетах. CX Codex +1 745установок develop-design-rationale Скилл помогает оформить обоснование UX-решений, разобрать альтернативы и зафиксировать компромиссы. Пригодится перед защитой дизайна перед стейкхолдерами. CX Codex +1 744установок measure-experiment-results Оформляет результаты завершённого эксперимента или A/B-теста: статистика, выводы по сегментам и рекомендация ship, iterate или kill. CX Codex +1 742установок iterate-retrospective Скилл помогает провести командную ретроспективу, разобрать успехи и сбои спринта, а затем зафиксировать задачи с дедлайнами и ответственными. CX Codex +1 741установок utility-mermaid-diagrams Помогает создавать корректные диаграммы Mermaid для PRD и технических спецификаций, подбирая подходящий тип из 15 вариантов и проверяя синтаксис. CX Codex +1 736установок discover-stakeholder-summary Скилл собирает карту людей и групп, которые влияют на проект: их интересы, тревоги, рычаги и подход к вовлечению. CX Codex +1 734установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой