seer-embed

작성자: sentry

Add a new Seer embed widget — a rich component rendered inline in Seer's markdown output via tag syntax. Covers schema, component, registration, and backend…

npx skills add https://github.com/getsentry/sentry --skill seer-embed

Add a Seer Embed

Seer embeds are rich widgets rendered inline in Seer's markdown output using Markdoc-style tag syntax ({% name %}{ ... }{% /name %}). Each embed has a Zod schema, a React component, and a registry entry.

Before You Start

  1. Read static/app/components/seer/markdown/embeds/schemas.ts to see existing schemas.
  2. Read static/app/components/seer/markdown/embeds/index.ts to see registered embeds.
  3. Confirm the embed name doesn't already exist.

Step 1: Add the Schema

In static/app/components/seer/markdown/embeds/schemas.ts, add an entry to SEER_EMBED_SCHEMAS:

export const SEER_EMBED_SCHEMAS = {
  // ...existing entries

  myEmbed: {
    description:
      "One sentence describing what this embed does—this passes through directly to the LLM's system prompt.",
    level: ['inline'], // 'inline', 'block', or both
    schema: z.object({
      // Define the data shape the LLM will produce
      someField: z.string(),
      optionalField: z.number().optional(),
    }),
    examples: [{label: 'Basic', data: {someField: 'hello'}}],
    // featureFlag: 'organizations:seer-explorer-my-embed',  // optional
  },
} as const satisfies Record<string, SeerEmbedSchema>;

Key decisions:

  • description: Write for the LLM — it uses this to decide when to emit the embed. Be specific about the use case.
  • level: Use ['inline'] for widgets that flow within text (timestamps, badges). Use ['block'] for widgets that need their own line (cards, charts). Use both if the embed adapts.
  • schema: Use Zod. Keep it flat and simple — the LLM has to produce valid JSON. Use .default() for optional fields with sensible defaults. Use .enum() to constrain string values.
  • examples: An array of {label, data, level?} objects. Each data must be valid against the schema. These are included in the generated JSON sent to the LLM as few-shot examples. In the stories page, all examples for an embed are composed into a single markdown block and rendered through one <SeerMarkdown> — inline examples are wrapped in prose text, block examples are appended at the end. Use multiple examples to show different prop combinations or block vs inline rendering. Set level on an example only when it differs from the schema's default (first entry in level).
  • featureFlag: Set this to gate the embed behind a feature flag. The backend filters it out of the schema sent to the LLM when the flag is off.

Step 2: Create the Component

Create static/app/components/seer/markdown/embeds/components/<name>.tsx:

import {defineSeerEmbed} from 'sentry/components/seer/markdown/embeds/utils';

export const MyEmbed = defineSeerEmbed({
  name: 'myEmbed', // must match the key in SEER_EMBED_SCHEMAS
  render({someField, optionalField}) {
    // Props are typed from the Zod schema — already validated
    return <span>{someField}</span>;
  },
});

What defineSeerEmbed does for you:

  • Looks up the Zod schema by name
  • safeParses the data prop against it
  • Returns null for invalid data (logs a warning in dev)
  • Sets displayName on the component (used by the registry)

Rules:

  • The name parameter must match the key in SEER_EMBED_SCHEMAS exactly.
  • The render function receives the Zod output type — props are already parsed and validated.
  • Keep the component simple. Import existing Sentry components (DateTime, TimeSince, Link, etc.) rather than building from scratch.
  • The component receives no context about where it appears — it only gets the data from the tag body.

Step 3: Register the Component

In static/app/components/seer/markdown/embeds/index.ts, import and add it to the embeds array:

import {MyEmbed} from './components/myEmbed';
import {Timestamp} from './components/timestamp';
import {SeerEmbedRegistry} from './registry';

const embeds = [Timestamp, MyEmbed];
for (const embed of embeds) {
  SeerEmbedRegistry.register(embed.displayName, embed);
}

Registration uses displayName (set by defineSeerEmbed) as the registry key.

Step 4: Regenerate Backend Schema

Run the codegen script to update the JSON Schema file the backend sends to the Seer agent:

pnpm gen:embed-widgets

This writes to src/sentry/seer/agent/embed_widgets.generated.json. Commit this generated file — it's checked in, not gitignored.

Step 5: Verify

  1. Lint: Run pnpm run lint:js on your new files.
  2. Types: Run pnpm run typecheck to confirm the schema types flow through.
  3. Manual test: In the Seer Explorer, trigger a response that would use your embed. Or test directly:
<SeerMarkdown raw={`{% myEmbed %}{"someField":"hello"}{% /myEmbed %}`} />

File Summary

FileWhat to do
static/app/components/seer/markdown/embeds/schemas.tsAdd Zod schema entry
static/app/components/seer/markdown/embeds/components/<name>.tsxCreate component with defineSeerEmbed
static/app/components/seer/markdown/embeds/index.tsImport and register
src/sentry/seer/agent/embed_widgets.generated.jsonRegenerated by pnpm gen:embed-widgets

Optional: Feature Flag

If the embed should be gated:

  1. Add featureFlag: 'organizations:seer-explorer-<name>' to the schema entry.
  2. Register the flag in src/sentry/features/temporary.py.
  3. The backend (src/sentry/seer/agent/embed_widgets.py) automatically filters flagged embeds using features.has().

sentry의 다른 스킬

generate-frontend-forms
sentry
Sentry의 새로운 폼 시스템을 사용하여 폼을 생성하는 가이드입니다. 폼, 폼 필드, 유효성 검사 또는 자동 저장 기능을 구현할 때 사용하세요.
official
sentry-snapshots-cocoa
sentry
Apple/Cocoa 프로젝트를 위한 전체 Sentry Snapshots 설정입니다. "SnapshotPreviews 설정", "Apple 스냅샷 테스트 설정", "Apple 스냅샷 업로드" 요청 시 사용하세요.
official
architecture-review
sentry
직원 수준의 코드베이스 건강 검토. 모놀리식 모듈, 무음 실패, 타입 안전성 격차, 테스트 커버리지 구멍, LLM 친화성 문제를 찾습니다.
official
linear-type-labeler
sentry
Linear 이슈를 분류하고, 각 이슈의 제목과 설명 내용을 기반으로 Sentry 워크스페이스의 레이블 분류 체계에서 Type 레이블을 적용합니다.
official
vercel-react-best-practices
sentry
Vercel Engineering의 React 및 Next.js 성능 최적화 가이드라인입니다. 이 스킬은 React/Next.js 코드를 작성, 검토 또는 리팩토링할 때 사용해야 합니다.
official
bump-size-limit
sentry
.size-limit.js 파일에서 크기 제한을 올립니다. size-limit CI 검사가 실패할 때 사용합니다. 사용자가 크기 제한 실패, 번들 크기 검사 실패, CI 크기 문제를 언급할 때 사용하세요.
official
generate-migration
sentry
Sentry용 Django 데이터베이스 마이그레이션을 생성합니다. 마이그레이션 생성, 컬럼이나 테이블 추가/제거, 인덱스 추가, 또는 마이그레이션 충돌 해결 시 사용하세요.
official
security-review
sentry
코드 변경 사항에서 악용 가능한 애플리케이션 보안 취약점을 찾습니다. Warden 보안 스캔, 앱 보안 검토, OWASP 스타일 점검, 인증 또는…에 사용합니다.
official