segment-cdp

segment-cdp is a skill for Claude Code, Codex from beel-collab/presets.dev. It costs 33 tokens per session (4,471 once invoked), scanned A, original, MIT.

A set of patterns for Segment, a customer data platform that collects product activity and sends it to analytics and other services.

In plain words
What is it for?
It helps implement page, user, and event tracking; connect destinations; define tracking plans; and handle identity resolution.
Why use it?
It helps teams structure event tracking, user identity, destinations, and data rules consistently across browser and server code.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It helps implement page, user, and event tracking; connect destinations; define tracking plans; and handle identity resolution.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/beel-collab/presets.dev/segment-cdp
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.

Any agent
npx skills add beel-collab/presets.dev --skill segment-cdp
Clone the repo
git clone --depth 1 https://github.com/beel-collab/presets.dev

Made for: Claude Code, Codex.

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 segment-cdp

README.md
[![agentmods](https://agentmods.dev/badge/skills/beel-collab/presets.dev/segment-cdp.svg)](https://agentmods.dev/skills/beel-collab/presets.dev/segment-cdp)
Your own site
<a href="https://agentmods.dev/skills/beel-collab/presets.dev/segment-cdp"><img src="https://agentmods.dev/badge/skills/beel-collab/presets.dev/segment-cdp.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,471 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00033 $0.04471
Opus 5 $0.00016 $0.02235
Sonnet 5 $0.00007 $0.00894
Haiku 4.5 $0.00003 $0.00447

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

Security

Grade A, and why

segment-cdp scanned grade A with 1 finding 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 3d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

async fetch(request: Request): Promise<Response> {
claude/skills/data/segment-cdp/SKILL.md · 854 lines

How it starts

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

Segment CDP

Expert patterns for Segment Customer Data Platform including Analytics.js, server-side tracking, tracking plans with Protocols, identity resolution, destinations configuration, and data governance best practices.

Patterns

Analytics.js Browser Integration

Client-side tracking with Analytics.js. Include track, identify, page, and group calls. Anonymous ID persists until identify merges with user.

// Next.js - Analytics provider component // lib/segment.ts import { AnalyticsBrowser } from '@segment/analytics-next';

export const analytics = AnalyticsBrowser.load({ writeKey: process.env.NEXT_PUBLIC_SEGMENT_WRITE_KEY!, });

// Typed event helpers export interface UserTraits { email?: string; name?: string; plan?: 'free' | 'pro' | 'enterprise'; createdAt?: string; company?: { id: string; name: string; }; }

export function identify(userId: string, traits?: UserTraits) { analytics.identify(userId, traits); }

export function track<T extends Record<string, any>>( event: string, properties?: T ) { analytics.track(event, properties); }

export function page(name?: string, properties?: Record<string, any>) { analytics.page(name, properties); }

export function group(groupId: string, traits?: Record<string, any>) { analytics.group(groupId, traits); }

// React hook for analytics // hooks/useAnalytics.ts import { useEffect } from 'react'; import { usePathname, useSearchParams } from 'next/navigation'; import { analytics, page } from '@/lib/segment';

export function usePageTracking() { const pathname = usePathname(); const searchParams = useSearchParams();

useEffect(() => { // Track page view on route change page(pathname, { path: pathname, search: searchParams.toString(), url: window.location.href, title: document.title, }); }, [pathname, searchParams]); }

// Usage in _app.tsx or layout.tsx function RootLayout({ children }) { usePageTracking();

return {children}; }

Read the full file on GitHub · 854 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. 3d ago First seen · 854 lines · 33 tokens per session scan A c9b587c040b9

Subscribe to this mod's changes

segment-cdp is a skill published in the GitHub repository beel-collab/presets.dev (2 stars, last pushed 4mo ago), licensed MIT. It adds 33 tokens to every session and 4,471 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

skill-creator-primer

You MUST load this skill before the skill-creator skill AND before making ANY change to, or conducting a review of ANY Agent Skill. Triggers include creating, editing, reviewing, or contributing to any part of an Agent Skill (description, frontmatter, body, references, scripts, trigger evals, conflicts, etc).

sammcj/agentic-coding · 74 tokens

llm-wiki

Use when building or maintaining a self-contained personal knowledge base (an LLM wiki) in plain markdown. Triggers: ingesting sources into a wiki, querying wiki knowledge, linting wiki health, auditing article claims against their sources, critiquing a wiki source's reasoning, superseding stale knowledge, 'add to…

sammcj/agentic-coding · 82 tokens

extract-wisdom

Extract wisdom, insights, and actionable takeaways from YouTube videos, blog posts, articles, or text files. Use when asked to extract wisdom or key insights from a given content source.

sammcj/agentic-coding · 43 tokens

apply-mantel-styles

Provides guidelines for applying Mantel's brand styles to diagrams and frontend components. Use when asked to create visuals that need to align with Mantel's branding.

sammcj/agentic-coding · 37 tokens

home-assistant

This skill should be used when helping with Home Assistant setup, including creating automations, modifying dashboards, checking entity states, debugging automations, and managing the smart home configuration. Use this for queries about HA entities, YAML automation/dashboard generation, or troubleshooting HA issues.

sammcj/agentic-coding · 57 tokens

deepeval

Use when discussing or working with DeepEval (the python AI evaluation framework).

sammcj/agentic-coding · 19 tokens