🦀
AI EngineeringPython

Rust Expert

by val1813

Rust Expert is an AI Engineering skill for Claude Code, published by val1813 in kwcode.

688 stars92 forkson val1813/kwcodeAdded 2026/08/12Repository updated 2026/05/14
Install in seconds
Install Rust Expert
Copy Rust Expert into your Claude Code skills folder. Run the command in your terminal, or review the source on GitHub before installing.
terminal
npx degit https://github.com/val1813/kwcode/tree/master/kaiwu/builtin_experts/rust ~/.claude/skills/rust

Requires Node.js. Downloads this skill only — not the rest of the repository — into your Claude Code skills folder.

Without Node.js

git clone https://github.com/val1813/kwcode.git

Clones the whole repository, then copy the skill’s own directory into your skills folder yourself.

In this catalog

Source file
kaiwu/builtin_experts/rust/SKILL.md in val1813/kwcode
Installs to
~/.claude/skills/rust
Collection
One of 19 skills cataloged from this repository
Category
AI Engineering2451 skills

What Rust Expert does

Rust Expert provides Rust coding guidance on ownership, borrowing, error handling, async, testing, and project structure. Use it when writing or reviewing Rust code and choosing idiomatic patterns.

Rust Expert is cataloged under AI Engineering on DirSkills.

Documentation

README

领域知识

你是Rust专家。

所有权与借用

  • 每个值有且仅有一个所有者
  • 借用规则:任意数量的 &T 或恰好一个 &mut T
  • 生命周期标注:编译器无法推断时才手动标注
  • 避免不必要的 .clone(),优先使用引用
  • 使用 Cow<'_, str> 延迟克隆决策

错误处理

  • 库代码:定义自己的 Error 枚举,实现 std::error::Error
  • 应用代码:使用 anyhow::Result 简化错误传播
  • ? 操作符传播错误,不要 .unwrap() 除非确定不会 panic
  • thiserror 派生宏简化 Error 实现

模式

  • 使用 Option 而非 null/sentinel 值
  • Builder 模式用于复杂对象构造
  • 类型状态模式(typestate)编码状态机
  • 零成本抽象:trait + 泛型 > dyn trait(除非需要动态分发)

异步

  • tokio 是标准异步运行时
  • async fn 返回 impl Future
  • 使用 tokio::spawn 创建并发任务
  • tokio::select! 多路复用
  • 避免在 async 中持有 MutexGuard 跨 await 点

测试

  • 单元测试:同文件 #[cfg(test)] mod tests
  • 集成测试:tests/ 目录
  • 运行:cargo test
  • 编译错误在 stderr,测试输出在 stdout
  • #[should_panic] 测试预期 panic

This is the opening of the README. Read the full README on GitHub.

Frequently asked about Rust Expert

  • What else does val1813 publish alongside Rust Expert?

    Rust Expert is one of 19 skills that DirSkills catalogs from val1813/kwcode, the repository it ships in. Its siblings there include API Expert, Bug Fix Expert and DeepSeek API Expert. Each one is a separate skill with its own page in this directory, installs the same way Rust Expert does, and is maintained by val1813 in that same repository. The rest of the collection is listed on the val1813/kwcode page.

  • How does Rust Expert compare to other AI Engineering skills?

    Rust Expert ranks #1743 by stars among the 2451 AI Engineering skills in this catalog. The most-starred ones next to it are Architecture Decision Records, AI-First Engineering and Agentic OS. DirSkills ranks by the star count of the repository each skill ships in, so that order reflects how popular those repositories are rather than any review of Rust Expert against them. Open each page to compare what they document and how they install.

More from val1813/kwcode

Rust Expert is one of 19 skills cataloged on DirSkills from val1813/kwcode.

See all 19 skills