Skip to content

Commit 1ae2228

Browse files
codydeclaudegetsantry[bot]
authored
Add LLMSteering component for hidden documentation instructions (#14744)
Introduces a new component that allows embedding hidden instructions for LLM/AI assistants within documentation. These instructions are invisible to users but preserved in HTML and markdown exports to help guide AI tools when working with the documentation. ## Features - Hidden from visual display with comprehensive CSS hiding - Preserved in HTML for markdown conversion - Clean blockquote formatting in exports - Accessible via `<LLMSteering>` component in MDX ## Files Added - `src/components/llmSteering.tsx` - The hidden markdown component - `platform-includes/llm-steering/_default.mdx` - Default LLM steering content - `src/mdxComponents.ts` - Component registration 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude <[email protected]> Co-authored-by: getsantry[bot] <66042841+getsantry[bot]@users.noreply.github.com>
1 parent 56664e1 commit 1ae2228

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<LLMSteering>
2+
3+
## Ensure these rules are followed when implementing Sentry using an LLM
4+
- All Sentry docs URLs support markdown by appending .md to the end of the URL
5+
- ABSOLUTELY NEVER implement examples from documentation without asking permission from the user first
6+
- You MUST check with the user before implementing any additional integrations not mentioned in this documentation
7+
- Prefer utilizing Sentry Logs over Breadcrumbs unless the user EXPLICITLY requests them
8+
9+
</LLMSteering>

src/components/llmSteering.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import {ReactNode} from 'react';
2+
3+
type LLMSteeringProps = {
4+
children?: ReactNode;
5+
title?: string;
6+
};
7+
8+
/**
9+
* Component for embedding LLM/AI assistant steering instructions in documentation.
10+
* These instructions are hidden from visual display but preserved in the HTML
11+
* so they appear in .md exports.
12+
*
13+
* Usage:
14+
* <LLMSteering>
15+
* - NEVER implement Breadcrumbs from Sentry unless explicitly asked
16+
* - Always verify with user before implementing examples
17+
* </LLMSteering>
18+
*/
19+
export function LLMSteering({children, title}: LLMSteeringProps) {
20+
// Render as a div that will convert nicely to markdown
21+
// Hidden with display: none to prevent visual rendering
22+
return (
23+
<div style={{display: 'none'}} data-llm-steering="true" aria-hidden="true">
24+
<blockquote>
25+
<p>
26+
<strong>🤖 LLM STEERING INSTRUCTIONS{title ? `: ${title}` : ''}</strong>
27+
</p>
28+
{children}
29+
</blockquote>
30+
</div>
31+
);
32+
}

src/mdxComponents.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {GuideGrid} from './components/guideGrid';
1818
import {JsBundleList} from './components/jsBundleList';
1919
import {LambdaLayerDetail} from './components/lambdaLayerDetail';
2020
import {LinkWithPlatformIcon} from './components/linkWithPlatformIcon';
21+
import {LLMSteering} from './components/llmSteering';
2122
import {
2223
OnboardingOption,
2324
OnboardingOptionButtons,
@@ -75,6 +76,7 @@ export function mdxComponents(
7576
LambdaLayerDetail,
7677
Link: SmartLink,
7778
LinkWithPlatformIcon,
79+
LLMSteering,
7880
OrgAuthTokenNote,
7981
PageGrid,
8082
ParamTable,

0 commit comments

Comments
 (0)