technical-docs

โดย sentry

เขียนและตรวจสอบเอกสารทางเทคนิคสำหรับเอกสาร Sentry SDK ใช้เมื่อสร้าง แก้ไข หรือตรวจสอบหน้าเอกสาร โดยเฉพาะไฟล์ MDX ใน...

npx skills add https://github.com/getsentry/sentry-docs --skill technical-docs

Technical Documentation Writing

Core Principles

1. Lead with "Why", Then "How"

Every section must answer: Why would a developer need this?

Bad:

## Server Actions
Use `captureException` in Server Actions to report errors.

Good:

## Server Actions
Server Actions that return error states to the client catch errors before Sentry sees them.
Report these manually so you don't lose visibility.

2. Structure by User Intent, Not API Surface

Organize around what developers are trying to do, not around API methods.

Bad structure (API-centric):

  • captureException
  • captureMessage
  • withScope

Good structure (intent-centric):

  • Errors that need manual capture (and why)
  • Adding context to errors
  • Troubleshooting missing errors

3. Avoid Redundant Examples

If the same pattern appears in multiple sections, consolidate it.

Ask yourself: "Am I showing the same code pattern again? If yes, reference the earlier example instead."

Bad:

## Error Boundaries
Sentry.captureException(error);

## Server Actions
Sentry.captureException(error);

## API Routes
Sentry.captureException(error);

Good:

## Where Manual Capture is Needed

These Next.js patterns catch errors before Sentry sees them:
- Error boundaries (error.tsx files)
- Server Actions returning error states
- API routes with custom error responses

[Single example with explanation of the pattern]

4. Be Precise About When/Why

Don't just show code. Explain the specific condition that requires this approach.

Bad:

Add captureException to report these errors.

Good:

Next.js error boundaries intercept errors before they bubble up to Sentry's global handler.
Without manual capture here, these errors silently disappear from your Sentry dashboard.

5. Concise for Humans, Complete for Context

Write clearly and concisely. Long pages with repeated patterns lose readers.

  • Keep explanatory text short and direct
  • One code example per concept (not per location)
  • Use TL;DR summaries for long sections
  • Prefer bullet points over prose for lists

6. Best Practices as Guidance, Not Repetition

Best practices should add new information, not repeat earlier examples.

Bad best practice:

## Best Practices
### Use captureException in Error Boundaries
[same code shown earlier]

Good best practice:

## Quick Reference
- Error boundaries: Required for visibility (errors intercepted by Next.js)
- Server errors: Automatic unless you return custom responses
- Client errors: Automatic for unhandled exceptions

Sentry Docs Specific Patterns

SplitLayout Usage

Use <SplitLayout> for side-by-side text/code when:

  • The code directly illustrates the text
  • Both are needed to understand the concept

Don't use when:

  • Showing a directory structure (use plain code block)
  • The text is just "here's an example" (just show the code)

PlatformLink Usage

Link to related docs rather than repeating content:

For automatic tracing, see <PlatformLink to="/configuration/apis/">API Reference</PlatformLink>.

Code Block Meta Flags

Always include filename when showing file-specific code:

Consecutive fenced code blocks are automatically grouped into tabbed code snippets. Each tab can have a title and filename:

```swift {tabTitle:Swift}
SentrySDK.capture(error: error)
```

```objc {tabTitle:Objective-C}
[SentrySDK captureError:error];
```

Markdown Export and {mdExpandTabs}

The .md export (mainly used by LLMs via the "Copy page" button) collapses tab groups by default: only the first tab is included, with a note listing the other tabs (e.g. Other available variations of the above snippet: yarn, pnpm). This keeps context lean when tabs show trivial variations an LLM can infer on its own.

Add {mdExpandTabs} to the first code fence in a group when the tabs contain code an LLM cannot reliably derive from seeing just one tab. This is rare — most times, adding only one tab to the produced .md is enough.

```swift {tabTitle:Swift} {mdExpandTabs}
SentrySDK.start { options in
    options.dsn = "..."
}
```

```objc {tabTitle:Objective-C}
[SentrySDK startWithConfigureOptions:^(SentryOptions *options) {
    options.dsn = @"...";
}];
```

