

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# AGENTS.md23This file provides guidance to AI coding agents (e.g. Claude Code, Codex, Cursor, Gemini CLI, and similar tools) when working with code in this repository.45Rclone welcomes AI-assisted contributions, but the expectation is that you, the human submitter, understand every line you propose and have compiled and tested it against real rclone code - not just generated it. See the "AI-assisted contributions" section of [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request.67## Project Overview89Rclone is a command-line program to sync files and directories to and from cloud storage providers. It's written in Go and supports 70+ backends (cloud storage systems). Think "rsync for cloud storage".1011## General Notes1213**We take backwards compatibility very seriously.** PRs should not change the observable behaviour of existing commands, flags or rc API without very good reason. Rclone does not try to preserve a stable Go API but try not to change it gratuitously.1415Rclone operates with a lot of different backends, so **compatibility is key**. It is the backend integration tests which guarantee that compatibility. Changes should consider both known and unknown backends and should take care not to break functionality of existing installations.1617The core parts of rclone under `fs` and `vfs` need to work with all backends and **backend specific hacks won't be merged**. Fixes likely need to go in the relevant backend or if new behaviour is really needed, a new Feature flag needs to be added.1819**Changes should be kept to the minimum.** Work hard to make the most elegant, smallest change you can. Do not refactor or re-order code unless necessary as this makes review more challenging. Re-use existing test scaffolding, existing or library routines (e.g. `lib`) where possible.2021Make sure added tests **actually test the code you have written** and test the intention behind the change. If you are fixing a problem, write the tests first to reproduce the problem before starting on the fix.2223## Build and Test Commands2425```bash26# Build rclone (simple)27go build2829# Build with version info (preferred)30make3132# Run all unit tests (no cloud credentials needed)33make quicktest34# or equivalently:35RCLONE_CONFIG="/notfound" go test ./...3637# Run tests for a specific package38cd backend/memory && go test -v39# or from root:40go test -v ./backend/memory/4142# Run a single test43go test -v -run TestIntegration/FsCheckWrap ./backend/memory/4445# Run tests with race detector46make racequicktest4748# Lint (requires golangci-lint)49golangci-lint run ./...5051# Run backend integration tests (requires configured TestRemote remote)52cd backend/drive && go test -v53# Run sync/operations integration tests against a remote54cd fs/sync && go test -v -remote TestDrive:55cd fs/operations && go test -v -remote TestDrive:5657# Run integration tests via test framework58go run ./fstest/test_all -backends drive59```6061## Architecture6263### Entry Point and Plugin Registration6465`rclone.go` is the main entry point. It imports `backend/all` and `cmd/all` which use Go's `init()` pattern to register all backends and commands. Each backend calls `fs.Register()` with a `fs.RegInfo` struct during init.6667### Core Interfaces (`fs/`)6869The `fs` package defines the core abstractions:70- **`fs.Fs`** (`fs/types.go`): The filesystem interface every backend must implement (List, NewObject, Put, Mkdir, Rmdir).71- **`fs.Object`** (`fs/types.go`): Interface for a file/object (Open, Update, Remove, SetModTime).72- **`fs.Features`** (`fs/features.go`): Optional capabilities a backend can declare (Purge, Copy, Move, DirMove, etc.). Backends set function pointers for operations they support; nil means not supported.73- **`fs.RegInfo`** (`fs/registry.go`): Registration metadata for a backend including its name, config options, and NewFs constructor.7475### Backend Structure (`backend/`)7677Each backend is a single Go package (e.g., `backend/s3/`, `backend/drive/`). Key conventions:78- Main implementation in a single file (e.g., `s3.go`) - **do not** split into `fs.go`/`object.go`.79- API types go in a separate `api/types.go` file.80- Test file (e.g., `s3_test.go`) uses `fstests.Run()` from `fstest/fstests` for standardized integration tests.81- Register in `backend/all/all.go` via blank import.82- HTTP-based backends should use `lib/rest` for HTTP calls and `fs/fshttp` for the HTTP client.83- Use `lib/dircache` for directory-ID-based remotes, `lib/oauthutil` for OAuth, `lib/pacer` for rate limiting.8485### Command Structure (`cmd/`)8687Each command is a package under `cmd/` registered in `cmd/all/all.go` via blank import. Commands use cobra via `cmd.Main()`.8889### Key Subsystems9091- **`fs/operations/`**: Core file operations (Copy, Move, Delete, etc.)92- **`fs/sync/`**: Directory sync logic93- **`fs/march/`**: Parallel directory tree walker used by sync94- **`fs/filter/`**: Include/exclude filtering95- **`fs/accounting/`**: Transfer statistics and bandwidth limiting96- **`fs/config/`**: Configuration file management97- **`vfs/`**: Virtual filesystem layer (used by mount, serve)98- **`librclone/`**: C-compatible library interface for embedding rclone99- **`fstest/`**: Integration test framework; `fstest/fstests/` has the generic backend test suite100101## Commit Message Convention102103Prefix with the directory of the change, then a colon: `drive: add team drive support - fixes #885`. For cross-cutting changes use a broader prefix like `fs` or `operations`.104105Make the first line of your commit message a summary of the change that a user (not a developer) of rclone would like to read. So write `drive: fix server side copy of big files` instead of `drive: no longer set the MimeType in Move or Copy`. This is important because these lines go into the change log which is read by users.106107## Code Commenting Style108109Comments describe the code as it is now, for a future reader who has no knowledge of the change that introduced it.110111Every exported type, function, field, and constant has a **godoc comment** that starts with its name and is phrased as a present-tense statement of what it is or does (`// Mkdir makes the directory (container, bucket)`)112113**Document the contract** callers need - preconditions, what's returned, which sentinel errors are returned and when, and any "shouldn't return an error if it already exists" style caveats - rather than the implementation.114115**Keep comments terse**: a single line for most things, with extra paragraphs (separated by blank `//` lines) reserved for genuine subtlety.116117Inline comments inside function bodies should **explain why** - a non-obvious API quirk, a workaround, a gotcha, or an ordering constraint - and may cite an external reference (forum thread, vendor docs, RFC) when that's what makes the behaviour non-obvious; skip comments that merely restate what the code plainly does.118119Use `FIXME` and `TODO` for known shortcomings.120121**Do not write comments that narrate the change itself** or compare against the previous behaviour (no "now we also handle...", "changed to...", "previously this returned...", or references to bug/PR numbers in the code) - that context belongs in the commit message, not in source that will outlive the change.122123Code comments should only refer to **current** behaviour - and shouldn't describe behaviour that is trivially deducible from reading the code.124125## Linting Configuration126127Uses golangci-lint v2 with config in `.golangci.yml`. Enabled linters: errcheck, govet, ineffassign, staticcheck, unused, gocritic, misspell, revive, unconvert. The `goimports` formatter is also enabled.128129## Documentation130131- Backend option docs come from `Help:` fields in the Go source Options structs, not from markdown files.132- Command docs are in the command source code (e.g., `cmd/ls/ls.go`).133- Don't commit autogenerated doc changes from `make backenddocs` or `make commanddocs`.134- Website docs are in `docs/content/` as markdown, built with Hugo (`make serve` to preview).135
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 201k | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| aaif-goose/gooseAGENTS.md · 53k | AGENTS.md | setupbuildtestlint-format+7 | 100/100 | 8 days ago | |
| duckduckgo/content-scope-scriptsspecial-pages/AGENTS.md · 70 | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| deepseek-ai/deepseek-harnessnative/landlock-run/AGENTS.md · 104k | AGENTS.md | setupteststylearch+3 | 100/100 | today | |
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 68k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 13 days ago | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | today | |
| vllm-project/vllmAGENTS.md · 89k | AGENTS.md | setuptestlint-formatstyle+5 | 100/100 | 14 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 100/100 | 14 days ago |
A badge carrying the measured quality of the strongest agent config file in this repository, out of 100. It reads from this index every time somebody loads your page, so it changes when the measurement changes and there is nothing to keep up to date. Free, no account, and the value is not something you or we can set by hand.
[](https://rulestack.kynth.studio/configs/rclone-rclone-agents)Would rather not hotlink us? Every badge is also served in shields.io’s endpoint schema, so shields renders the image and your readers never talk to our domain:
Published by Toolproof, the masthead over this index and eight others. The method behind the number is at toolproof.kynth.studio/methodology, and the whole thing is readable as JSON with no key at /api.