agentleFS
web3dev1337web3dev1337/gastown-gui/CLAUDE.md

gastown-gui

CLAUDE.md92 starsChanged 3 months agoMITView on GitHub

Web GUI for steveyegge/gastown multi-agent orchestrator. Update before PR: If you added/deleted/moved files, update CODEBASE_DOCUMENTATION.md. Browser SPA (vanilla JS, no framework) backed by an Express server that wraps gt/bd CLI commands as HTTP endpoints. WebSocket streams real-time events from gt feed. Published to npm as gastown-gui.

  • In this repositoryOne other file it gives its agents.

The file

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

5 rules. About 0 are common, 1 is distinctive, and 4 are 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.

  • 4

    Very specific

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

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

    CLI safety: All commands use execFile (no shell) + SafeSegment input validation

    line 21
  2. Very specific:

    No god files/classes: Do not keep adding logic to large files (especially server.js).

    line 28
  3. Distinctive:

    Refactor when touching: If a change makes a file larger or more complex, extract helpers into dedicated files in the same PR.

    line 30
  4. Very specific:

    Port 7667: Default port via GASTOWN_PORT env var.

    line 57
  5. Very specific:

    Mock server must match real server: When adding/changing endpoints, update both server.js (or routes) AND test/mock-server.js.

    line 61

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

CLAUDE.md - Gas Town GUI

Web GUI for steveyegge/gastown multi-agent orchestrator.

READ THESE ENTIRE DOCUMENTS BEFORE DOING ANYTHING

  1. Read CODEBASE_DOCUMENTATION.md NOW — Complete file inventory. Do NOT grep blindly for files. Read this first so you know where everything lives.
  2. Read CLI-COMPATIBILITY.md — Which gt/bd commands work, which are broken/remapped. Critical if touching any CLI calls.

Update before PR: If you added/deleted/moved files, update CODEBASE_DOCUMENTATION.md.

Overview

Browser SPA (vanilla JS, no framework) backed by an Express server that wraps gt/bd CLI commands as HTTP endpoints. WebSocket streams real-time events from gt feed. Published to npm as gastown-gui.

Architecture

  • Entry: server.js — monolith Express server, partially refactored into server/ modules
  • Refactored path: Gateway → Service → Route (see server/gateways/, server/services/, server/routes/)
  • Legacy endpoints: Mail, agents, nudge, polecat control, service controls still inline in server.js
  • CLI safety: All commands use execFile (no shell) + SafeSegment input validation
  • Frontend: Vanilla JS in js/, components render via innerHTML, global state in js/state.js
  • Real-time: WebSocket client in js/api.js, server pipes gt feed --json output
  • CLI entry: bin/cli.js — supports start, doctor, version, help

File Size Discipline

  • No god files/classes: Do not keep adding logic to large files (especially server.js).
  • Extract by responsibility: New backend logic should be placed in focused modules under server/ (services/gateways/routes/infrastructure) and imported into server.js.
  • Refactor when touching: If a change makes a file larger or more complex, extract helpers into dedicated files in the same PR.

Commands

npm start              # Start server (port 7667)
npm run dev            # Dev mode with auto-reload
npm test               # All tests (unit + integration + e2e)
npm run test:unit      # Unit tests only
npm run test:e2e       # E2E tests only (needs Puppeteer)
npm run test:watch     # Watch mode
npm run test:ui        # Vitest UI

Testing

  • Vitest for unit + integration, Puppeteer for E2E
  • Unit tests use dependency injection (mock gateways/services)
  • Route tests use real Express app with mocked services
  • Integration tests hit test/mock-server.js (mimics gt CLI responses)
  • E2E tests start real server + Chromium browser
  • npm test runs everything via prepublishOnly before npm publish

Gotchas

  1. Witness/refinery need rig: Service start/stop/restart for witness and refinery require a rig parameter in the request body. Mayor/deacon do not. Server returns 400 if missing.
  2. CLI renames: Several gt/bd commands were renamed upstream. See CLI-COMPATIBILITY.md for the full mapping. Key ones: formula use → formula run --rig, bd done → bd close, bd park → bd defer.
  3. Port 7667: Default port via GASTOWN_PORT env var. The CLI (bin/cli.js) also accepts --port.
  4. No build step: Frontend is vanilla JS served as static files. No bundler, no transpiler.
  5. server.js is partially refactored: Some endpoints moved to server/routes/, others still inline (~1700 lines). Don't duplicate — check both before adding endpoints.
  6. SafeSegment rejects metacharacters: Any rig/agent name with shell-special chars will be rejected. This is intentional security.
  7. Mock server must match real server: When adding/changing endpoints, update both server.js (or routes) AND test/mock-server.js.

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.