Token导航 LogoToken导航

Agent Skill · 开发

sentry-common-errors(哨兵常见错误)

sentry-common-errors 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 Codex、Claude、Cursor、Gemini CLI 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

sentry-common-errors 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为接触敏感数据;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 14,867。

总安装 654周安装 27GitHub Stars 2,074下载 214核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:sentry-common-errors(哨兵常见错误)
来源仓库:https://github.com/jeremylongshore/claude-code-plugins-plus-skills
仓库路径:skills/sentry-common-errors
安装命令:
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill sentry-common-errors
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill sentry-common-errors

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

用于记录任务执行中的错误与经验缺口,帮助 Agent 持续优化行为。适合在开发流程中沉淀问题、修正实践并积累最佳经验时使用。通过 GitHub 安装,结合具体 README 验证用法和交互方式。需确认权限范围和维护状态,注意是否涉及联网或文件操作。

sentry-common-errors 属于开发类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/sentry-common-errors

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skill…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要接触敏感数据,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

sentry-common-errors 怎么安装?

在终端执行 npx skills add https://github.com/jeremylongshore/claude-code-plugins-plus-skills --skill…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

sentry-common-errors 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

sentry-common-errors 需要什么权限?

权限级别是接触敏感数据。该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

sentry-common-errors 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

sentry-common-errors 用的人多吗?

公开数据是累计安装 654 次,近一周安装 27 次,下载 214 次,GitHub 2,074 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

sentry-common-errors 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。
  • 来源仓库有 2,074 星,维护活跃度相对可查。

先想清楚的地方

  • 需要接触敏感数据,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理开发类任务、又不想每次都手写提示词的人。

不太适合

  • 环境里有大量密钥、凭证,不方便给第三方 Skill 读取的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
skill-vetter

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
sentry-common-errors

哨兵常见错误 · 本页

6542,074接触敏感数据未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Sentry Common Errors

Overview

Diagnose and fix the most frequently encountered Sentry SDK integration issues across Node.js, browser, and Python environments. Covers DSN validation, missing events, source map failures, rate limiting, SDK initialization ordering, serverless flush patterns, CORS configuration, and environment tagging.

Prerequisites

  • Sentry SDK installed (@sentry/node v8+, @sentry/browser v8+, or sentry-sdk for Python)
  • Access to Sentry dashboard with project admin or member role
  • Application logs available for inspection
  • sentry-cli installed for source map and release operations

Instructions

Step 1 — Detect the installed SDK and current configuration

!npm list @sentry/node @sentry/browser @sentry/react @sentry/nextjs 2>/dev/null | head -10 || echo "No Node.js Sentry SDK found"

!python3 -c "import sentry_sdk; print(f'sentry-sdk {sentry_sdk.VERSION}')" 2>/dev/null || echo "No Python sentry-sdk found"

!command -v sentry-cli >/dev/null && sentry-cli --version || echo "sentry-cli not installed"

Grep the project for Sentry initialization to identify the current configuration:

grep -rn "Sentry.init\|sentry_sdk.init" --include="*.ts" --include="*.js" --include="*.mjs" --include="*.py" . 2>/dev/null | head -20

Step 2 — DSN not set or invalid DSN format

The DSN (Data Source Name) tells the SDK where to send events. Format: https://<public-key>@<org>.ingest.sentry.io/<project-id>

Symptoms: No events arrive. SDK silently does nothing. debug: true shows "No DSN provided."

// WRONG — DSN is undefined because env var is missing or misspelled
Sentry.init({
  dsn: process.env.SENTRI_DSN, // Typo in env var name
});

// CORRECT — validate DSN is present before init
const dsn = process.env.SENTRY_DSN;
if (!dsn) {
  console.error('SENTRY_DSN environment variable is not set');
  process.exit(1);
}
Sentry.init({
  dsn: dsn.trim(),
  debug: true, // Enable during troubleshooting
});

Python equivalent:

import os, sentry_sdk

dsn = os.environ.get("SENTRY_DSN")
if not dsn:
    raise RuntimeError("SENTRY_DSN not set")

sentry_sdk.init(dsn=dsn.strip(), debug=True)

Step 3 — Events not appearing in dashboard

Symptoms: Sentry.captureException() runs without errors, but nothing shows up in the Sentry web UI.

Root causes and fixes:

  1. beforeSend accidentally returning null:
// WRONG — missing return drops all non-exception events
beforeSend(event) {
  if (event.exception) {
    event.tags = { ...event.tags, has_exception: 'true' };
    return event;
  }
  // Implicit return undefined = event DROPPED
}

// CORRECT — always return event unless you explicitly want to filter
beforeSend(event) {
  if (event.message?.includes('ResizeObserver loop')) {
    return null; // Intentionally drop
  }
  if (event.exception) {
    event.tags = { ...event.tags, has_exception: 'true' };
  }
  return event; // ALWAYS return at the end
}
  1. sampleRate set to 0:
// WRONG
Sentry.init({ sampleRate: 0, tracesSampleRate: 0 }); // Nothing is sent

