Skill站外收录 @skilllib/skill-2117939930272415220
technical-docs
面向开发者编写和评审 Sentry SDK 技术文档,聚焦实际使用场景而非 API 列表,强调错误捕获的必要性与时机,统一示例避免重复,用清晰结构解释“为什么需要这么做”,并通过 SplitLayout、PlatformLink 等机制提升可读性与上下文关联。
文档处理 AI 技能
Skills.MD
# 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 Filenames
Always include filename when showing file-specific code:
```tsx {filename:app/error.tsx}
```
## 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?
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「technical-docs」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次