segment-cdp — Claude Code skill for Segment analytics
Plan Segment event tracking across browser and server code, manage user identity, and define event schemas. Useful when building or reviewing a customer data pipeline.
npx claude-code-templates@latest --skill web-development/segment-cdpWhat segment-cdp does
This skill covers Segment Customer Data Platform patterns for browser-based and server-side analytics. Its Analytics.js guidance includes track, identify, page, and group, along with the relationship between an anonymous ID and a user profile after identification. These patterns help keep client-side tracking aligned with user identity.
For backend events, the skill covers @segment/analytics-node and its non-blocking batching behavior. The package is relevant to server-generated events and webhooks, including cases involving sensitive data. Node.js and @segment/analytics-node are needed for this server-side approach.
The tracking-plan material focuses on Object + Action event names, required properties, data types, and validation through Protocols. It also flags design mistakes such as changing event names dynamically, treating properties as events, and calling track before identify. Use these patterns when defining a consistent event contract for an application.
What it helps with
- Set up browser event collection with Analytics.js
- Send backend events and webhook data to Segment
- Define event schemas with required properties and types
- Associate anonymous activity with an identified user
- Spot inconsistent event names and incorrect call order
Example prompts for the agent
- Design browser tracking with Analytics.js using
track,identify,page, andgroup. - Prepare server-side event delivery with
@segment/analytics-nodefor backend events and webhooks. - Draft a Segment tracking plan with Object + Action names, required properties, and Protocols validation.
How to install segment-cdp
1claude-code-templates
npx claude-code-templates@latest --skill web-development/segment-cdp2Skills CLI (Vercel)
npx skills add davila7/claude-code-templates --skill segment-cdp -a claude-code3Manually: put the files in place
~/.claude/skills/segment-cdp/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/segment-cdp/
Manually: put the files in place
.agents/skills/segment-cdp/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/segment-cdp/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install davila7/claude-code-templates segment-cdp2Manually: put the files in place
.github/skills/segment-cdp/SKILL.mdPlatform CLI
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/web-development/segment-cdpManually: put the files in place
.devin/skills/segment-cdp/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about segment-cdp
How do I install segment-cdp in Claude Code?
Choose one installation method. With Claude Code Templates, run npx claude-code-templates@latest --skill web-development/segment-cdp. With the skills installer, run npx skills add davila7/claude-code-templates --skill segment-cdp -a claude-code. The skill file path is ~/.claude/skills/segment-cdp/SKILL.md.
What does the segment-cdp skill do?
It guides browser and server tracking with Segment, user identification, and event schema design. It also covers common tracking mistakes that can make event data inconsistent.
How should I define and validate Segment tracking events?
Use Object + Action naming, specify required properties and their types, and connect validation rules to Protocols. The skill also warns against dynamic event names and calling track before identify.