analytics-scaffold

analytics-scaffold is a command for coding agents from Dokkabei97/forged-claude-code. It costs 22 tokens per session (775 once invoked), scanned A, original, MIT.

A command that creates event-tracking code from a description of what users do in an application. It supports Google Analytics 4, Mixpanel, and Amplitude, which are services used to measure product usage.

In plain words
What is it for?
Use it when adding analytics to a feature, standardizing events such as sign-ups and upgrades, or generating tracking code for a chosen provider.
Why use it?
It reduces the manual work of defining event names and properties and helps keep tracking consistent across the codebase. It can also make switching tracking providers easier.

Command

Part of the forged-claude-code plugin — 29 skills, 14 commands, 9 agents, 2 hooks shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/dokkabei97/forged-claude-code/analytics-scaffold
Clone the repo
git clone --depth 1 https://github.com/Dokkabei97/forged-claude-code

Or install forged-claude-code, the plugin that ships this one along with the rest of its 29 skills, 14 commands, 9 agents, 2 hooks.

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 analytics-scaffold

README.md
[![agentmods](https://agentmods.dev/badge/commands/dokkabei97/forged-claude-code/analytics-scaffold.svg)](https://agentmods.dev/commands/dokkabei97/forged-claude-code/analytics-scaffold)
Your own site
<a href="https://agentmods.dev/commands/dokkabei97/forged-claude-code/analytics-scaffold"><img src="https://agentmods.dev/badge/commands/dokkabei97/forged-claude-code/analytics-scaffold.svg" alt="Measured on agentmods" height="20"></a>
Per session 22 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 775 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00022 $0.00775
Opus 5 $0.00011 $0.00387
Sonnet 5 $0.00004 $0.00155
Haiku 4.5 $0.00002 $0.00077

Measured 4d ago against content hash cd0527fa6f9b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

analytics-scaffold 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 4d 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.

commands/analytics-scaffold.md · 119 lines

How it starts

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

/analytics-scaffold - Event Tracking Code Generator

Triggers

  • Setting up product analytics for a new feature
  • Standardizing event tracking across the codebase
  • Migrating between analytics providers

Usage

/analytics-scaffold [event spec file or description]
/analytics-scaffold --provider mixpanel
/analytics-scaffold --provider ga4
/analytics-scaffold --provider amplitude

Behavioral Flow

Phase 1: Define Event Spec

## Event Specification

| Event Name | Trigger | Properties |
|-----------|---------|------------|
| page_viewed | Page load | page_name, referrer |
| signup_started | Click signup CTA | source, plan_type |
| signup_completed | Account created | method (email/google/github) |
| feature_used | Feature interaction | feature_name, duration_ms |
| upgrade_clicked | Click upgrade | current_plan, target_plan |

Phase 2: Generate Tracking Code

Analytics Wrapper (provider-agnostic):

// lib/analytics.ts
type EventName = 'page_viewed' | 'signup_started' | 'signup_completed'
  | 'feature_used' | 'upgrade_clicked'

type EventProperties = {
  page_viewed: { page_name: string; referrer?: string }
  signup_started: { source: string; plan_type?: string }
  signup_completed: { method: 'email' | 'google' | 'github' }
  feature_used: { feature_name: string; duration_ms?: number }
  upgrade_clicked: { current_plan: string; target_plan: string }
}

export function track<T extends EventName>(
  event: T,
  properties: EventProperties[T]
): void {
  // Provider-specific implementation
  if (typeof window !== 'undefined') {
    mixpanel?.track(event, properties)
    // or: gtag('event', event, properties)
    // or: amplitude.track(event, properties)
  }
}

export function identify(userId: string, traits?: Record<string, any>): void {
  mixpanel?.identify(userId)
  mixpanel?.people.set(traits)
}

Usage in Components:

import { track } from '@/lib/analytics'

// In signup form
track('signup_started', { source: 'hero_cta', plan_type: 'free' })

// After successful signup
track('signup_completed', { method: 'google' })

Read the full file on GitHub · 119 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. 4d ago First seen · 119 lines · 22 tokens per session scan A cd0527fa6f9b

Subscribe to this mod's changes

analytics-scaffold is a command published in the GitHub repository Dokkabei97/forged-claude-code (2 stars, last pushed 6mo ago), licensed MIT. It adds 22 tokens to every session and 775 once invoked, about $0.0001 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.