agentleFS
pensopenso/arbor/AGENTS.md

arbor

AGENTS.md837 starsChanged 8 months agoMITView on GitHub

This file defines how coding agents should behave in this repository.

  • Commits and pushes
  • 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 31,439 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

48 rules. About 0 are common, 21 are distinctive, and 27 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈21

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 27

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Keep code simple, explicit, and maintainable.

    line 7
  2. Distinctive:

    Read this file at task start.

    line 13
  3. Very specific:

    Prefer just recipes for common tasks.

    line 14
  4. Very specific:

    Before committing code, always run just format and just lint and fix any failures.

    line 15
  5. Distinctive:

    Before handoff, run relevant checks for touched code.

    line 16
  6. Distinctive:

    When adding, changing, or removing a user-visible feature in one surface, check whether the other surface needs the same capability.

    line 21
  7. Distinctive:

    Default to keeping both surfaces in parity.

    line 22
  8. Very specific:

    Treat the GPUI app/window/entity context as the UI thread unless you have explicitly moved work off it.

    line 27
  9. Very specific:

    Use cx.background_spawn(...) or a BackgroundExecutor for blocking or CPU-heavy work.

    line 30
  10. Very specific:

    If you must adapt a synchronous blocking function, run it on a background thread/executor.

    line 31
  11. Very specific:

    When reviewing GPUI code, ask two questions every time: could this block?

    line 35
  12. Very specific:

    Run HTTP daemon: just run-httpd

    line 44
  13. Very specific:

    Do not use unwrap() or expect() in non-test code.

    line 48
  14. Very specific:

    Use arbor_core::ResultExt / arbor_core::OptionExt for .context() instead of ad-hoc .map_err().

    line 49
  15. Very specific:

    Use SessionId and WorkspaceId newtypes (from arbor_core::id) instead of raw String.

    line 50
  16. Very specific:

    Use clear error handling with typed errors (thiserror/anyhow where appropriate).

    line 51
  17. Distinctive:

    Keep modules focused and delete dead code instead of leaving it around.

    line 52
  18. Very specific:

    Use pub(crate) for items shared within a crate.

    line 58
  19. Very specific:

    Use pub(crate) use module::* re-exports to keep call sites clean after splitting.

    line 59
  20. Very specific:

    When extracting code to a new file, ensure all struct fields are pub(crate) (not private) so the parent module can access them.

    line 60
  21. Very specific:

    Use dep:crate_name syntax for optional dependency features.

    line 68
  22. Very specific:

    All dependency versions live in the root Cargo.toml [workspace.dependencies].

    line 73
  23. Very specific:

    Missing pub(crate) on extracted items: When moving structs, enums, or functions from main.rs to submodules, every field and method that …

    line 77
  24. Very specific:

    Unused imports after extraction: After moving code out of a file, clean up use statements in the source file — the compiler will flag these.

    line 78
  25. Distinctive:

    Duplicate definitions: When splitting code, ensure a function/type exists in exactly one place.

    line 79
  26. Very specific:

    Test module lint attributes: Test modules need both #[allow(clippy::unwrap_used)] and #[allow(clippy::expect_used)] since the workspace …

    line 80
  27. Very specific:

    Forgetting #[cfg(feature)] on imports: When gating a module with a feature flag, also gate its use import and any code that references …

    line 81
  28. Distinctive:

    Treat git status / git diff as read-only context.

    line 86
  29. Distinctive:

    Do not run destructive git commands.

    line 87
  30. Distinctive:

    Do not amend commits unless explicitly asked.

    line 88
  31. Distinctive:

    Only create commits when the user asks.

    line 89
  32. Very specific:

    Prefer conventional commits when they fit: feat|fix|docs|refactor|test|chore(scope): summary.

    line 93
  33. Distinctive:

    Use a real commit body for any non-trivial change.

    line 94
  34. Distinctive:

    Call out behavior changes, fallback paths, performance work, or bug triggers explicitly when they motivated the change.

    line 101
  35. Distinctive:

    If validation was important, mention the key checks in the body instead of making reviewers guess.

    line 102
  36. Very specific:

    Avoid useless subjects like fix stuff, updates, wip, or misc cleanup.

    line 103
  37. Very specific:

    Do not add Co-Authored-By or AI attribution trailers unless the user explicitly asks for them.

    line 104
  38. Very specific:

    When working in a worktree linked to a pull request, check .arbor/pr-comments.md for review comments left by reviewers.

    line 108
  39. Very specific:

    When adding or modifying UI, use screencapture -x /tmp/screenshot.png to take a screenshot and verify the result visually.

    line 115
  40. Very specific:

    Use git-cliff for changelog generation.

    line 119
  41. Distinctive:

    Discover new work?: Create linked issue:

    line 203
  42. Very specific:

    Use bd dolt push/bd dolt pull for remote sync

    line 212
  43. Distinctive:

    No manual export/import needed!

    line 213
  44. Distinctive:

    File issues for remaining work: - Create issues for anything that needs follow-up

    line 233
  45. Distinctive:

    Verify: - All changes committed AND pushed

    line 245
  46. Distinctive:

    NEVER stop before pushing - that leaves work stranded locally

    line 250
  47. Distinctive:

    NEVER say "ready to push when you are" - YOU must push

    line 251
  48. Distinctive:

    If push fails, resolve and retry until it succeeds

    line 252

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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

