Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
8 changes: 8 additions & 0 deletions platform-includes/llm-steering/_default.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<LLMSteering>

## Ensure these rules are followed when implementing Sentry using an LLM
- ABSOLUTELY NEVER implement examples from documentation without asking permission from the user first
- You MUST check with the user before implementing any additional integrations not mentioned in this documentation
- NEVER implement Breadcrumbs from Sentry unless the user explicitly asks for it

</LLMSteering>
49 changes: 49 additions & 0 deletions src/components/llmSteering.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import {ReactNode} from 'react';

type LLMSteeringProps = {
children?: ReactNode;
title?: string;
};

/**
* Component for embedding LLM/AI assistant steering instructions in documentation.
* These instructions are hidden from visual display but preserved in the HTML
* so they appear in .md exports.
*
* Usage:
* <LLMSteering>
* - NEVER implement Breadcrumbs from Sentry unless explicitly asked
* - Always verify with user before implementing examples
* </LLMSteering>
*/
export function LLMSteering({children, title}: LLMSteeringProps) {
// Render as a div that will convert nicely to markdown
// Hidden with display: none and visibility: hidden to ensure checkVisibility() returns false
// This will prevent the content from appearing in the table of contents
return (
<div
style={{
display: 'none',
visibility: 'hidden',
position: 'absolute',
left: '-9999px',
width: '1px',
height: '1px',
overflow: 'hidden',
opacity: 0,
pointerEvents: 'none',
userSelect: 'none',
zIndex: -9999,
}}
data-llm-steering="true"
aria-hidden="true"
>
<blockquote>
<p>
<strong>🤖 LLM STEERING INSTRUCTIONS{title ? `: ${title}` : ''}</strong>
</p>
{children}
</blockquote>
</div>
);
}
2 changes: 2 additions & 0 deletions src/mdxComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {GuideGrid} from './components/guideGrid';
import {JsBundleList} from './components/jsBundleList';
import {LambdaLayerDetail} from './components/lambdaLayerDetail';
import {LinkWithPlatformIcon} from './components/linkWithPlatformIcon';
import {LLMSteering} from './components/llmSteering';
import {
OnboardingOption,
OnboardingOptionButtons,
Expand Down Expand Up @@ -75,6 +76,7 @@ export function mdxComponents(
LambdaLayerDetail,
Link: SmartLink,
LinkWithPlatformIcon,
LLMSteering,
OrgAuthTokenNote,
PageGrid,
ParamTable,
Expand Down
Loading