rudder-cli-setup
Installs and authenticates rudder-cli. Use when installing rudder-cli, setting up rudder cli, rudder-cli command not found, or authenticating with RudderStack
Derives tracking plans from existing codebase types and structures. Use when instrumenting an existing product that wasn't well-instrumented or restructuring existing tracking.
$ npx -y skills add rudderlabs/rudder-agent-skills --skill rudder-code-first-instrumentation --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/rudder-code-first-instrumentationContext preview
The summary Claude sees to decide when to auto-load this skill.
Derives tracking plans from existing codebase types and structures. Use when instrumenting an existing product that wasn't well-instrumented or restructuring existing tracking.
name: rudder-code-first-instrumentation description: Derives tracking plans from existing codebase types and structures. Use when instrumenting an existing product that wasn't well-instrumented or restructuring existing tracking. allowed-tools: "Bash(rudder-cli *), Read, Write, Edit"
This skill guides instrumentation planning for **existing products** where you derive tracking plans from the codebase's existing types and structures.
| Scenario | Use This Skill? | |----------|-----------------| | Existing product needs instrumentation | Yes | | Codebase has domain types (enums, interfaces) you want to track | Yes | | Restructuring messy existing tracking | Yes | | Building new feature, events not yet defined | No — use `rudder-design-first-instrumentation` |
When a product already exists, the code contains valuable type information:
Deriving tracking plans from code types:
> "If I say plan, that cannot mean many things. It's the plan. I have to be specific."
┌─────────────────────────────────────────────────────────────────────┐
│ CODE-FIRST INSTRUMENTATION │
└─────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────┐
│ 1. DISCOVER │ ← Identify domain types in codebase
│ CODE TYPES │
└────────┬────────┘
▼
┌─────────────────┐
│ 2. MAP TYPES │ ← Translate code types to tracking plan types
│ TO YAML │
└────────┬────────┘
▼
┌─────────────────┐
│ 3. IDENTIFY │ ← What user actions should be tracked?
│ EVENTS │
└────────┬────────┘
▼
┌─────────────────┐
│ 4. BUILD │ ← Create YAML referencing the types
│ TRACKING │
│ PLAN │
└────────┬────────┘
▼
┌─────────────────┐
│ 5. VERIFY │ ← TypeScript compilation validates alignment
└────────┬────────┘
▼
┌─────────────────┐
│ 6. TEST & APPLY │ ← Verify in dev workspace, apply to prod
└─────────────────┘Scan the codebase for domain types that should flow through to analytics.
| Type Category | Examples | Tracking Plan Equivalent | |---------------|----------|-------------------------| | Enums | `BillingPlan`, `UserRole`, `Region` | Property with enum config | | String unions | `type Status = 'active' \| 'inactive'` | Property with enum config | | Interfaces | `Product`, `Workspace`, `User` | Custom type | | Constants | `PLAN_TYPES`, `REGIONS` | Property enum values |
# Find enums in TypeScript codebase
grep -r "enum " --include="*.ts" --include="*.tsx" src/
# Find type unions
grep -r "type.*=" --include="*.ts" src/ | grep "|"
# Find interfaces that might be tracked
grep -r "interface.*{" --include="*.ts" src/types/// Found in src/types/workspace.ts
enum BillingPlan {
FREE = 'free',
STARTER = 'starter',
GROWTH = 'growth',
ENTERPRISE = 'enterprise',
}
enum Region {
US = 'us',
EU = 'eu',
}
// Found in src/types/transformation.ts
type TransformationLanguage = 'javascript' | 'python';
// Found in src/types/audience.ts
enum ConditionGroupType {
AND = 'and',
OR = 'or',
AUDIENCE = 'audience',
}Translate discovered code types to tracking plan YAML.
// Code
enum BillingPlan {
FREE = 'free',
STARTER = 'starter',
GROWTH = 'growth',
ENTERPRISE = 'enterprise',
}# Tracking plan property
version: "rudder/v1"
kind: "property"
metadata:
name: "properties"
spec:
name: "billing_plan"
type: "string"
description: "Organization billing plan"
config:
enum:
- "free" # Exact match to BillingPlan.FREE
- "starter" # Exact match to BillingPlan.STARTER
- "growth" # Exact match to BillingPlan.GROWTH
- "enterprise" # Exact match to BillingPlan.ENTERPRISE// Code type TransformationLanguage = 'javascript' | 'python';
# Tracking plan property
version: "rudder/v1"
kind: "property"
metadata:
name: "properties"
spec:
name: "transformation_language"
type: "string"
description: "Programming language of transformation"
config:
enum:
- "javascript"
- "python"// Code
interface Product {
id: string;
name: string;
price: number;
category: ProductCategory;
}# Tracking plan custom type
version: "rudder/v1"
kind: "custom-type"
metadata:
name: "custom-types"
spec:
name: "ProductType"
type: "object"
description: "Product information from catalog"
config:
properties:
- property: "urn:rudder:property/product_id"
required: true
- property: "urn:rudder:property/product_name"
required: true
- property: "urn:rudder:property/product_price"
required: true
- property: "urn:rudder:property/product_category"
required: trueThe tracking plan **must** use the exact string values from the code:
// If code uses lowercase
enum Region {
US = 'us', // lowercase
EU = 'eu',
}
// YAML must match
config:
enum:
- "us" # NOT "US"
- "eu" # NOT "EU"With types mapped, identify what user actions to track.
Look for:
A Claude Code plugin marketplace and Agent Skills collection that teaches your AI coding agent how to drive every programmatic RudderStack surface — CLI, MCP server, Terraform, and Profiles — with the right preflight checks, commands, and recovery paths.
Installs and authenticates rudder-cli. Use when installing rudder-cli, setting up rudder cli, rudder-cli command not found, or authenticating with RudderStack
Validates, previews, and applies RudderStack resource changes via YAML specs. Use when iterating on RudderStack resources with rudder-cli - validates specs,…
Imports existing RudderStack workspace resources into YAML files for git-based management. Use when importing existing RudderStack resources to CLI management…
Creates and manages RudderStack transformations and libraries with local testing. Use when creating, editing, or managing RudderStack transformations and…
Generates type-safe SDKs (Swift/Kotlin) from tracking plans with compile-time validation. Use when generating type-safe event tracking code from tracking plans…
Creates and manages events, properties, categories, and custom types for instrumentation schemas. Use when creating or managing events, properties, categories,…