Beautiful Rust

三个 Agent Skills 和一套实测过的 clippy 配置,教会编码 Agent 写出、审查并移植地道的 Rust 代码。

Star 数
★ 1.7k
最近更新
2 天前
License
MIT
主语言
Python

30 秒速览

运行形态
Agent 插件 / 技能命令行工具
可在哪里用
通用 · 跨平台ChatGPT · Codex · Claude Code · Claude.ai
费用
软件免费,模型调用费用自付
上手难度
低 · 几分钟可跑通
开始前需要
Node.js 22.20+(用于 npx skills 安装器)含 cargo 和 clippy 的 Rust 工具链(用于 lints 配置)Shell / 命令行本地文件系统
典型场景
用 Claude Code 或 Codex 写 Rust 库的工程师,希望 Agent 默认写私有字段、补 # Errors 文档、写出可安全复制的 doc 示例
不适合
  • 不用支持 Agent Skills 格式的编码 Agent 的团队
  • 不用 Rust 或不打算把代码移植到 Rust 的开发者

这个 Agent 能做什么,适合哪些场景?

Beautiful Rust(仓库 morganlinton/BeautifulRust)是一组遵循 Agent Skills 格式的技能包,包含三个技能和一个 lint 配置:rust-best-practices 在 Agent 写或改 Rust 时自动加载并引导它写出地道、健壮的代码;rust-review 对文件、crate 或 diff 做分级审查(必须修/建议修/可选),每条发现都引用具体规则并给出最小修复;rust-port 把 C、C++、Python、Go 或 JavaScript 移植为行为一致的 Rust,先移植原测试以便验证。lints/ 提供可直接放入 CI 的 clippy 配置,逐条验证过会触发。指导内容综合自 Google Rust Style Guide、Rust API Guidelines、Effective Rust、Rust Design Patterns 和 Microsoft Pragmatic Rust Guidelines 五个来源,并附带 Bevy 0.20 专用的例外参考。可通过 Claude Code 插件、Codex 插件、npx skills 安装器或直接复制文件夹,用于 Claude Code、Codex、Copilot、Cursor、Gemini CLI 等任何读取该格式的 Agent。

安装后,三个技能文件夹(skills/rust-best-practices、skills/rust-review、skills/rust-port)会被 Agent 自动读取:写代码时 rust-best-practices 按 13 节内容(所有权、类型设计、错误处理、async、unsafe 等)引导生成;审查时 rust-review 在有工具链的情况下运行 cargo fmt、clippy 和测试,产出带 file:line 定位、规则出处(如 C-GETTER、Effective Rust 条目、clippy lint)和最小修复的三级报告;移植时 rust-port 先移植原测试套件、重新设计 Rust API 而非直译、最后用 cargo test 和 clippy 验证,并生成 PORTING.md 记录差异。当 crate 依赖 bevy 时,技能会先读 references/bevy.md,保留 Bevy 惯例并提示会静默编译的 ECS bug(如 B0001)。复制 lints/clippy.toml 和 lints/lints.toml 后运行 cargo clippy --all-targets --all-features -- -D warnings 即可在 CI 强制执行规则,lints/check/ 用一个故意违规的 crate 证明每条 lint 都会触发。

  1. 用 Claude Code 或 Codex 写 Rust 库的工程师,希望 Agent 默认写私有字段、补 # Errors 文档、写出可安全复制的 doc 示例
  2. 需要审查 Rust 文件、crate 或 PR diff 的维护者,想要带规则出处和最小修复建议的分级报告
  3. 要把 C、C++、Python、Go 或 JavaScript 模块移植为 Rust 的团队,希望先移植测试再验证行为一致
  4. 用 Bevy 或 bevy_ecs 开发的开发者,需要技能识别系统参数按值传递、prelude 导入等不该改动的惯例
  5. 想在 CI 中用 clippy 强制禁止 unwrap()、无 SAFETY 注释的 unsafe、无理由的 #[allow] 等模式的团队

如何安装或部署这个 Agent?

支持多种安装方式。

任意 Agent,一条命令(需 Node 22.20+):

npx skills add morganlinton/BeautifulRust

Claude Code 插件(便于一条命令更新):

