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.
- CLAUDE.mdCLAUDE.md
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
- Distinctive: line 7
Keep code simple, explicit, and maintainable.
- Distinctive: line 13
Read this file at task start.
- Very specific: line 14
Prefer just recipes for common tasks.
- Very specific: line 15
Before committing code, always run just format and just lint and fix any failures.
- Distinctive: line 16
Before handoff, run relevant checks for touched code.
- Distinctive: line 21
When adding, changing, or removing a user-visible feature in one surface, check whether the other surface needs the same capability.
- Distinctive: line 22
Default to keeping both surfaces in parity.
- Very specific: line 27
Treat the GPUI app/window/entity context as the UI thread unless you have explicitly moved work off it.
- Very specific: line 30
Use cx.background_spawn(...) or a BackgroundExecutor for blocking or CPU-heavy work.
- Very specific: line 31
If you must adapt a synchronous blocking function, run it on a background thread/executor.
- Very specific: line 35
When reviewing GPUI code, ask two questions every time: could this block?
- Very specific: line 44
Run HTTP daemon: just run-httpd
- Very specific: line 48
Do not use unwrap() or expect() in non-test code.
- Very specific: line 49
Use arbor_core::ResultExt / arbor_core::OptionExt for .context() instead of ad-hoc .map_err().
- Very specific: line 50
Use SessionId and WorkspaceId newtypes (from arbor_core::id) instead of raw String.
- Very specific: line 51
Use clear error handling with typed errors (thiserror/anyhow where appropriate).
- Distinctive: line 52
Keep modules focused and delete dead code instead of leaving it around.
- Very specific: line 58
Use pub(crate) for items shared within a crate.
- Very specific: line 59
Use pub(crate) use module::* re-exports to keep call sites clean after splitting.
- Very specific: line 60
When extracting code to a new file, ensure all struct fields are pub(crate) (not private) so the parent module can access them.
- Very specific: line 68
Use dep:crate_name syntax for optional dependency features.
- Very specific: line 73
All dependency versions live in the root Cargo.toml [workspace.dependencies].
- Very specific: line 77
Missing
pub(crate)on extracted items: When moving structs, enums, or functions from main.rs to submodules, every field and method that … - Very specific: line 78
Unused imports after extraction: After moving code out of a file, clean up use statements in the source file — the compiler will flag these.
- Distinctive: line 79
Duplicate definitions: When splitting code, ensure a function/type exists in exactly one place.
- Very specific: line 80
Test module lint attributes: Test modules need both #[allow(clippy::unwrap_used)] and #[allow(clippy::expect_used)] since the workspace …
- Very specific: line 81
Forgetting
#[cfg(feature)]on imports: When gating a module with a feature flag, also gate its use import and any code that references … - Distinctive: line 86
Treat git status / git diff as read-only context.
- Distinctive: line 87
Do not run destructive git commands.
- Distinctive: line 88
Do not amend commits unless explicitly asked.
- Distinctive: line 89
Only create commits when the user asks.
- Very specific: line 93
Prefer conventional commits when they fit: feat|fix|docs|refactor|test|chore(scope): summary.
- Distinctive: line 94
Use a real commit body for any non-trivial change.
- Distinctive: line 101
Call out behavior changes, fallback paths, performance work, or bug triggers explicitly when they motivated the change.
- Distinctive: line 102
If validation was important, mention the key checks in the body instead of making reviewers guess.
- Very specific: line 103
Avoid useless subjects like fix stuff, updates, wip, or misc cleanup.
- Very specific: line 104
Do not add Co-Authored-By or AI attribution trailers unless the user explicitly asks for them.
- Very specific: line 108
When working in a worktree linked to a pull request, check .arbor/pr-comments.md for review comments left by reviewers.
- Very specific: line 115
When adding or modifying UI, use screencapture -x /tmp/screenshot.png to take a screenshot and verify the result visually.
- Very specific: line 119
Use git-cliff for changelog generation.
- Distinctive: line 203
Discover new work?: Create linked issue:
- Very specific: line 212
Use bd dolt push/bd dolt pull for remote sync
- Distinctive: line 213
No manual export/import needed!
- Distinctive: line 233
File issues for remaining work: - Create issues for anything that needs follow-up
- Distinctive: line 245
Verify: - All changes committed AND pushed
- Distinctive: line 250
NEVER stop before pushing - that leaves work stranded locally
- Distinctive: line 251
NEVER say "ready to push when you are" - YOU must push
- Distinctive: line 252
If push fails, resolve and retry until it succeeds
≈ “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.
Files
AGENTS.md
This file defines how coding agents should behave in this repository.
Priorities
- Keep code simple, explicit, and maintainable.
- Fix root causes, avoid temporary band-aids.
- Preserve user changes, never revert unrelated edits.
Workflow
- Read this file at task start.
- Prefer
justrecipes for common tasks. - Before committing code, always run
just formatandjust lintand fix any failures. - Before handoff, run relevant checks for touched code.
UI Parity
- Arbor has two user-facing UI surfaces:
arbor-guiandarbor-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, andAsyncWindowContext::spawnrun 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 aBackgroundExecutorfor blocking or CPU-heavy work. Use the foreground task only to kick work off, await the result, and then hop back intoupdate(...)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::unblockwhen 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?andcould 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()orexpect()in non-test code. In test modules, allow them with#[allow(clippy::unwrap_used, clippy::expect_used)]. - Use
arbor_core::ResultExt/arbor_core::OptionExtfor.context()instead of ad-hoc.map_err(). - Use
SessionIdandWorkspaceIdnewtypes (fromarbor_core::id) instead of rawString. - Use clear error handling with typed errors (
thiserror/anyhowwhere appropriate). - Keep modules focused and delete dead code instead of leaving it around.
- Never shell out to external CLIs (
gh,gitviaCommand::new, etc.) for GitHub API calls. Use Rust crates (octocrab,reqwest, etc.) instead.std::process::Commandis 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-guifeatures:ssh,mosh,mdns(default: all enabled).arbor-httpdfeatures:mdns(default: enabled).arbor-corefeatures:ssh,mosh(propagated from GUI).- Gate optional modules/functions with
#[cfg(feature = "...")]. - Use
dep:crate_namesyntax for optional dependency features. moshimpliesssh— 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 frommain.rsto submodules, every field and method that was previously accessible needspub(crate). - Unused imports after extraction: After moving code out of a file, clean up
usestatements 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 itsuseimport 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 diffas 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:
- Subject line: concise, imperative, and specific about the user-visible or architectural change.
- Blank line.
- 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 logand terminal tools stay readable. - The body should capture the reasoning that will matter in
git logsix 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, ormisc cleanup. - Do not add
Co-Authored-Byor 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-clifffor changelog generation. CHANGELOG.mdis generated for release artifacts and is not tracked in git.- Config file:
cliff.toml - Commands:
just changelogjust changelog-file <path>just changelog-unreleasedjust changelog-release <version>
Project Structure
| Crate | Description |
arbor-core | Worktree primitives, change detection, shared types (SessionId, WorkspaceId, ResultExt) |
arbor-daemon-client | HTTP client for talking to arbor-httpd |
arbor-gui | GPUI desktop app (Arbor binary) |
arbor-httpd | Remote HTTP daemon (arbor-httpd binary) |
arbor-mcp | MCP server for AI agent integration |
arbor-mosh | Mosh shell backend (optional) |
arbor-ssh | SSH shell backend (optional) |
arbor-terminal-emulator | Terminal emulation layer |
arbor-web-ui | TypeScript 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 --jsonCreate 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 --jsonClaim and update:
bd update <id> --claim --json
bd update bd-42 --priority 1 --jsonComplete work:
bd close bd-42 --reason "Completed" --jsonIssue Types
bug- Something brokenfeature- New functionalitytask- Work item (tests, docs, refactoring)epic- Large feature with subtaskschore- 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
- Check ready work:
bd readyshows unblocked issues - Claim your task atomically:
bd update <id> --claim - Work on it: Implement, test, document
- Discover new work? Create linked issue:
bd create "Found bug" --description="Details about what was found" -p 1 --deps discovered-from:<parent-id>
- 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 pullfor remote sync - No manual export/import needed!
Important Rules
- ✅ Use bd for ALL task tracking
- ✅ Always use
--jsonflag for programmatic use - ✅ Link discovered work with
discovered-fromdependencies - ✅ Check
bd readybefore 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:
- File issues for remaining work - Create issues for anything that needs follow-up
- Run quality gates (if code changed) - Tests, linters, builds
- Update issue status - Close finished work, update in-progress items
- 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" - Clean up - Clear stashes, prune remote branches
- Verify - All changes committed AND pushed
- Hand off - Provide context for next session
CRITICAL RULES:
- Work is NOT complete until
git pushsucceeds - 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 -->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.

