grafana/faro-web-sdk/faro-web
Claude Code and agent skill by grafana/faro-web-sdk
- community
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-webSKILL.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.
.jsproject → create.jsfiles..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.localfiles 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.jsonat the root has a"workspaces"field, OR- Multiple
package.jsonfiles exist underpackages/*/orapps/*/
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-domorreact-routerin deps - If present, read its version from
package.json(ornode_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 undersrc/→ App Routerpages/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.jsondeps: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 forModuleFederationPlugin
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 framewindow\.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 features2. Reconfigure — re-run the full setup from scratch3. 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.jsor similar - Plain HTML:
index.html,*.htmlin 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:
- HTML files — look for
<script src="...">attributes pointing to external domains. package.json— look for known packages in dependencies/devDependencies.- Source files — grep for known 3rd party domain strings in
.js,.ts,.jsx,.tsx,.vue,.sveltefiles undersrc/only, up to 3 levels deep. Do NOT scannode_modules/,dist/, orbuild/.
Known 3rd party signals:
| Package / Domain | Service | |
|---|---|---|
@segment/analytics-next, analytics.js, cdn.segment.com, api.segment.io | Segment | |
posthog-js, app.posthog.com, eu.posthog.com | PostHog | |
mixpanel-browser, api.mixpanel.com, cdn.mxpnl.com | Mixpanel | |
amplitude-js, @amplitude/analytics-browser, api2.amplitude.com, cdn.amplitude.com | Amplitude | |
@hotjar/browser, static.hotjar.com, script.hotjar.com | Hotjar | |
@fullstory/browser, fullstory.com, rs.fullstory.com | FullStory | |
@intercom/messenger-js-sdk, widget.intercom.io, api-iam.intercom.io | Intercom | |
@datadog/browser-rum, browser-intake-datadoghq.com | Datadog RUM | |
react-ga, react-ga4, vue-gtag, google-analytics.com, googletagmanager.com, analytics.google.com | Google Analytics / GTM | |
drift, js.driftt.com, api.drift.com | Drift | |
crisp-sdk-web, client.crisp.chat | Crisp | |
logrocket, cdn.logrocket.io, r.lr-ingest.io | LogRocket | |
connect.facebook.net, facebook.com/tr | Facebook 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 errorResizeObserver loop completed with undelivered notifications— same- Chrome/Firefox extension interference: errors from
chrome-extension://ormoz-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) inpublic/index.html, Segment (@segment/analytics-next) inpackage.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
- SKILL.md in the repositoryCheckingai/grafana-cloud/faro-setup/skills/faro-web/SKILL.md
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
[](https://verified-skill.com/skills/grafana/faro-web-sdk/faro-web)