agentleFS
SilvrDuckSilvrDuck/skills/skills/hud/SKILL.md

hud

Skill1 starsChanged 6 months agoMITView on GitHub

Spin up a shared live web HUD on localhost for the current discussion — a small HTML control panel where every user click and keystroke is instantly appended to an events file the agent watches, and the agent reshapes the UI live by editing files (the page hot-swaps without reload). Proposes a few UI modalities as a multiple-choice question first, then builds and serves from /tmp. Use when the user types /hud or asks for a quick UI, control panel, dashboard, or a visual way to work together on the discussion.

  • Deletes or force-pushes

5 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use visual-verdict, ai-slop-cleaner and 5 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • lza6Skill

    visual-verdict

    Structured visual QA verdict for screenshot-to-reference comparisons

    Also in 3 projects that use this

  • lza6Skill

    ai-slop-cleaner

    Run an anti-slop cleanup/refactor/deslop workflow

    Also in 3 projects that use this

  • the-huginSkill

    configure-notifications

    Configure notification integrations (Telegram, Discord, Slack) via natural language

    Also in 3 projects that use this

  • ahilarionSkill

    trace

    Evidence-driven debugging with parallel hypothesis testing

    Also in 3 projects that use this

  • nicepkgSkill

    team

    根据任务快速组建临时 AI Agent 团队协作。自动从 .claude/agents/ 中选择最合适的成员组队。

    Also in 3 projects that use this

  • sundial-orgSkill

    skill

    Find, install, create, improve, and publish AI agent skills through the Sundial ecosystem. Use when the user wants to find or search for skills, install a skill, create a new skill, improve or evaluate an existing skill, or publish a skill to Sundial Hub. Trigger phrases include "find a skill", "install skill", "create a skill", "make a skill", "improve this skill", "evaluate skill", "publish skill", "push skill", "search for skills".

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

4 rules. 0 are common, 1 is distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 4 edited versions we read keep these.

  • 1

    Distinctive

    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. Very specific:

    React loop: When the watcher returns events: read them, respond in chat and/or mutate ui.html / state.json (the page updates live), then …

    line 30
  2. Very specific:

    Prefer state.json edits for data-only changes.

    line 63
  3. Very specific:

    Never write to events.jsonl or .events.cursor — read only.

    line 64
  4. Distinctive:

    If the sandbox blocks binding a port, rerun the server command with sandbox disabled or ask the user to allow it.

    line 67

“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “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

hud

Build a live, two-way visual workspace for the current conversation: the user steers through a local web page, the agent steers through files. The plumbing is fixed and shipped with this skill — never rewrite it. The agent's job is only to design ui.html and state.json for this discussion.

A HUD is a throwaway tool, not a fixture. It's spun up to serve one slice of the conversation and is meant to be torn down — server, watcher, hook, and the workspace directory deleted — the moment it's no longer useful. Do not let a HUD linger across the rest of a long conversation once its purpose is served. When in doubt whether it's still needed, ask rather than leave it running. See Teardown below; treat it as the default ending, not an afterthought.

How the pieces talk

File (in workspace dir)OwnerPurpose
ui.htmlagentUI fragment, hot-swapped into the page within ~250ms of any edit — no reload
state.jsonagentdata the UI renders; cheaper to update than rewriting ui.html
events.jsonlserverappend-only log of every user action, written the instant it happens

assets/server.py serves the page and logs events; assets/index.html is the browser shell that polls for changes. Run them as-is.

Flow

  1. Frame the problem. From the conversation, decide what visual surface would actually help. Then propose 2–4 concrete modalities via the harness's multiple-choice question tool (with small preview mockups if supported). Examples: triage/checklist board, parameter panel (sliders/toggles), ranking or voting on options, editable table, A/B compare with pick buttons, annotatable document, status dashboard.
  2. Set up the workspace at /tmp/claude/hud/<slug> (fall back to a dir inside the project if not writable). Write an initial ui.html and state.json.
  3. Start the server in the background: python3 <this-skill-dir>/assets/server.py --dir <workspace>. It picks a free port and writes <workspace>/server.json; read it and give the user the URL (http://localhost:<port>).
  4. Start the watcher in the background: python3 <this-skill-dir>/scripts/watch-events.py <workspace>. User actions accumulate silently in events.jsonl; the watcher blocks until the user clicks the shell's Nudge agent header button, then prints everything logged since the last sync and exits — that's the ping to react. (--on any wakes on every event instead — only for short waits on a single pick, it costs a turn per interaction.) Tell the user: "interact freely — hit Nudge agent when you want me to react, or just say anything in chat."
  5. React loop. When the watcher returns events: read them, respond in chat and/or mutate ui.html / state.json (the page updates live), then restart the watcher. Keep exactly one watcher running. Keep the server running for the whole session.
  6. Teardown — promptly, without being asked. The moment the HUD has served its purpose (the user says they're done, the task it was built for is finished, or the conversation has clearly moved on), tear it all down: stop the watcher and server, run python3 <this-skill-dir>/scripts/hook.py remove, and delete the workspace (rm -rf <workspace>). Leave nothing running and nothing on disk. If you're unsure whether it's still wanted, ask — don't let it sit idle through the rest of the conversation.

Writing ui.html fragments

ui.html is a body fragment (no <html>/<head>), injected into the shell's mount; its <script> tags re-run on every swap. The shell provides a dark theme with styled buttons/inputs/tables/.card, plus:

  • Auto-captured actions — no wiring needed: any element with data-action="name" logs a click event (extra data-* attributes are included); any input/select/textarea with a name logs its value as it changes. Use hud.send(type, {...}) for anything custom.
  • hud.state — the parsed state.json. Re-render on window.addEventListener('hud:state', e => ...). The swap itself re-runs scripts, so render from hud.state at script top level too.
  • Form values and focus survive swaps, matched by name (opt out with data-no-restore).
  • state.title sets the page header.

One fragment sketch:

<div class="card">
  <h2>Pick the winner</h2>
  <div id="opts"></div>
  <textarea name="notes" placeholder="why?"></textarea>
</div>
<script>
  function render() {
    document.getElementById('opts').innerHTML = (hud.state.options || [])
      .map(o => `<button data-action="pick" data-id="${o.id}">${o.label}</button>`).join(' ');
  }
  window.addEventListener('hud:state', render);
  render();
</script>

Rules

  • While a HUD is live, on every user chat message run python3 <this-skill-dir>/scripts/pending-events.py before responding — their unsynced HUD actions are context for what they just said. (Harnesses with prompt hooks can automate this; see below.)
  • Prefer state.json edits for data-only changes; edit ui.html only for structural changes.
  • Never write to events.jsonl or .events.cursor — read only.
  • Narrate meaningful reactions in chat ("saw you rejected #3 — removed it"), so the conversation and the HUD stay one discussion.
  • On TIMEOUT from the watcher, ask the user whether to keep the HUD open; restart the watcher if yes, otherwise tear it down now (step 6) rather than leaving it idle.
  • If the sandbox blocks binding a port, rerun the server command with sandbox disabled or ask the user to allow it.

Prompt hook (Claude Code only)

If the harness supports prompt hooks, run python3 <this-skill-dir>/scripts/hook.py install during setup: it adds a UserPromptSubmit hook running pending-events.py to the project's .claude/settings.local.json (git-excluded via .git/info/exclude — no repo diff, no machine-level config), so pending HUD events ride along whenever the user types in chat. Hooks load at session start: until the user opens /hooks or starts a new session, the chat-message rule above is the safety net. Always hook.py remove at teardown; a forgotten entry is an inert no-op anyway. Other harnesses skip this entirely.

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.