Metrics Instrumentation 标志

Metrics Instrumentation

社区
nemanli
metrics-instrumentation

Designs the tracking plan that captures the events behind a UX metric — event names, properties, naming conventions, taxonomy, PII rules, tool-agnostic schema. Triggers on "tracking plan", "event taxonomy", "what should we log", "event naming convention", "instrumentation", "how do I capture this metric". Skip for picking which metric to track (use metrics-ux), for the broader measurement plan (use metrics-spec), for tool-specific config (the analytics vendor's docs).

概览

发布者nemanli
代码仓库ux-metrics-skills
技能名称metrics-instrumentation
星标数
3
复刻数
0
附带文件
4
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 4 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 nemanli 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Metrics Instrumentation AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/nemanli/ux-metrics-skills/tree/main/skills/metrics-instrumentation
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/nemanli/ux-metrics-skills.git /tmp/ux-metrics-skills
mkdir -p .claude/skills
cp -r /tmp/ux-metrics-skills/skills/metrics-instrumentation .claude/skills/metrics-instrumentation
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Metrics Instrumentation,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Metrics Instrumentation。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Metrics Instrumentation 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Overview

Turns a metric into the events and properties that capture it. Five jobs: (1) name a convention (Object–Action, snake_case vs Title Case, tense, casing) and stick to it, (2) decide what is an event vs a property (the most common source of taxonomy mess), (3) specify required properties every event must carry (user_id, session_id, timestamp, platform, app_version), (4) commit to PII / consent rules that keep the plan compliant and auditable, (5) emit a tracking plan artefact the eng team can implement against.

This skill is tool-agnostic. It uses the Segment CDP spec as a baseline (Segment Spec) and cites Mixpanel/Amplitude/PostHog/Heap conventions where they diverge, but it does not generate vendor-specific configuration. Tool config belongs to the vendor's own documentation.

This skill produces a plan, not code. The eng team implements the plan in their analytics SDK of choice. The plan is the contract between design/PM and eng.

When to Use

Use this skill when a designer, PM, analyst, or eng asks any of the following — phrased differently by seniority but matching the same job-to-be-done:

Designer levelTypical phrasing that should trigger this skill
Junior"How do I track this metric?" / "What events do we need?" / "PM asked for a tracking plan and I don't know where to start"
Middle"We need a tracking plan for the new onboarding flow" / "Eng asked for the event spec" / "What properties should this event have?"
Senior"Our event names are inconsistent and the dashboard is a mess — how do we clean this up?" / "We're migrating from one analytics tool to another, want to redo the taxonomy" / "How do we handle PII in event properties?"
Lead"Set the team's instrumentation standard" / "We have 700+ event names and nobody can find anything; how do we restructure?"

Cross-cutting triggers (any seniority):

  • The user mentions: tracking plan, event spec, taxonomy, event naming, properties, instrumentation, "what to log".
  • The user is starting a new feature/product and wants the events designed up front.
  • The user is auditing an existing analytics setup and wants to find issues.
  • The user is migrating analytics tools and wants the schema to survive the move.
  • The user mentions PII, GDPR, CCPA, consent, or "what we shouldn't log".

Skip this skill when:

  • The user is picking which metric to track → use metrics-ux.
  • The user wants the broader measurement plan around an event → use metrics-spec.
  • The user wants tool-specific configuration (Amplitude project setup, Mixpanel JQL, PostHog filters) → point to the vendor's docs.
  • The user has data and is diagnosing a movement → use metrics-diagnose.
  • The user is presenting results → use metrics-present.

Process

Step 1 — Detect mode

ModeSignalAction
DirectAsks the convention or template directly ("what's the Object–Action naming pattern?", "give me the tracking plan template")Skip questionnaire. Open naming-conventions.md or tracking-plan-template.md.
SpecificHas the feature, the metric, and the audience ("we need to track onboarding completion, mobile + web, going into Amplitude")Skip questionnaire. Walk through Steps 3–7 inline.
VagueWants instrumentation but no specifics ("we need a tracking plan")Run hybrid questionnaire (Step 2).

Step 2 — Hybrid questionnaire (vague mode only)

Same 4 anchors as the other skills (SCOPE, STAGE, AUDIENCE, DATA — see metrics-basics/references/context-questions.md) plus two instrumentation-specific anchors:

  1. PLATFORM — what surfaces need to be instrumented (web, iOS, Android, server, all of the above)
  2. EXISTING TAXONOMY — is there a convention already in use, or is this greenfield?

If EXISTING TAXONOMY is "yes, but inconsistent", flag it: cleaning an existing taxonomy is a different job than designing a new one, and the user should pick a mode (greenfield design vs audit-and-migrate) before continuing.

Maximum 4 questions per session. Follow the "How to ask" section in context-questions.md.

Step 3 — Pick a naming convention

The convention is the single most important decision. Once events are flowing under a convention, changing it is a migration — slow, expensive, and incomplete in practice. Pick one of the two industry-standard conventions and stick to it.

ConventionShapeExampleUsed by
Object–Action, Title Case, past tense<Object> <Past-Tense-Action>Order Completed, Article Viewed, Account CreatedSegment Spec, Mixpanel docs, Amplitude default examples
snake_case, present tense<object>_<action>order_complete, article_view, account_createHeap default, internal tools, log-line conventions

Open naming-conventions.md for the full ruleset, edge cases (what is "Object"? what counts as an "Action"?), and the rewrite table for common mistakes.

Recommendation: Object–Action Title Case past tense (the Segment convention) for product analytics. It scales better as the taxonomy grows, separates events from properties cleanly, and is the dominant convention across major analytics tools. snake_case is fine when the org is already committed to it — what matters is consistency, not the choice itself.

Hard rules that apply regardless of convention:

  • One convention per workspace. Mixing Order Completed and order_complete produces two events that mean the same thing — the dashboard becomes unreadable.
  • No emojis, no spaces in property keys, no leading underscores (reserved by most tools).
  • Names are stable contracts — once an event ships, renaming breaks every downstream dashboard, alert, and warehouse model.

Step 4 — Event vs property

The most common taxonomy bug. The rule:

Events are things users do. Properties describe those things.

RightWrong
Event: Article Viewed. Property: article_category = "news".Event: News Article Viewed. Event: Sports Article Viewed.
Event: Button Clicked. Property: button_id = "primary_cta".Event: Primary CTA Clicked. Event: Secondary CTA Clicked.
Event: Search Submitted. Property: query_length = 12, has_filters = true.Event: Long Search Submitted. Event: Filtered Search Submitted.

Use properties to describe the event. Use events to mark distinct user actions. The test: if the only difference between two events is a label, they should be one event with a property.

Open taxonomy-patterns.md for the three event archetypes (funnel, lifecycle, feature) and how each maps to property design.

When to split. Three exceptions where two events are correct, not one:

  1. The actions involve different mechanisms (different APIs, different validation, different downstream effects). Account Created and Account Deleted are different events even though both are about accounts.
  2. The actions belong to different funnels at the analytics level. Signed Up and Signed In look similar but feed different lifecycle metrics.
  3. The actions need different schemas (different required properties). Video Played and Video Completed both reference a video but Completed needs watch_duration which Played doesn't.

Step 5 — Required properties

Every event carries a baseline of properties so downstream analysis isn't crippled. The Segment Spec lists these as automatic; if your tool doesn't capture them automatically, instrument them.

PropertyPurposeExample
user_idLogged-in user identifier (stable across sessions and devices)"u_8472"
anonymous_idAnonymous identifier for pre-login activity"anon_a1b2c3"
session_idSession identifier (typically refreshes after 30 min inactivity)"s_2026_03_05_18_42"
timestampServer-side ingestion time (ISO 8601, UTC)"2026-03-05T18:42:00Z"
platformweb / ios / android / server"ios"
app_versionApp / web build version"4.12.0"
localeUser's locale (helps with segment analysis)"en-US"

Event-specific properties are added on top. Use enum-style values where possible (status: "success" | "failure" | "timeout") rather than free text — free-text property values become an unbounded mess that breaks aggregation.

Open tracking-plan-template.md for the full template and a filled example.

Step 6 — PII and consent rules

Two failure modes: capturing data you shouldn't, and not handling consent properly. Both have legal exposure (GDPR Articles 5–7, CCPA, similar regimes).

CategoryRuleExample
Never log raw PII in event propertiesEmail addresses, full names, phone numbers, government IDs, full IP addresses, full credit card numbers go in dedicated user-profile fields with proper access controls, not in event properties.Wrong: event: Signup Completed, properties: { email: "x@y.com" }. Right: identify the user once with the email in the user-profile system; events reference user_id.
Never log content the user typedSearch queries, free-text inputs, chat messages, comments. These often contain PII the user didn't realize they were sharing.Wrong: property: query = "my SSN is 123-45-6789". Right: property: query_length = 27, has_results = true.
Hash or truncate identifiers when neededIf a property must carry a sensitive identifier for analysis, hash it (SHA-256) or truncate (e.g. domain only from email).email_domain: "gmail.com" instead of full email.
Honor consentUsers who declined tracking (cookie banner, GDPR consent) must not have events sent. The SDK config or wrapper must enforce this — relying on downstream filtering is risky and often non-compliant.Check: when consent = false, no events fire. Test this in QA.
Document data retentionEach event type should have a stated retention window (e.g. 13 months for product analytics, 6 months for marketing attribution). The plan names the policy; eng/ops implement deletion.Documented in the tracking plan, owned by privacy/legal.

Open pii-rules.md for the full rule set, the GDPR/CCPA-relevant decisions, and a pre-launch privacy review checklist.

When in doubt, don't log it. Adding a property later is easier than removing one that's already in 500 dashboards.

Step 7 — Emit the tracking plan artefact

Use tracking-plan-template.md. The deliverable is a table — one row per event — that eng implements against:

ColumnPurpose
Event nameFinal name per convention (Step 3)
TriggerWhat user action fires this event
PropertiesSchema: name, type, required/optional, allowed values
PII flagWhether any property carries PII risk (sensitive: yes/no, with note)
OwnerWho designed it (usually the PM or designer)
Implemented byEng owner
VersionSchema version (changes when properties added/removed/renamed)
StatusPlanned / In progress / Live / Deprecated

Keep it in markdown or a shared sheet, version-controlled. The tracking plan is the contract between design/PM and eng; treat it like a schema.

Step 8 — Verify

End every plan with: "Does this fit your setup, or should we adjust before instrumentation starts?"

If the tracking plan is feeding into a metrics-spec, confirm the spec's primary, counter, and guardrail metrics each map to events in the plan. If they don't, the spec is unimplementable until the plan is updated.

Example

User prompt (specific mode): "We're adding a new AI assistant feature to our mobile app. Need a tracking plan. We use Amplitude. Going live in 3 weeks. Primary metric is activation (invoked + returned within 7 days). Counter is core-flow task success. How do we instrument it?"

Mode detection: Specific — feature, metric, audience, DATA, timeline all present.

Step 3 — Naming convention: Object–Action Title Case past tense (Segment standard, works well with Amplitude). Apply consistently.

Step 4 — Event vs property design. The activation metric requires marking two distinct user actions: invocation and return. Plus diagnostic events for funnel analysis.

ConceptEventProperties (event-specific)
User opens the assistantAssistant Openedentry_point: "main_nav" | "in_context" | "cmd_palette"
User submits a queryAssistant Query Submittedquery_length: int, has_attachment: bool, session_query_index: int (1st in session, 2nd, ...)
Assistant respondsAssistant Response Receivedresponse_time_ms: int, response_status: "success" | "error" | "timeout", tokens: int
User reactsAssistant Response Ratedrating: "thumbs_up" | "thumbs_down", comment_length: int (NOT the comment itself)
User returns (counts toward activation)tracked from Assistant Opened with session_index property — no separate event needed

Note the choice to not create Mobile Assistant Opened and Web Assistant Opened as separate events. Platform is captured in the required platform property. Same for entry point (main_nav, in_context, etc.).

Step 5 — Required properties on every event: user_id, anonymous_id, session_id, timestamp, platform, app_version, locale (Step 5 default set).

Step 6 — PII and consent:

  • Assistant Query Submitted carries query_length, NOT the query text. The query may contain PII the user wasn't aware of.
  • Assistant Response Rated carries comment_length, NOT the comment text. Same reason.
  • If product later wants to qualitatively review what users typed, that goes into a separate, consented research pipeline with explicit opt-in — not into product analytics.
  • Consent: if user has not consented to product analytics, no events fire. Confirmed in QA.

Step 7 — Artefact (excerpt from the tracking plan):

Event: Assistant Opened
Trigger: user taps the AI assistant entry point
Properties:
  entry_point     (enum, required)   "main_nav" | "in_context" | "cmd_palette"
  user_id         (string, required) (Step 5 baseline)
  session_id      (string, required) (Step 5 baseline)
  ...
PII flag: no
Owner: Azar (design lead)
Implemented by: Sam (eng lead)
Version: 1.0
Status: Planned

Event: Assistant Query Submitted
Trigger: user submits a query via send button or enter key
Properties:
  query_length          (int, required)
  has_attachment        (bool, required)
  session_query_index   (int, required) — 1 for first query in session, etc.
  user_id, session_id, timestamp, platform, app_version, locale  (Step 5 baseline)
PII flag: no (query text NOT logged; only length and attachment presence)
Owner: Azar (design lead)
Implemented by: Sam (eng lead)
Version: 1.0
Status: Planned

[... rows for Assistant Response Received, Assistant Response Rated ...]

Step 8 — Verify: "Does this fit your setup, or should we adjust before instrumentation starts?"

Notes for the user:

  • Activation Rate (primary metric from the spec) is computable from Assistant Opened events: users with ≥1 Assistant Opened in week 1 AND ≥1 Assistant Opened in their next session within 7 days. No separate Activated event needed — derived from existing events. This is correct; resist the temptation to add a User Activated event.
  • Counter (core-flow task success) is owned by the existing taxonomy — confirm with eng that those events already fire on mobile.
  • If product wants to add chat_satisfaction_score later, that's a property on an existing event, not a new event. Version bump.

Example 2 — auditing an existing messy taxonomy

User prompt (vague mode): "We have ~700 event names in our analytics. The dashboard is a mess. Different designers added events with different conventions. Where do we start?"

Mode detection: Vague — auditing rather than greenfield.

Anchor parse:

  • SCOPE: present (whole product)
  • STAGE: present (mature)
  • AUDIENCE: missing (who's leading the cleanup?)
  • DATA: present (existing analytics, mixed conventions)
  • PLATFORM: missing
  • EXISTING TAXONOMY: present (yes, inconsistent)

Question: "Three things before I recommend a cleanup approach: 1) AUDIENCE — is this a design-team-only cleanup, or are PM/eng joining? 2) PLATFORM — which surfaces (web, mobile, all)? 3) Is the goal to clean up the live taxonomy, or to migrate to a new convention?"

User reply: "Design and analytics joining; web only; want to migrate to a new convention because the current one is unsalvageable."

Recommended approach (high-level — full reference in taxonomy-patterns.md):

  1. Audit first, don't migrate yet. Export all event names and their volume (last 90 days). Bucket them: high-volume + dashboard-referenced (must migrate), medium-volume + ad-hoc-referenced (decide case by case), low-volume + orphaned (deprecate).
  2. Pick the target convention. Object–Action Title Case (Step 3). Document it in a one-page standard.
  3. Build the rename map. For each high-volume event, name its target name. For duplicate events (Article Viewed and news_article_view), pick one target and consolidate.
  4. Implement gradually. Eng instruments the new event names alongside the old ones; both fire for 8–12 weeks while dashboards migrate. Then deprecate the old names with a 30-day notice.
  5. Lock the convention. Add a CI check (lint rule on event-firing code) that rejects new events not matching the convention.

Step 5 is where most cleanups fail — without enforcement, the next designer adds a one-off and the cycle restarts.

Common Pitfalls

These apply across most tracking plans. Each is also covered in the references.

  • Mixed conventions. Order Completed and order_complete coexist. Dashboard breaks. Pick one and enforce it.
  • Events that should be properties. Primary CTA Clicked, Secondary CTA Clicked, Tertiary CTA Clicked — collapse into CTA Clicked with cta_id property.
  • Properties that should be events. Generic Event with a type property that has 50 values, each a different user action. Split into one event per type.
  • Free-text property values. status: "success!", status: "Success", status: "ok" — three values for one concept. Use enums.
  • PII in event properties. Email, full name, raw search query. Move to user-profile fields or hash/truncate. See pii-rules.md.
  • Unbounded property cardinality. A property like query_text or url_full with unique values per event. Most analytics tools struggle past ~10k unique values per property; segment/aggregate breaks.
  • No required-property baseline. Some events have platform, others don't. Means any segment by platform is incomplete. Make required properties truly required at the SDK layer.
  • Renaming live events. Once an event ships, renaming breaks every downstream dashboard, alert, warehouse model, attribution path. Either don't rename, or fire old and new in parallel for 8+ weeks.
  • Plan diverges from implementation. Tracking plan says Order Completed, eng implemented OrderCompleted. Eng's version wins; plan needs to be updated to match. Add automation: the plan should be the source of truth, with CI checks that compare it to live events.
  • Adding new events instead of properties. Every feature ships 30 new events. Taxonomy bloats; nobody can find anything. Default to "add a property", split into a new event only when one of the Step 4 exceptions applies.
  • Naming analytics tools unprompted. Do not name specific tools (Mixpanel, Amplitude, PostHog, Heap, GA4, Segment, etc.) unless the user has already named one. Ask first.

Red Flags

When the user's situation triggers any of these, stop and redirect.

  • Wants vendor-specific config. "How do I set up Mixpanel?", "What's the Amplitude API for X?" — point to the vendor's docs. This skill is tool-agnostic; it does not generate platform configuration.
  • Wants to log PII in event properties. Direct request like "we want to log email on every event for easy filtering". Refuse, explain the legal exposure (GDPR Art. 5–7), recommend the user-profile approach. See pii-rules.md.
  • No clear metric to instrument for. User wants to "log everything just in case". This is the source of 700-event-mess problems. Recommend: pick the metric (metrics-ux), commit to the spec (metrics-spec), then instrument exactly what's needed. Bloat is rarely the right starting point.
  • Asking for taxonomy without a feature scope. "Tracking plan for the whole product" with no scope is an audit job, not an instrumentation design. Route to the audit approach in Example 2 or scope down.
  • Out-of-scope (revenue, MRR, monetization). Conversion (free → paid), revenue churn, LTV instrumentation is owned by metrics-product v2. Same boundary as other skills.
  • Wrong skill. If picking the metric → metrics-ux. If writing the spec → metrics-spec. If diagnosing live data → metrics-diagnose. If reviewing a claim → metrics-review. If communicating results → metrics-present.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Metrics Instrumentation AI 技能有什么作用?

Designs the tracking plan that captures the events behind a UX metric — event names, properties, naming conventions, taxonomy, PII rules, tool-agnostic schema. Triggers on "tracking plan", "event taxonomy", "what should we log", "event naming convention", "instrumentation", "how do I capture this metric". Skip for picking which metric to track (use metrics-ux), for the broader measurement plan (use metrics-spec), for tool-specific config (the analytics vendor's docs).

为什么在 TypingMind 中使用 Metrics Instrumentation?

因为您只需安装一次,就能搭配任何模型使用。Metrics Instrumentation 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Metrics Instrumentation?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/nemanli/ux-metrics-skills/tree/main/skills/metrics-instrumentation。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Metrics Instrumentation?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Metrics Instrumentation 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Metrics Instrumentation 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Metrics Instrumentation AI 技能免费吗?

是的。nemanli 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