Agent skill

Streaming Ssr

by justrach in justrach/merjs

Add streaming SSR to a merjs page. An agent skill from justrach/merjs.

MITAuto-check passedBackend & APIs

Install Streaming Ssr

skills CLI
$ npx skills add justrach/merjs --skill streaming-ssr -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install justrach/merjs streaming-ssr --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/justrach/merjs.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/streaming-ssr .claude/skills/streaming-ssr && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
streaming-ssr
GitHub stars
357
Token cost
~1.1k tokens
SKILL.md length
258 words
Files
1
Skills in repo
6
Repo updated
First seen
Licence
MIT

At a glance

Add streaming SSR to a merjs page. An agent skill from justrach/merjs.

  • Works in 6 steps: renderStream is called instead of render… → stream.write(html) flushes bytes to the… → stream.placeholder(id, skeleton_html)… → …
  • The user wants shell-first rendering
  • SKILL.md covers How it works, Steps, Key rules and Live example, plus 1 more section
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Streaming Ssr is an agent skill from justrach/merjs. Add streaming SSR to a merjs page. Use when the user wants shell-first rendering, skeleton placeholders, or parallel data fetching that resolves inline.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs. It works with WebAssembly and Cloudflare Workers. The repository describes itself as: A Zig-native web framework. File-based routing, SSR, type-safe APIs, WASM client interactivity. No Node. No npm. Just zig build serve. The licence is MIT.

When your agent uses it

  • The user wants shell-first rendering
  • Skeleton placeholders
  • Parallel data fetching that resolves inline

Example prompts

  • “/streaming-ssr”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. renderStream is called instead of render when the route is hit
  2. stream.write(html) flushes bytes to the browser immediately (chunked transfer encoding)
  3. stream.placeholder(id, skeleton_html) writes a shimmer skeleton + into the live DOM
  4. mer.fetchAll() fetches multiple URLs in parallel (threads on dev server, two-phase WASM bridge on Cloudflare Workers)
  5. stream.resolve(id, real_html) injects a hidden div + inline that swaps the skeleton with real content
  6. stream.flush() ends the response

What it can do on your machine

Read from SKILL.md and the folder at commit 28b53d8. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are zig).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • merlionjs.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Streaming Ssr loads about 1.1k tokens when it runs. Until then it costs about 42 tokens; SKILL.md has 258 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~42
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from justrach/merjs at commit 28b53d8, republished under its MIT licence (© justrach). 258 words, ~1,118 tokens.

