datastar
Skill2 starsChanged 7 months agoMITView on GitHub
Build reactive hypermedia web applications with backend-driven UI updates. 10.7KB framework combining HTMX-style backend reactivity with Alpine.js-style frontend reactivity.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- danmestas/wardrobetheir own version, first seen Apr 30, 2026
- maragudk/skillstheir own version, first seen Feb 12, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- maragudk/skills★ 49same name
- danmestas/wardrobe★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 88
Signals are sparse: - only for UI toggles + form binding
- Distinctive: line 91
No optimistic updates: - never fake success, use loading indicators
- Very specific: line 92
No client-side routing: - use <a> tags and View Transition API
- Distinctive: line 99
Server is source of truth: - No localStorage for state
- Very specific: line 101
FOUC prevention: - Add style="display:none" to data-show
- Very specific: line 108
Use ternary ?: or delegate to window.fn().
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
DataStar
Build reactive web applications with server-driven updates and declarative HTML attributes.
⛔ MANDATORY — NO FABRICATION: Before writing ANY DataStar code or explaining ANY DataStar attribute/action/event, you MUST consult the bundled
references/andmodules/files first. Do NOT generate syntax from memory — it will be wrong.Required workflow for every DataStar question:
Grep "<keyword>"across this skill'sreferences/andmodules/directories to locate the relevant file.Readthat file to get exact syntax.- Quote it directly.
- If the answer is not in the bundled files, fetch the official docs at https://data-star.dev before answering.
If nothing is found → say "Not found in DataStar references" and stop. Never invent syntax.
Quick Start
<script type="module" src="https://cdn.jsdelivr.net/gh/starfederation/datastar@v1.0.0/bundles/datastar.js"></script>Signal naming: camelCase is the default and recommended convention. Hyphenated HTML attributes auto-convert to camelCase. Use __case.snake to opt into snake_case.
Core Concepts
Signals (State)
<div data-signals="{count: 0, name: ''}">
<input data-bind:name />
<div data-text="$count"></div>
<div data-computed:doubled="$count * 2" data-text="$doubled"></div>
</div>Actions (Backend Requests)
<button data-on:click="@get('/data')">Load</button>
<button data-on:click="@post('/save')" data-indicator:saving>Save</button>Backend Responses (SSE)
event: datastar-patch-elements
data: elements <div id="foo">Content</div>
event: datastar-patch-signals
data: signals {count: 5}Knowledge Modules
| Module | Description |
modules/tao.md | The Tao of Datastar - 14 core principles from the team |
modules/gotchas.md | Critical pitfalls with fixes |
modules/core.md | Architecture, signals, actions |
modules/best-practices.md | Naming, performance, security |
modules/debugging.md | Common errors and solutions |
Reference Files
| Reference | Description |
references/attributes.md | All data-* attributes |
references/actions.md | All @ actions |
references/patterns.md | UI patterns (forms, lists, etc.) |
references/sse-events.md | SSE protocol, SDK examples |
Examples
| Example | Description |
examples/realtime-counter.html | Simplest reactive example |
examples/form-validation.html | Form with client-side validation |
examples/dynamic-list.html | Add/remove items via SSE |
examples/todo-app.html | Complete todo application |
examples/wp-sse-endpoint.php | WordPress SSE handler |
The Tao of Datastar (Philosophy)
14 official principles from the core team. Key takeaways:
- Backend is source of truth - state lives on server, not client
- Patch, don't poll - backend drives frontend via SSE patches
- Signals are sparse - only for UI toggles + form binding
- Fat morph - send large DOM chunks, let morphing handle diffs
- CQRS - one long-lived GET for reads, short POSTs for writes
- No optimistic updates - never fake success, use loading indicators
- No client-side routing - use
<a>tags and View Transition API
See modules/tao.md for all 14 principles with code examples.
Top 5 Gotchas
- camelCase signals (default) -
playerNamenotplayer_name(snake_case opt-in via__case.snake) - Server is source of truth - No localStorage for state
- Missing IDs - Elements need
id=for morphing - FOUC prevention - Add
style="display:none"to data-show - PHP output buffering - Disable with
ob_end_clean()for SSE
See modules/gotchas.md for the full list.
Block-form statements (if (…) { … }, for { }, try { }) in data-on-* / data-effect
break the expression parser — half the page works, the rest silently fails to mount.
Use ternary ?: or delegate to window.fn().
When to Use DataStar
Good fit: Server-rendered apps, real-time dashboards, forms, CRUD apps, multi-step workflows
Not ideal: Offline-first apps, heavy client computation, complex routing, gaming
Official Resources
- Docs: https://data-star.dev
- GitHub: https://github.com/starfederation/datastar
- Version: 1.0.0 (released 2026-04-16)
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

