Langsung ke konten
Skillpedia
Website & UI (frontend)48k ยท #4670

frontend-observability

Fungsinya

Sistem ini membantu Anda memahami bagaimana pengguna sungguhan berinteraksi dengan aplikasi web atau mobile Anda. Sistem ini mengumpulkan informasi tentang event, performa, dan error, sambil memastikan data terkumpul dengan andal dan tetap menghormati privasi pengguna.

Kapan dipakai

  • โœ“Untuk mengetahui tombol mana yang paling sering diklik pengguna.
  • โœ“Untuk memantau kecepatan pemuatan halaman bagi pengguna sungguhan.
  • โœ“Untuk mengidentifikasi dan melaporkan error yang terjadi di dalam aplikasi.

Link skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/frontend-observability/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/frontend-observability/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit โ†’

Contoh permintaan ke AI

โ€œSaya ingin tahu fitur mana di website saya yang paling sering digunakan pengguna dan apakah mereka mengalami error.โ€

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Sistem ini bekerja dengan merekam event penting yang terjadi di aplikasi Anda. Event tersebut dikirim ke berbagai alat analitik, tetapi jika salah satu alat gagal, alat lainnya tetap berjalan tanpa mengganggu aplikasi. Sistem ini juga mengukur performa dari sisi pengguna sungguhan dan hanya mengirim data jika pengguna memberikan persetujuan.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Frontend Observability (the field side)

When to Use

Use this skill when you need a portable, framework-agnostic field-side observability system for any React or React Native app. Establishes one typed event taxonomy (canonical event-name constants, never inline strings), a best-effort non-blocking provider fan-out so a failing or absent analytics provider can never...

Portable skill โ€” readable by Claude Code, OpenCode, Codex, Cursor, Windsurf, and others. This skill describes a field-side observability system โ€” event taxonomy, provider fan-out, real-user vitals, error reporting, consent โ€” not a dashboard or a specific vendor. It is the field complement to the frontend-lighthouse skill: Lighthouse is the lab gate (synthetic, pre-merge); this is the field (what real users actually experience). It lives in a services/analytics/ module per the frontend-architecture skill.

The goal: you can answer "what are real users doing, and what are they experiencing?" โ€” with a typed event vocabulary (no stringly-typed track("clicked_thing") scattered everywhere), a fan-out that is best-effort (a broken provider never breaks the app), real Core Web Vitals from the field, and consent respected before anything fires.


0. The five core ideas

  1. Events are a typed vocabulary. Event names are canonical constants with a union type โ€” never inline string literals. The taxonomy is reviewable in one file and the compiler rejects typos.
  2. Fan-out is best-effort and non-blocking. track() dispatches to every provider, each in its own try/catch. A missing global, a thrown provider, an unloaded script โ€” none can throw into the caller or stop the other providers.
  3. One entry point, SSR-safe. A single track(event, props) is the only way to record. It's reached through a context hook that no-ops outside a provider and on the server, so instrumented components render safely anywhere.
  4. Field vitals complement lab budgets. Real-user LCP/INP/CLS are reported to the same fan-out. Lighthouse proves the build can be fast; field vitals prove it is โ€” together they close the loop.
  5. Consent gates everything. No telemetry (events, vitals, error reports with PII) fires before opt-in. Consent state is checked at the fan-out boundary, not sprinkled through call sites.

1. Directory layout

The system is one service module plus its constants (per frontend-architecture).

src/
โ”œโ”€โ”€ constants/
โ”‚   โ””โ”€โ”€ analytics.ts           โ† canonical event names + AnalyticsEvent union
โ”œโ”€โ”€ services/analytics/
โ”‚   โ”œโ”€โ”€ index.ts               โ† barrel: track, adapters, types
โ”‚   โ”œโ”€โ”€ track.ts               โ† the best-effort fan-out (single entry point)
โ”‚   โ”œโ”€โ”€ adapters.ts            โ† one (event, props) => void per provider, window-guarded
โ”‚   โ”œโ”€โ”€ web-vitals.ts          โ† report real-user LCP/INP/CLS into track()
โ”‚   โ””โ”€โ”€ consent.ts             โ† consent gate read by the fan-out
โ”œโ”€โ”€ providers/
โ”‚   โ””โ”€โ”€ AnalyticsProvider.tsx  โ† 'use client' context exposing useAnalytics().track
โ””โ”€โ”€ error/
    โ””โ”€โ”€ ErrorBoundary.tsx      โ† reports caught render errors via the fan-out

2. The event taxonomy (typed, never inline)

One file owns every event name. Components reference constants; the union type makes typos a compile error and the catalog a single source of truth.

// constants/analytics.ts
export const ANALYTICS_EVENTS = {
  PROJECT_CLICK: "project_click",
  GITHUB_CLICK: "github_click",
  RESUME_DOWNLOAD: "resume_download",
  CONTACT_SUBMISSION: "contact_submission",
} as const;

export type AnalyticsEvent =
  (typeof ANALYTICS_EVENTS)[keyof typeof ANALYTICS_EVENTS];
// CORRECT โ€” typed constant, autocompletes, can't typo
track(ANALYTICS_EVENTS.GITHUB_CLICK, { url });

// WRONG โ€” stringly-typed, drifts, no compile check
track("github-click"); // โŒ silently a different event from "github_click"

Hard rules:

  • No inline event-name strings anywhere; only ANALYTICS_EVENTS.*.
  • Event names are snake_case and stable โ€” renaming one breaks historical dashboards, so treat the catalog as a contract.
  • Keep props shapes small and PII-light (see ยง6); prefer ids over names, never raw emails.

3. Best-effort, non-blocking fan-out

track() is the single entry point. It iterates the adapter registry, guarding each call so one provider can't affect the caller or the others.

// services/analytics/track.ts

โ€ฆ
Pertanyaan umum

Apa maksud 'framework-agnostic'?

Artinya sistem ini bisa digunakan di semua jenis proyek web atau mobile, tanpa peduli teknologi (framework) yang dipakai untuk membangunnya, misalnya React atau React Native.

Apa itu 'Core Web Vitals'?

Core Web Vitals adalah metrik penting yang mengukur pengalaman pengguna dari sisi kecepatan pemuatan, interaktivitas, dan kestabilan tampilan sebuah halaman web.

Bagaimana privasi pengguna dilindungi?

Sistem ini hanya mengumpulkan dan mengirim data (telemetri) setelah pengguna memberikan persetujuan secara eksplisit, dan data yang dikumpulkan tidak mencakup informasi pribadi yang bisa mengidentifikasi seseorang.

Detail

Deskripsi asli dari pembuat

A portable, framework-agnostic field-side observability system for any React or React Native app.

repo: sickn33/agentic-awesome-skills

Popularitas

Bintang GitHub
48k
Peringkat
#4670
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • โ€ฆ

Skill lain dari repositori ini

Skill serupa