sentry-best-practices
БесплатноБез исполняемых скриптовНе проверенCapture exceptions, attach user/context, add spans and breadcrumbs, and log via the Sentry SDK. Use when instrumenting errors, performance, or context in app…
от andrelandgraf★ 22 звезды на GitHubОб этом скилле
Sentry Best Practices
Capture exceptions, add context, trace performance, and log with Sentry.
Prerequisites
Complete these setup recipes first:
- Sentry Setup
Capturing Exceptions
Capture errors that are handled but still worth tracking.
import * as Sentry from "@sentry/nextjs";
try {
await riskyOperation();
} catch (err) {
Sentry.captureException(err);
}
Adding Context
setUser persists for the session. Attach tags (indexed, filterable) and extra (arbitrary detail) per exception.
import * as Sentry from "@sentry/nextjs";
Sentry.setUser({ id: session.user.id, email: session.user.email });
Sentry.captureException(err, {
tags: { feature: "checkout", plan: "pro" },
extra: { orderId: "order_123", items: cart.items },
});
Clear the user on sign out.
Sentry.setUser(null);
Performance Tracing
Wrap meaningful operations in startSpan. The sync form receives the span for attributes.
import * as Sentry from "@sentry/nextjs";
const users = await Sentry.startSpan(
{ op: "http.client", name: "GET /api/users" },
async () => (await fetch("/api/users")).json(),
);
Sentry.startSpan({ op: "ui.click", name: "Submit Button Click" }, (span) => {
span.setAttribute("form", "checkout");
processSubmit();
});
Breadcrumbs
Console logs, fetches, and UI clicks are captured automatically. Add manual breadcrumbs for custom events.
import * as Sentry from "@sentry/nextjs";
Sentry.addBreadcrumb({
category: "auth",
message: "User signed in",
level: "info",
});
Sentry Logger
Structured logs surface in the Logs tab.
import * as Sentry from "@sentry/nextjs";
const { logger } = Sentry;
logger.info("Payment processed", { orderId: "123", amount: 99.99 });
logger.warn("Rate limit approaching", { current: 90, max: 100 });
logger.error("Payment failed", { orderId: "123", reason: "declined" });
References
Установить sentry-best-practices в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл sentry-best-practices?
Capture exceptions, attach user/context, add spans and breadcrumbs, and log via the Sentry SDK. Use when instrumenting errors, performance, or context in app code.
Как установить скилл sentry-best-practices?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл sentry-best-practices запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic