datastar

A reference for using Datastar HTML attributes and backend actions in Templ templates. Datastar is a browser tool that supports reactive page updates, live server messages, and actions such as loading, creating, changing, or deleting data.

In plain words
What is it for?
Writing Templ templates with Datastar actions, browser signals, server-sent updates, dynamic page changes, and generated internal links.
Why use it?
It prevents templates from using incorrect or fragile links and action URLs. Instead, the guide requires generated project functions that keep links and actions aligned with the server.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/romshark/datapages/datastar
Any agent
npx skills add romshark/datapages --skill datastar
Clone the repo
git clone --depth 1 https://github.com/romshark/datapages

Made for: Claude Code, Codex.

Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 17,782 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00054 $0.17782
Opus 5 $0.00027 $0.08891
Sonnet 5 $0.00011 $0.03556
Haiku 4.5 $0.00005 $0.01778

Measured 3d ago against content hash 86f4640551e4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

datastar scanned grade A with 0 findings 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 3d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.skills/datastar/SKILL.md · 1,681 lines

How it starts

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

Datastar HTML Attribute and Action Reference

Datastar adds frontend reactivity via HTML data-* attributes and SSE. Docs: https://data-star.dev For the full Datastar API reference, fetch from: https://data-star.dev/reference/plugins_core

This skill covers the HTML template side only. Server-side SSE wiring is handled by Datapages. See datapages/SKILL.md. Templates are written in Templ. Docs: https://templ.guide/developer-tools/llm/

IMPORTANT: Datapages Rules (ALWAYS follow these)

  • Never hardcode action URLs (@get('/path'), @post('/path'), etc.). Always use the generated functions from the action package (app/datapagesgen/action/). These functions return the correct Datastar action string. Example: action.POSTPageLoginSubmit() returns @post('/login/submit/'). To pass Datastar action options, use the typed helpers (action.WithContentType(action.ContentTypeForm), action.WithPayload("{extra: 1}"), action.WithRetry(action.RetryNever), ...), never hardcode the options object.
  • Never hardcode href URLs for app-internal links. Always use the generated functions from the href package (app/datapagesgen/href/). Each function is named after the page type. Example: href.PageMessages(href.QueryPageMessages{Chat: chatID}) returns /messages/?chat=.... External URLs (outside the app) can be hardcoded as usual.
  • CSRF protection is handled automatically by Datapages - never set CSRF headers manually.
  • SSE streams must NOT be opened manually — Datapages manages all SSE stream lifecycle.
  • Use Templ expression syntax for action attributes. In .templ files, use ={ expr } (not ="...") for attributes that call generated action functions. Example: data-on:click={ action.POSTPageLoginSubmit() }, not data-on:click="@post('/login/submit/')".
  • No plain HTML forms for server interaction. CSRF protection only works with Datastar fetch requests. Always use Datastar actions (@get, @post, @put, @patch, @delete) instead of plain HTML <form> submissions.
  • Never install the Datastar JS file manually. Datapages includes and serves it automatically.

Read the full file on GitHub · 1,681 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. 3d ago First seen · 1,681 lines · 54 tokens per session scan A 86f4640551e4

Subscribe to this mod's changes

datastar is a skill published in the GitHub repository romshark/datapages (87 stars, last pushed 4d ago), licensed MIT. It adds 54 tokens to every session and 17,782 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

implementation-strategy

Choose compatibility-aware scope for runtime and API changes in openai-agents-python. Use before initial implementation and each review-feedback batch to decide whether to patch, reset the design, preserve compatibility, or reject unsupported cases.

openai/openai-agents-python · 47 tokens

examples-run-analysis

Analyze artifacts from the latest completed manual examples Make run. Read the main log, every relevant per-example log, and example source; validate every exit-0 example and classify failures, skips, and environment restrictions. Never execute or control examples.

openai/openai-agents-python · 52 tokens

pr-to-video

Turn a GitHub pull request (a PR URL, owner/repo#N, or 'this PR' in a checked-out repo) into a code-change explainer video — changelog, feature reveal, fix, or refactor walkthrough built from the diff, commits, and files: the input is a code change, not a website. Not a product promo (/product-launch-video) or a no-PR…

heygen-com/hyperframes · 104 tokens

general-video

Author or edit a custom HyperFrames composition when no specialized workflow fits, or when BRIEF.md sets flow: companion. Use for longer or multi-scene pieces, brand and sizzle reels, montages, static loops, static title cards, footage remixes, and freeform builds. Use motion-graphics instead for a short unnarrated…

heygen-com/hyperframes · 92 tokens

hyperframes-cli

Use the HyperFrames CLI development loop: init, add, catalog, capture, lint, check, snapshot, compare, grade-compare, preview, play, present, beats, keyframes, single or batch render, publish, cloud, cloudrun, feedback, lambda, doctor, browser, info, upgrade, skills, compositions, docs, benchmark, telemetry…

heygen-com/hyperframes · 129 tokens

hyperframes-keyframes

Use when a HyperFrames composition needs a punch-in, punch-out, zoom, reframe, Ken Burns treatment, camera move, visual match/whip handoff, or other seek-safe 2D/3D keyframes; also for GSAP, CSS keyframes, Anime.js, WAAPI, FLIP, paths, masks, SVG morph/draw, text trails, 3D depth, or hyperframes keyframes diagnostics.…

heygen-com/hyperframes · 116 tokens