Download SKILL.mdSave it as .claude/skills/streaming-ssr/SKILL.md (or your agent's skills folder).
name
streaming-ssr
description
Add streaming SSR to a merjs page. Use when the user wants shell-first rendering, skeleton placeholders, or parallel data fetching that resolves inline.
argument-hint
[page-name]
disable-model-invocation
true

Add Streaming SSR to a merjs page

Scaffold or upgrade app/$ARGUMENTS.zig to use renderStream — shell-first streaming with skeleton placeholders that resolve as data arrives.

How it works

  1. renderStream is called instead of render when the route is hit
  2. stream.write(html) flushes bytes to the browser immediately (chunked transfer encoding)
  3. stream.placeholder(id, skeleton_html) writes a shimmer skeleton + <div id="P:id"> into the live DOM
  4. mer.fetchAll() fetches multiple URLs in parallel (threads on dev server, two-phase WASM bridge on Cloudflare Workers)
  5. stream.resolve(id, real_html) injects a hidden div + inline <script> that swaps the skeleton with real content
  6. stream.flush() ends the response

On Cloudflare Workers, mer.fetchAll() uses a two-phase JS bridge:

  • Phase 1: WASM dry-run collects URLs (collect_fetch_urls)
  • Phase 2: JS fetches all in parallel via Workers native fetch()
  • Phase 3: results injected into WASM cache, full render proceeds

Steps

  1. Create or update app/$ARGUMENTS.zig:
zig
const std = @import("std");
const mer = @import("mer");

pub const meta: mer.Meta = .{
    .title = "PAGE_TITLE",
    .description = "PAGE_DESCRIPTION",
    .extra_head = "<style>" ++ page_css ++ "</style>",
};

// Fallback for non-streaming clients (required)
pub fn render(req: mer.Request) mer.Response {
    _ = req;
    return mer.html("<p>Requires streaming.</p>");
}

pub fn renderStream(req: mer.Request, stream: *mer.StreamWriter) void {
    const alloc = req.allocator;

    // Shell hits browser immediately — before any fetch
    stream.write(
        \\<div class="page">
        \\  <h1>PAGE_TITLE</h1>
    );

    // Skeleton placeholders — visible in DOM while fetching
    stream.placeholder("section-a",
        \\<div class="skeleton">Loading...</div>
    );

    // Fetch multiple URLs in parallel
    const results = mer.fetchAll(alloc, &.{
        .{ .url = "https://api.example.com/data-a" },
        .{ .url = "https://api.example.com/data-b" },
    });
    defer for (results) |r| if (r) |ok| ok.deinit(alloc);

    // Resolve skeleton → real content inline
    if (results[0]) |res| {
        stream.resolve("section-a", buildCard(alloc, res.body));
    } else {
        stream.resolve("section-a", "<p>Failed to load.</p>");
    }

    stream.write("</div>");
    stream.flush();
}

fn buildCard(alloc: std.mem.Allocator, body: []u8) []const u8 {
    _ = body;
    return std.fmt.allocPrint(alloc, "<div class=\"card\">data</div>", .{}) catch "error";
}

const page_css =
    \\.page { max-width: 640px; margin: 0 auto; }
    \\.card { background: var(--bg2); border-radius: 10px; padding: 20px; }
    \\.skeleton { background: var(--bg3); border-radius: 10px; padding: 20px; height: 80px;
    \\  position: relative; overflow: hidden; }
    \\.skeleton::after { content:''; position:absolute; inset:0;
    \\  background:linear-gradient(90deg,transparent,rgba(255,255,255,0.25),transparent);
    \\  animation:shimmer 1.5s infinite; }
    \\@keyframes shimmer { 0%{transform:translateX(-100%)} 100%{transform:translateX(100%)} }
;
  1. Run zig build codegen to register the route
  2. Run zig build serve and visit the route — watch skeletons resolve

Key rules

  • MUST export both render (fallback) and renderStream
  • MUST export pub const meta: mer.Meta
  • stream.placeholder(id, skeleton) must come BEFORE mer.fetchAll
  • stream.resolve(id, html) must come AFTER results are ready
  • stream.flush() must be called at the end
  • mer.fetchAll returns []?mer.FetchResult — always handle the null case
  • Always defer deinit on results to free memory
  • The id passed to placeholder and resolve must match exactly

Live example

See also

  • src/mer.zig — StreamWriter, fetchAll, placeholder, resolve
  • src/ssr.zig — streaming engine
  • src/router.zig — dispatchStream / dispatchBuffered
  • src/worker.zig — two-phase fetch exports (collect_fetch_urls, provide_fetch_result)
  • PRIMITIVES.md — full API reference

© justrach, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/streaming-ssr of justrach/merjs.

Open the folder on GitHubat commit 28b53d8

Compare with similar skills

Streaming Ssr next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Streaming Ssr compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Streaming Ssr this skilljustrach/merjs357—~1.1kAutomated safety check: PassMIT
Stash Edgecipherstash/stack157—~6.4kAutomated safety check: NotesMIT
Crossbindcrossbind/crossbind148—~1.1kAutomated safety check: PassMIT
RuView CLI, API and WASMruvnet/RuView97k—~1.2kAutomated safety check: NotesMIT
Spider Kingaoyunyang/spider-king-skill509—~7.3kAutomated safety check: PassMIT
Durable Objectscloudflare/skills3k2 repos~1.5kAutomated safety check: PassApache-2.0

Similar skills

  • Stash Edge

    cipherstash/stack

    Run CipherStash encryption on edge and non-Node runtimes with the @cipherstash/stack/wasm-inline entry — Deno, Supabase Edge Functions, Cloudflare Workers, and Bun.

    157 GitHub stars~6.4k tokensUpdated today
    DatabasesAuto-check: notes
  • Crossbind

    crossbind/crossbind

    A skill your agent uses when a user wants to call C++ or Rust from JavaScript or TypeScript; add a native library such as GDAL, SQLite, OpenSSL, GEOS or PROJ to a browser, Node.js, Cloudflare Worker…

    148 GitHub stars~1.1k tokensUpdated yesterday
    MobileAuto-check passed
  • Covers the RuView `wifi-densepose` command line binary, its Axum REST API and the WebAssembly builds for browsers and ESP32, for embedding or scripting RuView.

    97k GitHub stars~1.2k tokensUpdated today
    Backend & APIsAuto-check: notes
  • Spider King

    aoyunyang/spider-king-skill

    Pure-web protocol reverse skill: turn hostile browser clients into browser-free Python collectors.

    509 GitHub stars~7.3k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed
  • Durable Objects

    cloudflare/skills

    Official

    Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination.

    3k GitHub starsUsed in 2 repos~1.5k tokens
    Backend & APIsAuto-check passed
  • Durable Objects

    hodgef/apiker

    Create and review Cloudflare Durable Objects. An agent skill from hodgef/apiker.

    127 GitHub starsUsed in 4 repos~1.5k tokens
    Backend & APIsAuto-check passed

More from justrach/merjs

  • Merjs

    justrach/merjs

    Work with the merjs Zig web framework. An agent skill from justrach/merjs.

    357 GitHub stars~4k tokensUpdated 1 mo ago
    Auto-check: notes
  • Dev

    justrach/merjs

    Build and start the merjs dev server with hot reload. An agent skill from justrach/merjs.

    357 GitHub stars~222 tokensUpdated 1 mo ago
    Auto-check passed
  • New API

    justrach/merjs

    Scaffold a new merjs API route. An agent skill from justrach/merjs.

    357 GitHub stars~302 tokensUpdated 1 mo ago
    Auto-check passed
  • New Page

    justrach/merjs

    Scaffold a new merjs page. An agent skill from justrach/merjs.

    357 GitHub stars~361 tokensUpdated 1 mo ago
    Auto-check passed
  • Deploy

    justrach/merjs

    Full production build — codegen, compile, prerender, and prepare for deployment.

    357 GitHub stars~171 tokensUpdated 1 mo ago
    Auto-check passed

Categories

Questions about Streaming Ssr

What does Streaming Ssr do?

Add streaming SSR to a merjs page. An agent skill from justrach/merjs. Streaming Ssr is an agent skill from justrach/merjs. Add streaming SSR to a merjs page.

When should I use Streaming Ssr?

Streaming Ssr fits situations like: the user wants shell-first rendering; skeleton placeholders; parallel data fetching that resolves inline.

How do I install Streaming Ssr in Claude Code?

Run `npx skills add justrach/merjs --skill streaming-ssr -a claude-code`. Or copy the skill folder (.claude/skills/streaming-ssr in justrach/merjs) into .claude/skills/streaming-ssr in your project. Claude Code loads it when a task matches its description.

How do I install Streaming Ssr in Codex?

Run `npx skills add justrach/merjs --skill streaming-ssr -a codex`. Or copy the skill folder (.claude/skills/streaming-ssr in justrach/merjs) into .agents/skills/streaming-ssr in your project. Codex loads it when a task matches its description.

Can I use Streaming Ssr in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add justrach/merjs --skill streaming-ssr -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/streaming-ssr, .gemini/skills/streaming-ssr, .github/skills/streaming-ssr and .opencode/skills/streaming-ssr in your project.

What does Streaming Ssr need to run?

SKILL.md names no scripts, command-line tools or credentials: Streaming Ssr is instructions for the agent only.

Does Streaming Ssr access the network?

SKILL.md names 1 domain. As links in the text: merlionjs.com. This is read from the text; nothing was executed.

Is Streaming Ssr safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Streaming Ssr use?

Streaming Ssr is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Streaming Ssr use?

About 1.1k tokens (SKILL.md is roughly 4.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Streaming Ssr?

Skills that share tags, products or a category with Streaming Ssr: Stash Edge (cipherstash/stack, 157 stars), Crossbind (crossbind/crossbind, 148 stars), RuView CLI, API and WASM (ruvnet/RuView, 97k stars) and Spider King (aoyunyang/spider-king-skill, 509 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Streaming Ssr?

justrach (a GitHub user) maintains it in justrach/merjs, which has 357 GitHub stars. The repository holds 6 skills in this directory. The repository was last updated on August 26, 2026.

Source: justrach/merjs on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.