Lens rust
Stack lens para Rust. Use durante Discovery quando Cargo.toml for detectado. Cobre binários, libs, async runtimes (tokio/async-std), error handling, web frameworks (axum, actix-web, rocket).From its SKILL.md
npx -y skills add vynazevedo/first-plan --skill lens-rustAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 21 stars21 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.7 KB, as published. Nobody here has run it
Lens Rust
Detecção fina
| Sinal | Variante |
|---|---|
[[bin]] em Cargo.toml ou src/main.rs | Binário |
[lib] em Cargo.toml ou src/lib.rs | Lib |
axum / actix-web / rocket / warp em deps | HTTP API |
tonic em deps | gRPC |
tokio em deps | Async runtime tokio |
async-std em deps | Async runtime async-std |
clap em deps + bin | CLI |
tauri em deps | Tauri (desktop) |
bevy | Game/3D |
[workspace] em Cargo.toml | Workspace (monorepo Rust) |
Extração de padrões
Estrutura
src/main.rsousrc/bin/<name>.rssrc/lib.rs+ módulos- Workspaces - quais crates, dependências entre eles
tests/integration testsexamples/exemplosbenches/benchmarks
Error handling
thiserror(typed errors)anyhow(boxed errors em apps)?operator usage- Custom Error enums
Async
- Runtime: tokio vs async-std vs smol
Send + Syncconstraints- Spawning tasks (
tokio::spawn) - Channels (
tokio::sync::mpsc,crossbeam)
Macros
derivemacros customizados (sinal: dependências de proc-macro crates)macro_rules!definidos no projeto
Testing
#[test]unit tests inlinetests/integrationcriterionpara benchmarksproptest,quickcheck(property testing)mockall(mocks)wiremock(HTTP mocks)
Web
axum:
- Handlers como funções
async fn(...) -> impl IntoResponse - Extractors (
State,Json,Path,Query) - Routers compostos
actix-web:
- Handlers com
web::Data,web::Json - App factory
Logging
tracingecosystem (tracing + tracing-subscriber + tracing-opentelemetry)logcrate + env_logger (legacy)
Build / config
cargo-make,justem vez de Makefileclippy.toml,rustfmt.toml- Edition (2018, 2021, 2024)
MSRV(minimum supported Rust version)
Output
Padrão. Atenção:
02-conventions/errors.md- thiserror vs anyhow vs custom02-conventions/di.md- Rust geralmente usa State/Context structs em vez de DI clássico
Confidence rules
Aumentar:
clippy.tomlstrict + zero warnings nos commits recentes- Padrão consistente de error handling
Reduzir:
unsafeblocks em código não-justificado por SAFETY: commentunwrap()/expect()em produção sem justificativa
Anti-padrões comuns
unwrap()semexpect("razão")em produçãoclone()excessivo (smell de fight com borrow checker)Arc<Mutex<T>>quandoRwLockou channel resolveria melhorpanic!em lib (deveria retornar Result)