This file defines how coding agents should behave in this repository.

Priorities

  1. Keep code simple, explicit, and maintainable.
  2. Fix root causes, avoid temporary band-aids.
  3. Preserve user changes, never revert unrelated edits.

Workflow

  1. Read this file at task start.
  2. Prefer just recipes for common tasks.
  3. Before committing code, always run just format and just lint and fix any failures.
  4. Before handoff, run relevant checks for touched code.

UI Parity

  • Arbor has two user-facing UI surfaces: arbor-gui and arbor-web-ui.
  • When adding, changing, or removing a user-visible feature in one surface, check whether the other surface needs the same capability.
  • Default to keeping both surfaces in parity. If parity is intentionally deferred, call that out clearly in the handoff and create follow-up work instead of silently shipping only one side.
  • UI verification should cover both surfaces when the feature is meant to exist in both.

GPUI Threading Rules

  • Treat the GPUI app/window/entity context as the UI thread unless you have explicitly moved work off it.
  • Be extremely careful not to block the UI thread with disk I/O, network I/O, daemon RPCs, SSH, git/process spawning, sleeps, waits, or CPU-heavy work. If it can stall a frame, assume it is forbidden on the UI thread.
  • GPUI/Zed guidance matters here: App::spawn, Context::spawn_in, and AsyncWindowContext::spawn run futures that are polled on the main thread. Do not put blocking or CPU-intensive work directly inside those futures.
  • Use cx.background_spawn(...) or a BackgroundExecutor for blocking or CPU-heavy work. Use the foreground task only to kick work off, await the result, and then hop back into update(...) to apply state changes.
  • If you must adapt a synchronous blocking function, run it on a background thread/executor. Prefer GPUI background tasks, and use smol::unblock when you need to wrap a blocking call into a future. Do not introduce Tokio.
  • Render paths must be pure state reads. Never do filesystem scans, config loads, git queries, daemon calls, SSH work, process spawning, or expensive recomputation from render_* methods.
  • Event handlers and hot paths must stay thin. on_action, listener, websocket/message handlers, timers, auto-refresh loops, and key/mouse handlers should schedule background work and return quickly instead of doing the slow part inline.
  • Cache derived data that is expensive to compute or load. If the UI needs it often, compute it in the background, store it in state, and render from the cached state.
  • When reviewing GPUI code, ask two questions every time: could this block? and could this run during render or a hot UI path? If yes, move it off-thread.

Commands

  • Format: just format
  • Format check: just format-check
  • Lint: just lint
  • Test: just test
  • Run app: just run
  • Run HTTP daemon: just run-httpd

