bun-react-ssr

bun-react-ssr is a skill for Claude Code from secondsky/claude-skills. It costs 33 tokens per session (2,099 once invoked), scanned A, original, MIT.

A guide to building React websites that render HTML on the server using Bun, including streaming and browser-side hydration. It covers custom setups without a full framework.

In plain words
What is it for?
Use it to start a Bun React server, serve static files, render pages, and connect the browser client to the server-rendered HTML.
Why use it?
It helps you put together the server and browser parts correctly when React must work on both sides. It also covers common rendering approaches such as producing a complete HTML string or sending it in pieces.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the bun plugin — 27 skills, 6 commands, 3 agents, 2 hooks shipped together

not rated 215repo +2 today A scan Socket: passSnyk: passSkillSpector: pass 33 tokens original MIT

Good fit Use it to start a Bun React server, serve static files, render pages, and connect the browser client to the server-rendered HTML.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/secondsky/claude-skills/bun-react-ssr
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add secondsky/claude-skills --skill bun-react-ssr
Clone the repo
git clone --depth 1 https://github.com/secondsky/claude-skills

Made for: Claude Code.

Or install bun, the plugin that ships this one along with the rest of its 27 skills, 6 commands, 3 agents, 2 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for bun-react-ssr

README.md
[![agentmods](https://agentmods.dev/badge/skills/secondsky/claude-skills/bun-react-ssr.svg)](https://agentmods.dev/skills/secondsky/claude-skills/bun-react-ssr)
Your own site
<a href="https://agentmods.dev/skills/secondsky/claude-skills/bun-react-ssr"><img src="https://agentmods.dev/badge/skills/secondsky/claude-skills/bun-react-ssr.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,099 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 4 Apr 2026
  • Snyk pass 4 Apr 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00033 $0.02099
Opus 5 $0.00016 $0.01050
Sonnet 5 $0.00007 $0.00420
Haiku 4.5 $0.00003 $0.00210

Measured 4d ago against content hash c7d54b164168, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

bun-react-ssr scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

async fetch(req) {
plugins/bun/skills/bun-react-ssr/SKILL.md · 409 lines

How it starts

The opening of the file, as written. The whole thing — 409 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Bun React SSR

Build custom server-rendered React applications with Bun.

Quick Start

# Initialize project
mkdir my-ssr-app && cd my-ssr-app
bun init

# Install dependencies
bun add react react-dom
bun add -D @types/react @types/react-dom

Basic SSR Setup

Server Entry

// src/server.tsx
import { renderToString } from "react-dom/server";
import App from "./App";

Bun.serve({
  port: 3000,
  async fetch(req) {
    const url = new URL(req.url);

    // Serve static files
    if (url.pathname.startsWith("/static/")) {
      const file = Bun.file(`./public${url.pathname}`);
      if (await file.exists()) {
        return new Response(file);
      }
    }

    // Render React app
    const html = renderToString(<App url={url.pathname} />);

    return new Response(
      `<!DOCTYPE html>
      <html>
        <head>
          <meta charset="utf-8">
          <meta name="viewport" content="width=device-width, initial-scale=1">
          <title>React SSR</title>
        </head>
        <body>
          <div id="root">${html}</div>
          <script src="/static/client.js"></script>
        </body>
      </html>`,
      {
        headers: { "Content-Type": "text/html" },
      }
    );
  },
});

console.log("Server running on http://localhost:3000");

Client Entry

// src/client.tsx
import { hydrateRoot } from "react-dom/client";
import App from "./App";

hydrateRoot(
  document.getElementById("root")!,
  <App url={window.location.pathname} />
);

React App

// src/App.tsx
interface AppProps {
  url: string;
}

export default function App({ url }: AppProps) {
  return (
    <div>
      <h1>React SSR with Bun</h1>
      <p>Current path: {url}</p>
      <button onClick={() => alert("Hydrated!")}>Click me</button>
    </div>
  );
}

Build Client Bundle

// build.ts
await Bun.build({
  entrypoints: ["./src/client.tsx"],
  outdir: "./public/static",
  target: "browser",
  minify: true,
  splitting: true,
});

Read the full file on GitHub · 409 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 409 lines · 33 tokens per session scan A c7d54b164168

Subscribe to this mod's changes

bun-react-ssr is a skill published in the GitHub repository secondsky/claude-skills (215 stars, last pushed today), licensed MIT. It adds 33 tokens to every session and 2,099 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories