Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问许可证需确认审计通过

sentry-react-router-framework-sdkSentry React router framework SDK 搜索

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

3,151

周安装

130

GitHub Stars

157

下载量

1,030
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:sentry-react-router-framework-sdk(Sentry React router framework SDK 搜索)
来源仓库:https://github.com/getsentry/sentry-for-ai
仓库路径:skills/sentry-react-router-framework-sdk
安装命令:
npx skills add https://github.com/getsentry/sentry-for-ai --skill sentry-react-router-framework-sdk
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/getsentry/sentry-for-ai --skill sentry-react-router-framework-sdk

简介

用于查找、检索和筛选相关信息,支持关键词和任务场景快速定位候选结果。

  • 适用于 Codex、Claude、Cursor、Gemini CLI 中需要根据来源线索快速定位信息时使用。
  • 可结合来源仓库和原始 README 继续核验具体用法,确保功能匹配实际需求。
  • 安装命令:npx skills add https://github.com/getsentry/sentry-for-ai --skill sentry-react-router-framework-sdk。
  • 建议确认权限范围和维护状态,以及是否会触发联网、命令执行或文件读写操作。

SKILL.md

All Skills > SDK Setup > React Router Framework SDK

Sentry React Router Framework SDK

Opinionated wizard that scans your React Router Framework project and guides you through complete Sentry setup across client and server entry points.

Invoke This Skill When

  • User asks to "add Sentry to React Router Framework" or "set up Sentry in React Router v7 framework mode"
  • User wants to install or configure @sentry/react-router
  • User uses React Router framework entry files (entry.client.tsx, entry.server.tsx) and wants tracing/error capture
  • User asks about reactRouterTracingIntegration, sentryOnError, createSentryHandleRequest, or React Router wizard setup
Important: This SDK is currently beta. For React Router non-framework/data/declarative mode (v5/v6/v7), use sentry-react-sdk with @sentry/react integrations instead.

Phase 1: Detect

Run these commands to understand the project before making any recommendations:

# Detect React Router Framework indicators and versions
cat package.json | grep -E '"react-router"|"@react-router/"|"react-router-dev"|"react-router-serve"'

# Detect Sentry package choice
cat package.json | grep -E '"@sentry/react-router"|"@sentry/react"|"@sentry/profiling-node"'

# Check entry point visibility and server instrumentation files
ls entry.client.tsx entry.server.tsx instrument.server.mjs react-router.config.ts vite.config.ts 2>/dev/null

# Check if React Router files are still hidden (framework mode helper command available)
cat package.json | grep -E '"reveal"|react-router'

# Detect runtime startup scripts and import strategy
cat package.json | grep -E '"dev"|"start"|NODE_OPTIONS|--import'

# Detect optional logging/profile-related dependencies
cat package.json | grep -E '"pino"|"winston"|"@sentry/profiling-node"'

# Detect companion backend directories
ls ../backend ../server ../api 2>/dev/null
cat ../go.mod ../requirements.txt ../Gemfile ../pom.xml 2>/dev/null | head -3

What to determine:

QuestionImpact
@sentry/react-router already installed?Skip install and move to feature setup
Framework entry files exposed?Need npx react-router reveal before manual config
Using @sentry/react instead?This is likely non-framework routing; redirect to sentry-react-sdk
react-router.config.ts + Vite config present?Source map upload and build-end hook setup path
NODE_OPTIONS --import available?Preferred server instrumentation startup path
@sentry/profiling-node desired/available?Enable server profiling integration
Backend directory found?Trigger Phase 4 cross-link suggestion

Phase 2: Recommend

Present a concrete recommendation based on what you found. Do not ask open-ended questions — lead with a proposal:

Recommended (core coverage):

  • Error Monitoring — always; captures client and server errors with framework hooks
  • Tracing — recommended baseline in framework apps with client/server request flow
  • Session Replay — recommended for user-facing applications

Optional (enhanced observability):

  • Profiling — server-side profiling with @sentry/profiling-node
  • Logs — structured Sentry.logger.* ingestion and correlation
  • User Feedback — in-app feedback widget/reporting flows

Recommendation logic:

FeatureRecommend when...
Error MonitoringAlways — non-negotiable baseline
TracingUsually yes in framework apps; route and request timing is high-value
Session ReplayUser-facing product or difficult UX debugging
ProfilingServer performance investigations needed; Node runtime compatibility verified
LogsTeam wants log-search and trace correlation in Sentry
User FeedbackProduct/support teams need direct in-app issue reports

Propose: *"I recommend Error Monitoring + Tracing + Session Replay first. Want me to also enable Profiling, Logs, and User Feedback?"*


