JSX-MD Authoring
Use this skill for prompt components and Markdown rendering code.
Read First
packages/jsx-md/README.mdpackages/jsx-md/src/primitives.tsxpackages/jsx-md/src/render.tspackages/jsx-md/src/context.ts
Authoring Rules
- Prefer JSX-MD components over inline Markdown strings.
- Use lowercase XML intrinsics for structured LLM prompt sections such as
<context>,<instructions>, and<examples>. - Use
Mdonly as an escape hatch for genuinely undecomposable Markdown. - Escape user-supplied strings with
EscapeorescapeMarkdownwhen they should render literally. - Use
Codeblockfor fenced code and let it choose a safe fence length. - Keep
render()deterministic and synchronous. - Do not introduce React or DOM runtime assumptions into
jsx-md. - Use context only for cross-cutting rendering state, not arbitrary global state.
Text Rules
- Bare JSX text is preferred for plain prose.
- Use
{...}only when JSX syntax requires it, such as backticks, braces,<,>, or apostrophes inside the text. - Keep XML attributes primitive and serializable.
Verification
- Run
bun testinpackages/jsx-mdfor renderer changes. - Run
bun run typecheckafter export, type, or JSX runtime changes.