home / skills / andrelandgraf / fullstackrecipes / shiki-code-blocks
This skill highlights code blocks using Shiki with SSR support and automatic theme switching for seamless developer experience.
npx playbooks add skill andrelandgraf/fullstackrecipes --skill shiki-code-blocksReview the files below or copy the command above to add this skill to your agents.
---
name: shiki-code-blocks
description: Syntax highlight code blocks with Shiki. Supports server-side rendering in RSC and automatic light/dark theme switching.
---
# Shiki Code Blocks
Syntax highlight code blocks with Shiki. Supports server-side rendering in RSC and automatic light/dark theme switching.
```bash
curl -H "Accept: text/markdown" https://fullstackrecipes.com/api/recipes/shiki-code-blocks
```
This skill provides server-ready syntax highlighting for code blocks using Shiki. It renders highlighted code both server-side (RSC) and client-side with automatic light/dark theme switching. The implementation is TypeScript-friendly and optimized for production use in full-stack web AI apps.
The skill uses Shiki to tokenize and style source code, producing HTML or pre-rendered nodes on the server (RSC) so pages are delivered with highlighted code already applied. It detects the user's color scheme and switches themes automatically, while offering a fallback for client-side hydration. Integrations include easy insertion into component libraries and markdown renderers.
Does this work with server components (RSC)?
Yes. The skill supports server-side rendering so highlighted output can be generated in RSC and sent as ready HTML.
How does theme switching work?
It detects the user's preferred color scheme and switches themes automatically; you can also supply an explicit light/dark theme override.