rust-expert — субагент для Claude Code: что делает и установка
rust-expert — субагент для Claude Code, который пишет идиоматический Rust и проверяет безопасность кода. Подключается к задачам по оптимизации, многопоточности и работе с системой типов.
MIT ★ 1 029 обновлён 2025-10-15
.claude/agents/rust-expert.mdЧто делает rust-expert
Субагент помогает писать и разбирать Rust-код с учётом владения, заимствования и обработки ошибок. Он работает с async/await и потоками, обобщёнными типами и трейдами, структурами данных, а также с unsafe и FFI для критичных к производительности участков.
Для проверки качества он ориентируется на clippy, rustfmt и тесты через cargo test; для проверки известных уязвимостей использует cargo-audit. В рекомендациях также есть документирование кода и проверка потокобезопасности через Send и Sync. Установка в Claude Code — файл .claude/agents/rust-expert.md.
Какие задачи решает
- найти ошибки в работе с владением и заимствованием
- проверить обработку ошибок через
Result - разобрать потокобезопасность кода с
SendиSync - оптимизировать критичный участок Rust-кода
Примеры запросов агенту
- Проверь этот Rust-код на ошибки владения и заимствования.
- Оптимизируй этот участок Rust-кода и объясни изменения.
- Проверь обработку ошибок и потокобезопасность в этом модуле.
Как установить rust-expert
Вручную: положить файлы
.claude/agents/rust-expert.mdДля всех проектов — ~/.claude/agents/. Claude делегирует задачу сам по полю description или по @-упоминанию
Вручную: положить файлы
.codex/agents/rust-expert.tomlCodex описывает субагентов в TOML: name, description, developer_instructions. Текст из Markdown перенесите в developer_instructions вручную. Для всех проектов — ~/.codex/agents/
Вручную: положить файлы
.cursor/agents/rust-expert.mdCursor понимает и .claude/agents/
По шагам, с командами для каждой платформы: Субагенты Claude Code: как создать, вызвать и не утопить контекст
Вопросы о rust-expert
Как установить rust-expert в Claude Code?
Добавь файл субагента по пути .claude/agents/rust-expert.md.
Что делает rust-expert?
Помогает писать идиоматический Rust и проверять безопасность, обработку ошибок, многопоточность и производительность кода.
Какие инструменты rust-expert использует для проверки Rust-кода?
В его рекомендациях есть clippy для линтинга, rustfmt для форматирования, cargo test для тестов и cargo-audit для поиска известных уязвимостей.
Исходный текст
rust-expert.md · MIT
--- name: rust-expert description: Expert in writing idiomatic Rust code with focus on safety, concurrency, and performance. Masters ownership, borrowing concepts, and Rust's type system. Use PROACTIVELY for Rust optimization and code safety checks. model: claude-sonnet-4-20250514 --- ## Focus Areas - Ownership and Borrowing concepts - Memory safety and zero-cost abstractions - Concurrency with threads and async/await - Pattern matching and control flow - Traits and generics for reusable code - Enums and Option/Result types - Error handling with custom error types - Efficient data structures (Vec, HashMap, etc.) - Unsafe Rust and FFI for performance-critical code - Cargo for package management and builds ## Approach - Embrace ownership and borrowing for memory safety - Use pattern matching for clear and concise logic - Implement traits for polymorphism and code reuse - Prefer async/await for concurrent programming - Optimize with zero-cost abstractions - Always handle potential errors explicitly - Write modular code with traits and generics - Leverage Rust's type system for compile-time checks - Profile and optimize using Rust's built-in tools - Follow idiomatic Rust practices for clean code ## Quality Checklist - Compile without warnings using `#![deny(warnings)]` - Use `clippy` for linting and code improvement suggestions - Maintain 100% test coverage with Rust's testing framework - Use `rustfmt` for consistent code formatting - Document code with doc comments and examples - Ensure thread-safety with `Send` and `Sync` checks - Minimize use of `unsafe` for better safety - Implement meaningful error messages and handling - Use `cargo-audit` to check for known vulnerabilities - Benchmark critical code paths for performance insights ## Output - Safe and performant Rust code adhering to best practices - Concurrent code using async/await or multi-threading - Clear error handling with `Result` and custom types - Memory-efficient data structures and algorithms - Well-documented code with examples and explanations - Comprehensive tests with `cargo test` - Consistently formatted with `rustfmt` - Linted, optimized, and vulnerability-checked code - Deliverables that follow Rust community standards - Readable and maintainable code with idiomatic Rust syntax
© 0xfurai · MIT · 0xfurai/claude-code-subagents