home / skills / cacr92 / wereply / code-review
This skill helps you review code for Rust, React, and databases, identifying risks, regressions, and incorrect typings to improve reliability.
npx playbooks add skill cacr92/wereply --skill code-reviewReview the files below or copy the command above to add this skill to your agents.
---
name: code-review
description: 当用户要求代码审查、Review、找风险或列问题时使用。
---
# Code Review Skill
## 适用范围
- Rust/Tauri 后端审查
- React 前端审查
- 数据库与性能风险检查
## 关键规则(Critical Rules)
- 优先发现逻辑错误与回归风险
- 检查命令签名与类型导出是否完整
- 检查前端是否违反 `console.*` / `as any`
- UI 表格:检查表格行高/内边距是否符合紧凑规范(默认 th/td padding 6px 10px、line-height 1.2;表格内 Tag 紧凑化)
## 审查要点
- Tauri:`#[tauri::command]` + `#[specta::specta]` 是否齐全
- 类型:入参/出参 `specta::Type` 与 camelCase 一致
- 数据库:`sqlx::query_as!`、显式列名、事务正确
- 前端:仅用 `commands`,错误 `message.*` 提示
- 性能:重复计算、N+1、无谓 clone
## 快速命令
```bash
cargo clippy --all-targets --all-features -- -D warnings
cargo fmt --all
cd frontend && npm run lint
```
## 反馈结构
- 先列出问题(严重性排序)
- 给出可操作修复建议
- 标注文件路径与关键位置
## 检查清单
- [ ] 关键路径无回归风险
- [ ] Tauri 命令与类型导出完整
- [ ] 前端无 `console.*` / `as any`
- [ ] Lint/Clippy 无警告
- [ ] 表格行高与内边距保持紧凑统一This skill performs focused code reviews for a WeChat chat auto-reply assistant, emphasizing Rust/Tauri backends, React frontends, database usage, and performance risks. It surfaces logic errors, regression risks, and interface mismatches, then produces prioritized, actionable feedback with file locations. Reviews aim to reduce runtime bugs, unsafe patterns, and UI inconsistencies quickly.
The skill scans code for critical patterns: Tauri command annotations, Specta type export consistency, explicit SQL column usage, and common frontend anti-patterns like console.* or casting to any. It runs checklist validations (lint/clippy, formatting) and inspects performance issues such as N+1 queries, unnecessary cloning, and repeated computations. Output lists issues sorted by severity and includes concrete fixes and exact file/line hints.
What severity levels are used?
Issues are grouped by severity: Blocker (regressions, security/transaction errors), High (type mismatches, performance hotspots), Medium (lint warnings, minor UI rules), Low (stylistic suggestions).
How are fixes presented?
Each finding includes a short description, reproducible steps or code snippets for a fix, and a file path with the key lines to change.