agentleFS
crywolfecrywolfe/claude-code-design/.claude/skills/live-reload/SKILL.md

live-reload

Skill0 starsChanged 8 days agoMITView on GitHub

Add a dev-only auto-reload script to an HTML artifact so the preview refreshes on every save while served from 127.0.0.1. Use when user says "live reload", "auto refresh the preview", "hot reload", or runs /live-reload.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If the artifact already has <link rel="icon" href="data:,"/> skip.

    line 37
  2. Distinctive:

    Only active at http://127.0.0.1.

    line 49

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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

Live reload

Injects starters/live_reload.js next to the artifact and a data-dev-only script tag before </body>. The script polls the file's Last-Modified header over the /serve server and reloads on change. It no-ops on file:// and on any host other than 127.0.0.1, and /publish, /export-standalone and /handoff drop [data-dev-only] scripts.

Prerequisites

  • $0 is an HTML file under artifacts/.
  • The artifact is (or will be) previewed over /serve.

Phase 1 — Idempotency check

Grep $0 for live_reload.js. If found, report "already enabled" and stop.

Phase 2 — Copy the starter

Bash(cp starters/live_reload.js artifacts/<dir-of-$0>/) — spell the directory literally (for artifacts/deck.html that is artifacts/).

Phase 3 — Inject the tag

Edit $0: replace the final </body> with

<script src="./live_reload.js" data-dev-only></script>
</body>

If the artifact already has <link rel="icon" href="data:,"/> skip; otherwise add it to <head> (the /serve favicon rule in CLAUDE.md).

Verify

/serve if not running, then /done http://127.0.0.1:4567/<relative path>. Console must be clean. No further checks; the reload behaviour is covered by test/smoke-live-reload.html.

Report

"Live reload on. Save the file and the preview refreshes within a second. Only active at http://127.0.0.1; exports and publishes drop it."

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.