Skip to content

Commit 93fcaf8

Browse files
committed
Adding components for llmSteering functionality
1 parent 9130ecd commit 93fcaf8

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

src/components/llmSteering.tsx

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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 blockquote that will convert nicely to markdown
21+
// Hidden with inline styles so it's invisible in the browser
22+
return (
23+
<blockquote
24+
style={{
25+
position: 'absolute',
26+
left: '-9999px',
27+
width: '1px',
28+
height: '1px',
29+
overflow: 'hidden',
30+
// Additional hiding for extra safety
31+
opacity: 0,
32+
pointerEvents: 'none',
33+
userSelect: 'none',
34+
zIndex: -9999
35+
}}
36+
data-llm-steering="true"
37+
aria-hidden="true"
38+
>
39+
<p>
40+
<strong>🤖 LLM STEERING INSTRUCTIONS{title ? `: ${title}` : ''}</strong>
41+
</p>
42+
{children}
43+
</blockquote>
44+
);
45+
}

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,
@@ -74,6 +75,7 @@ export function mdxComponents(
7475
LambdaLayerDetail,
7576
Link: SmartLink,
7677
LinkWithPlatformIcon,
78+
LLMSteering,
7779
OrgAuthTokenNote,
7880
PageGrid,
7981
ParamTable,

0 commit comments

Comments
 (0)