Rust Rules

  • Do not use unwrap() or expect() in non-test code. In test modules, allow them with #[allow(clippy::unwrap_used, clippy::expect_used)].
  • Use arbor_core::ResultExt / arbor_core::OptionExt for .context() instead of ad-hoc .map_err().
  • Use SessionId and WorkspaceId newtypes (from arbor_core::id) instead of raw String.
  • Use clear error handling with typed errors (thiserror/anyhow where appropriate).
  • Keep modules focused and delete dead code instead of leaving it around.
  • Never shell out to external CLIs (gh, git via Command::new, etc.) for GitHub API calls. Use Rust crates (octocrab, reqwest, etc.) instead. std::process::Command is if no rust crate exists.

Code Organization

  • Split large files by domain. Target ~800 lines per file max.
  • Use pub(crate) for items shared within a crate. Apply to fields, methods, and free functions.
  • Use pub(crate) use module::* re-exports to keep call sites clean after splitting.
  • When extracting code to a new file, ensure all struct fields are pub(crate) (not private) so the parent module can access them.

Feature Flags

  • arbor-gui features: ssh, mosh, mdns (default: all enabled).
  • arbor-httpd features: mdns (default: enabled).
  • arbor-core features: ssh, mosh (propagated from GUI).
  • Gate optional modules/functions with #[cfg(feature = "...")].
  • Use dep:crate_name syntax for optional dependency features.
  • mosh implies ssh — features are hierarchical.

Workspace Dependencies

All dependency versions live in the root Cargo.toml [workspace.dependencies]. Subcrate Cargo.toml files use { workspace = true }. Never hardcode a version in a subcrate.

Common Mistakes to Avoid

  • Missing pub(crate) on extracted items: When moving structs, enums, or functions from main.rs to submodules, every field and method that was previously accessible needs pub(crate).
  • Unused imports after extraction: After moving code out of a file, clean up use statements in the source file — the compiler will flag these.
  • Duplicate definitions: When splitting code, ensure a function/type exists in exactly one place. Check both the source and destination files.
  • Test module lint attributes: Test modules need both #[allow(clippy::unwrap_used)] and #[allow(clippy::expect_used)] since the workspace denies both.
  • Forgetting #[cfg(feature)] on imports: When gating a module with a feature flag, also gate its use import and any code that references its types.
  • Double-truncating UI preview text: For branch/path/URL previews in forms and modals, choose exactly one truncation layer. If the string is already truncated in code, do not add UI-level ellipsis on top of it. Add a regression test for the preview helper or render path so placeholders never collapse to just ... or ….

Git Rules

  • Treat git status / git diff as read-only context.
  • Do not run destructive git commands.
  • Do not amend commits unless explicitly asked.
  • Only create commits when the user asks.

Commit Messages

  • Prefer conventional commits when they fit: feat|fix|docs|refactor|test|chore(scope): summary.
  • Use a real commit body for any non-trivial change. One-line commits are for genuinely tiny edits only.
  • Structure commit messages like this:
    1. Subject line: concise, imperative, and specific about the user-visible or architectural change.
    2. Blank line.
    3. Body: short paragraphs or bullets explaining why the change was needed, what changed, and any important constraints, follow-ups, or migrations.
  • Wrap commit message text. Keep the subject short, and wrap body lines to roughly 72 columns so git log and terminal tools stay readable.
  • The body should capture the reasoning that will matter in git log six months later, not just restate the diff.
  • Call out behavior changes, fallback paths, performance work, or bug triggers explicitly when they motivated the change.
  • If validation was important, mention the key checks in the body instead of making reviewers guess.
  • Avoid useless subjects like fix stuff, updates, wip, or misc cleanup.
  • Do not add Co-Authored-By or AI attribution trailers unless the user explicitly asks for them.

PR Review Comments

When working in a worktree linked to a pull request, check .arbor/pr-comments.md for review comments left by reviewers. This file is auto-generated by the Arbor GUI and contains all PR review threads grouped by file path. Address unresolved comments when they relate to your current task. Delete .arbor/pr-comments.md before merging to main.

UI Verification

When adding or modifying UI, use screencapture -x /tmp/screenshot.png to take a screenshot and verify the result visually. Run the app with just run, capture, then inspect the image.

