agentleFS
untrauntra/operator/AGENTS.md

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.

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
  1. Distinctive:

    Avoid using comments in function body code.

    line 24
  2. Very specific:

    Write superpowers plans to superpowers/plans/ and design specs to superpowers/specs/ (repo root, not hosted).

    line 30
  3. Distinctive:

    Ask, don't assume. If something is unclear, ask before writing into a corner.

    line 34
  4. Distinctive:

    Consider the simplest solution first.

    line 35
  5. Distinctive:

    Avoid changing unrelated code.

    line 36
  6. Very specific:

    All changes MUST pass these checks before committing.

    line 42
  7. Very specific:

    If any of these fail, fix the issues before proceeding.

    line 72
  8. Distinctive:

    Always running lint step when finished working in a directory.

    line 77
  9. Distinctive:

    Don't hand-roll encodings or hashes with bitwise operators.

    line 78
  10. Distinctive:

    When changes touch subprojects, those must also pass validation:

    line 82
  11. Distinctive:

    Write tests first: - Before implementing a feature or fix, write a failing test that defines the expected behavior

    line 98
  12. Distinctive:

    Run the test: - Verify it fails for the right reason

    line 99
  13. Distinctive:

    Implement the minimum code: - Write just enough code to make the test pass

    line 100
  14. Distinctive:

    Repeat: - Add more tests to cover edge cases

    line 102
  15. Very specific:

    Use descriptive test names: test_<function>_<scenario>_<expected_behavior>

    line 122
  16. Distinctive:

    Assign: When agent slot available, select next ticket

    line 200
  17. Distinctive:

    Launch: Run the agent CLI in the configured session target with the interpolated prompt

    line 202
  18. Very specific:

    Check .tickets/queue/ for tickets matching your project

    line 231
  19. Very specific:

    Look for *-{project}-*.md files, take the oldest (FIFO)

    line 232
  20. Very specific:

    Create feature branch: git checkout -b {branch-from-ticket}

    line 234
  21. Very specific:

    Run full validation: make check (CI-parity fmt + clippy + test)

    line 238
  22. Distinctive:

    Ensure all tests pass and no clippy warnings

    line 239
  23. Very specific:

    Commit with message: {type}({project}): {summary}\n\nTicket: {ID}\n

    line 240
  24. Distinctive:

    All generated files include a header warning:

    line 279
  25. Very specific:

    Create a struct implementing DocGenerator trait in src/docs_gen/

    line 288
  26. Very specific:

    When adding or changing UI: change a brand color in tokens.css (web surfaces follow automatically).

    line 307

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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/, shared webcomponents/ 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

  1. Ask, don't assume. If something is unclear, ask before writing into a corner. Never make silent assumptions about intent, architecture or requirements.
  2. Consider the simplest solution first. First attempt the simplest approach that could work, then consider abstractions and flexibility with regards to similar implementations.
  3. Avoid changing unrelated code. If a file or function is not part of the current task, do not modify it.
  4. Flag uncertainty explicitly. If you are not confident about an approach or technical detail, say so before proceeding.
  5. 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 suites

make 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-features flags matter: plain cargo clippy misses 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 compile

Test-Driven Development (TDD)

This project follows TDD practices:

  1. Write tests first - Before implementing a feature or fix, write a failing test that defines the expected behavior
  2. Run the test - Verify it fails for the right reason
  3. Implement the minimum code - Write just enough code to make the test pass
  4. Refactor - Clean up while keeping tests green
  5. 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 check

Test Organization

  • Unit tests go in the same file as the code, in a #[cfg(test)] mod tests block
  • 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 docs

Full 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 to agents.max_agents_per_repo agents 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

  1. Watch: Monitor .tickets/queue/ for new tickets
  2. Sort: Order by priority, then FIFO timestamp
  3. Assign: When agent slot available, select next ticket
  4. Confirm: Prompt operator for launch confirmation
  5. Launch: Run the agent CLI in the configured session target with the interpolated prompt
  6. Track: Monitor agent progress, watch for completion
  7. 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

  1. Check .tickets/queue/ for tickets matching your project
  2. Look for *-{project}-*.md files, take the oldest (FIFO)
  3. Move claimed ticket to .tickets/in-progress/
  4. Create feature branch: git checkout -b {branch-from-ticket}

Completing Work

  1. Run full validation: make check (CI-parity fmt + clippy + test)
  2. Ensure all tests pass and no clippy warnings
  3. 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

FileGeneratesPurpose
src/taxonomy/taxonomy.tomldocs/taxonomy/index.md25 project Kinds across 5 tiers
src/schemas/issuetype_schema.jsondocs/schemas/issuetype.mdIssue type structure (key, mode, fields, steps)
src/schemas/ticket_metadata.schema.jsondocs/schemas/metadata.mdTicket YAML frontmatter format
src/ui/keybindings.rsdocs/shortcuts/index.mdKeyboard shortcuts by context
src/main.rs + src/env_vars.rsdocs/cli/index.mdCLI commands and env vars
src/config.rsdocs/configuration/index.mdConfig structure (via schemars)
src/rest/docs/schemas/openapi.jsonREST API spec (via utoipa)
src/docs_gen/llms.rs + docs/*/index.mddocs/llms.txtllms.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 sourcesdocs/collections/search.jsonMachine-readable collection catalog (also feeds the /workflows/ page)
the same collection sourcesdocs/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

  1. Create a struct implementing DocGenerator trait in src/docs_gen/
  2. Implement name(), source(), output_path(), and generate()
  3. Register it in src/docs_gen/mod.rs all_generators() - that one list drives the full run, the --only filter, and the CLI help text, so there is nothing to add in src/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.

SurfaceWhereRule
Docs site (Jekyll)docs/assets/css/main.cssLinks tokens.css (via _includes/head.html); style components with var(--...), never raw hex.
Embedded SPA (Vite/React)ui/src/index.css + *.module.cssImports tokens.css; layers app-only semantic tokens (--surface, --border, --danger, …) on top. Components reference semantic tokens, not raw hex.
Ratatui TUIsrc/ui/*.rsTerminal 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 webviewvscode-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/.

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.