// CORRECT
Sentry.init({ sampleRate: 1.0, tracesSampleRate: 0.1 });
  1. Missing await Sentry.flush() in serverless / CLI contexts:
// WRONG — Lambda/CLI process exits before SDK sends the event
export const handler = async (event) => {
  try {
    return await processRequest(event);
  } catch (error) {
    Sentry.captureException(error);
    throw error; // Process exits, event never sent!
  }
};

// CORRECT — flush before returning
export const handler = async (event) => {
  try {
    return await processRequest(event);
  } catch (error) {
    Sentry.captureException(error);
    await Sentry.flush(2000); // Wait up to 2s for event to send
    throw error;
  }
};

Python (AWS Lambda):

def handler(event, context):
    try:
        return process_request(event)
    except Exception as e:
        sentry_sdk.capture_exception(e)
        sentry_sdk.flush(timeout=2)  # CRITICAL for Lambda
        raise
  1. SDK initialized after error occurs:
// WRONG — error happens before Sentry.init()
import express from 'express';
app.get('/', () => { throw new Error('boom'); }); // Sentry not ready

import * as Sentry from '@sentry/node';
Sentry.init({ dsn: '...' }); // Too late

// CORRECT — Sentry FIRST
import * as Sentry from '@sentry/node';
Sentry.init({ dsn: '...' });
import express from 'express';

Diagnostic checklist for missing events:

# 1. Verify DSN is present
echo "DSN set: ${SENTRY_DSN:+yes}"

# 2. Enable debug mode and send test event
node -e "
const Sentry = require('@sentry/node');
Sentry.init({ dsn: process.env.SENTRY_DSN, debug: true });
const id = Sentry.captureMessage('Test from CLI', 'info');
console.log('Event ID:', id);
Sentry.flush(5000).then(() => console.log('Flush complete'));
"

