/research-convensions:review-implementationfrom research-convensions
Reviews uncommitted code diffs with a fresh-context subagent for design principles (DRY/KISS/HC-LC), test quality, and public-API ergonomics, then consolidates findings and applies clear fixes automatically.
Ships in research-convensions. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Dispatches a quality-review subagent with fresh context (no implementation history bias) to check the diff for design, test, and API quality before the commit lands.
The agent that just wrote the code has a strong bias toward declaring it correct. A reviewer with no memory of how the code came to be will notice over-engineering, missing edge-case tests, and unclear error messages that the author has stopped seeing.
fix-pr instead).BASE_SHA=$(git merge-base main HEAD) # or master / dev — adjust per repo
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."
Dispatch with the Agent tool. Prefer subagent_type="superpowers:code-reviewer" if available; otherwise use general-purpose with the prompt template below.
Fill in the placeholders and pass as the agent prompt:
First, read the repo's
CLAUDE.mdand any language-specific style rules under.claude/rules/(e.g.,rust.md,julia.md,python.md) to understand the project's conventions. Use these as your review baseline.You are reviewing code changes for quality in the
{REPO_NAME}codebase ({ONE_LINE_REPO_PURPOSE}). You have NO context about prior implementation work — review the code fresh.What changed: {DIFF_SUMMARY}
Changed files: {CHANGED_FILES}
Plan / task 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 (High Cohesion / Low Coupling) — Single responsibility per function/module? "God" functions (>50 lines doing multiple things)?
Public-API ergonomics (only if a public surface changed — CLI flags, library entrypoints, MCP/HTTP tools, exported functions):
- Error messages — Actionable? Bad:
"invalid parameter". Good:"input JSON must include 'num_qubits' field".- Discoverability — Documented parameters, examples, sensible defaults?
- Consistency — Similar operations expressed similarly (parameter names, output formats)?
- Least surprise — Output matches expectations? No silent failures?
- Feedback — The operation confirms what it did?
Test quality:
- Naive test detection — Flag tests that:
- Only check types/shapes, not values (e.g.,
assert is_ok(result)without checking the result).- Mirror the implementation (recomputing the same formula proves nothing).
- Lack adversarial cases (only happy path; no malformed inputs, edge cases, error paths).
- Use trivial instances only (n=1 may pass with off-by-one bugs; need n≥3).
- Have too few assertions (1-2 asserts on 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] ### Public-API ergonomics (if applicable) - 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 - [action items with severity]
When the subagent returns:
Do not silently disagree with a finding. If you think the reviewer is wrong, write that down and ask the user.
## Review: <description of changes>
### Build Status
- <project's test command>: PASS / FAIL
- <project's lint command>: PASS / FAIL
### Code Quality
- DRY: OK / ...
- KISS: OK / ...
- HC/LC: OK / ...
### Public-API ergonomics (if applicable)
...
### Test Quality
...
### Fixes Applied
- [list of issues auto-fixed, with file:line]
### Remaining Items (needs user decision)
- [list of issues to discuss]
After the user approves any remaining items, you can commit.
| Mistake | Fix |
|---|---|
| Skipping the fresh-context dispatch and "reviewing yourself" | You wrote the code; your judgment is biased. Dispatch the subagent. |
| Filling the prompt template with placeholders left unfilled | Always substitute {BASE_SHA}, {HEAD_SHA}, etc. before sending. |
| Auto-fixing Minor items and burying them | Minor items go to the user. Only apply unambiguous Important+ fixes silently. |
Hardcoding main as the base | Some repos publish from dev or master. Compute merge-base against the real default branch. |
| Reviewing while implementation is still in flux | Wait until tests pass locally. The reviewer will flag scaffolding you intend to remove. |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub codingthrust/templates --plugin research-convensions7 skills in this plugin
/fix-prUse when a pull request on the current branch has review comments, failing CI checks, or coverage gaps to address — guides a triaged cleanup pass that fixes feedback in priority order without bundling unrelated changes./issue-to-prUse when you have a GitHub issue and want to open a PR carrying an implementation plan — guides fetching the issue, brainstorming an approach with the user, writing a plan file, and pushing a plan-only PR ready for implementation (manual or automated)./repo-hygiene-auditUse when auditing a software repository for beginner-level best-practice violations, repo health, Git history hygiene, issue and PR usage, branch discipline, tests, docs, coding style, CI, security basics, or maintainability signals.Other plugins' skills for the same job