Expand — the code is too different for an LLM to infer:

  • Different languages: Swift / Objective-C, cross-language guides (JS/Python/PHP/Ruby/...)
  • Different setup flows: Hono guide init (Cloudflare vs Node.js --import vs Bun)
  • Different APIs or wrappers: GCP Cloud Functions (wrapHttpFunction vs wrapCloudEventFunction), serverless async/sync handlers
  • Different framework versions with distinct imports: Spring 5/6/7, Spring Boot 2/3/4, Svelte v5+ / v3
  • Client / Server splits: Next.js, Remix, React Router (Replay + browser tracing vs Node integrations)
  • Different platform tooling: KMP (commonMain / iosApp / androidApp), Flutter navigation (Navigator / GoRouter / AutoRoute)
  • Install methods with different patterns: npm (import) vs CDN (<script>) vs Loader (sentryOnLoad)
  • SDK version migration: SDK 2.x vs 1.x when APIs differ

Collapse (default) — an LLM can figure it out from one tab:

  • Package managers: npm / yarn / pnpm, pip / uv, .NET CLI / NuGet
  • Module format: ESM / CommonJS (same API, different import syntax)
  • Config file formats: JSON / TOML, properties / yml
  • Java / Kotlin on the same platform (same APIs, syntactic sugar differences)
  • Runtime tabs where only the import path changes (e.g. @sentry/hono/cloudflare vs @sentry/hono/node in platform-includes/ snippets)
  • Build tools when only dependency declaration syntax differs: Gradle / Maven / SBT

Review Checklist

When reviewing documentation:

  • Does each section explain WHY before HOW?
  • Is the same code pattern shown multiple times? (consolidate if yes)
  • Would a developer know WHEN to use this approach?
  • Can any section be shortened without losing meaning?
  • Are best practices adding new info or just repeating?

Skills เพิ่มเติมจาก sentry

generate-frontend-forms
sentry
คู่มือการสร้างฟอร์มโดยใช้ระบบฟอร์มใหม่ของ Sentry ใช้เมื่อต้องการสร้างฟอร์ม ฟิลด์ฟอร์ม การตรวจสอบความถูกต้อง หรือฟังก์ชันบันทึกอัตโนมัติ
official
sentry-snapshots-cocoa
sentry
การตั้งค่า Sentry Snapshots แบบสมบูรณ์สำหรับโปรเจกต์ Apple/Cocoa ใช้เมื่อถูกขอให้ "ตั้งค่า SnapshotPreviews", "ตั้งค่าการทดสอบ snapshot ของ Apple", "อัปโหลด snapshots ของ Apple ไปยัง…
official
architecture-review
sentry
การตรวจสอบสุขภาพโค้ดเบสระดับทีมงาน ค้นหาโมดูลขนาดใหญ่ที่รวมทุกอย่างไว้ด้วยกัน ความล้มเหลวที่ไม่มีสัญญาณเตือน ช่องว่างด้านความปลอดภัยของชนิดข้อมูล ช่องโหว่ของความครอบคลุมการทดสอบ และปัญหาที่เป็นมิตรกับ LLM
official
linear-type-labeler
sentry
จำแนกประเภทของ Linear issues และใช้ป้ายกำกับประเภทจากระบบป้ายกำกับของ Sentry workspace ตามเนื้อหาของชื่อและคำอธิบายของแต่ละ issue
official
sentry-flutter-sdk
sentry
การตั้งค่า Sentry SDK แบบเต็มสำหรับ Flutter และ Dart ใช้เมื่อถูกขอให้ "เพิ่ม Sentry ใน Flutter", "ติดตั้ง sentry_flutter", "ตั้งค่า Sentry ใน Dart" หรือกำหนดค่าข้อผิดพลาด...
official
sentry-svelte-sdk
sentry
การตั้งค่า Sentry SDK อย่างสมบูรณ์สำหรับ Svelte และ SvelteKit ใช้เมื่อถูกขอให้ "เพิ่ม Sentry ไปยัง Svelte", "เพิ่ม Sentry ไปยัง SvelteKit", "ติดตั้ง @sentry/sveltekit" หรือกำหนดค่า…
official
vercel-react-best-practices
sentry
แนวทางปฏิบัติที่ดีที่สุดในการเพิ่มประสิทธิภาพ React และ Next.js จากทีมวิศวกรรมของ Vercel ควรใช้ทักษะนี้เมื่อเขียน ตรวจสอบ หรือปรับโครงสร้าง React/Next.js…
official
sentry-tanstack-start-sdk
sentry
การตั้งค่า Sentry SDK แบบเต็มสำหรับ TanStack Start React ใช้เมื่อถูกขอให้ "เพิ่ม Sentry ไปยัง TanStack Start", "ติดตั้ง @sentry/tanstackstart-react" หรือกำหนดค่าข้อผิดพลาด…
official