claude plugin install beautiful-rust --marketplace morganlinton/BeautifulRust

OpenAI Codex 插件:

codex plugin marketplace add morganlinton/BeautifulRust
codex plugin add beautiful-rust@beautiful-rust

GitHub Copilot(需 GitHub CLI 2.90+):

gh skill install morganlinton/BeautifulRust rust-best-practices
gh skill install morganlinton/BeautifulRust rust-review
gh skill install morganlinton/BeautifulRust rust-port

Gemini CLI:

gemini skills install https://github.com/morganlinton/BeautifulRust --path skills/rust-best-practices
gemini skills install https://github.com/morganlinton/BeautifulRust --path skills/rust-review
gemini skills install https://github.com/morganlinton/BeautifulRust --path skills/rust-port

Cursor 或其他:克隆并复制技能文件夹:

git clone https://github.com/morganlinton/BeautifulRust
mkdir -p ~/.agents/skills
cp -R BeautifulRust/skills/rust-* ~/.agents/skills/

注意:Claude Code 不读取 .agents/skills/,需使用其自身目录或插件方式。claude.ai 需为每个技能打包 zip 并在 Customize > Skills 上传,且须先开启代码执行。

如何使用这个 Agent?

技能安装后自动触发,通常无需显式调用(Claude Code 中显示为 /beautiful-rust:rust-best-practices 等)。

审查代码:向 Agent 提出如 "review src/parser.rs" 或 "what would you change in this PR" 的请求。

移植代码:提出如 "port parser.c to Rust" 或 "rewrite this Python service in Rust" 的请求。

在 CI 强制规则:将 lints/clippy.toml 复制到 Cargo.toml 旁,把 lints/lints.toml 中的 [lints] 块合并进去,然后:

cargo clippy --all-targets --all-features -- -D warnings

验证 lint 配置(从仓库根目录):

bash scripts/check-lints.sh

运行技能评估(按技能目录执行,会产生真实的模型调用费用):

claude plugin eval . --allow-tools Write,Edit,Bash --scaffold

这个 Agent 有哪些优点和局限?

优点
  • 每个 Rust 示例都在 stable Rust 上编译过、每条 lint 都验证过会触发(lints/check/ 有逐条违规 crate),不是凭空罗列的规则
  • 在 2026 年 10 月的盲评基准中,Claude Code 通过率从 85% 升到 94%,Codex 从 62% 升到 89%,且公布了完整方法和局限
  • 跨五个主流 Agent(Claude Code、Codex、Copilot、Cursor、Gemini CLI)通用,并提供一处目录表说明各家的安装路径
  • 五处来源冲突时技能明确选边并说明理由,并附 Bevy 0.20 的专用例外参考(含 B0001 等会静默编译的 ECS bug)
局限
  • 效果依赖宿主 Agent 本身,基准中 Claude 在 Bevy 特性任务上反而因技能变差,收益因 Agent 和任务而异
  • rust-review 和 rust-port 依赖本机 Rust 工具链(cargo、clippy),无工具链时功能受限
  • 基准为每种配置只跑一次且由 Claude 模型评分,证据强度有限
  • Copilot 和 Gemini CLI 需逐个安装三个技能,且 Gemini CLI 只支持按 --path 安装,没有整体插件

这个 Agent 与同类方案有什么区别?

仓库未点名直接竞品,但其基准把带技能与不带技能的 Claude Code(Opus 5.5)和 Codex CLI 做了对比,可作为评估受益幅度的参照。

与相关度最高的同类 agent 并排比较关键指标。

Agent 源码审查 形态 / 费用 Star 最近更新 主语言 完整支持的平台
Beautiful Rust 当前 78 · 表现良好 Agent 插件 / 技能免费 + 模型费 ★ 1.7k 2 天前 Python ChatGPT · Codex · Claude Code · Claude.ai
Waza 技 63 · 存在缺口 命令行工具免费 ★ 7.5k 3 天前 Python Codex · Claude Code
Aster 77 · 表现良好 命令行工具免费 + 模型费 ★ 137 4 天前 Rust OpenAI API
Finding-Unknowns Skills 76 · 表现良好 Agent 插件 / 技能免费 ★ 363 1 个月前 Python Claude Code · Claude.ai

