openteams
AGENTS.md626 starsChanged 10 months agoApache-2.0View on GitHub
OpenTeams is a local-first multi-agent collaboration workspace with four main surfaces: - Free-form multi-agent chat with streaming, queues, approvals, attachments, diffs, and team protocols. - Workflow execution built from React Flow plans and run by an orchestrator. - Projects/issues with GitHub, source-control, delivery, and analytics views. - Optional isolated Git worktrees for individual chat sessions. Supported runtimes include Claude Code, Gemini CLI, Codex, Qwen Code, OpenCode, Amp, and the bundled OpenTeams CLI. - crates/db/: SQLx models, migrations, and offline query…
- Reads credentials
- Installs packages
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.
In this repository5 other files it gives its agents.
- docs/AGENTS.mdAGENTS.md
- frontend/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- docs/CLAUDE.mdCLAUDE.md
- frontend/CLAUDE.mdCLAUDE.md
The file
We split this AGENTS.md into the rules it gives an agent
12 rules. About 0 are common, 8 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
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
- could be automatic: a setting could enforce it
- Distinctive: line 58
Every meaningful workflow transition must use the reducer, guard the expected previous state where possible, write a typed event, and …
- Distinctive: line 74
Use compare-and-swap for status changes.
- Very specific: line 96
Use typed enums and serde snake_case values for persisted/wire statuses.
- Distinctive: line 99
Do not bypass workflow or worktree reducers with ad-hoc state updates.
- Distinctive: line 100
Never fall back to process cwd for user source-control or worktree actions.
- Very specific: line 101
Treat .openteams/ as runtime data, not user source.
- Distinctive: line 104
Do not add wrapper functions merely to implement one feature or rename an existing operation.
- Very specific: line 114
Do not commit secrets or local .env values.
- Distinctive: line 122
Keep scoped fixes narrow; avoid unrelated refactors.
- Distinctive: line 123
Add tests for state machines, shared logic, migrations, security-sensitive paths, source-control scoping, and likely regressions.
- Distinctive: line 125
Run the narrowest meaningful verification first, then broaden when shared behavior is affected.
- Very specific: line 157
Use the local scripts inside openteams-cli/ when changing that workspace.
≈ “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
Repository Guidelines
Project
OpenTeams is a local-first multi-agent collaboration workspace with four main surfaces:
- Free-form multi-agent chat with streaming, queues, approvals, attachments, diffs, and team protocols.
- Workflow execution built from React Flow plans and run by an orchestrator.
- Projects/issues with GitHub, source-control, delivery, and analytics views.
- Optional isolated Git worktrees for individual chat sessions.
Supported runtimes include Claude Code, Gemini CLI, Codex, Qwen Code, OpenCode, Amp, and the bundled OpenTeams CLI.
Repository Map
crates/db/: SQLx models, migrations, and offline query cache.crates/server/: Axum routes and API binaries. Keep route handlers thin.crates/services/: business logic for chat, workflows, worktrees, projects, GitHub, source control, agents, and analytics.crates/executors/,crates/git/,crates/review/,crates/utils/: supporting Rust crates.frontend/: React 19, TypeScript, Vite, and Tailwind v4 app.shared/types.ts: generated Rust-to-TypeScript declarations; never edit it manually.openteams-cli/: separate Bun workspace for the bundled CLI.npx/: NPX package wrappers.docs/: Mintlify and architecture/debugging documentation.src-tauri/: desktop app configuration; excluded from the main Rust workspace together withcrates/remote/.
Core Architecture
Chat
crates/services/src/services/chat_runner/owns free-chat execution, queues, streaming, prompts, run records, token metadata, and file-change capture.- Chat routes live in
crates/server/src/routes/chat/. - Runtime files live under
<workspace>/.openteams/; workflow events and transcripts live in database tables.
Workflow
- Plan JSON and revisions in
chat_workflow_plansandchat_workflow_plan_revisionsare the truth source. workflow/compiler/validates plans and materializes execution graphs.workflow/orchestrator/owns scheduling, commands, retries, and runtime transitions.workflow/orchestrator/reducer.rsis the only legal writer for workflow runtime state.workflow/runtime/builds prompts, executes agents, persists transcripts, and produces frontend projections.frontend/src/components/workflow/renders workflow state and controls.
Every meaningful workflow transition must use the reducer, guard the expected previous state where possible, write a typed event, and refresh the runtime/card projection. Frontend controls must match backend-accepted states. Final acceptance always belongs to the user.
Session Worktrees
crates/services/src/services/session_worktree.rsis the authoritative worktree state machine.crates/db/src/models/chat_session_worktree.rsowns persisted types and compare-and-swap helpers.crates/services/src/services/worktree_manager.rsis the low-level Git adapter.crates/server/src/routes/chat/worktree.rsmust remain a thin service adapter.
Use compare-and-swap for status changes. Automated cleanup must never remove unmerged active/conflicted worktrees; only explicit discard may move them toward cleanup. Validate conflict paths as relative paths inside the resolved workspace before filesystem access.
Projects and Source Control
- Project routes:
crates/server/src/routes/projects.rs,project_source_control.rs, andproject_github.rs. - Project/GitHub services:
crates/services/src/services/project/andcrates/services/src/services/github/. services/project/source_control.rsis authoritative for status, diffs, staging, discard, commits, safety guards, caching, and worktree-aware workspace selection.
Source-control data and mutations must stay scoped to the selected project/session/worktree. Workspace resolution is currently duplicated across chat, workflow, source control, and session routes; keep their behavior aligned and prefer a shared resolver over adding another copy.
Non-Negotiable Rules
- Use typed enums and serde snake_case values for persisted/wire statuses. Do
not add
format!("{:?}", status).to_lowercase(). - Restrict plan JSON writes to lead/system code paths.
- Do not bypass workflow or worktree reducers with ad-hoc state updates.
- Never fall back to process cwd for user source-control or worktree actions.
- Treat
.openteams/as runtime data, not user source. - Rust types exposed to the frontend must derive
TS, be registered incrates/server/src/bin/generate_types.rs, and be regenerated. - Do not add wrapper functions merely to implement one feature or rename an existing operation. Prefer updating the existing function and its call sites directly; introduce a wrapper only when it represents a real abstraction, compatibility boundary, or independently reusable behavior.
- Shared services and runtimes must not branch on a concrete adapter or runner to add adapter-specific behavior. Express adapter differences through a public executor capability contract implemented by the adapter, and consume that contract generically.
- Preserve existing service boundaries and compatibility paths unless the task explicitly changes them.
- Do not commit secrets or local
.envvalues.
Coding and Testing
- Rust: use
rustfmt, snake_case functions/modules, PascalCase types, and small service methods with clear ownership. - TypeScript/React: use 2-space indentation, PascalCase components, camelCase identifiers, and existing API/mapping patterns.
- Keep scoped fixes narrow; avoid unrelated refactors.
- Add tests for state machines, shared logic, migrations, security-sensitive paths, source-control scoping, and likely regressions.
- Run the narrowest meaningful verification first, then broaden when shared behavior is affected.
Key test locations:
- Workflow:
crates/services/src/services/workflow/orchestrator/tests.rs - Worktrees:
crates/services/src/services/session_worktree/tests.rs - Frontend: colocated
*.test.tsand*.test.tsx
Common Commands
pnpm install
pnpm run frontend:check
pnpm run frontend:build
pnpm run backend:check
pnpm run backend:lint
pnpm run check
pnpm run lint
pnpm run format
pnpm run format:check
pnpm run generate-types
pnpm run generate-types:check
pnpm run prepare-db
pnpm run prepare-db:checkNotes:
pnpm run formatonly runscargo fmt --all.frontend:checkruns TypeScript with--noEmit.backend:lintruns Clippy with--features qa-mode.- Use the local scripts inside
openteams-cli/when changing that workspace.
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.

