一键导入
review-implementation
Use after implementing a model, rule, or any code change to verify completeness and correctness before committing
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use after implementing a model, rule, or any code change to verify completeness and correctness before committing
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when preparing a new yao-rs release, bumping the version, or tagging a release
Use when you have a GitHub issue and want to create a PR with an implementation plan that triggers automated execution
Use when a PR has review comments to address, CI failures to fix, or codecov coverage gaps to resolve
| name | review-implementation |
| description | Use after implementing a model, rule, or any code change to verify completeness and correctness before committing |
Dispatches a quality review subagent with fresh context (no implementation history bias) to check code quality, test coverage, and correctness.
/review-implementation -- auto-detect from git diffBASE_SHA=$(git merge-base main HEAD)
HEAD_SHA=$(git rev-parse HEAD)
git diff --stat $BASE_SHA..$HEAD_SHA
git diff --name-only $BASE_SHA..$HEAD_SHA
PR_NUM=$(gh pr view --json number -q .number 2>/dev/null)
if [ -n "$PR_NUM" ]; then
ISSUE_NUM=$(gh pr view $PR_NUM --json body -q .body | grep -oE '#[0-9]+' | head -1 | tr -d '#')
fi
if [ -n "$ISSUE_NUM" ]; then
ISSUE_BODY=$(gh issue view $ISSUE_NUM --json title,body -q '"# " + .title + "\n\n" + .body')
fi
If an issue is found, pass it as {ISSUE_CONTEXT} to the subagent. If not, set to "No linked issue found."
Dispatch using Agent tool with subagent_type="superpowers:code-reviewer".
Fill this prompt template and pass it as the agent prompt:
First, read
.claude/rules/rust-writing.mdto understand the project's Rust design patterns and conventions. Use these as your review baseline.You are reviewing code changes for quality in the
tn-mcp-rsRust codebase (a tensor network MCP server for quantum circuit simulation). You have NO context about prior implementation work -- review the code fresh.What Changed: {DIFF_SUMMARY}
Changed Files: {CHANGED_FILES}
Plan Step Context: {PLAN_STEP}
Linked Issue: {ISSUE_CONTEXT}
Git Range: Base: {BASE_SHA} / Head: {HEAD_SHA}
Start by running:
git diff --stat {BASE_SHA}..{HEAD_SHA} git diff {BASE_SHA}..{HEAD_SHA}Then read the changed files in full.
Review Criteria:
- DRY -- Duplicated logic that should be extracted?
- KISS -- Unnecessarily complex? Over-engineered abstractions, convoluted control flow?
- HC/LC -- Single responsibility? God functions (>50 lines doing multiple things)?
HCI (if MCP tools changed, i.e.
src/tools/):
- Error messages -- Actionable? Bad:
"invalid parameter". Good:"circuit JSON must include num_qubits field".- Discoverability -- Missing documentation on tool parameters?
- Consistency -- Similar operations expressed similarly? Parameter names, output formats uniform?
- Least surprise -- Output matches expectations? No silent failures?
- Feedback -- Tool confirms what it did?
Test Quality:
- Naive Test Detection -- Flag tests that:
- Only check types/shapes, not values (e.g.,
assert!(result.is_ok())without checking the result)- Mirror the implementation (recomputing the same formula proves nothing)
- Lack adversarial cases (only happy path, no malformed inputs or edge cases)
- Use trivial instances only (1-qubit circuits may pass with bugs; need multi-qubit tests)
- Assert count too low (1-2 asserts for non-trivial code is insufficient)
Output format:
## Code Quality Review ### Design Principles - DRY: OK / ISSUE -- [description with file:line] - KISS: OK / ISSUE -- [description with file:line] - HC/LC: OK / ISSUE -- [description with file:line] ### HCI (if MCP tools changed) - Error messages: OK / ISSUE -- [description] - Discoverability: OK / ISSUE -- [description] - Consistency: OK / ISSUE -- [description] - Least surprise: OK / ISSUE -- [description] - Feedback: OK / ISSUE -- [description] ### Test Quality - Naive test detection: OK / ISSUE - [specific tests flagged with reason and file:line] ### Issues #### Critical (Must Fix) [Bugs, correctness issues, data loss risks] #### Important (Should Fix) [Architecture problems, missing tests, poor error handling] #### Minor (Nice to Have) [Code style, optimization opportunities] ### Summary - [list of action items with severity]
When the subagent returns:
## Review: [Description of Changes]
### Build Status
- `make test`: PASS / FAIL
- `make clippy`: PASS / FAIL
### Code Quality
- DRY: OK / ...
- KISS: OK / ...
- HC/LC: OK / ...
### HCI (if MCP tools changed)
...
### Test Quality
...
### Fixes Applied
- [list of issues automatically fixed]
### Remaining Items (needs user decision)
- [list of issues that need user input]