Skip to content

A fast file manager for Windows and macOS that never freezes: tabs, dual panes, archives as folders, Quick Look-style previews. A File Explorer and Finder alternative written in Rust.

4.8 KB
Raw Blame

For AI coding agents working on rustyfiles

Short rules for a tool that writes code here (and for the person driving it). The human version is CONTRIBUTING.md; where the two differ, this file is the stricter one.

Before you write anything

  1. Work from today's main of gelenmedya/rustyfiles. Fixes land every day. In a fork, origin is the fork, and its main is usually behind, so name the real repository: git fetch https://github.com/gelenmedya/rustyfiles main && git rebase FETCH_HEAD. Read the code as it is there, not the released version the issue was written against.
  2. Check that the work is still open. Read the whole issue, its last comments included, and search the open and recently merged pull requests for the same fix (gh pr list --state all --search "<issue number or words>"). Several pull requests have repeated a fix that was already on main.
  3. Find the cause before the fix. Reproduce the problem, or measure it, and say in the pull request what the cause was. A change that makes the symptom go away without a named cause is not taken.

What goes into a pull request

  • One change. No refactoring, renaming or tidying beside it.
  • Never run cargo fmt and do not reformat lines you did not change: the tree is not formatted with rustfmt, and a reformatted file cannot be reviewed.
  • Only the files of the change. Keep your own files out: screenshot folders (.agent-screenshots/), plans, notes, tool settings. No version bumps, no edits to .github/workflows/, vendor/ or Cargo.lock unless the change is about exactly that.
  • No new dependency without asking in the issue first.
  • A new setting is off by default (unless it fixes something) and has its own switch in Settings.

The code

  • Layout. crates/rf-app is the interface (GPUI), rf-win everything that talks to Windows, rf-core, rf-archive and rf-nearby are shared with the macOS app, rf-dialog is the DLL that runs inside other programs for Open/Save, rf-shellguard watches the Explorer replacement, rf-convert is the converter's core (pure Rust: what turns into what, and the writing). The macOS app (macos/, crates/rf-mac) is outside the Windows workspace and builds on a Mac only: if you change a public type in a shared crate, search crates/rf-mac for its uses.
  • Nothing waits on the interface thread. Disk, shell and network calls run on a background executor; a slow or failing part must not freeze or take down another one.
  • Comments say why, in plain English, with the issue number, the way the code around them does.
  • Interface texts are written in Turkish inside t!("..."), with the English in crates/rf-app/src/i18n_en.rs. If you do not know Turkish, put the English in both places and say so in the pull request. Do not edit crates/rf-app/locales/*.json: the maintainer runs the translations.

Building and trying

cargo test -p rf-app -p rf-win -p rf-core
cargo run -p rf-app --bin rustyfiles -- C:\some\folder
  • Try it in a copy with its own settings, never on the user's real ones: RUSTYFILES_CONFIG_DIR=<empty folder> and RUSTYFILES_MULTI_INSTANCE=1.
  • Do not end explorer.exe, change the shell in the registry, or do anything that asks for administrator rights as part of a test.
  • Add a test for logic that can break (parsing, sorting, file operations). Tests that measure speed depend on the machine: if one fails, run it alone before believing it, and never loosen its limit.
  • A test fails? Run it on a clean main first. If it fails there too it is not yours: say so in the pull request, and do not "fix", skip or delete it on the way.
  • What CI runs on a pull request: cargo test --workspace, a release build (cargo build --release -p rf-app -p rf-dialog), and a release build for Windows on ARM with --locked (--target aarch64-pc-windows-msvc). So the code has to compile for ARM64 too (no x86-only code without a cfg), and Cargo.lock has to be committed whenever a dependency changed.

Commits and the pull request's text

  • Every commit of the branch lands in the history as it is (branches are merged, not squashed). So each commit title is short, plain English, under 72 characters, and says what changed for the person using the program: "The tab menu has Open in terminal", not "feat: add menu item" or "fix review comments". Squash work-in-progress commits before asking for review.
  • Title of the pull request: the same style.
  • Body: what was wrong and why, what you changed, and how you tried it (Windows version, the steps, a picture for anything visible). Link the issue.
  • Say what you did not try. "Compiles and the tests pass" is not "works": if the change was never run on a real window, write that. An honest "untested on Windows 10" is worth more than a confident summary.