awesome-ai-rules
🤖 Curated AI coding assistant rules for Cursor, Claude Code, Copilot, Windsurf, Codex CLI & Gemini CLI. Copy-paste configs for TypeScript, React, Next.js & Python.
Install / Use
npx skills add Lay4U/awesome-ai-rulesInstalls into whichever agent you are using.
.windsurfrules
Windsurf/Codeium rules
Quality Score
Category
Development & EngineeringSupported Platforms
Skill content
View source on GitHubWindsurf Rules: Rust
Baseline
- Produce Rust that is safe by default and simple to audit.
- Prefer clear data flow over clever abstractions.
Borrowing and Lifetimes
- Start with borrowed references before choosing ownership transfer.
- Limit mutable access windows to reduce borrow conflicts.
- Make lifetimes explicit when signatures are ambiguous.
- Do not patch borrow errors with broad cloning.
Error Strategy
- Use
Result<T, E>for all recoverable failures. - Use
thiserrorfor reusable library error enums. - Use
anyhowfor app-level glue code and command entrypoints. - Add contextual details at I/O, parsing, and network boundaries.
- Disallow
unwrap()in production code. - Prefer
?; useexpect()only with clear invariant text.
Matching and Control Flow
- Keep pattern matching exhaustive and intentional.
- Avoid
_arms on domain enums unless future variants are truly irrelevant. - Use
let ... elsefor early exits and reduced nesting.
Workspace and Quality Gates
- Structure multi-crate projects as Cargo workspaces.
- Keep shared crates framework-agnostic.
- Format with
cargo fmt --all. - Lint with
cargo clippy --all-targets --all-features -D warnings. - Treat lint suppressions as exceptions requiring comments.
Unsafe Policy
- Use
unsafeonly when benchmarked or API-constrained. - Encapsulate unsafe internals in small modules.
- Add safety comments that state required invariants.
- Validate unsafe assumptions with targeted tests.
Testing and Docs
- Run
cargo test --workspacebefore finishing. - Put integration tests in
tests/. - Keep unit tests close to the module they verify.
- Provide rustdoc on public APIs with short examples.
- Ensure doc examples are accurate and compilable.
Implementation Style
- Prefer iterator chains to manual indexing loops.
- Keep functions small, typed, and single-purpose.
- Favor explicit domain enums over stringly typed status values.
Related Skills
momen-cursurrules-prompt-file
40.6kCursor rules for building custom frontends with Momen.app as headless BaaS with GraphQL API, actionflows, AI agents, and Stripe integration.
pyspark-etl-best-practices-cursorrules-prompt-file
40.6kCursor rules for PySpark ETL development with code style, joins, window functions, map operations, and Iceberg patterns.
semiotic-react-dataviz-cursorrules-prompt-file
40.6kCursor rules for Semiotic data visualization library with 30+ chart types, MCP server, and AI-assisted chart generation.
Agent-Reach
71.6kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
Security Score
Audited on Invalid Date
