senior-rust-practices
إتقان بنية مساحات العمل Rust وأفضل الممارسات
هل تواجه صعوبة في تنظيم مشاريع Rust؟ توفر هذه المهارة أنماطًا مُختبرة ميدانيًا لتصميم مساحات العمل القابلة للتوسع، من النموذج الأولي إلى الإنتاج. تعلم كيف يُنظم المطورون الأكبر سنًا قواعد بيانات Rust الكبيرة بحدود واضحة وبنية قابلة للصيانة.
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
測試它
正在使用「senior-rust-practices」。 How should I structure a Rust workspace for a microservice with shared domain logic?
預期結果:
- Use a layered architecture with 4 crates:
- - core/: Pure domain logic, no IO dependencies
- - storage/: Database implementations with traits
- - api/: HTTP handlers and DTOs
- - cli/: Binary that wires everything together
- Keep core synchronous and free of tokio/sqlx dependencies
正在使用「senior-rust-practices」。 How do I organize dependencies in a Rust workspace?
預期結果:
- Use workspace.dependencies in root Cargo.toml:
- Centralize versions with: anyhow = '*', serde = { version = '*', features = ['derive'] }
- Then reference with workspace = true in each crate
- This prevents version drift across crates
正在使用「senior-rust-practices」。 What testing approach works best for Rust workspaces?
預期結果:
- Follow the testing pyramid:
- 1. Unit tests in each crate (mod tests {})
- 2. Integration tests in crates/<crate>/tests/
- 3. E2E tests sparingly with real dependencies
- 4. Add property tests with procoloq for correctness-critical code
安全審計
安全This is a documentation-only skill containing Rust best practices guidance. No executable code, scripts, or network operations exist. The static analyzer flagged documentation patterns (shell syntax in examples, git commands, file paths) as security issues, but these are all benign references within documentation. All 103 detected patterns are FALSE POSITIVES - the skill is safe for publication.
風險因素
🌐 網路存取 (1)
📁 檔案系統存取 (3)
⚙️ 外部命令 (73)
品質評分
你能建構什麼
Design scalable Rust architecture
Structure large Rust projects with clear crate boundaries and maintainable dependencies for teams.
Establish Rust coding standards
Define workspace conventions, testing strategies, and quality gates for Rust projects.
Set up Rust CI/CD pipelines
Implement automated testing, linting, and security checks for Rust workspaces.
試試這些提示
I need to create a Rust workspace for a web service with core business logic, database layer, and API handlers. What's the recommended structure?
How should I organize dependencies in a workspace to avoid version conflicts and keep builds fast?
What's the best testing approach for a Rust workspace with multiple crates? How do I balance unit, integration, and e2e tests?
What CI checks and quality gates should I implement for a production Rust service? Include tooling recommendations.
最佳實務
- Start with 2-5 crates maximum and split only when compile times become painful
- Use workspace.dependencies to centralize version management across all crates
- Keep async code at the edges - make core logic synchronous when possible
避免
- Creating too many small crates creates unnecessary complexity and maintenance burden
- Leaking implementation details from core to other architectural layers
- Using unwrap() in library code instead of proper error handling with thiserror
常見問題
When should I use a Rust workspace instead of a single crate?
How many crates should I have in my workspace?
Can I use async/await in my core domain logic?
How do I manage dependencies across workspace crates?
What testing approach works best for workspaces?
How does this compare to other Rust architecture guides?
開發者詳情
授權
MIT
儲存庫
https://github.com/ClementWalter/rookie-marketplace/tree/main/rust-dev/skills/senior-rust-practices引用
main
檔案結構
📄 SKILL.md