mcpField
R
rust

rust

github.com/pproenca开发222124 次安装12 周前更新
代码仓库

关于 rust

面向 Rust 开发者和编码 Agent 的性能实践指南,按影响优先级整理规则,涵盖内存、所有权、集合、异步代码、算法与编译期优化。

主要功能

  1. 01按优先级划分八类指南
  2. 02内存分配与所有权规则
  3. 03集合与迭代器模式
  4. 04异步与并发实践
  5. 05算法与编译期优化建议

适用场景

  1. 01编写新的 Rust 代码
  2. 02检查代码中的性能问题
  3. 03优化内存与所有权模式
  4. 04处理 Rust 异步代码

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/pproenca/dot-skills --skill rust

安装后在 Claude Code 中输入/rust确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

AGENTS.md
README.md
metadata.json
assets/templates/
_template.md
references/
_sections.md
algo-avoid-nested-loops-for-lookup.md
algo-use-binary-search-for-sorted-data.md
algo-use-chunks-for-batch-processing.md
algo-use-select-nth-unstable-for-partial-sort.md
algo-use-sort-unstable-when-order-irrelevant.md
async-avoid-blocking-in-async-context.md
async-avoid-holding-lock-across-await.md
async-minimize-lock-scope.md
async-use-buffered-for-bounded-concurrency.md
async-use-join-for-concurrent-futures.md
async-use-rwlock-over-mutex-for-read-heavy.md
comp-avoid-repeated-parsing-of-static-data.md
comp-prefer-static-dispatch.md
comp-reduce-monomorphization-bloat.md
comp-use-const-for-compile-time-computation.md
comp-use-const-generics-for-array-sizes.md
ds-use-btreemap-for-sorted-iteration.md
ds-use-entry-api-for-conditional-insert.md
ds-use-hashmap-for-key-lookup.md
ds-use-hashset-for-membership.md
ds-use-vecdeque-for-queue-operations.md
iter-chain-instead-of-intermediate-collect.md
iter-use-extend-for-bulk-append.md
iter-use-filter-map-for-combined-operations.md
iter-use-flat-map-for-nested-iteration.md

详细介绍

社区 Rust 最佳实践

Rust 应用的全面性能优化指南。包含 8 个类别中的 42 条规则,并按影响排序,以指导自动重构和代码生成。

适用场景

在以下情况下参考这些指南:

  • 编写新的 Rust 代码
  • 优化内存分配和所有权模式
  • 使用迭代器和集合
  • 使用 Tokio 或其他运行时编写异步代码
  • 检查代码中的性能问题

按优先级划分的规则类别

优先级类别影响前缀
1内存分配严重mem-
2所有权与借用严重own-
3数据结构选择高ds-
4迭代器与集合模式高iter-
5异步与并发中高async-
6算法复杂度中algo-
7编译时优化中comp-
8微优化低micro-

快速参考

1. 内存分配(严重)
2. 所有权与借用(严重)
3. 数据结构选择(高)
4. 迭代器与集合模式(HIGH)
5. 异步与并发(MEDIUM-HIGH)
6. 算法复杂度(MEDIUM)
7. 编译时优化(MEDIUM)
8. 微优化(LOW)

使用方法

阅读各个参考文件,了解详细说明和代码示例:

完整编译文档

如需查阅包含所有规则的综合指南,请参阅 AGENTS.md。

参考文件

文件描述
AGENTS.md包含所有规则的完整编译指南
references/_sections.md类别定义和排序
assets/templates/_template.md新规则模板
metadata.json版本和参考信息

评论

支持 Markdown