operator
AGENTS.md44 starsChanged 8 days agoMITView on GitHub
operator is a Rust TUI application for orchestrating Claude/Codex/Gemini/Grok CLI agents across multi-project codebases. It manages ticket queues, launches agents, tracks progress, and provides notifications. Avoid using comments in function body code. Code comments are terse, short and punctual. Comments should not refer to implementation or current wip status. Write superpowers plans to superpowers/plans/ and design specs to superpowers/specs/ (repo root, not hosted). All changes MUST pass these checks before committing. Run them with make check, which is fmt-check +…
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 33,398 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 repositoryOne other file it gives its agents.
- docs/llms.txtllms.txt
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
26 rules. About 0 are common, 15 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
11
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Avoid using comments in function body code.
- Very specific: line 30
Write superpowers plans to superpowers/plans/ and design specs to superpowers/specs/ (repo root, not hosted).
- Distinctive: line 34
Ask, don't assume. If something is unclear, ask before writing into a corner.
- Distinctive: line 35
Consider the simplest solution first.
- Distinctive: line 36
Avoid changing unrelated code.
- Very specific: line 42
All changes MUST pass these checks before committing.
- Very specific: line 72
If any of these fail, fix the issues before proceeding.
- Distinctive: line 77
Always running lint step when finished working in a directory.
- Distinctive: line 78
Don't hand-roll encodings or hashes with bitwise operators.
- Distinctive: line 82
When changes touch subprojects, those must also pass validation:
- Distinctive: line 98
Write tests first: - Before implementing a feature or fix, write a failing test that defines the expected behavior
- Distinctive: line 99
Run the test: - Verify it fails for the right reason
- Distinctive: line 100
Implement the minimum code: - Write just enough code to make the test pass
- Distinctive: line 102
Repeat: - Add more tests to cover edge cases
- Very specific: line 122
Use descriptive test names: test_<function>_<scenario>_<expected_behavior>
- Distinctive: line 200
Assign: When agent slot available, select next ticket
- Distinctive: line 202
Launch: Run the agent CLI in the configured session target with the interpolated prompt
- Very specific: line 231
Check .tickets/queue/ for tickets matching your project
- Very specific: line 232
Look for *-{project}-*.md files, take the oldest (FIFO)
- Very specific: line 234
Create feature branch: git checkout -b {branch-from-ticket}
- Very specific: line 238
Run full validation: make check (CI-parity fmt + clippy + test)
- Distinctive: line 239
Ensure all tests pass and no clippy warnings
- Very specific: line 240
Commit with message: {type}({project}): {summary}\n\nTicket: {ID}\n
- Distinctive: line 279
All generated files include a header warning:
- Very specific: line 288
Create a struct implementing DocGenerator trait in src/docs_gen/
- Very specific: line 307
When adding or changing UI: change a brand color in tokens.css (web surfaces follow automatically).
≈ “Common” is an estimate: at least 1 in 5 of the 43,423 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
AGENTS.md - operator
Project Overview
operator is a Rust TUI application for orchestrating Claude/Codex/Gemini/Grok CLI agents across multi-project codebases. It manages ticket queues, launches agents, tracks progress, and provides notifications.
Tech Stack
- Language: Rust (core), TypeScript (
ui/,webcomponents/,vscode-extension/) - TUI: ratatui (crossterm backend); tokio async runtime
- Server surfaces: axum REST API + utoipa OpenAPI (
src/rest/), MCP server (src/mcp/), ACP (src/acp/) - Web: Vite/React SPA in
ui/, sharedwebcomponents/package, thin VS Code extension webview - Notifications: mac-notification-sys (macOS), notify-rust (Linux), webhooks
- Config: config crate (TOML); File Watching: notify crate
Code Style
Aim for functional software development with a focus on stateless, single responsibility testable functions.
Minimize use of comments entirely; they should be terse and used judiciously, ideally one line tops.
Data types come from rust; typescript and docs binds are generated from low-level rust types annotated with comments that embed as descriptions into configuration and reference files.
Favor falsey defaults ; lets aim not to enforce default=true or some other javascript-truthy default value.
Comments
Avoid using comments in function body code. Code comments are terse, short and punctual. Comments should not refer to implementation or current wip status.
Plans & Specs Location
Write superpowers plans to superpowers/plans/ and design specs to superpowers/specs/ (repo root, not hosted).
Development Standards
- Ask, don't assume. If something is unclear, ask before writing into a corner. Never make silent assumptions about intent, architecture or requirements.
- Consider the simplest solution first. First attempt the simplest approach that could work, then consider abstractions and flexibility with regards to similar implementations.
- Avoid changing unrelated code. If a file or function is not part of the current task, do not modify it.
- Flag uncertainty explicitly. If you are not confident about an approach or technical detail, say so before proceeding.
- I am open to ideas on better approaches or strategies. Speak up and suggest a better course if I am off-course from a better solution.
Mandatory Before Committing
All changes MUST pass these checks before committing. Run them with make check,
which is fmt-check + lint + test - each verb striped across every module:
make check
# fmt-check: report-only formatting, per module
make fmt-check-rust # cargo fmt --check: root, crates/relay, opr8r, zed-extension
make fmt-check-ts # oxfmt --check, every JS/TS subproject
make fmt-check-tf # terraform fmt -check -diff (coder-module)
# lint: warnings are errors everywhere
make lint-rust # clippy --locked --all-targets --all-features, all 4 crates
make lint-ts # oxlint --type-aware, every JS/TS subproject
make lint-shell # shellcheck -S warning
make lint-helm # helm lint charts/operator
make lint-tf # terraform validate + rendered coder_script check
# test
make test-rust # cargo test --locked --all-features, all 3 crates
make test-ts # webcomponents + coder-module suitesmake fmt is the same striping in rewrite mode (cargo fmt, bun run fmt); only fmt-check gates. make relay / make opr8r / make vscode-extension run every gate for one module when only it changed.
Display-bound suites stay off make test: make vscode-extension and make storybook (browser + axe) are run on their own.
Formatting and linting are enforced for every subproject, not just the main crate.
Rust uses cargo fmt/clippy (root, crates/relay, opr8r, zed-extension), JS/TS uses root-installed oxfmt + oxlint (ui, webcomponents, vscode-extension, agnt-plugin, the coder-module test harness), Terraform uses terraform fmt, charts use helm lint, and shell scripts use shellcheck. bun run fmt rewrites; bun run fmt:check reports.
Generated output (bindings/, shared/types.ts, each */generated/) is excluded by .oxfmtrc.json / .oxlintrc.jsonc and must never be reformatted.
The
--locked --all-targets --all-featuresflags matter: plaincargo clippymisses test-target and feature-gated lints (e.g. a dependency deprecation that only surfaces under--all-targets), which is how a clippy failure can pass locally yet break CI. Always use the full command above.
If any of these fail, fix the issues before proceeding. Do NOT use #[allow(...)] attributes to silence warnings unless there's a documented reason (e.g., code used only in tests).
Strict Linting
Linting is strictly enforced; the rules are tighter than other software. Linting warnings are errors; address them as part of design. Always running lint step when finished working in a directory. Fix all found linting problems before declaring work done. Don't hand-roll encodings or hashes with bitwise operators; use a crate or std API.
Subproject Validation
When changes touch subprojects, those must also pass validation:
opr8r (Rust/cargo):
cargo run vscode-extension (TypeScript/npm):
cd vscode-extension && npm run lint && npm run fmt:check && npm run compileTest-Driven Development (TDD)
This project follows TDD practices:
- Write tests first - Before implementing a feature or fix, write a failing test that defines the expected behavior
- Run the test - Verify it fails for the right reason
- Implement the minimum code - Write just enough code to make the test pass
- Refactor - Clean up while keeping tests green
- Repeat - Add more tests to cover edge cases
Example workflow:
# 1. Write a new test in the appropriate module
# 2. Run tests to see it fail
cargo test test_new_feature -- --nocapture
# 3. Implement the feature
# 4. Run tests to see it pass
cargo test
# 5. Run full validation before committing
make checkTest Organization
- Unit tests go in the same file as the code, in a
#[cfg(test)] mod testsblock - Integration tests go in
tests/directory - Use descriptive test names:
test_<function>_<scenario>_<expected_behavior>
Quick Reference
make check # Full gate: fmt-check + lint + test, every module
make fmt # Rewrite formatting in every module
make lint # Every linter: clippy, oxlint, shellcheck, helm, terraform
make test # Rust + fast JS/TS suites
make vscode-extension # Compile + lint the extension (incl. the webview bundle)
make install-hooks # Install the fast pre-push hook (once per clone)
cargo test <name> # Run specific test
cargo run # Run TUI
cargo run -- queue # CLI: show queue
cargo run -- launch # CLI: launch next ticket
cargo run -- api # REST API + embedded web UI
cargo run -- mcp # MCP server (stdio)
cargo run -- docs # Regenerate auto-generated docsFull command list: docs/cli/ (auto-generated).
Architecture
Grouped map of src/ (not exhaustive - ls src/ for the full list):
src/
├── main.rs, lib.rs # Entry + CLI parsing; lib/bin split (src/rest compiles
│ # in the lib and must not reference bin-only src/ui)
├── app/ # TUI application state and event loop
├── ui/ # Ratatui rendering: dashboard, panels, dialogs, keybindings
├── queue/ # Ticket parsing, creation, file watcher
├── agents/ # Agent lifecycle: launcher/ (tmux, zellij, cmux, coder,
│ # remote), monitor, activity/idle detection, hooks
├── config.rs, config/ # TOML config: agent profiles, kanban, llm tools,
│ # sessions, targets, git, notifications
├── state.rs # Persistent state store
├── rest/ # REST API + embedded web UI hosting (axum, utoipa)
├── mcp/, acp/ # MCP server; Agent Client Protocol
├── api/, services/ # Kanban/GitHub/PR clients and sync services
├── llm/, permissions/ # LLM tool detection + runtime configs; per-tool
│ # permission translation (claude, codex, gemini)
├── issuetypes/, templates/, collections/ # Issue type schema, registry,
│ # shipped collections
├── taxonomy/, schemas/, docs_gen/ # Source-of-truth data + docs generators
├── workflow_gen/ # Workflow export (Claude .js, AGNT)
├── notifications/ # OS notifications (macOS/Linux) + webhook integrations
└── git/, steps/, relay/, integrations/, startup/, editors.rs, projects.rs, …Sibling subprojects: ui/ (SPA), webcomponents/ (shared JS, built ahead of
ui/ and docs/), vscode-extension/, opr8r/, docs/ (hosted Jekyll
site), collections/community/.
Key Concepts
Agent Modes
Execution mode is declared per issue type (mode in the issuetype schema):
- Autonomous (e.g. FEAT, FIX, TASK): launch and monitor progress
- Paired (e.g. SPIKE, INV): require human interaction, track "awaiting input"
Parallelism Rules
- Effective max agents = max(1, min(
agents.max_parallel, cpu_cores -agents.cores_reserved)) - Same repo is sequential unless
git.use_worktrees = true, which allows up toagents.max_agents_per_repoagents in per-ticket worktrees - Paired agents run one at a time per operator attention
State Management
Persistent state lives under paths.state (default .tickets/operator/);
state.json holds queue/agent state - schema documented at /schemas/state/.
Per-ticket worktrees default to ~/.operator/worktrees.
Ticket Workflow
- Watch: Monitor
.tickets/queue/for new tickets - Sort: Order by priority, then FIFO timestamp
- Assign: When agent slot available, select next ticket
- Confirm: Prompt operator for launch confirmation
- Launch: Run the agent CLI in the configured session target with the interpolated prompt
- Track: Monitor agent progress, watch for completion
- Complete: Move ticket, notify, update stats
Agent Launching
src/agents/launcher/ builds the agent CLI command (claude, codex, gemini) with a prompt interpolated from the ticket + issuetype steps,
then runs it in the configured session target:
- Terminal multiplexers: tmux, zellij, cmux
- Editors: VS Code, Cursor, Zed (
src/editors.rs) - Remote: SSH hosts and Coder workspaces (
[[targets]]config)
Per-ticket git worktrees are prepared by launcher/worktree_setup.rs.
Notifications
Dispatched through src/notifications/service.rs to the enabled integrations:
OS notifications (mac-notification-sys on macOS, notify-rust on Linux) and webhooks.
Project Discovery
On startup, operator scans the configured projects directory for subdirectories containing an agent marker file (AGENTS.md, plus vendor backups CLAUDE.md, GEMINI.md, CODEX.md, GROK.md).
These are presented as available projects when creating tickets.
Working a Ticket
Before Starting Work
- Check
.tickets/queue/for tickets matching your project - Look for
*-{project}-*.mdfiles, take the oldest (FIFO) - Move claimed ticket to
.tickets/in-progress/ - Create feature branch:
git checkout -b {branch-from-ticket}
Completing Work
- Run full validation:
make check(CI-parity fmt + clippy + test) - Ensure all tests pass and no clippy warnings
- Commit with message:
{type}({project}): {summary}\n\nTicket: {ID}\n
Auto-Documentation System
Operator uses a schema-driven, code-derived documentation strategy to reduce maintenance burden. Documentation is auto-generated from structured source-of-truth files, ensuring docs stay in sync with code.
Source-of-Truth Files
| File | Generates | Purpose |
src/taxonomy/taxonomy.toml | docs/taxonomy/index.md | 25 project Kinds across 5 tiers |
src/schemas/issuetype_schema.json | docs/schemas/issuetype.md | Issue type structure (key, mode, fields, steps) |
src/schemas/ticket_metadata.schema.json | docs/schemas/metadata.md | Ticket YAML frontmatter format |
src/ui/keybindings.rs | docs/shortcuts/index.md | Keyboard shortcuts by context |
src/main.rs + src/env_vars.rs | docs/cli/index.md | CLI commands and env vars |
src/config.rs | docs/configuration/index.md | Config structure (via schemars) |
src/rest/ | docs/schemas/openapi.json | REST API spec (via utoipa) |
src/docs_gen/llms.rs + docs/*/index.md | docs/llms.txt | llms.txt site map for LLMs (no front matter; served verbatim) |
src/collections/*/collection.json + collections/community/*/ | docs/collections/ | Hosted collection bundle: index.json, per-collection manifests, issuetype schemas, templates, icons |
| the same collection sources | docs/collections/search.json | Machine-readable collection catalog (also feeds the /workflows/ page) |
| the same collection sources | docs/workflows/ | The workflow catalog page + one page per collection |
Regenerating Documentation
# Generate all documentation
cargo run -- docs
# Generate specific docs only
cargo run -- docs --only taxonomy
cargo run -- docs --only openapi
cargo run -- docs --only config
# `--only` accepts any key from docs_gen::all_generators(); an unknown key
# prints the full list.Auto-Generated File Headers
All generated files include a header warning:
<!-- AUTO-GENERATED FROM {source} - DO NOT EDIT MANUALLY -->
<!-- Regenerate with: cargo run -- docs -->Adding New Generators
- Create a struct implementing
DocGeneratortrait insrc/docs_gen/ - Implement
name(),source(),output_path(), andgenerate() - Register it in
src/docs_gen/mod.rsall_generators()- that one list drives the full run, the--onlyfilter, and the CLI help text, so there is nothing to add insrc/main.rs
Design & UI Consistency
Operator presents one brand (terracotta + cornflower + cream over a green scale) across four rendering surfaces. Keep them consistent by following the rule that fits each surface - they are deliberately not all styled the same way. Full details and swatches live in docs/design-system/ (/design-system/).
Brand source of truth: docs/assets/css/tokens.css - the only place the brand hex values + dark-mode overrides are declared. Both web surfaces consume it; never re-declare a brand color elsewhere.
| Surface | Where | Rule |
| Docs site (Jekyll) | docs/assets/css/main.css | Links tokens.css (via _includes/head.html); style components with var(--...), never raw hex. |
| Embedded SPA (Vite/React) | ui/src/index.css + *.module.css | Imports tokens.css; layers app-only semantic tokens (--surface, --border, --danger, …) on top. Components reference semantic tokens, not raw hex. |
| Ratatui TUI | src/ui/*.rs | Terminal can't render hex - match a semantic role to ANSI (danger=Red, success=Green, warning=Yellow, focus=Cyan). Reuse color_for_key/glyph_for_key from src/templates/mod.rs; don't re-hardcode issuetype/priority colors. |
| VS Code webview | vscode-extension/webview-ui/ | Defer to the VS Code host theme: style with raw var(--vscode-*) custom properties (styles/webview.css + components/primitives/). Apply brand only as accents via the --op-* variables; never override the user's editor theme wholesale. No MUI/CSS-in-JS - enforced by tests/it/suites/ui_packaging.rs. |
When adding or changing UI: change a brand color in tokens.css (web surfaces follow automatically); reference semantic tokens in new web CSS; map a role to ANSI in the TUI; and leave the webview deferring to the editor theme.
Icons. Every SVG icon follows the Operator icon standard - a single monochrome <path> on a 24×24 canvas with no fill/stroke/width/height, so it tints from currentColor and sizes to its container on all four surfaces. Governed directories: icons/, docs/assets/icons/, ui/public/icons/, and each collection's icon.svg.
Enforced by cargo test --test it suites::svg_icon_standard::; the rules and rationale are in docs/design-system/.
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.

