К основному содержанию
скилл CX Codex

dd-instrument-rum — скилл для Claude Code: настройка RUM

Скилл dd-instrument-rum для Claude Code настраивает Datadog Browser RUM в веб-приложениях. Запускается по запросу добавить, исправить или проверить RUM, Browser Monitoring или Session Replay.

MIT 116 установок ★ 185 обновлён 2026-10-22

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add datadog-labs/agent-skills --skill dd-instrument-rum -a claude-code
Открыть на GitHub

Что делает dd-instrument-rum

Скилл изучает структуру проекта, находит браузерное приложение, фреймворк, точку входа и существующую настройку RUM. Затем добавляет или дополняет классическую интеграцию Datadog Browser RUM для React, Next.js, Angular, Vue, Nuxt, Svelte и других браузерных приложений, не создавая повторную инициализацию.

Перед правками он сверяет требования фреймворка и версии пакетов, сохраняет зависимости в манифесте и lockfile, а после изменений запускает сборку. Существующую корректную конфигурацию и её параметры скилл сохраняет; если учётные данные нельзя определить или конфликтующие вызовы init нельзя безопасно объединить, он останавливается без правок. Для работы нужны учётные данные Datadog и допустимое значение site.

Какие задачи решает

  • добавить Browser RUM в веб-приложение
  • исправить настройку RUM без повторной инициализации
  • подключить плагин RUM для используемого фреймворка
  • проверить сборку после настройки мониторинга

Примеры запросов агенту

  • Добавь Datadog Browser RUM в это веб-приложение.
  • Настрой Session Replay через Browser RUM для приложения.
  • Проверь настройку Browser Monitoring и исправь её, если сборка проходит.

Как установить dd-instrument-rum

1Через Skills CLI (Vercel)

npx skills add datadog-labs/agent-skills --skill dd-instrument-rum -a claude-code

2Вручную: положить файлы

~/.claude/skills/dd-instrument-rum/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/dd-instrument-rum/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о dd-instrument-rum

Как установить dd-instrument-rum в Claude Code?

Выполни npx skills add datadog-labs/agent-skills --skill dd-instrument-rum -a claude-code. Файл скилла появится по пути ~/.claude/skills/dd-instrument-rum/SKILL.md.

Что делает dd-instrument-rum?

Скилл анализирует браузерное приложение и настраивает или исправляет в нём Datadog Browser RUM. Он проверяет существующую инициализацию и запускает сборку после изменений.

Что нужно для работы dd-instrument-rum?

Нужны учётные данные Datadog и допустимое значение site. Скилл проверяет требования выбранного фреймворка до правок.

Исходный текст

SKILL.md · MIT
---
name: dd-instrument-rum
description: Instrument browser-based web applications with Datadog Browser RUM. Detect the application framework, router, package manager, bundler, entrypoint, credentials, and existing RUM setup; add or safely complete classic Browser RUM instrumentation for React, Next.js App or Pages Router, Angular, Vue, Nuxt, Svelte, vanilla JavaScript, SPAs, and iframe-hosted apps; avoid duplicate initialization; and verify the application still builds. Use when asked to add, set up, instrument, repair, or verify Datadog RUM, Browser Monitoring, Session Replay, or framework-specific Browser RUM plugins.
metadata:
  version: "0.1.0"
  author: datadog-labs
  repository: https://github.com/datadog-labs/agent-skills
  tags: datadog,rum,browser-rum,instrumentation,session-replay,react,nextjs,angular,vue,nuxt,svelte
  alwaysApply: "false"
---

# Datadog Browser RUM instrumentation

Instrument only the browser application in scope. Do not add Datadog APM, tracing, LLM Observability, Logs, source-map upload, user identification, Vercel metadata, Shopify, Salesforce, or unrelated Datadog products.

Use normal file inspection, editing, and command tools for every step except optional RUM application creation. Use only `CreateRumApplication` for that operation, as described in `references/common-credentials.md`; never invent Datadog tool names.

## Ground rules

