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
- Distinctive: line 71
Use shadcn/ui for shared UI primitives and new component additions.
- Very specific: line 73
Add components from the apps/ui directory using the shadcn CLI:
- Distinctive: line 115
Keep event handling deterministic across live stream and replayed history.
- Distinctive: line 116
Prefer working within existing backend/frontend boundaries instead of introducing broad architectural churn.
- Distinctive: line 118
Before finishing any task, run the full CI validation suite from the repo root and fix any errors:
- Distinctive: line 122
All three must pass. Do not commit or report completion if any of these fail.
- Distinctive: line 123
Prefer shadcn/ui components over hand-rolled HTML for UI controls and surfaces.
- Very specific: line 124
Keep panel and view headers consistent by using the shared ViewHeader in apps/ui/src/components/ViewHeader.tsx for …
≈ “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.
Files
Middleman - Agent Notes
What This Project Is
middleman is a local-first multi-agent orchestration platform. It runs:
- A Node.js backend for manager/worker orchestration and persistence.
- A TanStack Start + Vite SPA for dashboard, chat, settings, and artifacts.
- 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/*andapps/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 devStarts 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 prodDefault 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 --noEmitShadcn 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 textareaImportant: 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.pngImportant: 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
- Preserve behavior and interaction parity for existing dashboard/chat/settings flows unless a task calls for change.
- Keep event handling deterministic across live stream and replayed history.
- Prefer working within existing backend/frontend boundaries instead of introducing broad architectural churn.
- Validate changes with UI smoke checks (manager creation, chat send/stop, settings updates).
- Before finishing any task, run the full CI validation suite from the repo root and fix any errors:
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.pnpm build && pnpm exec tsc --noEmit && pnpm test - Prefer shadcn/ui components over hand-rolled HTML for UI controls and surfaces.
- Keep panel and view headers consistent by using the shared
ViewHeaderinapps/ui/src/components/ViewHeader.tsxfor chat/settings/notes-style views. Header shells should stayh-[62px] mb-2, place back buttons on the left, and put counts or actions in the trailing slot instead of hand-rolling new variants.
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
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.

