RuleStack

Configs

Stacks

Compare

Diff

RuleStack

Configs

Stacks

Compare

Diff

Read API

RuleStack

Configs

Stacks

Compare

Diff

Read API

Configs/Cursor rules/alexwine36/serpeo

Cursor rule

.cursor/rules/rust-async-development-rules.mdc

[object Object]

Cursor rules

Quality

38/100

Scores the file, not the repository.

Length

482 words

0 headings · 0 code blocks

Repository

0

— · pushed 434 days ago

Last changed

3 days ago

First indexed 3 days ago.
alexwine36/serpeo/.cursor/rules/rust-async-development-rules.mdcRawGitHub
1---
2description:
3globs:
4alwaysApply: true
5---
6You are an expert in Rust, async programming, and concurrent systems.
7 
8Key Principles
9- Write clear, concise, and idiomatic Rust code with accurate examples.
10- Use async programming paradigms effectively, leveraging `tokio` for concurrency.
11- Prioritize modularity, clean code organization, and efficient resource management.
12- Use expressive variable names that convey intent (e.g., `is_ready`, `has_data`).
13- Adhere to Rust's naming conventions: snake_case for variables and functions, PascalCase for types and structs.
14- Avoid code duplication; use functions and modules to encapsulate reusable logic.
15- Write code with safety, concurrency, and performance in mind, embracing Rust's ownership and type system.
16- Make sure generated code is free from compiler errors regenerating if necessary.
17 
18Async Programming
19- Use `tokio` as the async runtime for handling asynchronous tasks and I/O.
20- Implement async functions using `async fn` syntax.
21- Leverage `tokio::spawn` for task spawning and concurrency.
22- Use `tokio::select!` for managing multiple async tasks and cancellations.
23- Favor structured concurrency: prefer scoped tasks and clean cancellation paths.
24- Implement timeouts, retries, and backoff strategies for robust async operations.
25 
26Channels and Concurrency
27- Use Rust's `tokio::sync::mpsc` for asynchronous, multi-producer, single-consumer channels.
28- Use `tokio::sync::broadcast` for broadcasting messages to multiple consumers.
29- Implement `tokio::sync::oneshot` for one-time communication between tasks.
30- Prefer bounded channels for backpressure; handle capacity limits gracefully.
31- Use `tokio::sync::Mutex` and `tokio::sync::RwLock` for shared state across tasks, avoiding deadlocks.
32 
33Error Handling and Safety
34- Embrace Rust's Result and Option types for error handling.
35- Use `?` operator to propagate errors in async functions.
36- Implement custom error types using `thiserror` or `anyhow` for more descriptive errors.
37- Handle errors and edge cases early, returning errors where appropriate.
38- Use `.await` responsibly, ensuring safe points for context switching.
39 
40Testing
41- Write unit tests with `tokio::test` for async tests.
42- Use `tokio::time::pause` for testing time-dependent code without real delays.
43- Implement integration tests to validate async behavior and concurrency.
44- Use mocks and fakes for external dependencies in tests.
45 
46Performance Optimization
47- Minimize async overhead; use sync code where async is not needed.
48- Avoid blocking operations inside async functions; offload to dedicated blocking threads if necessary.
49- Use `tokio::task::yield_now` to yield control in cooperative multitasking scenarios.
50- Optimize data structures and algorithms for async use, reducing contention and lock duration.
51- Use `tokio::time::sleep` and `tokio::time::interval` for efficient time-based operations.
52 
53Key Conventions
541. Structure the application into modules: separate concerns like networking, database, and business logic.
552. Use environment variables for configuration management (e.g., `dotenv` crate).
563. Ensure code is well-documented with inline comments and Rustdoc.
57 
58Async Ecosystem
59- Use `tokio` for async runtime and task management.
60- Leverage `hyper` or `reqwest` for async HTTP requests.
61- Use `serde` for serialization/deserialization.
62- Use `sqlx` or `tokio-postgres` for async database interactions.
63- Utilize `tonic` for gRPC with async support.
64 
65Refer to Rust's async book and `tokio` documentation for in-depth information on async patterns, best practices, and advanced features.

What it covers

code-style

Stack — with the evidence

rust

(1.00)

turborepo

(1.00)

biome

(1.00)

node

(0.70)

react

(0.70)

tailwind

(0.70)

vite

(0.70)

vitest

(0.70)

desktop-app

(0.70)

typescript

(0.60)

javascript

(0.60)

swift

(0.60)

monorepo

(0.60)

pnpm

(0.60)

github-actions

(0.60)

Glob targeting

  • [object Object]

Format

Cursor rules

The most expressive format here. Many small .mdc files, each with frontmatter declaring when it should load, so a rule about migrations only enters context when a migration is open. Costs the most to maintain and only one editor reads it.

What the corpus says about it

Repository

Owner
alexwine36
Language
—
License
—
Archived
no

All configs in this repo

Also in alexwine36/serpeo

Diff this repo’s formats

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?

The other instruction files in this repository
RepositoryFormatStackCoversScoreChanged
alexwine36/serpeo.cursor/rules/general.mdc · 0Cursor rulesrustturborepo+13no sections24/1003 days ago
Diff against .cursor/rules/general.mdc

Similar configs

Same format, overlapping stack, ranked by quality.

Same format, overlapping stack, ranked by quality
RepositoryFormatStackCoversScoreChanged
hiromaily/go-crypto-wallet.cursor/rules/typescript.mdc · 126Cursor rulesgobun+5setupbuildtestlint-format+6100/1003 days ago
markstev/mark-starter.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+14setuptestlint-formatstyle+699/1003 days ago
Allymahmoud/case-intake-platform.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+13setuptestlint-formatstyle+799/1003 days ago
dodgecfr/combatfilms-webapp.cursor/rules/frontend.mdc · 0Cursor rulestypescriptturborepo+15setuptestlint-formatstyle+799/1003 days ago
nerds-odd-e/doughnut.cursor/rules/cli.mdc · 49Cursor rulestypescriptcypress+14setupbuildteststyle+496/1003 days ago
hiromaily/go-crypto-wallet.cursor/rules/proto.mdc · 126Cursor rulesgobiome+4buildlint-formatstylearch+396/1003 days ago
K-Mistele/opensearch.cursor/rules/default.mdc · 30Cursor rulestypescriptbun+3buildtestlint-formatstyle+294/1003 days ago
hiromaily/go-crypto-wallet.cursor/rules/task-context-loading.mdc · 126Cursor rulesgobiome+4archtypesdatabasedo-not+193/1003 days ago
RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack

RuleStack

Built by

Kynth Studio

Directory

Configs
Stacks
Compare formats
Diff two configs
Best AGENTS.md examples

Formats

AGENTS.md
CLAUDE.md
Cursor rules
Copilot instructions

Reference

Read API
Corpus health
Privacy Policy
Terms

RuleStack