Changelog

  • Use git-cliff for changelog generation.
  • CHANGELOG.md is generated for release artifacts and is not tracked in git.
  • Config file: cliff.toml
  • Commands:
    • just changelog
    • just changelog-file <path>
    • just changelog-unreleased
    • just changelog-release <version>

Project Structure

CrateDescription
arbor-coreWorktree primitives, change detection, shared types (SessionId, WorkspaceId, ResultExt)
arbor-daemon-clientHTTP client for talking to arbor-httpd
arbor-guiGPUI desktop app (Arbor binary)
arbor-httpdRemote HTTP daemon (arbor-httpd binary)
arbor-mcpMCP server for AI agent integration
arbor-moshMosh shell backend (optional)
arbor-sshSSH shell backend (optional)
arbor-terminal-emulatorTerminal emulation layer
arbor-web-uiTypeScript dashboard assets + helper crate
<!-- BEGIN BEADS INTEGRATION -->

Issue Tracking with bd (beads)

IMPORTANT: This project uses bd (beads) for ALL issue tracking. Do NOT use markdown TODOs, task lists, or other tracking methods.

Why bd?

  • Dependency-aware: Track blockers and relationships between issues
  • Git-friendly: Dolt-powered version control with native sync
  • Agent-optimized: JSON output, ready work detection, discovered-from links
  • Prevents duplicate tracking systems and confusion

Quick Start

Check for ready work:

bd ready --json

Create new issues:

bd create "Issue title" --description="Detailed context" -t bug|feature|task -p 0-4 --json
bd create "Issue title" --description="What this issue is about" -p 1 --deps discovered-from:bd-123 --json

Claim and update:

bd update <id> --claim --json
bd update bd-42 --priority 1 --json

Complete work:

bd close bd-42 --reason "Completed" --json

Issue Types

  • bug - Something broken
  • feature - New functionality
  • task - Work item (tests, docs, refactoring)
  • epic - Large feature with subtasks
  • chore - Maintenance (dependencies, tooling)

Priorities

  • 0 - Critical (security, data loss, broken builds)
  • 1 - High (major features, important bugs)
  • 2 - Medium (default, nice-to-have)
  • 3 - Low (polish, optimization)
  • 4 - Backlog (future ideas)

Workflow for AI Agents

  1. Check ready work: bd ready shows unblocked issues
  2. Claim your task atomically: bd update <id> --claim
  3. Work on it: Implement, test, document
  4. Discover new work? Create linked issue:
    • bd create "Found bug" --description="Details about what was found" -p 1 --deps discovered-from:<parent-id>
  5. Complete: bd close <id> --reason "Done"

Auto-Sync

bd automatically syncs via Dolt:

  • Each write auto-commits to Dolt history
  • Use bd dolt push/bd dolt pull for remote sync
  • No manual export/import needed!

Important Rules

  • ✅ Use bd for ALL task tracking
  • ✅ Always use --json flag for programmatic use
  • ✅ Link discovered work with discovered-from dependencies
  • ✅ Check bd ready before asking "what should I work on?"
  • ❌ Do NOT create markdown TODO lists
  • ❌ Do NOT use external issue trackers
  • ❌ Do NOT duplicate tracking systems

For more details, see README.md and docs/QUICKSTART.md.

Landing the Plane (Session Completion)

When ending a work session, you MUST complete ALL steps below. Work is NOT complete until git push succeeds.

MANDATORY WORKFLOW:

  1. File issues for remaining work - Create issues for anything that needs follow-up
  2. Run quality gates (if code changed) - Tests, linters, builds
  3. Update issue status - Close finished work, update in-progress items
  4. PUSH TO REMOTE - This is MANDATORY:
    git pull --rebase
    bd dolt pull
    git push
    bd dolt push
    git status  # MUST show "up to date with origin"
  5. Clean up - Clear stashes, prune remote branches
  6. Verify - All changes committed AND pushed
  7. Hand off - Provide context for next session

CRITICAL RULES:

  • Work is NOT complete until git push succeeds
  • NEVER stop before pushing - that leaves work stranded locally
  • NEVER say "ready to push when you are" - YOU must push
  • If push fails, resolve and retry until it succeeds
<!-- END BEADS INTEGRATION -->

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.