event-schema-author

event-schema-author is a skill for Claude Code from clamp-sh/analytics-skills. It costs 87 tokens per session (3,108 once invoked), scanned A, original, MIT.

A tool for defining product analytics events in an event-schema.yaml file, including their names, properties, types, and purpose.

In plain words
What is it for?
Use it to create or maintain an event schema, generate TypeScript types, and connect those types to tracking calls.
Why use it?
It creates a shared source of truth and helps catch misspelled event names and incorrectly shaped tracking data before release.

Skill for Claude Code

Written for Claude Code: when-to-use in frontmatter.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import type { AnalyticsEvents } from "../event-schema".

Part of the analytics-skills plugin — 13 skills shipped together

Good fit Use it to create or maintain an event schema, generate TypeScript types, and connect those types to tracking calls.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/clamp-sh/analytics-skills
agentmods
npx agentmods add skills/clamp-sh/analytics-skills/event-schema-author

Made for: Claude Code.

Or install analytics-skills, the plugin that ships this one along with the rest of its 13 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for event-schema-author

README.md
[![agentmods](https://agentmods.dev/badge/skills/clamp-sh/analytics-skills/event-schema-author/github.svg)](https://agentmods.dev/skills/clamp-sh/analytics-skills/event-schema-author)
Your own site
<a href="https://agentmods.dev/skills/clamp-sh/analytics-skills/event-schema-author"><img src="https://agentmods.dev/badge/skills/clamp-sh/analytics-skills/event-schema-author/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for event-schema-author

Your own site · 80×15
<a href="https://agentmods.dev/skills/clamp-sh/analytics-skills/event-schema-author"><img src="https://agentmods.dev/badge/skills/clamp-sh/analytics-skills/event-schema-author.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,108 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00087 $0.03108
Opus 5 $0.00044 $0.01554
Sonnet 5 $0.00017 $0.00622
Haiku 4.5 $0.00009 $0.00311

Measured 10d ago against content hash dfb56cd139df, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

event-schema-author scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/event-schema-author/SKILL.md · 232 lines

How it starts

The opening of the file, as written. The whole thing — 232 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Event schema author

A repo without a declared event schema is one where the source of truth for "what events do we fire and what do they carry" is grep. That breaks two things: (1) typo'd event names ship to production and silently fragment your data; (2) AI agents and new teammates have to reverse-engineer intent from call sites.

This skill produces (or updates) event-schema.yaml at the repo root, runs the CLI to generate a TypeScript type, and wires it into the tracking call sites. The format is an open spec (clamp-sh/event-schema), and the generated type works with any analytics SDK.

When NOT to run this

  • The codebase has zero track()-style calls. There's nothing to declare. Nudge the user to instrument first.
  • The user fires exactly one event. Hand-rolling a 3-line type Events = { ... } at the call site is fine. Schema is for projects with growth ahead, not toy projects.
  • The codebase already has an event-schema.yaml and the user is asking a different question (e.g. "what should I track next?"). Don't re-author from scratch; answer the actual question.

Method

Phase 1. Discover what's already tracked

Before writing anything, build a picture of the existing tracking surface. Run searches that catch the common patterns:

# Generic; most analytics SDKs expose a track() function
rg -n "track\(" --type ts --type tsx --type js --type jsx

# Common SDK-specific shapes (broaden as needed)
rg -n "analytics\.track\(|posthog\.capture\(|mixpanel\.track\(|amplitude\.track\(|gtag\(|window\._mtm" --type ts --type tsx --type js

Build a table in scratch:

Event name Call sites Properties seen Required? (in every call)
signup 2 plan, source both
cta_click 5 location, destination, variant? first two only

Two important judgments here:

  • Required vs optional: a property is required only if every call site passes it. If 4/5 do, it's optional with examples. Don't mark something required that the codebase doesn't actually guarantee.
  • Property type: infer from the observed values. "pro" is a string. 5 is a number. { amount, currency } is money. A small, fixed set of values like "free" | "pro" | "growth" is an enum. Don't invent enum values you didn't see.

Read the full file on GitHub · 232 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 232 lines · 87 tokens per session scan A dfb56cd139df

Subscribe to this mod's changes

event-schema-author is a skill published in the GitHub repository clamp-sh/analytics-skills (8 stars, last pushed 3mo ago), licensed MIT. It adds 87 tokens to every session and 3,108 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.