ワンクリックで
simplify-rust
Review changed Rust code for reuse, quality, and efficiency, then fix any issues found.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Review changed Rust code for reuse, quality, and efficiency, then fix any issues found.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
End-to-end workflow for adding a new tree-sitter language to big-code-analysis. Wires up the grammar crate, regenerates the language enum, implements Checker/Getter/Alterator/metrics, adds per-metric tests, updates docs, then runs simplify-rust, rust-optimize, and audit-tests. Does NOT commit — leaves the working tree dirty for final user review.
Audit a Rust crate in the big-code-analysis workspace for logic errors, complexity, bugs, security issues, and code smells. Operates at the crate level via `cargo -p`. Use when asked to audit or review a crate.
Audit a single Rust source file in the big-code-analysis workspace for logic errors, complexity, bugs, security issues, and code smells. Use when asked to audit or review a specific file.
Audit naming quality in a crate or directory for misleading, inconsistent, or unclear names. Use when asked to audit or review naming.
Audit test suites for tests that pass trivially, mask bugs, or assert the wrong thing. Finds tests designed to pass rather than designed to catch regressions.
Fix multiple GitHub issues on an integration branch. Issues touching different crates run in parallel worktrees; issues sharing a crate or affecting cross-language code run sequentially. Each goes through fix, simplify, review, and remediation before merging. Use when asked to fix several issues at once.
| name | simplify-rust |
| description | Review changed Rust code for reuse, quality, and efficiency, then fix any issues found. |
Review recently changed Rust code and fix issues across three dimensions: reuse,
clarity, and efficiency. Focus on semantic problems that cargo fmt and clippy
cannot catch. Apply fixes directly -- don't just list suggestions.
Determine what to review based on $ARGUMENTS:
| Argument | Scope |
|---|---|
| (empty) | Unstaged + staged changes (git diff HEAD) |
staged | Staged changes only (git diff --cached) |
branch | All commits on current branch vs main (git diff main...HEAD) |
| path | Specific file or directory (any argument that isn't a keyword above) |
make pre-commit to validate formatting, linting, and tests. Fall
back to cargo check --workspace --all-features if make is
unavailable.file:line references| Priority | Action | Description |
|---|---|---|
| Fix now | Apply immediately | Correctness risks, API misuse, missing error propagation |
| Improve | Apply in this pass | Clarity wins, unnecessary allocations, dead abstractions |
| Note | Comment only | Minor style preferences, subjective naming |
Skip anything already clean. Do not create churn.
Look for duplicated logic and missing abstractions.
From/TryFrom implFrom implsrc/languages/ that could be expressed via
a trait method or macro instead of being copied across language modules
(when consolidating into a macro, follow .claude/rules/macro-comments.md:
hoist per-language rationale comments above each invocation, not into the
macro body)Do NOT extract: one-off logic into tiny helpers that obscure the flow. Three similar lines are better than a premature abstraction.
Look for unnecessary complexity and missed Rust idioms.
unwrap() / expect() in non-test code -- must use ? or Result/Optionif/match that can be flattened with early returns or ?pub items that should be pub(crate) (not used outside the crate)impl blocks far from their struct/enum definitionto_string_lossy() on paths used as identifiers (must use to_str() + error handling)expect("invariant")Do NOT simplify: clear for loops into unreadable iterator chains; clear
if/else into clever match patterns; or add lifetime annotations the
compiler already infers.
Look for unnecessary allocations and wasted work.
.clone() where a borrow suffices (the parameter doesn't need ownership)String parameters where &str worksVec allocations where a slice or iterator would do.collect() into intermediate Vec before further iterationString::from() / .to_string() where &'static str or Cow workswith_capacity() for collections built in loopsDo NOT optimize: hot-path micro-optimizations without evidence of impact. Clarity beats performance for non-critical paths.
This project is the big-code-analysis Rust workspace (root crate plus
big-code-analysis-cli and big-code-analysis-web). Key Rust principles to
enforce:
unsafe codepub(crate) over pubexpect("reason") for provably unreachable code, not fallback logicpath.display() for log output; to_str() + error handling for identifiersimpl AsRef<str> everywhere)