一键导入
review
Audit code changes for correctness, performance, security, and quality issues. Use when asked to review changes, diffs, or pull requests.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Audit code changes for correctness, performance, security, and quality issues. Use when asked to review changes, diffs, or pull requests.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
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.
基于 SOC 职业分类
| name | review |
| description | Audit code changes for correctness, performance, security, and quality issues. Use when asked to review changes, diffs, or pull requests. |
Audit the current change set for correctness, performance, security, and quality problems. Produce concrete, actionable findings.
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) |
pr <N> | Pull request diff (gh pr diff <N>) |
<commit> | Single commit (git show <commit>) |
<commit>..<commit> | Commit range |
<path or glob> | All content in matching files (full-file review, no diff) |
find_referencing_symbols, find_symbol).
Changes that break or subtly alter a contract are only visible when you see
who depends on it.docs/development/lessons_learned.md exists, read it and check whether
any lesson applies to the change under review.Apply every applicable question to every changed region. Record each finding:
FINDING: <short title>
FILE: <path>:<line range>
CHECKLIST: <question number(s)>
EVIDENCE: <what is wrong and why, with code snippet>
SEVERITY: bug | performance | security | code-smell | test-gap
EFFORT: trivial | small | medium
continue, _ => {},
Err(_) discarded, unwrap() in non-test code)?None/null, non-UTF-8 paths, missing files, concurrent access?enums/ crate output, language tables)
still consistent with their generator logic after this change?String::from / .to_string() / .clone() inside loops, collect()
into intermediate Vec that is immediately iterated again, format!()
for static strings.Vec where a
HashSet/HashMap lookup would be O(1); a BTreeMap where insertion
order does not matter and HashMap suffices; a Vec used as a set with
contains() checks.&str borrowing would avoid allocation?Vec::with_capacity, HashMap::with_capacity for known sizes.)to_string_lossy() on paths used as identifiers
(map keys, JSON fields, error correlation)? This silently corrupts
non-UTF-8 paths. Use to_str() with error handling instead.unwrap() or expect() used outside of test code? If expect() is
used, is the invariant truly guaranteed and documented?todo!(), unimplemented!(), or unreachable!() calls
that could be reached at runtime?pub, pub(crate),
private)?big-code-analysis is published as a
library on crates.io — public API breaks affect downstream users.)is_ok() or
!is_empty() without checking the actual value are weak.src/languages/ deliberately use macros for
shared structure — extend them rather than copy-pasting.)clone(), to_owned(), or collect() calls where
borrowing or iterating directly would suffice?For each finding:
Print findings grouped by severity, highest first:
## Review: <scope description>
### Bugs
| # | Finding | File | Effort | Evidence |
|---|---------|------|--------|----------|
### Performance
| # | Finding | File | Effort | Evidence |
|---|---------|------|--------|----------|
### Security
| # | Finding | File | Effort | Evidence |
|---|---------|------|--------|----------|
### Test gaps
| # | Finding | File | Effort | Evidence |
|---|---------|------|--------|----------|
### Code quality
| # | Finding | File | Effort | Evidence |
|---|---------|------|--------|----------|
### Summary
- Files reviewed: N
- Findings: N (N bug, N performance, N security, N test-gap, N code-quality)
- Pre-existing issues noted: N
- Verdict: APPROVE | APPROVE WITH COMMENTS | REQUEST CHANGES
If there are zero findings, say so explicitly and state "APPROVE".
cargo fmt, clippy, or
rumdl. Automated tools own style.