生锈简化

其他 社区

技能解读

当前原文的自动摘译,尚未人工审校。

目标选择

在读取大文件之前,首选jcodemunch符号和文件分析。选择受影响的板条箱或模块中价值最高的 Rust 文件。如果提供了文件路径,请确认它确实已连接到构建中。

质量通行证

减少重复和嵌套控制流。更喜欢惯用的 Rust 和显式错误处理。检查可疑的字符串所有权模式。更喜欢借用&str进行查找和比较工作,并在实际所有权边界分配String值。在没有基准证据的情况下,不要在热路径中执行广泛的分配搅动。

验证

对任何 .rs、Cargo.toml 或 Cargo.lock 更改运行 repo 所需的 Rust 检查。运行 python3 scripts/audit-rust-review-smells.py --changed 进行 Rust 清理并查看建议结果。如果所触及的文件需要,则重新生成架构。报告您运行的确切检查和结果。

流狐档案 运行与权限由流狐静态检查推断,不代表作者声明或实际测试结果。
领域
通用
作者声明的智能体
未找到明确声明;不据此推断已兼容或已测试
静态检查
88 / 100 · 启发式扫描,不代表运行安全
运行环境证据
未执行;当前没有隔离运行测试证据
作者 / 版本 / 许可证
@tomevault-io · 未声明许可证
上下文用量评级
低消耗
接入复杂程度
即装即用
是否需要外部接口密钥
不需要
兼容的系统
未声明(默认跨平台)
运行环境要求
未检出明确要求
检测到的文件与系统行为
  • 只读
  • 允许写入 / 修改
网络行为
仅限本地
安装命令数
无(仅作为资料)

需要注意: 未声明工具权限范围;实际权限由运行环境决定。

作者说明文件(原文) SKILL.md

# Rust Simplify

Use this skill for bounded Rust cleanup work in the Citum workspace when the task is to
improve code quality rather than fix a specific bug.

When `.jj` is present, use `docs/guides/JJ_AI_CHANGE_STACK.md` for optional
local change isolation and intent capture before publishing through Git/GitHub.

Read first:
- `docs/guides/CODING_STANDARDS.md`
- `docs/guides/AGENT_SKILLS.md`

## Target Selection

- Prefer `jcodemunch` symbol and file analysis before reading large files.
- Pick the highest-value Rust file in the affected crate or module.
- If a file path was supplied, confirm it is actually wired into the build.

## Quality Pass

- Reduce duplication and nested control flow.
- Prefer idiomatic Rust and explicit error handling.
- Review suspicious string ownership patterns. Prefer borrowed `&str` for lookup
  and comparison work, and allocate `String` values at real ownership boundaries.
- Do not perform broad allocation churn in hot paths without benchmark evidence.
- Add or update tests when behavior changes.
- When tests change, keep expected values independent of current implementation
  output and confirm behavior changes would have failed before the fix when
  practical.
- Keep the scope to one focused file or one tightly related cluster.

## Verification

- Run the repo-required Rust checks for any `.rs`, `Cargo.toml`, or `Cargo.lock` change.
- Run `python3 scripts/audit-rust-review-smells.py --changed` for Rust cleanup
  passes and review the advisory findings.
- Regenerate schemas if the touched files require it.
- Report the exact checks you ran and the result.

---
> Source: [citum/citum-core](https://github.com/citum/citum-core) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-05-23 -->

讨论

基于 GitHub Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。