agentleFS
SawyerHoodSawyerHood/middleman/AGENTS.md

middleman

AGENTS.md184 starsChanged 9 months agoApache-2.0View on GitHub

middleman is a local-first multi-agent orchestration platform. It runs: This is a greenfield project — do not worry about backwards compatibility. Breaking changes to APIs, storage formats, protocols, and UI are fine. Move fast and keep the codebase clean. For dashboard/chat/settings work, preserve existing behavior and interaction patterns unless the task explicitly requests a redesign. Canonical wire contracts are defined in: Starts backend + UI in one command (two local ports): Default production ports: Use shadcn/ui for shared UI primitives…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 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.

The file

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

8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use shadcn/ui for shared UI primitives and new component additions.

    line 71
  2. Very specific:

    Add components from the apps/ui directory using the shadcn CLI:

    line 73
  3. Distinctive:

    Keep event handling deterministic across live stream and replayed history.

    line 115
  4. Distinctive:

    Prefer working within existing backend/frontend boundaries instead of introducing broad architectural churn.

    line 116
  5. Distinctive:

    Before finishing any task, run the full CI validation suite from the repo root and fix any errors:

    line 118
  6. Distinctive:

    All three must pass. Do not commit or report completion if any of these fail.

    line 122
  7. Distinctive:

    Prefer shadcn/ui components over hand-rolled HTML for UI controls and surfaces.

    line 123
  8. Very specific:

    Keep panel and view headers consistent by using the shared ViewHeader in apps/ui/src/components/ViewHeader.tsx for …

    line 124

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

Middleman - Agent Notes

What This Project Is

middleman is a local-first multi-agent orchestration platform. It runs:

  1. A Node.js backend for manager/worker orchestration and persistence.
  2. A TanStack Start + Vite SPA for dashboard, chat, settings, and artifacts.
  3. Realtime updates over WebSocket.

Scope Expectations

This is a greenfield project — do not worry about backwards compatibility. Breaking changes to APIs, storage formats, protocols, and UI are fine. Move fast and keep the codebase clean.

For dashboard/chat/settings work, preserve existing behavior and interaction patterns unless the task explicitly requests a redesign.

Architecture (Current)

Frontend

  • SPA with TanStack Start + Vite in apps/ui.
  • Real-time client state and transport in apps/ui/src/lib/ws-client.ts.
  • Core UI surfaces in apps/ui/src/components/chat/* and apps/ui/src/components/settings/*.

Backend

  • HTTP + WebSocket server in apps/backend/src/ws/server.ts.
  • Agent orchestration and runtime logic in apps/backend/src/swarm/*.
  • Scheduler in apps/backend/src/scheduler/*.

Contracts

Canonical wire contracts are defined in:

  • packages/protocol/

Run and Test

Development

pnpm dev

Starts backend + UI in one command (two local ports):

  • Backend HTTP + WS: http://127.0.0.1:47187 / ws://127.0.0.1:47187
  • UI: http://127.0.0.1:47188

Production

pnpm prod

Default production ports:

  • Backend HTTP + WS: http://127.0.0.1:47287 / ws://127.0.0.1:47287
  • UI preview: http://127.0.0.1:47289

Useful checks

pnpm build
pnpm test
pnpm exec tsc --noEmit

Shadcn UI

Use shadcn/ui for shared UI primitives and new component additions. Always prefer shadcn components over hand-rolled HTML elements.

Add components from the apps/ui directory using the shadcn CLI:

cd apps/ui
pnpm dlx shadcn@latest add <component-name>

For example:

cd apps/ui
pnpm dlx shadcn@latest add button label switch select tabs separator scroll-area checkbox tooltip textarea

Important: The shadcn CLI must be run from apps/ui/ (where components.json lives), not from the repo root.

Generated components go to apps/ui/src/components/ui/. Check available components and usage at https://ui.shadcn.com/docs.

Currently installed: badge, button, card, checkbox, context-menu, dialog, input, label, scroll-area, select, separator, switch, tabs, textarea, tooltip.

Visual Testing with Agent Browser

For any UI/visual changes, use dev-browser to verify your work in a real browser. Start a dev server on unique ports (not the default 47187/47188 — those are used by the running production instance) and use dev-browser to screenshot and interact with the UI.

# Pick unique ports that don't collide with other workers or production
MIDDLEMAN_PORT=48387 MIDDLEMAN_UI_PORT=48388 \
  MIDDLEMAN_HOME=~/worktrees/<your-worktree>/.test-data pnpm dev &

# Open and screenshot
npx dev-browser open http://localhost:48388 --screenshot /tmp/my-test.png

# Navigate to specific views
npx dev-browser open http://localhost:48388/?view=notes --screenshot /tmp/notes-test.png
npx dev-browser open http://localhost:48388/?view=settings --screenshot /tmp/settings-test.png

Important: Each worker must use a different port pair to avoid collisions when running in parallel. Suggested ranges: 484xx, 485xx, 486xx, 487xx, 488xx, 489xx.

Working Rules for Future Changes

  1. Preserve behavior and interaction parity for existing dashboard/chat/settings flows unless a task calls for change.
  2. Keep event handling deterministic across live stream and replayed history.
  3. Prefer working within existing backend/frontend boundaries instead of introducing broad architectural churn.
  4. Validate changes with UI smoke checks (manager creation, chat send/stop, settings updates).
  5. Before finishing any task, run the full CI validation suite from the repo root and fix any errors:
    pnpm build && pnpm exec tsc --noEmit && pnpm test
    All three must pass. Do not commit or report completion if any of these fail. CI runs the same checks — if it fails locally, it will fail in CI.
  6. Prefer shadcn/ui components over hand-rolled HTML for UI controls and surfaces.
  7. Keep panel and view headers consistent by using the shared ViewHeader in apps/ui/src/components/ViewHeader.tsx for chat/settings/notes-style views. Header shells should stay h-[62px] mb-2, place back buttons on the left, and put counts or actions in the trailing slot instead of hand-rolling new variants.

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.