Phase 3: Guide

Option 1: Wizard (Recommended)

You need to run this yourself — the wizard is interactive and may require browser login: ``bash npx @sentry/wizard@latest -i reactRouter ` It installs @sentry/react-router`, exposes React Router entry files, creates instrumentation files, updates root error handling, configures source map upload, and adds verification examples. Once it finishes, continue at Verification.

If the user skips wizard setup, continue with manual setup below.


Option 2: Manual Setup

Install packages

npm install @sentry/react-router --save

If profiling is needed:

npm install @sentry/profiling-node --save

Expose framework entry files

npx react-router reveal

Configure client in entry.client.tsx

import * as Sentry from "@sentry/react-router";
import { startTransition, StrictMode } from "react";
import { hydrateRoot } from "react-dom/client";
import { HydratedRouter } from "react-router/dom";

Sentry.init({
  dsn: "___PUBLIC_DSN___",
  sendDefaultPii: true,
  integrations: [
    Sentry.reactRouterTracingIntegration(),
    Sentry.replayIntegration(),
    Sentry.feedbackIntegration({ colorScheme: "system" }),
  ],
  enableLogs: true,
  tracesSampleRate: 1.0,
  tracePropagationTargets: [/^\//, /^https:\/\/yourserver\.io\/api/],
  replaysSessionSampleRate: 0.1,
  replaysOnErrorSampleRate: 1.0,
});

startTransition(() => {
  hydrateRoot(
    document,
    <StrictMode>
      <HydratedRouter onError={Sentry.sentryOnError} />
    </StrictMode>,
  );
});

Configure server in instrument.server.mjs

import * as Sentry from "@sentry/react-router";
import { nodeProfilingIntegration } from "@sentry/profiling-node";

Sentry.init({
  dsn: "___PUBLIC_DSN___",
  sendDefaultPii: true,
  enableLogs: true,
  integrations: [nodeProfilingIntegration()],
  tracesSampleRate: 1.0,
  profileSessionSampleRate: 1.0,
});

Wrap server handlers in entry.server.tsx

import * as Sentry from "@sentry/react-router";
import { createReadableStreamFromReadable } from "@react-router/node";
import { renderToPipeableStream } from "react-dom/server";
import { ServerRouter } from "react-router";

const handleRequest = Sentry.createSentryHandleRequest({
  ServerRouter,
  renderToPipeableStream,
  createReadableStreamFromReadable,
});

export default handleRequest;

export const handleError = Sentry.createSentryHandleError({
  logErrors: false,
});

For custom server logic, use wrapSentryHandleRequest, getMetaTagTransformer, and manual Sentry.captureException in your custom handleError.

Load server instrumentation on startup

Prefer NODE_OPTIONS --import:

{
  "scripts": {
    "dev": "NODE_OPTIONS='--import ./instrument.server.mjs' react-router dev",
    "start": "NODE_OPTIONS='--import ./instrument.server.mjs' react-router-serve ./build/server/index.js"
  }
}

Fallback for platforms where runtime flags are restricted:

import "./instrument.server.mjs";

This direct-import method can result in incomplete auto-instrumentation compared to --import.

Configure source maps

vite.config.ts:

import { reactRouter } from "@react-router/dev/vite";
import {
  sentryReactRouter,
  type SentryReactRouterBuildOptions,
} from "@sentry/react-router";
import { defineConfig } from "vite";

const sentryConfig: SentryReactRouterBuildOptions = {
  org: "___ORG_SLUG___",
  project: "___PROJECT_SLUG___",
  authToken: process.env.SENTRY_AUTH_TOKEN,
};

export default defineConfig((config) => {
  return {
    plugins: [reactRouter(), sentryReactRouter(sentryConfig, config)],
  };
});

react-router.config.ts:

import type { Config } from "@react-router/dev/config";
import { sentryOnBuildEnd } from "@sentry/react-router";

export default {
  ssr: true,
  buildEnd: async ({ viteConfig, reactRouterConfig, buildManifest }) => {
    await sentryOnBuildEnd({ viteConfig, reactRouterConfig, buildManifest });
  },
} satisfies Config;

For Each Agreed Feature

Walk through features one at a time. Load the reference file, follow steps exactly, and verify before moving on:

FeatureReferenceLoad when...
Error Monitoring${SKILL_ROOT}/references/error-monitoring.mdAlways
Tracing${SKILL_ROOT}/references/tracing.mdRoute/request performance visibility needed
Profiling${SKILL_ROOT}/references/profiling.mdServer performance analysis needed
Session Replay${SKILL_ROOT}/references/session-replay.mdUser-facing app
Logs${SKILL_ROOT}/references/logging.mdStructured logs/correlation needed
User Feedback${SKILL_ROOT}/references/user-feedback.mdIn-app feedback flows needed
Framework Features${SKILL_ROOT}/references/react-router-framework-features.mdEntry files, wrappers, source maps, startup import strategy

For each feature: Read ${SKILL_ROOT}/references/<feature>.md, follow steps exactly, verify it works.


Configuration Reference

Key Sentry.init() options

OptionTypeDefaultNotes
dsnstringRequired; SDK disabled when empty
sendDefaultPiibooleanfalseIncludes headers/IP-derived user context
integrationsIntegration[]SDK defaultsAdd tracing/replay/feedback/profiling integrations
enableLogsbooleanfalseEnables Sentry.logger.* ingestion
tracesSampleRatenumberUsually 1.0 in testing, lower in production
tracePropagationTargets`(stringRegExp)[]`SDK defaults
replaysSessionSampleRatenumberFraction of all sessions recorded
replaysOnErrorSampleRatenumberFraction of error sessions recorded
profileSessionSampleRatenumberFraction of transactions profiled (server profiling)
tunnelstringOptional ad-blocker bypass endpoint
debugbooleanfalseVerbose SDK diagnostics

Framework-specific APIs

APIPurpose
reactRouterTracingIntegration()Client-side tracing integration for framework mode
sentryOnErrorHooks into React Router HydratedRouter error reporting
createSentryHandleRequest(...)Server request wrapper for framework entry server
createSentryHandleError(...)Server error handler wrapper
wrapServerLoader(...) / wrapServerAction(...)Manual wrapping for server loaders/actions
sentryReactRouter(...)Vite plugin for source maps/build integration
sentryOnBuildEnd(...)React Router build-end hook for source map processing

Verification

Wizard-generated path

If wizard examples were generated, open /sentry-example-page and trigger test actions.

Manual error test

export async function loader() {
  throw new Error("My first Sentry error!");
}

Manual tracing test

import * as Sentry from "@sentry/react-router";

export async function loader() {
  return Sentry.startSpan(
    { op: "test", name: "My First Test Transaction" },
    () => {
      throw new Error("My first Sentry error!");
    },
  );
}

Logs test

Sentry.logger.info("User example action completed");
Sentry.logger.warn("Slow operation detected", { operation: "data_fetch", duration: 3500 });
Sentry.logger.error("Validation failed", { field: "email", reason: "Invalid email" });

Confirm in Sentry:

  • Issues: errors appear
  • Traces: transaction/span data appears
  • Profiles: profiles appear when profiling enabled
  • Replays: replay entries appear when enabled
  • Logs: log events appear when enableLogs: true
  • User Feedback: submissions appear when feedback enabled

Phase 4: Cross-Link

After completing React Router Framework setup:

  1. Check whether the app is actually non-framework routing (v5/v6/v7 data/declarative with @sentry/react).
  2. If yes, redirect to sentry-react-sdk for non-framework routing integrations.

Then check companion backend coverage:

ls ../backend ../server ../api ../go ../python 2>/dev/null
cat ../go.mod ../requirements.txt ../pyproject.toml ../Gemfile ../pom.xml 2>/dev/null | head -5
Backend detectedSuggest skill
Gosentry-go-sdk
Pythonsentry-python-sdk
Rubysentry-ruby-sdk
Node backend servicessentry-node-sdk
Java servicesUse @sentry/java docs

Troubleshooting

IssueSolution
entry.client.tsx / entry.server.tsx missingRun npx react-router reveal first
Client errors missingEnsure HydratedRouter includes onError={Sentry.sentryOnError}
Server errors missingUse createSentryHandleRequest and createSentryHandleError wrappers
Custom server handlers bypass SentryUse wrapSentryHandleRequest and manual captureException in custom handleError
Source maps not uploadedVerify sentryReactRouter plugin config and sentryOnBuildEnd hook
SENTRY_AUTH_TOKEN undefined in Vite configLoad env vars in config or use .env.sentry-build-plugin
Incomplete server auto-instrumentationPrefer NODE_OPTIONS='--import./instrument.server.mjs' startup
Profiling data missingConfirm @sentry/profiling-node installed and nodeProfilingIntegration enabled
Running unsupported Node auto-instrumentation versionUse instrumentation API/manual wrappers as documented
Non-framework app configured with @sentry/react-routerSwitch to sentry-react-sdk + @sentry/react for v5/v6/v7 non-framework routes

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.48%
按下载量换算355

Claude

28.91%
按下载量换算298

Cursor

20.15%
按下载量换算208

Gemini CLI

10.5%
按下载量换算108

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills