agentleFS
MarcinDudekDevMarcinDudekDev/claude-skill-datastar/datastar/SKILL.md

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

  • Other versions2 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 2

    1. maragudk/skills★ 49same name
    2. 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
  1. Distinctive:

    Signals are sparse: - only for UI toggles + form binding

    line 88
  2. Distinctive:

    No optimistic updates: - never fake success, use loading indicators

    line 91
  3. Very specific:

    No client-side routing: - use <a> tags and View Transition API

    line 92
  4. Distinctive:

    Server is source of truth: - No localStorage for state

    line 99
  5. Very specific:

    FOUC prevention: - Add style="display:none" to data-show

    line 101
  6. Very specific:

    Use ternary ?: or delegate to window.fn().

    line 108

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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/ and modules/ files first. Do NOT generate syntax from memory — it will be wrong.

Required workflow for every DataStar question:

  1. Grep "<keyword>" across this skill's references/ and modules/ directories to locate the relevant file.
  2. Read that file to get exact syntax.
  3. Quote it directly.
  4. 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

ModuleDescription
modules/tao.mdThe Tao of Datastar - 14 core principles from the team
modules/gotchas.mdCritical pitfalls with fixes
modules/core.mdArchitecture, signals, actions
modules/best-practices.mdNaming, performance, security
modules/debugging.mdCommon errors and solutions

Reference Files

ReferenceDescription
references/attributes.mdAll data-* attributes
references/actions.mdAll @ actions
references/patterns.mdUI patterns (forms, lists, etc.)
references/sse-events.mdSSE protocol, SDK examples

Examples

ExampleDescription
examples/realtime-counter.htmlSimplest reactive example
examples/form-validation.htmlForm with client-side validation
examples/dynamic-list.htmlAdd/remove items via SSE
examples/todo-app.htmlComplete todo application
examples/wp-sse-endpoint.phpWordPress 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

  1. camelCase signals (default) - playerName not player_name (snake_case opt-in via __case.snake)
  2. Server is source of truth - No localStorage for state
  3. Missing IDs - Elements need id= for morphing
  4. FOUC prevention - Add style="display:none" to data-show
  5. 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.