teamem / src
AGENTS.md1 starsChanged 6 months agoApache-2.0View on GitHub
Runtime source for Teamem. Core layers are pure domain logic (domain/), I/O adapters (infra/), server tool surface (server/), local MCP bridge (bridge/), Claude Code channel runtime (channel/), setup/CLI entry points (setup/, cli/), and Claude Code hook adapters (hooks/). The split enforces a one-way dependency rule: domain knows nothing about SQLite, HTTP, MCP, or hooks; infra knows nothing about MCP; server is the layer that wires domain + infra together for tool calls. None outside src/ — this directory is the…
In this repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- hooks/AGENTS.mdAGENTS.md
- plugin/AGENTS.mdAGENTS.md
- plugin-e2e-module/AGENTS.mdAGENTS.md
- tests/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- rddSkill
The file
Files
<!-- Parent: ../AGENTS.md --><!-- Generated: 2026-05-01 | Updated: 2026-05-13 -->src
Purpose
Runtime source for Teamem. Core layers are pure domain logic (domain/), I/O adapters (infra/), server tool surface (server/), local MCP bridge (bridge/), Claude Code channel runtime (channel/), setup/CLI entry points (setup/, cli/), and Claude Code hook adapters (hooks/). The split enforces a one-way dependency rule: domain knows nothing about SQLite, HTTP, MCP, or hooks; infra knows nothing about MCP; server is the layer that wires domain + infra together for tool calls.
Key Files
| File | Description |
index.ts | bootstrap() entrypoint that returns { status, config } |
config.ts | loadConfig(env) reads NODE_ENV, TEAMEM_* vars with defaults |
Subdirectories
| Directory | Purpose |
domain/ | Event types, validation, conflict scoring, IDs, git/path helpers (pure) — see domain/AGENTS.md |
infra/ | SQLite client, event store, migrations, projections — see infra/AGENTS.md |
server/ | Hono HTTP server, tool registry, and teamem.* tool handlers — see server/AGENTS.md |
bridge/ | Local stdio MCP bridge and CLI fallback to the server — see bridge/AGENTS.md |
channel/ | Claude Code Channels runtime for realtime notification delivery — see channel/AGENTS.md |
cli/ | Setup, hooks, reset, and operational CLI implementations — see cli/AGENTS.md |
setup/ | bun run setup dispatcher for create/join/space management flows — see setup/AGENTS.md |
hooks/ | Claude Code hook adapter + retry queue — see hooks/AGENTS.md |
For AI Agents
Working In This Directory
- Respect layering: a file in
domain/should never import frominfra/,server/, orhooks/. - Local relative imports MUST use
.jsextensions (NodeNext ESM); e.g.import { ... } from './config.js'. - The default
repo_idisteamem-poc; the defaultdbUrlisfile:./data/teamem.db. - The string keys for env overrides live in
config.tsanddomain/conflicts/config.ts— keepTEAMEM_*naming consistent.
Testing Requirements
- Unit tests under
tests/unit/mirror this directory's tree. - New domain logic should ship with a deterministic unit test (no DB, no I/O).
- New infra/server code should have an integration test that exercises a real in-memory SQLite.
Common Patterns
- Pure functions in
domain/(e.g.evaluateConflict,validateEvent). - Factory functions for stateful services (
createTeamemTools,createClaudeHookAdapter). - Result types:
ToolResponse<T> = { ok: true, data: T } | { ok: false, error: {...} }— seeserver/types.ts.
Dependencies
Internal
None outside src/ — this directory is the source-of-truth library.
External
bun:sqlite(used insideinfra/db/)- Node built-ins (
node:fs,node:path)
<!-- MANUAL: -->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.

