

Also from Kynth Studios


Also from Kynth Studios


Also from Kynth Studios
1# AGENTS.md - Spacedrive Core v223## Build/Test Commands45- `cargo build` - Build the project6- `cargo test` - Run all tests7- `cargo test <test_name>` - Run specific test (e.g., `cargo test library_test`)8- `cargo clippy` - Lint code9- `cargo fmt` - Format code10- `cargo run --bin sd-cli -- <command>` - Run CLI (note: binary is `sd-cli`, not `spacedrive`)1112## Code Style1314- **Imports**: Group std, external crates, then local modules with blank lines between15- **Formatting**: Use `cargo fmt` - tabs for indentation, snake_case for variables/functions. DO NOT use emojis at all.16- **Types**: Explicit types preferred, use `Result<T, E>` for error handling with `thiserror`17- **Naming**: snake_case for functions/variables, PascalCase for types, SCREAMING_SNAKE_CASE for constants18- **Error Handling**: Use `Result` types, `thiserror` for custom errors, `anyhow` for application errors19- **Async**: Use `async/await`, prefer `tokio` primitives, avoid blocking operations20- **Resumable Jobs**: For long-running jobs that need to be resumable, store the job's state within the job's struct itself. Use `#[serde(skip)]` for fields that should not be persisted. For example, in a file copy job, the list of already copied files can be stored to allow the job to resume from where it left off.21- **Documentation**: Use `//!` for module docs, `///` for public items, include examples22- **Architecture**: Follow a Command Query Responsibility Segregation (CQRS) and Domain-Driven Design (DDD) pattern.23 - **Domain**: Core data structures and business logic are located in `src/domain/`. These are the "nouns" of your system.24 - **Operations**: State-changing commands (actions) and data-retrieving queries are located in `src/ops/`. These are the "verbs" of your system.25 - **Actions**: Operations that modify the state of the application. They should be self-contained and transactional.26 - **Queries**: Operations that retrieve data without modifying state. They should be efficient and optimized for reading.27- **Feature Modules**: Each new feature should be implemented in its own module within the `src/ops/` directory. For example, a new "share" feature would live in `src/ops/files/share`. Each feature module should contain the following files where applicable:28 - `action.rs`: The main logic for the state-changing operation.29 - `input.rs`: Data structures for the action's input.30 - `output.rs`: Data structures for the action's output.31 - `job.rs`: If the action is long-running, the job implementation.32- **Database**: Use SeaORM entities, async queries, proper error propagation33- **Comments**: Minimal inline comments, focus on why not what, no TODO comments in production code3435## Daemon Architecture3637Spacedrive uses a **daemon-client architecture** where a single daemon process manages the core functionality and multiple client applications (CLI, GraphQL server, desktop app) connect to it via Unix domain sockets.3839> **For detailed daemon architecture documentation, see [/docs/core/daemon.md](/docs/core/daemon.md)**4041### **The `Wire` Trait**4243All actions and queries must implement the `Wire` trait to enable type-safe client-daemon communication:4445```rust46pub trait Wire {47 const METHOD: &'static str;48}49```5051### **Registration Macros**5253Instead of manually implementing `Wire`, use these registration macros that automatically:54551. Implement the `Wire` trait with the correct method string562. Register the operation in the global registry using the `inventory` crate5758**For Queries:**5960```rust61crate::register_query!(NetworkStatusQuery, "network.status");62// Generates method: "query:network.status"63```6465**For Library Actions:**6667```rust68crate::register_library_action!(FileCopyAction, "files.copy");69// Generates method: "action:files.copy.input"70```7172**For Core Actions:**7374```rust75crate::register_core_action!(LibraryCreateAction, "libraries.create");76// Generates method: "action:libraries.create.input"77```7879### **Registry System**8081- **Location**: `core/src/ops/registry.rs`82- **Mechanism**: Uses the `inventory` crate for compile-time registration83- **Global Maps**: `QUERIES` and `ACTIONS` hashmaps populated at startup84- **Handler Functions**: Generic handlers that decode payloads, execute operations, and encode results8586## Logging Standards8788- **Setup**: Use `tracing_subscriber::fmt()` with env filter for structured logging89- **Macros**: Use `info!`, `warn!`, `error!`, `debug!` from `tracing` crate, not `println!`90- **Job Context**: Use `ctx.log()` in jobs for job-specific logging with automatic job_id tagging91- **Structured**: Include relevant context fields: `debug!(job_id = %self.id, "message")`92- **Levels**: debug for detailed flow, info for user-relevant events, warn for recoverable issues, error for failures93- **Format**: `tracing_subscriber::fmt().with_env_filter(env_filter).init()` in main/examples94- **Environment**: Respect `RUST_LOG` env var, fallback to module-specific filters like `sd_core=info`9596## Documentation9798- **Core level docs**: Live in `/docs/core` - comprehensive architecture and implementation guides99- **Core design docs**: Live in `/docs/core/design` - planning documents, RFCs, and design decisions100- **Application level docs**: Live in `/docs`101- **Code docs**: Use `///` for public APIs, `//!` for module overviews, include examples102103## Debug Instructions104105- You can view the logs of a job in the job_logs directory in the root of the data folder106- When testing the CLI, after compiling you must first use the `restart` command to ensure the Spacedrive daemon is using the latest build.107
One repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| spacedriveapp/spacedriveAGENTS.md · 39k | AGENTS.md | setupbuildtestlint-format+9 | 84/100 | 14 days ago | |
| spacedriveapp/spacedrivepackages/interface/CLAUDE.md · 39k | CLAUDE.md | stylearchtypesui+3 | 65/100 | 14 days ago |
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| code-yeongyu/oh-my-openagentpackages/web/AGENTS.md · 68k | AGENTS.md | setupbuildtestlint-format+6 | 100/100 | 13 days ago | |
| mui/material-uiAGENTS.md · 99k | AGENTS.md | setupbuildtestlint-format+9 | 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 | |
| TryGhost/Ghoste2e/AGENTS.md · 55k | AGENTS.md | setupteststylearch+2 | 100/100 | today | |
| n8n-io/n8npackages/@n8n/agents/AGENTS.md · 201k | AGENTS.md | buildteststylearch+3 | 100/100 | 14 days ago | |
| elastic/elasticsearchx-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/AGENTS.md · 78k | AGENTS.md | buildtestlint-formatstyle+2 | 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/spacedriveapp-spacedrive-core-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.