FollowAgents 如何评估这个 Agent?

FollowAgents 源码审查 · FARS-2.1
表现良好
78/ 100 五分制 3.9 / 5
信任安全 18/29
可靠稳定 12/14
适用触发 16/18
规范维护 16/18
有效结果 10/13
证据核验 6/8
查看各维度的扣分理由
信任安全18 / 29 · 3.1/5

产品以提示词技能为主,无网络访问、无凭据处理;review 技能会运行 cargo fmt/clippy/测试,README 已明示,属合理且已披露的能力面,故 least_privilege 记 2。review 触发的 cargo test 会执行被审代码,且未要求用户确认,user_confirmation 记 1。引用 PRIVACY.md 与网站通知 workflow(secret 用途已注明、缺省跳过),data_flow_transparency 记 2。sensitive_data_handling 仅由 PRIVACY.md 文件名支撑,内容未在证据中,记 1。无运行时依赖、安装走第三方 npx 安装器,dependency_security 记 2。外部效应(运行工具链、Vercel hook)均已披露,记 2。版本更新与卸载/重装路径有文档,rollback 记 2。来源归属表逐条列出作者与许可证,甚至澄清『螃蟹不是吉祥物』,source_attribution 记 3。

可靠稳定12 / 14 · 4.3/5

CI 三条流水线校验技能清单、编译全部示例、证明每条 lint 触发;check-skill.py 有约 40 个测试且对真实仓库自检,self_consistency 记 3。依赖 cargo、python3、Node 22.20+ 等工具,部分场景已给版本要求但整体未列依赖矩阵,dependency_availability 记 2。校验脚本的错误信息经测试断言(含 file:line、drift 提示、skip 需理由),failure_messages 记 3。

适用触发16 / 18 · 4.4/5

明确覆盖写、审、移植三种场景与多代理环境,audience_and_scenarios 记 3。已知边界诚实:Bevy 需专门参考、基准中有一例技能反而降低成绩、基准方法与注意点单独成页,capability_boundaries 记 3。触发依赖 SKILL.md 描述(『写或改 Rust 时加载』),本静态评审未读到具体 frontmatter 全文,trigger_precision 记 2。环境适配详尽,含 Claude Code 不读 .agents/skills 等怪癖说明,environment_fit 记 3。

规范维护16 / 18 · 4.4/5

Layout 一节给出完整目录树并逐项注解,information_architecture 记 3。安装说明覆盖六类代理、claude.ai zip、目录对照表,install_notes 记 3。技能/插件命名一致且由检查脚本强制(名称须匹配目录、版本须为 semver),naming_stability 记 3。示例丰富(review 实例报告、移植样例、lint 违例 crate)但无 FAQ,examples_and_faq 记 2。已知限制充分披露(基准注意点、lint 的 rust-version 要求、Bevy 例外),known_limitations 记 3。MIT 许可证与 LICENSE 文件齐备,license 记 3。CHANGELOG、semver 强制一致、发布流程文档化,versioning_changelog 记 3。有 CONTRIBUTING 与更新路径,但维护者为单一未验证个人、无响应承诺或发布节奏,maintenance_responsibility 记 2。

有效结果10 / 13 · 3.8/5

review 输出三级分级、file:line 定位、引用规则来源、最小修复与亮点收尾;port 输出 PORTING.md 映射表,output_usability 记 3。增量价值以 29/30 vs 24/30 和跨代理基准支撑,但均为作者自报的模型评分、每配置仅一次运行,marginal_value 记 2。成本为纯提示词+lint 配置,代价低;但基准承认一例负收益且评分为模型自评,cost_benefit 记 2。

证据核验6 / 8 · 3.8/5

每条规则要求可溯源到已发布来源,示例由脚本逐块编译验证,lint 触发由违例 crate 证明,claim_traceability 记 3。五个外部来源与许可证表可对照,但摘要是『为本项目改写的转述』,静态评审无法核对转述忠实度,cross_source_corroboration 记 2。事实与推断总体分得清(基准注意点、『螃蟹是螃蟹』),但关键声明(如 lint 全部触发、示例全部编译)在本次证据内属自我声明,fact_inference_separation 记 2。