# 3. Check Sentry service status
curl -s https://status.sentry.io/api/v2/status.json | python3 -c "
import sys, json; d = json.load(sys.stdin)
print(f\"Status: {d['status']['description']}\")
" 2>/dev/null || echo "Could not reach status.sentry.io"

Step 4 — Source maps not resolving

Symptoms: Stack traces in Sentry show minified variable names and wrong line numbers.

Root cause 1 — Release version mismatch: The release in Sentry.init() must exactly match the release name used during sentry-cli upload.

Sentry.init({ dsn: process.env.SENTRY_DSN, release: 'my-app@1.2.3' });
# During build/deploy — same version string
export VERSION="my-app@1.2.3"
sentry-cli releases new "$VERSION"
sentry-cli releases files "$VERSION" upload-sourcemaps ./dist \
  --url-prefix '~/static/js'   # Must match how browser loads the files
sentry-cli releases finalize "$VERSION"

Root cause 2 — URL prefix mismatch:

# Diagnose with the explain command
sentry-cli sourcemaps explain --org "$SENTRY_ORG" --project "$SENTRY_PROJECT" EVENT_ID
# List uploaded artifacts to verify
sentry-cli releases files "$VERSION" list

Root cause 3 — Source maps uploaded after error occurred: Sentry does not retroactively apply source maps. Upload before the release goes live.

Root cause 4 — Build tool not generating source maps:

// webpack: devtool: 'source-map'
// vite: build: { sourcemap: true }

Step 5 — 429 rate limit errors

Symptoms: Sentry returns HTTP 429. Events are dropped.

Sentry.init({
  dsn: process.env.SENTRY_DSN,
  sampleRate: 0.25,              // Send 25% of errors
  tracesSampleRate: 0.01,        // 1% of transactions
  maxBreadcrumbs: 20,            // Reduce from default 100
  ignoreErrors: [
    'ResizeObserver loop limit exceeded',
    'Non-Error promise rejection captured',
    /Loading chunk \d+ failed/,
    /Failed to fetch/,
  ],
  beforeSend(event) {
    const frames = event.exception?.values?.[0]?.stacktrace?.frames || [];
    if (frames.some(f => f.filename?.includes('extension://'))) return null;
    return event;
  },
});

Check quota: Settings > Projects > [Project] > Client Keys > Configure > Rate Limiting.

Step 6 — SDK version conflicts

Symptoms: TypeError: Sentry.X is not a function, duplicate events, or missing integrations.

# All @sentry/* packages must share the same major version
npm list | grep @sentry 2>/dev/null
# Fix: npm install @sentry/node@latest @sentry/browser@latest

SDK v8 breaking change: @sentry/tracing is removed. Tracing is built into the core:

import * as Sentry from '@sentry/node';
Sentry.init({ dsn: '...', tracesSampleRate: 0.1 }); // No @sentry/tracing needed

Step 7 — Wrong environment tag

// WRONG — hardcoded, same value in dev and prod
Sentry.init({ environment: 'production' });

// CORRECT — derive from runtime
Sentry.init({ dsn: process.env.SENTRY_DSN, environment: process.env.NODE_ENV || 'development' });

Step 8 — CORS issues with browser SDK

The standard SDK sends to https://<org>.ingest.sentry.io which has permissive CORS. If you see CORS errors:

  1. CSP blocking — add connect-src 'self' https://*.ingest.sentry.io to your CSP
  2. Tunnel misconfiguration — your tunnel endpoint must proxy and return CORS headers
  3. Ad blockers — use the tunnel option to route through your domain
Sentry.init({ dsn: process.env.SENTRY_DSN, tunnel: '/api/sentry-tunnel' });

Step 9 — Node.js process exits before events are sent

The SDK batches events asynchronously. Short-lived processes must flush before exit.

async function main() {
  try { await doWork(); }
  catch (error) { Sentry.captureException(error); }
  finally { await Sentry.flush(5000); } // CRITICAL
}

// Graceful shutdown for servers
process.on('SIGTERM', async () => {
  await Sentry.flush(5000);
  server.close(() => process.exit(0));
});

Step 10 — Express "not instrumented" warning

Sentry must initialize before importing Express so it can monkey-patch HTTP modules:

// instrument.mjs — imported first
import * as Sentry from '@sentry/node';
Sentry.init({ dsn: process.env.SENTRY_DSN, tracesSampleRate: 0.1 });

// app.mjs
import './instrument.mjs'; // FIRST
import express from 'express';
const app = express();
Sentry.setupExpressErrorHandler(app); // After all routes

Or use node --import./instrument.mjs app.mjs.

Output

  • Root cause identified from the diagnostic steps above
  • Configuration fix applied and verified with a test event
  • debug: true output confirming SDK initialization and event delivery
  • Test event visible in Sentry dashboard (search by Event ID)
  • debug: true removed after issue is resolved

Error Handling

Error / SymptomCauseSolution
Invalid Sentry DsnMalformed or empty DSN stringRe-copy DSN from Project Settings > Client Keys. Verify format: https://<key>@<org>.ingest.sentry.io/<id>
No events in dashboardbeforeSend returns undefined on some code pathsAdd explicit return event as the last line of beforeSend. Use return null only for intentional filtering
No events in dashboardsampleRate set to 0Set sampleRate: 1.0 (default) for errors. Use fractional values only for tracesSampleRate
No events in serverless/CLIProcess exits before SDK flushes its queueAdd await Sentry.flush(2000) before process.exit(), Lambda return, or CLI exit
Minified stack tracesSource map release version does not match Sentry.init({release})Ensure release string is identical in both Sentry.init() and sentry-cli releases upload
Minified stack traces--url-prefix does not match browser JS URL pathRun sentry-cli sourcemaps explain EVENT_ID to diagnose the prefix
429 Too Many RequestsProject or org quota exceededLower sampleRate/tracesSampleRate, add ignoreErrors, set server-side rate limits
TypeError: Sentry.X is not a functionMixed SDK major versions (v7 + v8)Run npm list @sentry/core to find duplicates. Upgrade all @sentry/* to same major
Express not instrumentedSentry.init() called after import expressMove init to instrument.mjs and import first, or use node --import
Wrong environment in eventsenvironment hardcoded or not setSet environment: process.env.NODE_ENV in Sentry.init()
CORS errors in browserCSP blocking *.ingest.sentry.io or tunnel missing headersAdd connect-src https://*.ingest.sentry.io to CSP, or fix tunnel CORS
Duplicate eventsError captured at multiple layersCapture at ONE level only — catch block OR error middleware, not both
Missing stack tracesSentry.captureException('string') instead of ErrorAlways pass new Error('message') — strings have no stack trace
ESM ERR_REQUIRE_ESMNode.js version below 18.19 for ESM supportUpgrade to Node.js 18.19+ or 20.6+. Use --import flag

Examples

Example 1: Debug missing events in a Next.js app Request: "Sentry captureException runs but nothing shows in the dashboard" Steps: Enable debug: true in Sentry.init(). Console showed "No DSN provided." The NEXT_PUBLIC_SENTRY_DSN env var was not set in .env.production. Added the variable, redeployed, confirmed events arrive within seconds.

Example 2: Fix source maps in a Vite + React app Request: "Stack traces in Sentry are all minified" Steps: Ran sentry-cli sourcemaps explain EVENT_ID which reported "source map not found for URL ~/assets/index-abc123.js". The --url-prefix was ~/dist but Vite serves from ~/assets. Fixed to --url-prefix '~/assets' and re-uploaded. Stack traces now resolve correctly.

Example 3: Lambda events disappearing Request: "Sentry.captureException works locally but not in AWS Lambda" Steps: Added await Sentry.flush(2000) before the Lambda handler returns. Events now arrive consistently. Wrapped handler with Sentry.wrapHandler() for automatic scope management.

Resources

Next Steps

  • After fixing, send a test event with Sentry.captureMessage('verify-fix', 'info') and confirm it appears
  • Disable debug: true before deploying to production
  • Consider setting up Sentry alerts to catch future issues early
  • Review the sentry-rate-limits skill if you hit 429 errors frequently
  • Review the sentry-release-management skill for source map upload automation

平台分布

Codex

33.55%
按下载量换算72

Claude

29.66%
按下载量换算63

Cursor

20.56%
按下载量换算44

Gemini CLI

9.49%
按下载量换算20

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

接触敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

继续浏览同类 Skills