- Inspect before editing. Base every framework, version, entrypoint, command, and configuration decision on project files.
- Copy package names, import paths, exported symbols, and init option keys exactly from the applicable references. Do not substitute package aliases or recreate SDK APIs from memory.
- Post a short checklist before making changes and update it as work completes.
- Initialize RUM exactly once and as early as safely possible in the browser lifecycle. Never put `init()` in a component render, lifecycle hook, route handler, or repeated callback.
- Preserve an existing valid init configuration. Add missing compatible framework plugin wiring to that init in place; never create a competing init.
- **Existing-init credential guardrail:** when one valid RUM init already exists, treat its `applicationId`, `clientToken`, `site`, service tags, sampling, privacy, tracking, and every other existing option as immutable. Credentials supplied by the task are for a new init only; they are not an override for an existing valid init. In this branch, do not rewrite credential lines while adding plugin wiring.
- Stop without editing when required credentials cannot be resolved, `site` is invalid, framework/plugin prerequisites are unmet, permissions prevent the work, or multiple conflicting init calls cannot be safely consolidated.
- Install only packages required for Browser RUM. Keep `@datadog/browser-rum` and every `@datadog/browser-rum-*` integration package on the same exact SDK version.
- Persist dependencies in the manifest and lockfile used by the real build. Do not rely on packages that happen to exist in `node_modules`.
- Preserve application behavior, existing custom error handling, formatting conventions, and unrelated code.
- Apply edits with the available file-editing tool. If an expected text match fails, re-read the file and adapt to its current contents instead of retrying the same edit.
- Do not write project paths, framework details, credentials, client tokens, or RUM application IDs to persistent memory.
- Run a terminating build before reporting success. Never claim telemetry was received unless it was actually observed.

## Phase 1: analyze the target

### Locate the browser application

Identify the project root that produces browser code. In a monorepo, inspect workspace configuration, scripts, Dockerfiles, and CI/deployment configuration to find the frontend manifest used by the real build rather than editing the repository root by assumption. Record that manifest path and its package manager before editing. If several independent browser applications are plausible and the user did not select one, ask which application to instrument.

Reject non-browser applications such as Ink CLIs and projects with no HTML/browser build target.

### Detect the framework and runtime shape

Inspect dependencies and source layout in this order so meta-frameworks win over their underlying UI library:

1. `nuxt` -> Nuxt
2. `next` -> Next.js; distinguish App Router from Pages Router by source layout
3. `@angular/core` -> Angular; distinguish standalone bootstrap from NgModule
4. `vue` -> Vue
5. `svelte` or `@sveltejs/kit` -> Svelte or SvelteKit
6. `react` -> React
7. Browser entrypoint without the above -> generic/vanilla browser application

Also detect:

- Exact framework, React Router, TanStack Router, Vue Router, and Node versions.
- TypeScript when a `tsconfig.json` or TypeScript dependency is present; otherwise preserve JavaScript.
- Package manager from the deployed manifest's `packageManager` field first, then its adjacent lockfile: `bun.lock` or `bun.lockb`, `pnpm-lock.yaml`, `yarn.lock`, or `package-lock.json`. Use npm only when no stronger project signal exists, and never mix managers.
- Bundler from configuration and dependencies: Vite, Webpack, Rollup, esbuild, Rspack, or Create React App (`react-scripts`). Treat unmanaged HTML as CDN only when no package/bundler build owns it.
- Browser entrypoint from build configuration, HTML script targets, framework conventions, and the import graph rather than filename alone.
- The normal terminating build/typecheck command.
- Existing public environment-variable conventions.

Read `references/rum-core.md`, then read exactly the applicable framework reference:

| Target | Reference |
|---|---|
| React, React Router, TanStack Router | `references/rum-react.md` |
| Next.js App or Pages Router | `references/rum-nextjs.md` |
| Angular | `references/rum-angular.md` |
| Vue | `references/rum-vue.md` |
| Nuxt | `references/rum-nuxt.md` |
| Svelte, vanilla, generic SPA, iframe-hosted app | `references/rum-other-frameworks.md` |

Validate every prerequisite in the selected reference before provisioning credentials or editing. Do not upgrade a framework and do not silently fall back to core-only RUM when a detected framework plugin is incompatible.

### Detect existing RUM instrumentation

Search source, HTML, and configuration files while excluding dependency, build, generated, and coverage directories such as `node_modules`, `dist`, `build`, `.next`, `.nuxt`, and `coverage`.

Check for:

- Imports or requires from `@datadog/browser-rum`, including renamed and namespace bindings.
- Imports from any `@datadog/browser-rum-*` integration package.
- Calls bound to the imported `datadogRum.init`, including aliases and local wrapper modules.
- `DD_RUM.init`, `window.DD_RUM.init`, `DD_RUM.onReady`, and Datadog CDN loader URLs.
- Existing plugin registrations, router wrappers/providers/components, and framework error hooks.

Treat package presence alone as insufficient: a dependency may be unused.

- **No init:** add one using the selected reference.
- **One valid init:** keep its location and all existing values. Do not resolve or apply replacement credentials. Add only missing compatible plugin/router/error wiring to it.
- **One init with missing or invalid required credentials/site:** stop and report the invalid configuration; do not layer another init over it.
- **Multiple init calls or mixed npm/CDN setups:** stop and report every location unless they can be proven to be one mutually exclusive setup. Do not guess which setup should win.
- **Complete setup:** make no changes; still run the applicable verification.

## Phase 2: instrument

Resolve credentials through `references/common-credentials.md` only after analysis succeeds. If analysis found one valid existing init, reuse its existing credentials and skip credential replacement entirely. Supplied task credentials may be used only when creating a new init. Then:

1. Install the core SDK and compatible framework package(s) with the detected package manager, using the deployed frontend manifest. For an existing valid init, install only a missing integration package; never replace already-valid RUM packages or configuration.
2. Apply the canonical configuration and install method from `references/rum-core.md`. For an existing valid init, apply only missing compatible fields to that same object; do not copy credential or canonical-option placeholders over existing values.
3. Apply the selected framework reference, including router tracking and safe framework error integration when those surfaces exist.
4. Update the lockfile with the same package manager. Never hand-edit a generated lockfile.
5. Detect configured formatting from manifest scripts such as `lint:fix`, `fix`, or `format` and from ESLint/Prettier configuration. Run the project's formatter or fix command only for files changed by this work.

Do not add `allowedTracingUrls` or any backend/CORS/tracing configuration; those belong to an APM onboarding workflow.

## Phase 3: verify and report

Follow `references/common-verify-report.md`. Before reporting success, inspect the final diff against the pre-edit project. When an existing valid init was found, verify that every pre-existing init value—including both credentials—remains byte-for-byte unchanged and that the only setup changes are the required missing integration wiring (plus any strictly necessary dependency/lockfile change). If an existing value changed, restore it before reporting success. Do not report success unless required packages are persisted, the resulting setup contains exactly one init, and the normal build succeeds.

© datadog-labs · MIT · datadog-labs/agent-skills

Похожие скиллы

Все скиллы по теме «Фронтенд и UI» →
redis-observability Redis, Inc. Скилл redis-observability подсказывает, какие метрики Redis держать под наблюдением и какие встроенные команды запускать при разборе инцидентов. CX Codex +1 2 600установок cost-export ruvnet Скилл cost-export выгружает телеметрию расходов агента в формате Prometheus textfile или отправляет JSON через вебхук для внешнего мониторинга. CX Codex +1 681установок datadog devops-skills Настраивает агент Datadog, сбор логов, APM-трейсинг и метрики для сервисов и баз данных. Пригодится при развёртывании единого мониторинга инфраструктуры. CX Codex +1 347установок datadog-automation davepoon Скилл datadog-automation автоматизирует задачи мониторинга в Datadog: запросы метрик, поиск логов, управление мониторами и дашбордами, создание событий и даунтаймов. Требует подключённый Rube MCP и активную авторизацию в Datadog. CX Codex +1 124установок datadog-cli davila7 Скилл datadog-cli для Claude Code ищет логи и проверяет метрики прямо в чате агента при расследовании сбоев на проде. CX Codex +1 100установок ops-oncall-log c0x12c Скилл ops-oncall-log собирает алерты из мониторинга и пишет структурированный журнал дежурства на вики команды. Нужен в конце смены или на разборе инцидентов. CX Codex +1 ★ 111звёзд репо

Из того же набора41

Весь набор →
agent-observability-build-eval-from-annotations Скилл agent-observability-build-eval-from-annotations обучает LLM-судью Datadog LLM-Obs по готовой разметке очереди аннотаций. Помогает масштабировать ручную оценку трейсов через замеры качества. CX Codex +1 254установок agent-observability-online-experiment Скилл agent-observability-online-experiment для Claude Code запускает онлайн A/B-тесты LLM-приложений и сравнивает версии промптов или моделей на реальном трафике. CX Codex +1 170установок upgrade-browser-sdk-v6 Скилл upgrade-browser-sdk-v6 для Claude Code и Cursor проводит миграцию Datadog Browser SDK с версии 5 на 6. Применяется при обновлении зависимостей или удалении старых опций. CX Codex +1 134установок dd-product-recommender Скилл dd-product-recommender для Claude Code анализирует кодовую базу и цели проекта, чтобы подобрать подходящие продукты Datadog. CX Codex +1 130установок upgrade-browser-sdk-v5 Скилл upgrade-browser-sdk-v5 для Claude Code переносит Datadog Browser SDK с v4 на v5. Запускается при поиске старых параметров и API или CDN-ссылок с путём /v4/. CX Codex +1 124установок dd-account-setup Скилл dd-account-setup для Claude Code подключает Datadog и проверяет ключи API и регион. Запускается перед настройкой или инструментированием Datadog, а также при ошибке 403 из-за неверного региона. CX Codex +1 113установок setup-browser-sdk-sourcemaps Скилл setup-browser-sdk-sourcemaps для Claude Code настраивает загрузку JavaScript sourcemap в Datadog через плагин сборщика. RUM и Error Tracking показывают исходные stack trace вместо минифицированных. CX Codex +1 108установок dd-aws-integration Скилл dd-aws-integration для Claude Code настраивает интеграцию AWS с Datadog через Terraform и IAM. CX Codex +1 105установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой