Agent skill

Jaspr Pre-Rendering and Hydration

by rodydavis in rodydavis/signals.dart

Sets the rules for static or server mode Jaspr apps in Dart, covering dual entrypoints, the client annotation and data hydration.

Apache-2.0Auto-check passedFrontend & Design

Install Jaspr Pre-Rendering and Hydration

skills CLI
$ npx skills add rodydavis/signals.dart --skill jaspr-pre-rendering-and-hydration -a claude-code

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

GitHub CLI
$ gh skill install rodydavis/signals.dart jaspr-pre-rendering-and-hydration --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/rodydavis/signals.dart.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/jaspr-pre-rendering-and-hydration .claude/skills/jaspr-pre-rendering-and-hydration && 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
jaspr-pre-rendering-and-hydration
GitHub stars
819
Token cost
~1.2k tokens
SKILL.md length
418 words
Files
1
Skills in repo
15
Repo updated
First seen
Licence
Apache-2.0

At a glance

Sets the rules for static or server mode Jaspr apps in Dart, covering dual entrypoints, the client annotation and data hydration.

  • Works in 3 steps: Dual Entrypoints → Library Constraints → Interactivity / Hydration: Components…
  • Building a static or server mode Jaspr project
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Adding client-side interactivity to a server-rendered component

What it does

It applies when a project's pubspec sets a Jaspr mode of static or server, where components pre-render on the server by default and only gain interactivity through hydration in the browser. The server entrypoint must never import the browser-only JS interop or web packages, and the client entrypoint must never import file or FFI packages; shared code using the universal web package has to guard any browser API access behind a web-platform check so it doesn't crash during server rendering.

Adding interactivity means annotating only the uppermost component of a subtree with the client annotation, since child components in that subtree hydrate automatically as part of the parent; the client entrypoint's app call finds and hydrates every annotated component that was pre-rendered. Parameters passed into a client component are serialized on the server and deserialized in the browser, so they must be initializing fields and either a primitive type or a custom type with defined encoder and decoder methods, never a function or a component.

When your agent uses it

  • Building a static or server mode Jaspr project
  • Adding client-side interactivity to a server-rendered component
  • Passing server-fetched data into a hydrated client component

Example prompts

  • “Add a client counter component that hydrates on this server-rendered page.”
  • “Why is my client entrypoint failing to import a file-system package?”
  • “Pass this list of products from the server into a hydrated client widget.”

Requirements

  • A Jaspr project in static or server mode

Workflow steps

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

  1. Dual Entrypoints
  2. Library Constraints
  3. Interactivity / Hydration: Components are server-rendered by default. To add client interactivity (e.g., event listeners, state, using…

What it can do on your machine

Read from SKILL.md and the folder at commit 81d64e8. 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 dart).

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

  • Network

    No URLs in SKILL.md.

    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

Jaspr Pre-Rendering and Hydration loads about 1.2k tokens when it runs. Until then it costs about 59 tokens; SKILL.md has 418 words of instructions outside code blocks.

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

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 rodydavis/signals.dart at commit 81d64e8, republished under its Apache-2.0 licence (© rodydavis). 418 words, ~1,187 tokens.

Download SKILL.mdSave it as .claude/skills/jaspr-pre-rendering-and-hydration/SKILL.md (or your agent's skills folder).
name
jaspr-pre-rendering-and-hydration
description
Use when working in a **static** or **server** mode Jaspr project. Covers SSR/SSG, async data fetching, the @client annotation, hydration, and handling dual entrypoints (.server.dart vs .client.dart).
metadata.jaspr_version
0.23.1

This skill is relevant for static and server mode Jaspr projects. You can check the mode of a Jaspr project in pubspec.yaml under jaspr: mode: <mode>.

Core Rules for Pre-rendering (SSR/SSG)

Jaspr pre-renders components at request/build-time on the server. Interactive browser features require hydration.

  1. Dual Entrypoints:
    • Server: lib/main.server.dart -> Calls runApp(Document(body: MyApp()))
    • Client: lib/main.client.dart -> Calls runApp(ClientApp())
  2. Library Constraints:
    • Importing: You MUST NOT import dart:js_interop or package:web in any code imported by the server entrypoint.
    • Importing: You MUST NOT import dart:io or dart:ffi in any code imported by the client entrypoint.
    • Using: You can import package:universal_web in shared code, but you MUST wrap any access to its browser APIs inside an if (kIsWeb) check to prevent crashing during server-side rendering.
  3. Interactivity / Hydration: Components are server-rendered by default. To add client interactivity (e.g., event listeners, state, using browser APIs), you MUST annotate a component with @client.
The @client Annotation and ClientApp

When you annotate a component with @client, Jaspr renders its initial HTML on the server and "hydrates" it in the browser.

  • ClientApp() (called in the client entrypoint) automatically looks for and hydrates all @client components that were pre-rendered on the server.
  • Rule: Only the uppermost component of a subtree that needs client interactivity needs to be annotated with @client. Do not annotate child components in that subtree, they will automatically be hydrated as part of the parent.
Show full SKILL.md (190 more words)Show less
Passing Data to @client Components

Use parameters of @client components to pass data from the server to the client. These are automatically serialized on the server and deserialized in the browser.

  • Rule 1: All parameters MUST be initializing fields (e.g., const MyClientComponent({required this.title});).
  • Rule 2: All parameters MUST be serializable. They must be primitive types (int, String, double, bool, List, Map) OR custom types that define @encoder and @decoder methods.
    • Parameters MUST NOT be functions, components, or any other non-serializable types.
Fetching Data on the Server (Async Components)

When pre-rendering in server or static mode, you often need to fetch data asynchronously (e.g., from a database or API) before rendering the HTML. Jaspr provides special server-only components to delay the build phase until the data is ready.

  • Rule 1: You MUST use AsyncStatelessComponent or AsyncBuilder to perform async work during the build phase.
  • Rule 2: These components MUST ONLY be used on the server (import package:jaspr/server.dart).
  • Rule 3: Once the data is fetched on the server, you should pass it to a @client component as a parameter if you need that data to be available for client-side interactivity.

Example Usage:

dart
import 'package:jaspr/server.dart'; // Note the server-only import!
import 'package:jaspr/dom.dart';

import 'my_interactive_button.dart';

// This component fetches data before server-rendering the HTML.
class MyServerComponent extends AsyncStatelessComponent {
  const MyServerComponent();

  @override
  Future<Component> build(BuildContext context) async {
    // 1. Fetch data asynchronously on the server
    final databaseCount = await loadCountFromDatabase();

    return div([
      .text('This is static.'),
      // 2. Pass the fetched data to the client component
      MyInteractiveButton(initialCount: databaseCount), 
    ]);
  }
}
dart
import 'package:jaspr/jaspr.dart';
import 'package:jaspr/dom.dart';

// This component runs in the browser (interactive).
@client
class MyInteractiveButton extends StatefulComponent {
  const MyInteractiveButton({this.initialCount = 0});

  final int initialCount;

  @override
  State<MyInteractiveButton> createState() => _MyInteractiveButtonState();
}

class _MyInteractiveButtonState extends State<MyInteractiveButton> {
  late int count = component.initialCount;

  @override
  Component build(BuildContext context) {
    return button(
      onClick: () => setState(() => count++),
      [.text('Clicked $count times')],
    );
  }
}

© rodydavis, Apache-2.0. 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 .agents/skills/jaspr-pre-rendering-and-hydration of rodydavis/signals.dart.

Open the folder on GitHubat commit 81d64e8

Compare with similar skills

Jaspr Pre-Rendering and Hydration 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.

Jaspr Pre-Rendering and Hydration compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Jaspr Pre-Rendering and Hydration this skillrodydavis/signals.dart819—~1.2kAutomated safety check: PassApache-2.0
React Router Developmentremix-run/react-router57k1 repos~1.5kAutomated safety check: PassMIT
React UI State PatternsChrisWiles/claude-code-showcase6.1k8 repos~1.6kAutomated safety check: PassNone
GSAP in Vue, Nuxt and Sveltegreensock/gsap-skills16k3 repos~2.6kAutomated safety check: PassMIT
Svelte Core Best Practicesrilldata/rill2.9k4 repos~1.8kAutomated safety check: PassApache-2.0
Vuetify Playgroundvuetifyjs/vuetify41k—~730Automated safety check: PassCustom licence

Similar skills

  • React Router Development

    remix-run/react-router

    Guides work on React Router apps by first identifying whether the app uses Framework, Data or Declarative mode, then loading the matching reference and the installed package docs.

    57k GitHub starsUsed in 1 repo~1.5k tokens
    Frontend & DesignAuto-check passed
  • React UI State Patterns

    ChrisWiles/claude-code-showcase

    Sets patterns for React interfaces: when to show loading spinners or skeletons, how to surface errors, how to disable buttons during async work and how to handle empty lists.

    6.1k GitHub starsUsed in 8 repos~1.6k tokens
    Frontend & DesignAuto-check passed
  • GSAP in Vue, Nuxt and Svelte

    greensock/gsap-skills

    Shows how to use GSAP in Vue, Nuxt, Svelte and other lifecycle-based frameworks: create after mount, scope selectors to the component, and revert on unmount.

    16k GitHub starsUsed in 3 repos~2.6k tokens
    Frontend & DesignAuto-check passed
  • Rules for writing idiomatic Svelte 5 code: when to reach for runes like state, derived and effect, and how to handle props, attachments and bindings.

    2.9k GitHub starsUsed in 4 repos~1.8k tokens
    Frontend & DesignAuto-check passed
  • Vuetify Playground

    vuetifyjs/vuetify

    Maintains the Vuetify repo's local Playground.vue so contributors get a realistic reproduction and a short demo they can paste into a pull request description.

    41k GitHub stars~730 tokensUpdated today
    Frontend & DesignAuto-check passed
  • Starts the right Tabler dev server, keeps it from clashing with builds and verifies changes in the browser before a page or component is handed back.

    42k GitHub stars~1.2k tokensUpdated yesterday
    Frontend & DesignAuto-check passed

More from rodydavis/signals.dart

All 15 skills in this repo
  • Jaspr Component Fundamentals

    rodydavis/signals.dart

    Teaches the agent Jaspr's Flutter-like component model and typed HTML elements, with strict rules on build methods and helper syntax.

    819 GitHub stars~1.8k tokensUpdated 26 days ago
    Auto-check passed
  • Jaspr CSS-in-Dart Styling

    rodydavis/signals.dart

    Guides styling of Jaspr web components with the type-safe Styles API in Dart, covering @css annotations, inline styles and global stylesheets.

    819 GitHub stars~1.7k tokensUpdated 26 days ago
    Auto-check passed
  • Jaspr JS Interop

    rodydavis/signals.dart

    Rules for calling JavaScript from Jaspr web apps in Dart: which interop libraries to import in server, static and client modes, and how to wrap functions, objects and libraries.

    819 GitHub stars~823 tokensUpdated 26 days ago
    Auto-check passed
  • Update Dart Examples Dependencies

    rodydavis/signals.dart

    Upgrades every package under ./examples to the repository's latest signals version, runs pub upgrade on third-party dependencies, and fixes the resulting analysis problems.

    819 GitHub stars~514 tokensUpdated 26 days ago
    Auto-check passed
  • Jaspr HTML Converter

    rodydavis/signals.dart

    Use when you need to convert / rewrite existing HTML (from a file or url) into Jaspr code.

    819 GitHub stars~378 tokensUpdated 26 days ago
    Auto-check passed
  • Dart Monorepo Coverage Booster

    rodydavis/signals.dart

    Runs, merges, and analyzes Dart and Flutter test coverage across a Melos monorepo, then targets the exact uncovered lines.

    819 GitHub stars~1.1k tokensUpdated 26 days ago
    Auto-check passed

Works with

Questions about Jaspr Pre-Rendering and Hydration

What does Jaspr Pre-Rendering and Hydration do?

Sets the rules for static or server mode Jaspr apps in Dart, covering dual entrypoints, the client annotation and data hydration. It applies when a project's pubspec sets a Jaspr mode of static or server, where components pre-render on the server by default and only gain interactivity through hydration in the browser. The server entrypoint must never import the browser-only JS interop or web packages, and the client entrypoint must never import file or FFI packages; shared code using the universal web package has to guard any browser API access behind a web-platform check so it doesn't crash during server rendering.

When should I use Jaspr Pre-Rendering and Hydration?

Jaspr Pre-Rendering and Hydration fits situations like: building a static or server mode Jaspr project; adding client-side interactivity to a server-rendered component; passing server-fetched data into a hydrated client component.

How do I install Jaspr Pre-Rendering and Hydration in Claude Code?

Run `npx skills add rodydavis/signals.dart --skill jaspr-pre-rendering-and-hydration -a claude-code`. Or copy the skill folder (.agents/skills/jaspr-pre-rendering-and-hydration in rodydavis/signals.dart) into .claude/skills/jaspr-pre-rendering-and-hydration in your project. Claude Code loads it when a task matches its description.

How do I install Jaspr Pre-Rendering and Hydration in Codex?

Run `npx skills add rodydavis/signals.dart --skill jaspr-pre-rendering-and-hydration -a codex`. Or copy the skill folder (.agents/skills/jaspr-pre-rendering-and-hydration in rodydavis/signals.dart) into .agents/skills/jaspr-pre-rendering-and-hydration in your project. Codex loads it when a task matches its description.

Can I use Jaspr Pre-Rendering and Hydration 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 rodydavis/signals.dart --skill jaspr-pre-rendering-and-hydration -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/jaspr-pre-rendering-and-hydration, .gemini/skills/jaspr-pre-rendering-and-hydration, .github/skills/jaspr-pre-rendering-and-hydration and .opencode/skills/jaspr-pre-rendering-and-hydration in your project.

What does Jaspr Pre-Rendering and Hydration need to run?

SKILL.md names no scripts, command-line tools or credentials: Jaspr Pre-Rendering and Hydration is instructions for the agent only. Our summary lists: A Jaspr project in static or server mode.

Does Jaspr Pre-Rendering and Hydration access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Jaspr Pre-Rendering and Hydration 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 Jaspr Pre-Rendering and Hydration use?

Jaspr Pre-Rendering and Hydration is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Jaspr Pre-Rendering and Hydration use?

About 1.2k tokens (SKILL.md is roughly 4.7k 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 Jaspr Pre-Rendering and Hydration?

Skills that share tags, products or a category with Jaspr Pre-Rendering and Hydration: React Router Development (remix-run/react-router, 57k stars), React UI State Patterns (ChrisWiles/claude-code-showcase, 6.1k stars), GSAP in Vue, Nuxt and Svelte (greensock/gsap-skills, 16k stars) and Svelte Core Best Practices (rilldata/rill, 2.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Jaspr Pre-Rendering and Hydration?

rodydavis (a GitHub user) maintains it in rodydavis/signals.dart, which has 819 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on September 14, 2026.

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