用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/mikailustuner/OmniRule --skill error-tracking命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Bun runtime: HTTP server, file I/O, SQLite, test runner, package manager, bundler — all-in-one JS toolchain.
Clerk: Drop-in auth UI, Organizations, User management, JWT templates, webhooks, Next.js middleware integration.
Gelişmiş masaüstü, tarayıcı ve işletim sistemi kontrol yeteneği. Görsel (koordinat tabanlı) fare/klavye otomasyonu, DOM manipülasyonu, pencere yönetimi, gelişmiş dosya, ağ ve süreç yönetimini kapsar.
基于 SOC 职业分类
正在显示 SKILL.md
| name | error-tracking |
| description | Error Tracking: Sentry, Bugsnag integration, Error boundaries, Source maps, Performance monitoring. |
| triggers | {"files":["sentry.config.ts","bugsnag.config.js"],"directories":["monitoring/","error-tracking/"],"keywords":["Sentry","Bugsnag","error tracking","crash reporting","source map"]} |
| auto_load_when | Setting up error monitoring or analyzing production errors |
| agent | devops-engineer |
| tools | ["Read","Write","Bash"] |
Focus: Error collection, source maps, monitoring
Sentry SDK:
import * as Sentry from '@sentry/svelte'
Sentry.init({
dsn: process.env.SENTRY_DSN,
environment: process.env.NODE_ENV,
release: 'my-app@1.0.0',
integrations: [
Sentry.browserTracingIntegration(),
Sentry.replayIntegration()
],
tracesSampleRate: 0.1,
replaysSessionSampleRate: 0.1,
replaysOnErrorSampleRate: 1.0
})
Capture Errors:
try {
await riskyOperation()
} catch (error) {
Sentry.captureException(error)
}
Sentry.captureMessage('Something happened', 'warning')
Custom Context:
Sentry.setUser({ id: user.id, email: user.email })
Sentry.setTags({ environment: 'production' })
Sentry.setExtra({ key: 'value' })
Svelte Error Boundary:
<script>
import { onError } from '@sveltejs/kit'
onError(({ error, cause }) => {
Sentry.captureException(error, { extra: { cause } })
})
</script>
React Error Boundary:
class ErrorBoundary extends React.Component {
constructor(props) {
super(props)
this.state = { hasError: false }
}
static getDerivedStateFromError(error) {
return { hasError: true }
}
componentDidCatch(error, errorInfo) {
Sentry.captureException(error, { extra: errorInfo })
}
render() {
if (this.state.hasError) {
return <FallbackUI />
}
return this.props.children
}
}
Webpack Source Maps:
// webpack.config.js
production: {
devtool: 'source-map',
plugins: [
new SentryPlugin({
org: 'my-org',
project: 'my-project',
authToken: process.env.SENTRY_AUTH_TOKEN,
release: 'my-app@1.0.0',
include: './dist'
})
]
}
Vite Source Maps:
export default defineConfig({
build: {
sourcemap: true
},
plugins: [
sentryVitePlugin({
org: 'my-org',
project: 'my-project',
authToken: process.env.SENTRY_AUTH_TOKEN
})
]
})
Uploads After Build:
sentry-cli releases files ./dist/*.map upload-sourcemaps
Sentry Performance:
Sentry.startTransaction({
op: 'pageload',
name: 'My Page'
})
// In React
<SentryTracing>
<App />
</SentryTracing>
Custom Spans:
const transaction = Sentry.startTransaction({ name: 'my-task' })
const span = transaction.startChild({ op: 'database' })
try {
await db.query(...)
span.setStatus('ok')
} catch (e) {
span.setStatus('internal_error')
throw e
} finally {
span.finish()
transaction.finish()
}
Web Vitals:
import { onCLS, onFID, onLCP } from 'web-vitals'
onCLS(metric => Sentry.addBreadcrumb({ category: 'webvital', message: `CLS: ${metric.value}` }))
onFID(metric => Sentry.addBreadcrumb({ category: 'webvital', message: `FID: ${metric.value}` }))
onLCP(metric => Sentry.addBreadcrumb({ category: 'webvital', message: `LCP: ${metric.value}` }))
❌ No error tracking in production
✅ Always use error monitoring
❌ Capturing too much data
✅ Only capture relevant context
❌ No source maps
✅ Upload source maps for debugging
❌ Ignoring errors
✅ Triage and mark as resolved
❌ Too many alerts
✅ Filter noise, only alert critical
❌ Not tracking performance
✅ Monitor slow transactions
| Tool | SDK | Note |
|---|---|---|
| Sentry | @sentry/svelte, @sentry/node | Most popular |
| Bugsnag | @bugsnag/js | Good for React |
| Rollbar | rollbar.js | Simpler setup |
| Datadog | dd-trace | APM + errors |