smithery.ai

code-rust-best-practices

Rust 工程最佳实践:错误处理、并发、模块组织、序列化、测试与可维护性。

First seen Mar 21, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Skill metadata

Parsed from SKILL.md frontmatter.

More metadata
short-description
Rust 工程实践与代码风格建议

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 724 B
  • docs SUMMARY.md 133 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Rust 工程最佳实践

错误处理

  • 业务错误:自定义 error enum(thiserror)
  • 边界层:把外部错误映射为可序列化错误

并发/异步

  • I/O 用 tokio;避免在 async 中做阻塞操作
  • 锁粒度尽量小;注意死锁与持锁 await

代码组织

  • 模块边界清晰:commands / runtime / storage
  • 类型与协议:单独文件维护(models/types)

测试

  • 优先单元测试关键解析/权限逻辑
  • 使用 tempfile 做文件系统隔离