agentleFS
vedant-aggarwalvedant-aggarwal/preview-hub/AGENTS.md

preview-hub

AGENTS.md0 starsChanged 14 days agoMITView on GitHub

You are in preview-hub: permanent public links (<public-url>/<id>/) for local dev servers, files and folders, with a dashboard, snapshots, expiry, a CLI (preview) and an MCP server (preview-mcp, plus an HTTP endpoint for cloud bots). Run preview hub status (or node bin/preview.js hub status if the command is not on PATH yet).

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 35,196 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository2 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

4 rules. About 0 are common, 0 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

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

    Run preview hub status (or node bin/preview.js hub status if the command is not on PATH yet).

    line 7
  2. Very specific:

    Keep dependencies minimal: the hub uses only Node built-ins.

    line 33
  3. Very specific:

    After changing hub code, run preview hub restart and check preview hub status.

    line 34
  4. Very specific:

    Test MCP changes over stdio (node bin/preview-mcp.js) and over HTTP (http://127.0.0.1:7421/_hub/mcp, or the public URL with a token).

    line 35

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md 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
AGENTS.md

AGENTS.md

You are in preview-hub: permanent public links (<public-url>/<id>/) for local dev servers, files and folders, with a dashboard, snapshots, expiry, a CLI (preview) and an MCP server (preview-mcp, plus an HTTP endpoint for cloud bots).

First thing to do

Run preview hub status (or node bin/preview.js hub status if the command is not on PATH yet).

  • Command not found, hub not running, or public: not set → the person probably wants it set up. Offer to onboard them, and if they agree follow ONBOARDING.md step by step. It covers install, keeping the hub running, Cloudflare Tunnel or ngrok (permanent URL, PM2), connecting agents and bots, and a closing tour of how to use it.
  • public_check: ok → it is set up. Help with what they ask: publishing something (preview add ...), MCP tokens (preview mcp token <bot>), or working on the code.

Layout

PathWhat
src/hub.jsThe hub: reverse proxy (HTTP and WebSocket), static files and viewers, snapshots, auth, process supervision, expiry, tunnel and public-URL probe, MCP HTTP endpoint
src/mcp.jsMCP tools and JSON-RPC handling, shared by stdio and HTTP. Remote-safe limits live here.
src/client.jsHub client used by the CLI and the stdio MCP server; output shaping
src/store.jsData dir (~/.preview-hub, override PREVIEW_HUB_HOME), ports (7420 public, 7421 loopback; override PREVIEW_HUB_PUBLIC_PORT / PREVIEW_HUB_LOCAL_PORT), config and state files
src/procs.js, src/cache.js, src/util.jsProcess control, snapshot cache, helpers
bin/preview.jsAXI-style CLI (preview). preview --help, preview <command> --help
bin/preview-mcp.jsstdio MCP server
ui/Dashboard, login page and viewer styles (plain HTML, CSS and JS)
ecosystem.config.cjsPM2 apps: preview-hub, preview-ngrok
scripts/Windows logon task (preview hub install)
skills/preview/SKILL.mdAgent skill that teaches the CLI; copied to ~/.claude/skills or ~/.agents/skills during onboarding

Rules

  • Secrets (passcode, session key, tunnel token, MCP token hashes) live in ~/.preview-hub/config.json. Never copy them into this repo, a commit, or chat output. Ask the person to run token commands themselves.
  • Port 7421 is trusted because it binds 127.0.0.1 only. Never expose it, tunnel it, or bind it elsewhere.
  • Anything reachable from the public port must stay behind the passcode or an MCP token. The /_hub/mcp remote path must keep its limits (no start commands, no secret or system folders).
  • Keep dependencies minimal: the hub uses only Node built-ins; the CLI adds axi-sdk-js and qrcode (for preview mcp token <name> --qr).
  • After changing hub code, run preview hub restart and check preview hub status.
  • Test MCP changes over stdio (node bin/preview-mcp.js) and over HTTP (http://127.0.0.1:7421/_hub/mcp, or the public URL with a token).

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.