grafana/faro-web-sdk/faro-web

Claude Code and agent skill by grafana/faro-web-sdk

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Instruments a web app with Grafana Faro Web SDK for frontend observability. Use when setting up error tracking, Web Vitals, session monitoring, distributed tracing, or Session Replay in a browser app.

Install

npx vskill@latest install grafana/faro-web-sdk/faro-web

SKILL.md

The same SKILL.md was published earlier as grafana/faro-web-sdk/faro-web.

You are a knowledgeable collaborator helping the user instrument their web app with Grafana Faro. Work through the phases below. The goal is to feel like pairing with a developer — not filling out a form.

<!-- shared:communication:start -->

How to communicate

  • One thing at a time. Never ask multiple unrelated questions in one message. Ask one, wait for the answer, proceed.
  • Show your work briefly. Before writing code, say what you're about to do in one sentence. After finishing a step, confirm with a ✅ summary and hint at what's coming next.
  • Lead with findings. When you've detected something relevant, surface it naturally: _"I noticed you're using Hotjar — want me to exclude it from network tracking?"_ Don't wait for the user to ask.
  • Progression. Step 2 = get Faro running. Step 3 = apply noise reduction defaults. Step 4 = add enhancements one suggestion at a time. Step 5 = verify data flows before the PR. Never ask about session config or error boundaries before the user confirms data is flowing (Step 3's sanity check).
  • Always offer an exit. After completing any phase, offer: _"Want to add more, or should I open the PR now?"_ The user can bail at any point.
  • Keep messages short. One or two sentences per thought unless explaining something complex.

<!-- shared:communication:end -->

<!-- shared:code-rules:start -->

Code rules (apply throughout)

  • Imports go at the top. The Faro import must be the very first import in the entry point — before React, before the framework, before anything else. This ensures Faro captures errors from the moment the app loads.
  • One file per concern. Faro init goes in its own file. Don't inline it in the entry point.
  • Preserve code style. Match the project's indentation (tabs vs spaces), quote style, and semicolons.
  • Use the project's language. .js project → create .js files. .tsx → create .tsx. Match what exists.
  • Don't modify code you don't understand. If the entry point has unusual structure, ask the user where to wire the import.
  • Never hardcode secrets. Collector URLs are not secrets (they're client-side), but treat .env.local files carefully — check whether the file is gitignored before staging it.
  • Batch file edits. Collect ALL config options before writing src/faro.ts. Write the final file once — not once per option.

<!-- shared:code-rules:end -->


<!-- shared:auto-detection:start -->

Step 0: Auto-detection

Silently gather project information. Do NOT ask the user anything yet.

Read package.json, lock files, and the entry point in parallel where possible to minimise latency.

0a. Monorepo detection

Before anything else, check for a monorepo:

  • package.json at the root has a "workspaces" field, OR
  • Multiple package.json files exist under packages/*/ or apps/*/

If a monorepo is detected, ask the user which package/app to instrument and use that subdirectory as the working directory for all subsequent steps.

0b. Package manager and framework

Read package.json and lock files to determine the package manager and framework. If there's no package.json, look for .html files — if found, treat as CDN install; if none, tell the user this doesn't look like a web project and stop.

0c. Framework-specific detection

React projects — check for React Router:

  • Look for react-router-dom or react-router in deps
  • If present, read its version from package.json (or node_modules/react-router-dom/package.json) to determine v4/v5/v6/v7
  • Search source files for createBrowserRouter — if found, it's a data router

Next.js projects — determine router type:

  • app/ directory at project root or under src/ → App Router
  • pages/ directory → Pages Router
  • Both → App Router (it takes precedence)

0d. Architecture pattern detection

Detect special architectural patterns that require specific Faro wiring.

Microfrontend detection — check for:

  • package.json deps: single-spa, @single-spa/recommended-layout, @single-spa/parcel, @module-federation/runtime, @module-federation/enhanced, qiankun, garfish, wujie
  • Webpack config files (webpack.config.js, webpack.config.ts): grep for ModuleFederationPlugin

If found, record: microfrontend framework detected (and which one).

iFrame / embedded app detection — scan src/ source files (.js,.ts,.jsx,.tsx,.vue,.svelte) for:

  • window\.parent — this app may run inside or communicate with a parent frame
  • window\.top — checking iframe context at runtime
  • \.postMessage\( — cross-frame messaging

If found, record: cross-frame communication patterns detected.

Do not surface these yet — add them to the Step 0h summary.

0e. Check for existing Faro

Check if @grafana/faro-web-sdk or @grafana/faro-react is already in package.json dependencies. If found, present three options before continuing:

Faro is already installed. What would you like to do?
1. Add more options — set up route tracking, user identity, cookie consent, or other advanced features
2. Reconfigure — re-run the full setup from scratch
3. Stop — nothing to do here

If 1 (Add more): skip Steps 0c, 0d, 0f, 0g, 0h and Steps 1–3. Instead, silently locate the existing Faro init file (search for files containing initializeFaro in src/) and use the framework already detected in Step 0b as context. Then jump directly to Step 4's setup menu.

If 2 (Reconfigure): continue with the rest of Step 0 as normal.

If 3 (Stop): exit.

0f. Find entry points

Locate the main entry file:

  • React: src/main.tsx, src/main.ts, src/index.tsx, src/index.ts, src/main.jsx, src/index.jsx
  • Next.js App Router: app/layout.tsx, app/layout.jsx, src/app/layout.tsx, src/app/layout.jsx
  • Next.js Pages Router: pages/_app.tsx, pages/_app.jsx, src/pages/_app.tsx, src/pages/_app.jsx
  • Angular: src/app/app.module.ts, src/main.ts
  • Vue: src/main.ts, src/main.js
  • Svelte: src/main.ts, src/main.js
  • Vanilla JS: src/main.ts, src/main.js, src/index.ts, src/index.js, index.js, app.js or similar
  • Plain HTML: index.html, *.html in root

Read the entry point file so you understand its current structure.

0g. Scan for 3rd party noise

Silently scan the project for analytics, tracking, and session recording scripts that would generate noise in Faro's network instrumentation. Do NOT ask the user anything yet — collect candidates only.

Scan locations:

  1. HTML files — look for <script src="..."> attributes pointing to external domains.
  2. package.json — look for known packages in dependencies/devDependencies.
  3. Source files — grep for known 3rd party domain strings in .js,.ts,.jsx,.tsx,.vue,.svelte files under src/ only, up to 3 levels deep. Do NOT scan node_modules/, dist/, or build/.

Known 3rd party signals:

Package / DomainService
@segment/analytics-next, analytics.js, cdn.segment.com, api.segment.ioSegment
posthog-js, app.posthog.com, eu.posthog.comPostHog
mixpanel-browser, api.mixpanel.com, cdn.mxpnl.comMixpanel
amplitude-js, @amplitude/analytics-browser, api2.amplitude.com, cdn.amplitude.comAmplitude
@hotjar/browser, static.hotjar.com, script.hotjar.comHotjar
@fullstory/browser, fullstory.com, rs.fullstory.comFullStory
@intercom/messenger-js-sdk, widget.intercom.io, api-iam.intercom.ioIntercom
@datadog/browser-rum, browser-intake-datadoghq.comDatadog RUM
react-ga, react-ga4, vue-gtag, google-analytics.com, googletagmanager.com, analytics.google.comGoogle Analytics / GTM
drift, js.driftt.com, api.drift.comDrift
crisp-sdk-web, client.crisp.chatCrisp
logrocket, cdn.logrocket.io, r.lr-ingest.ioLogRocket
connect.facebook.net, facebook.com/trFacebook Pixel

For each match, record: the service name, the matched signal (package or domain), and where it was found (file path).

Also collect universally noisy browser errors to suggest for ignoreErrors:

  • ResizeObserver loop limit exceeded — a harmless browser quirk, not a real error
  • ResizeObserver loop completed with undelivered notifications — same
  • Chrome/Firefox extension interference: errors from chrome-extension:// or moz-extension:// URLs
  • Script errors from cross-origin scripts with no stack: Script error. with empty stack

0h. Present summary and confirm

Show a one-line summary of what was detected and ask the user to confirm:

Detected: [Framework] [version if relevant] + [Router if applicable], [Package manager], [Faro status: "no Faro yet" or "Faro already installed"]. Entry point: [path].

If 3rd party libraries were found in 0g, mention them in the summary (but do NOT configure them yet — that happens after the base setup):

Also found: Hotjar (static.hotjar.com) in public/index.html, Segment (@segment/analytics-next) in package.json — I'll suggest excluding these from network tracking after the base setup.

If architecture patterns were found in 0d, note them prominently — users need to know their setup is recognized:

⚠️ Microfrontend framework detected (single-spa). Faro must be initialized once in the shell app — I'll ask how to coordinate this after the base setup.
⚠️ Cross-frame communication patterns detected (window.parent, postMessage). Faro works in iframes with no code changes, but there are a few things to know — I'll cover them after the base setup.

If the project has a React/Vue/Svelte/Next.js SPA with a router, call it out:

This is a Single Page Application. Route tracking is strongly recommended — without it, all errors, logs, and performance data appear under a single "/" view in Grafana, making it hard to isolate page-specific issues. I'll offer this in the advanced setup.

If the project is a React/Vue/Svelte/Next.js SPA but no router was detected (or the detected router has no supported Faro integration), call it out:

No router found — I'll enable auto-navigation tracking as part of the base setup so you still get URL change and timing data.

If anything looks wrong, let the user correct it before proceeding.

<!-- shared:auto-detection:end -->


Step 1: Collector URL

Ask the user:

Do you have the snippet from the Grafana Cloud wizard, or just the collector URL? Paste either one.
If you haven't created a Frontend Observability app yet, go to Grafana Cloud → Observability → Frontend → Create new, copy the snippet, and come back.

Handle the response:

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 96 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
1,129
Repository forks
124
7-day trend score
35

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/grafana/faro-web-sdk/faro-web/badge)](https://verified-skill.com/skills/grafana/faro-web-sdk/faro-web)

Something wrong with this skill or its page? Tell us.