markdown
Skill8 starsChanged 5 months agoMITView on GitHub
Render and customize assistant message text as markdown in assistant-ui. Use when displaying model output as formatted markdown with MarkdownTextPrimitive from @assistant-ui/react-markdown wired into the MessagePrimitive.Parts text branch, configuring remarkPlugins (remark-gfm, remark-math) and rehypePlugins (rehype-katex), or memoizing components with unstable_memoizeMarkdownComponents. Covers code-block syntax highlighting via react-shiki or react-syntax-highlighter registered as SyntaxHighlighter in components/componentsByLanguage, LaTeX math rendering with KaTeX, Mermaid diagrams gated on stream completion, custom math delimiters via preprocess, and the StreamdownTextPrimitive alternative from @assistant-ui/react-streamdown with built-in Shiki/KaTeX/Mermaid and block streaming. For general chat UI composition route to primitives.
20 other projects use a version of this.
Adopted by
Most recently taken up by
- instrument-org/skillstheir own version, first seen Nov 29, 2026
- ninthspace/claude-skillstheir own version, first seen Nov 29, 2026
- ryanmat/adwtheir own version, first seen Nov 22, 2026
- p-chan/agent-skillstheir own version, first seen Nov 16, 2026
- p-chan/skillstheir own version, first seen Nov 16, 2026
- tahianahajanirina/claude-skillstheir own version, first seen Nov 15, 2026
Used with
Projects with it also use changeset and typescript.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
MaxGfellerSkillchangeset
Draft a Changesets file for modified public packages in this repo.
Also in 3 projects that use this
MicrosoftSkilltypescript
TypeScript best practices for this monorepo. Use this skill when: (1) writing new TypeScript code, (2) reviewing TypeScript code, (3) working with API responses, fetch calls, or JSON parsing, (4) adding or modifying types and interfaces.
Also in 4 projects that use this
Other versions20 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 20
- mattmireles/gemma-tuner-multimodal★ 1.5ksame name
- DaveSkender/Stock.Indicators★ 1.3ksame name
- wado-lang/wado★ 122same name
- tuanductran/hr-skills★ 58same name
- testdino-hq/google-styleguides-skills★ 15same name
- flowing-abyss/obsidian-vault-skills★ 9same name
- bsene/skills★ 7same name
- bmaltais/skills★ 2same name
- quatico-solutions/agent-skills★ 2same name
- ryanmat/adw★ 2same name
10 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository16 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- public/llms-full.txtllms.txt
- public/llms.txtllms.txt
- assistant-uiSkill
- cloudSkill
- copilotsSkill
- observabilitySkill
- primitivesSkill
- react-mcpSkill
- runtimeSkill
- setupSkill
- speckit-agent-context-updateSkill
- streamingSkill
- thread-listSkill
- toolsSkill
- updateSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 15 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 52
KaTeX has no styling: Import katex/dist/katex.min.css once at the app root.
“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
assistant-ui Markdown
Always consult assistant-ui.com/llms.txt for the latest API.
Render and customize assistant message text as markdown with MarkdownTextPrimitive from @assistant-ui/react-markdown, wired into the MessagePrimitive.Parts text branch.
References
- ./references/markdown-text.md -- MarkdownTextPrimitive setup
- ./references/syntax-highlighting.md -- code highlighting (react-shiki / react-syntax-highlighter)
- ./references/latex-mermaid.md -- LaTeX and Mermaid
- ./references/streamdown.md -- StreamdownTextPrimitive alternative
Orientation
MarkdownTextPrimitive renders one text part as markdown. The registry component (npx assistant-ui@latest add markdown-text) generates components/assistant-ui/markdown-text.tsx, which exports a memoized MarkdownText built on the primitive plus a defaultComponents map from unstable_memoizeMarkdownComponents. Render MarkdownText from the text branch of MessagePrimitive.Parts.
import "@assistant-ui/react-markdown/styles/dot.css";
import { MarkdownTextPrimitive } from "@assistant-ui/react-markdown";
import { MessagePrimitive } from "@assistant-ui/react";
import remarkGfm from "remark-gfm";
import { memo } from "react";
const MarkdownTextImpl = () => (
<MarkdownTextPrimitive
remarkPlugins={[remarkGfm]}
className="aui-md"
components={defaultComponents}
/>
);
export const MarkdownText = memo(MarkdownTextImpl);
<MessagePrimitive.Parts>
{({ part }) => (part.type === "text" ? <MarkdownText /> : null)}
</MessagePrimitive.Parts>;Add highlighting, math, or diagrams by extending the same primitive: rehypePlugins for KaTeX, componentsByLanguage for a per-language SyntaxHighlighter (Mermaid, diff), and preprocess to normalize raw text before parsing. See the references for each. For a batteries-included alternative with built-in Shiki, KaTeX, Mermaid, and block streaming, swap in StreamdownTextPrimitive from @assistant-ui/react-streamdown.
Common Gotchas
- Nothing renders / plain text shows. The
textbranch must returnMarkdownText; returning<p>{part.text}</p>bypasses markdown entirely. - No syntax highlighting. Highlighting is not bundled. Register a
SyntaxHighlighterindefaultComponents(react-shiki recommended) per the syntax-highlighting reference. - KaTeX has no styling. Import
katex/dist/katex.min.cssonce at the app root;rehypeKatexonly emits markup. - Mermaid parses partial diagrams while streaming. Gate rendering on stream completion (the reference uses
useAuiStateto detect the closing fence) instead of rendering every delta. - Memoization export name. The package exports
unstable_memoizeMarkdownComponents; the generated file aliases it tomemoizeMarkdownComponents. - Unstyled by default. The
aui-mdclass andstyles/dot.cssprovide base styling; add your own Tailwind/CSS otherwise.
Related Skills
- primitives -- general UI composition (
ThreadPrimitive,ComposerPrimitive,MessagePrimitive.Parts) for assembling the message and the rest of the chat surface around the markdown text branch.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

