add-tracked-event
Adds or changes an analytics event end to end, keeping the taxonomy, the typed schema, the code and the docs in sync. Use whenever a new event is needed or an existing one changes.
SKILL.md.claude/skills/add-tracked-event/SKILL.md
GitHubAdd a tracked event
- Confirm the event is needed for the funnel or a guardrail in
docs/ANALYTICS.md(draft taxonomy indocs/PLAN.mduntil Stage 6). If it is not, stop and say why. - Name it
object_actionin snake case. Decide where it is captured: the server for anything that confirms an outcome (conversion, profile update), the relay for interface events. - Add it to the shared event schema with typed properties. Properties are enums, booleans, numbers or opaque ids; never email, name or free text. Values read from the DOM must pass the schema.
- Fire it from exactly one place. Server events fire only after the database write commits.
- Add a test that fails if the event is not fired, and one that fails if a property outside the schema is sent.
- Update the taxonomy table in
docs/ANALYTICS.mdin the same commit: name, trigger, where it is captured, properties. - Run the
analytics-auditoragent and include its verdict in the stage report.