风险与缓解建议
  • rust-review 技能会运行 cargo fmt/clippy/test,等于执行被审代码;审计不受信代码前应确认沙箱隔离。
  • 安装走第三方 npx skills 安装器与各代理的插件市场,供应链环节不在本仓库控制内。
  • 效能声明(29/30、跨代理基准)为作者自报、模型评分、每配置单次运行,不能视为独立验证。
  • 发布者身份未经验证;lint 配置需 rust-version 1.81+,Bevy 支持绑定 0.20 版本,升级时需复查。
  • 静态评审未读取 SKILL.md 正文、lints/lints.toml 与 eval 内容,触发精度与规则质量未经逐条核对。
证据充分度:低 评估于 2026年10月31日 审查版本 a9cdcfa94d13 评估后仓库已有新提交,评分可能未覆盖最新改动
查看完整评分方法 →

最近版本

来自该项目 GitHub Releases 的最新发布记录,说明为上游原文摘录,未经本站改写或测试。

  1. v1.5.0 v1.5.0: Bevy, and a benchmark across agents
    发布说明摘录
    Bevy support, a Claude Code vs Codex benchmark, and every Rust example compiled in CI. Thanks to @tmchow and @DylanCosto for their pull requests, and to @millionart for proposing Bevy support. Bevy support A new [Bevy 0.20 reference](https://github.com/morganlinton/BeautifulRust/blob/main/skills/rust-best-practices/references/bevy.md) teaches the skills which general Rust rules don't fit Bevy systems (by-value system parameters, the prelude, plain-data components, complex queries) and which ECS bugs compile cleanly but fail at runtime: two queries that can reach the same comp …
    在 GitHub 查看 ↗
  2. v1.4.0 v1.4.0: every rule, checked
    发布说明摘录
    The first BeautifulRust release with outside contributions. Huge thanks to @mvanhorn, who sent both of this release's headline features. Every lint is now proven to fire lints/check/ is a small crate with one deliberate violation for each of the 28 lints in the drop-in config, and scripts/check-lints.sh runs clippy on it. It fails if a lint goes quiet, if anything unexpected fires, or if the published table drifts from the tested one. CI runs it on every push and pull request, so the lints config can't silently rot. …
    在 GitHub 查看 ↗
  3. v1.3.0 v1.3.0: port your code to Rust
    发布说明摘录
    BeautifulRust now ports existing code to Rust, and the repo is ready for contributors. New: the rust-port skill Ask your agent to port a module ("port parser.c to Rust", "rewrite this Python service in Rust") and it: - reads the original and its tests, and ports the tests first, so the port is proven against the original's own behavior …
    在 GitHub 查看 ↗

常见问题

它是免费的吗?
仓库本身 MIT 许可、免费使用。但运行技能的宿主 Agent 产生真实的模型调用费用(评估用例需按次计费运行)。
支持哪些 Agent?
任何读取 Agent Skills 格式的 Agent:Claude Code、OpenAI Codex(含 ChatGPT 桌面端)、GitHub Copilot、Cursor、Gemini CLI,以及 claude.ai 的自定义 Skills。
安装后需要配置吗?
技能安装后自动触发,无需配置。若要在 CI 强制 lint,则需复制 lints/clippy.toml 并合并 lints/lints.toml 的 [lints] 块;allow_attributes 相关 lint 需要 rust-version 1.81 或更高。
审查报告长什么样?
报告分三级:必须修、建议修、可考虑;每条发现给出 file:line、违反的规则及其出处(如 C-GETTER、clippy lint 名)和最小修复代码,结尾还会列出代码已做得好的部分。examples/review-inventory.md 是一个真实产出示例。
对 Bevy 项目有什么特别处理?
当 crate 依赖 bevy 或 bevy_ecs 时,写作和审查技能会先读 references/bevy.md(针对 Bevy 0.20,每个行为都用 bevy 0.20.0 测试验证过),避免给出会破坏 Bevy 惯例的错误建议,并提示能静默编译的 ECS bug。
在 GitHub 查看 ↗ 安装 ↓

对比同类 Agent

用同一套 FARS 评审,横向比较这个 Agent 所属的短名单。

相关 Agents