Skip to content
Development
Skill

/rudder-ai-events-instrument

Adds RudderStack AI events code from an approved ai-events.md plan: installs @rudderstack/ai, rudderstack-ai or ai-sdk-go, wraps model clients and MCP servers, opens interactions and tasks, wires feedback and browser events. Use when implementing an approved AI events plan.

From plugin
rudder-agent-skills
1928 skills1 MCP

Claude Code

$ npx -y skills add rudderlabs/rudder-agent-skills --skill rudder-ai-events-instrument --agent claude-code

SKILL.md

rudder-ai-events-instrument.SKILL.md
name: rudder-ai-events-instrument
description: "Adds RudderStack AI events code from an approved ai-events.md plan: installs @rudderstack/ai, rudderstack-ai or ai-sdk-go, wraps model clients and MCP servers, opens interactions and tasks, wires feedback and browser events. Use when implementing an approved AI events plan."
allowed-tools: "Bash(npm *), Bash(npx *), Bash(pnpm *), Bash(yarn *), Bash(bun *), Bash(node *), Bash(deno *), Bash(uv *), Bash(poetry *), Bash(pip *), Bash(python *), Bash(python3 *), Bash(pytest *), Bash(go get *), Bash(go mod tidy), Bash(go list *), Bash(go build *), Bash(go vet *), Bash(go test *), Bash(git status), Bash(git diff), Bash(git diff *), Bash(cp *), Bash(git switch -c *), Read, Write, Edit, Glob, Grep"

RudderStack AI Events Instrumentation

Turns the approved plan into the smallest reviewable diff, for AI events spec v0.4. Recipes with exact code: `references/node.md`, `references/python.md`, `references/go.md`, `references/client-events.md`. Full API: each SDK's README (npm package, PyPI page, Go module).

Preconditions

1. `ai-events.md` exists at the repo root with front matter `status: approved`. Missing or `draft`: stop and run `rudder-ai-events-setup`; never instrument from an unapproved plan. Copy every value from the fenced `yaml` block under `## Config` (it wins over the prose); the files you may touch are the ones under `## Files to change`. Key paths below (`spec.config`, `surfaces[]`, `sdks[]`, `spec.switches`) are inside that block, under `spec`. 2. Every surface you are about to change has `status: instrument`. Skip the rest (`skipped`, `blocked`, `unsupported`). 3. Apart from `ai-events.md`, the working tree is clean, or the user agreed to mix changes. Work on the current branch; on the default branch, create the branch the plan's `## Summary` names (`feat/ai-events` by default) without asking. 4. Each `sdks[].version` (`<VERSION>` in the recipe files) is `@rudderstack/ai` / `rudderstack-ai` 0.8.0 or later, or `ai-sdk-go` v0.4.0 or later (verify needs their migration check and recorders); never a branch or pseudo-version. Older: run `rudder-ai-events-setup`, which re-resolves versions on resume. A user-named unreleased exact target stays in the plan, but installation waits for publication. Browser-only plans have `sdks: []`: skip server install/configure steps and consume the named server dependency's response contract and switch source.

Install preflight

Before writing code, check that the pinned version installs as is:

  • **Latest release**: resolve it from a scratch directory outside the repo (inside a repo with `devEngines`, `npm view` fails with `EBADDEVENGINES`): `npm view @rudderstack/ai version`, `pip index versions rudderstack-ai`, `go list -m -versions github.com/rudderlabs/ai-sdk-go` (each Go integration module, `.../rudderopenai`, `.../rudderotel`, ..., has its own tags). Newer than the plan: say so in one line and install the plan's version.
  • **Release-age gates**: pnpm `minimumReleaseAge` (minutes) / `minimumReleaseAgeExclude` (`pnpm-workspace.yaml`), npm `min-release-age` / `before` (`.npmrc`), uv `exclude-newer` (`pyproject.toml` `[tool.uv]`, `uv.toml`). A gate that blocks the version: add the exemption the plan's `## Dependencies and blockers` lists (only the SDK package, with a comment that says why and the removal date); a gate the plan does not list is a plan change.
  • **Registries**: scoped or mirrored registries (`.npmrc`, pip `index-url`, uv indexes, `GOPROXY`) must serve the version. The SDKs are public on npm, PyPI and proxy.golang.org: no `GOPRIVATE`, no git credentials. Expired registry auth: ask the user to log in, never write tokens.
  • **Peer ranges**: compare the SDK's peer or extra range for each provider, framework and MCP SDK against the approved target dependency set (installed versions plus exact upgrades under Dependencies and blockers). A conflict that set does not resolve, or an unapproved bump: stop; it is a plan change. Node.js: `@rudderstack/ai` needs `@rudderstack/rudder-sdk-node` `>=3.0.16` (npm fails with `ERESOLVE` on older). When the plan's `## Dependencies and blockers` approves upgrading the app's client, install that exact pin together with the SDK; an upgrade the plan does not list is a plan change for the user. Never `--legacy-peer-deps` or `--force`.
  • **Framework peer cascades**: for each approved framework upgrade, check that exact version's own peers and every forced bump listed under Dependencies and blockers. Install only those exact approved pins; an unlisted cascade is a plan change.
  • **Go toolchain**: the minimum is the plan's `sdks[].runtime` (the `go` line of the pinned version's `go.mod`). An app below it gets its `go` line raised by `go get`: name that in `## What changes`; a toolchain its CI cannot run is a blocker.

Only the main agent runs package-manager commands. Subagent briefs forbid all of them, including commands that can install as a side effect (`npx`, `pnpm dlx`, `uv run`, `go run` of a new module, test scripts with an install step); subagents edit code only.

Order of changes

Do one surface at a time; after each, run the app's type check (and its tests when they are fast).

1. **Install** the SDK in each `sdks[].path` with an exact pin, using the repo's package manager (pinned version in `packageManager` / tool files):

   npm install --save-exact @rudderstack/ai@<VERSION>
   deno add npm:@rudderstack/ai@<VERSION>                    # peers: deno add npm:<package>@<approved exact version>
   uv add "rudderstack-ai[<extras from the plan>]==<VERSION>"   # e.g. rudderstack-ai[anthropic]==<VERSION>
   go get github.com/rudderlabs/ai-sdk-go@<VERSION>           # plus one module per provider at its own version

Other managers: section 1 of the recipe files. Never add a version range, and bump the app's own LLM libraries or their peers only to exact pins approved under Dependencies and blockers. Add the RudderStack server cli

Read more
@rudderlabs
Ships withrudder-agent-skills

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, Profiles, and AI events — with the right preflight checks, commands, and recovery

1928 skills1 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
19
Star history of rudderlabs/rudder-agent-skills on GitHub, a chart by star-history.com

Other skills on rudder-agent-skills.

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills3w309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc3w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react13d252k
@facebook@facebookInstall Skill

Questions about rudder-ai-events-instrument.

Which coding agents can use rudder-ai-events-instrument?
rudder-ai-events-instrument installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.