Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 57 additions & 1 deletion .claude/skills/technical-docs/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,68 @@ Link to related docs rather than repeating content:
For automatic tracing, see <PlatformLink to="/configuration/apis/">API Reference</PlatformLink>.
```

### Code Block Filenames
### Code Block Meta Flags

Always include filename when showing file-specific code:
```tsx {filename:app/error.tsx}
```

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. *Also available for: 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:
Expand Down
2 changes: 1 addition & 1 deletion docs/platforms/javascript/guides/hono/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ Before continuing, make sure you've completed the runtime-specific steps above:
</SplitSectionText>
<SplitSectionCode>

```typescript {tabTitle:Cloudflare Workers} {filename:index.ts}
```typescript {tabTitle:Cloudflare Workers} {filename:index.ts} {mdExpandTabs}
import { Hono } from "hono";
import { sentry } from "@sentry/hono/cloudflare";

Expand Down
2 changes: 1 addition & 1 deletion scripts/generate-md-exports.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {rehypeExpandCodeTabs} from './rehype-expand-code-tabs.mjs';
const DOCS_ORIGIN = process.env.NEXT_PUBLIC_DEVELOPER_DOCS
? 'https://develop.sentry.dev'
: 'https://docs.sentry.io';
const CACHE_VERSION = 8;
const CACHE_VERSION = 9;
const CACHE_COMPRESS_LEVEL = 4;
const R2_BUCKET = process.env.NEXT_PUBLIC_DEVELOPER_DOCS
? 'sentry-develop-docs'
Expand Down
Loading
Loading