diff --git a/.claude/skills/technical-docs/SKILL.md b/.claude/skills/technical-docs/SKILL.md index 66601af0f403b..da9c546573576 100644 --- a/.claude/skills/technical-docs/SKILL.md +++ b/.claude/skills/technical-docs/SKILL.md @@ -130,12 +130,68 @@ Link to related docs rather than repeating content: For automatic tracing, see API Reference. ``` -### 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 (`