error-tracking-web — скилл для Claude Code: ошибки PostHog в вебе
Скилл error-tracking-web добавляет в веб-приложение на JavaScript сбор ошибок через PostHog: перехват исключений, source maps, алерты и разбор проблем.
MIT 116 установок ★ 80 обновлён 2026-10-24
npx skills add PostHog/skills --skill error-tracking-web -a claude-codeЧто делает error-tracking-web
Скилл проводит агента через подключение error tracking PostHog к веб-приложению на JavaScript. Внутри шесть справочных файлов: установка для веба, фингерпринты, алерты, просмотр и поиск проблем, назначение задач на коллег и загрузка source maps. Агент открывает нужный файл и правит код по нему.
Ключей в коде не будет: скилл требует держать ключ проекта и host в переменных окружения. Отслеживание добавляется рядом с текущей обработкой ошибок, а не вместо неё. Сначала включается автозахват исключений в posthog.init(), потом уже ручные вызовы captureException() в error boundaries и catch. Без загрузки source maps стек-трейсы так и останутся в минифицированных бандлах, поэтому этот шаг в списке есть.
posthog-js работает только в браузере, для Node и серверного кода нужен posthog-node. posthog.init() вызывается до остальных методов. Email и имя кладут в posthog.identify(), а не в свойства событий capture(); identify() повторяют на логине и на обновлении страницы, на логауте — posthog.reset(). В SPA без роутера просмотры страниц ловят через $pageview или опцией capture_pageview со значением history_change.
Какие задачи решает
- включить сбор исключений в веб-приложении на JavaScript
- настроить загрузку source maps, чтобы стек-трейсы читались
- сгруппировать повторяющиеся ошибки по фингерпринтам
- подключить алерты о новых ошибках
- назначить разбор проблемы конкретному разработчику
Примеры запросов агенту
- Добавь error tracking PostHog в наше приложение на React, ключ возьми из
VITE_POSTHOG_KEY - Стек-трейсы приходят минифицированными, разбери шаг загрузки source maps по
references/upload-source-maps.md - Покажи, какие ошибки в PostHog стоит назначить на команду фронтенда
Как установить error-tracking-web
1Через Skills CLI (Vercel)
npx skills add PostHog/skills --skill error-tracking-web -a claude-code2Вручную: положить файлы
~/.claude/skills/error-tracking-web/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/error-tracking-web/
1Через Skills CLI (Vercel)
npx skills add PostHog/skills --skill error-tracking-web -a codex2Вручную: положить файлы
.agents/skills/error-tracking-web/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add PostHog/skills --skill error-tracking-web -a cursor2Вручную: положить файлы
.cursor/skills/error-tracking-web/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install PostHog/skills skills/posthog/all/skills/error-tracking-web2Вручную: положить файлы
.github/skills/error-tracking-web/SKILL.md1Через Skills CLI (Vercel)
npx skills add PostHog/skills --skill error-tracking-web -a gemini-cli2Командой платформы
gemini skills install https://github.com/PostHog/skills --path skills/posthog/all/skills/error-tracking-webВручную: положить файлы
.devin/skills/error-tracking-web/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add PostHog/skills --skill error-tracking-web -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы об error-tracking-web
Как установить error-tracking-web в Claude Code?
Выполните npx skills add PostHog/skills --skill error-tracking-web -a claude-code. Файл скилла окажется по пути ~/.claude/skills/error-tracking-web/SKILL.md.
Что делает error-tracking-web?
Помогает агенту подключить error tracking PostHog к веб-приложению: включает автозахват исключений, ручные captureException() на границах ошибок, загрузку source maps и алерты.
Чем posthog-js отличается от posthog-node?
posthog-js рассчитан только на браузер, импортировать его в Node нельзя. Для серверного кода берут posthog-node.
Исходный текст
SKILL.md · MIT
---
name: error-tracking-web
description: PostHog error tracking for Web (JavaScript)
metadata:
author: PostHog
version: 1.9.4
---
# PostHog error tracking for Web (JavaScript)
This skill helps you add PostHog error tracking to Web (JavaScript) applications.
## Reference files
- `references/web.md` - Web error tracking installation - docs
- `references/fingerprints.md` - Fingerprints - docs
- `references/alerts.md` - Send error tracking alerts - docs
- `references/monitoring.md` - Monitor and search issues - docs
- `references/assigning-issues.md` - Assign issues to teammates - docs
- `references/upload-source-maps.md` - Upload source maps - docs
Consult the documentation for API details and framework-specific patterns.
## Key principles
- **Environment variables**: Always use environment variables for PostHog keys and host URLs. Never hardcode them.
- **Minimal changes**: Add error tracking alongside existing error handling. Don't replace or restructure existing error handling code.
- **Autocapture first**: Enable exception autocapture in the SDK initialization before adding manual captures.
- **Source maps**: Upload source maps so stack traces resolve to original source code, not minified bundles.
- **Manual capture for boundaries**: Use `captureException()` at error boundaries and catch blocks for errors that don't propagate to the global handler.
## Framework guidelines
- Remember that source code is available in the node_modules directory
- Check package.json for type checking or build scripts to validate changes
- posthog-js is the JavaScript SDK package name
- posthog.init() MUST be called before any other PostHog methods (capture, identify, etc.)
- posthog-js is browser-only — do NOT import it in Node.js or server-side contexts (use posthog-node instead)
- Autocapture is ON by default with posthog-js (tracks clicks, form submissions, pageviews). Do NOT disable autocapture unless the user explicitly requests it.
- NEVER send PII in posthog.capture() event properties — no emails, full names, phone numbers, physical addresses, IP addresses, or user-generated content
- PII belongs in posthog.identify() person properties (email, name, role), NOT in capture() event properties
- Call posthog.identify(userId, { email, name, role }) on login AND on page refresh if the user is already logged in
- Call posthog.reset() on logout to unlink future events from the current user
- For SPAs without a framework router, capture pageviews with posthog.capture($pageview) or use the capture_pageview history_change option in init for History API routing
© PostHog · MIT · PostHog/skills