بنقرة واحدة
code-reviewer
Structured code review using 6 dimensions. Works with or without the code-reviewer agent.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Structured code review using 6 dimensions. Works with or without the code-reviewer agent.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Close a GitHub issue with discipline — resolved, superseded, or duplicate. Pre-flights body + comments, migrates substance before destroying context, cross-links both directions.
File a new GitHub issue with duplicate search, scope decision, label discovery, and preview before posting. Prevents fragmented or silently-filed issues.
Restructure the topology of GitHub issues — split one into many focused replacements, or merge multiple into one keeper. Migrates substance and cross-links before closing anything.
Update an existing GitHub issue — edit body, post a comment, retag, or reopen. Pre-flights body + comments; acknowledges stale framing instead of silently rewriting.
Review and address PR feedback using 6-dimensional code review
Create conventional commits with quality gates and validation
| name | code-reviewer |
| description | Structured code review using 6 dimensions. Works with or without the code-reviewer agent. |
| allowed-tools | Read, Grep, Glob, Bash(git diff*), Bash(git log*) |
Perform structured code reviews across six dimensions: correctness, design, readability, performance, testing, and security.
Review code systematically to catch bugs, improve design, and enforce quality standards before merge.
git diff, file paths, or PR context)# Show recent changes
git diff HEAD~1 HEAD --stat
git diff HEAD~1 HEAD
# Or: review specific file
git diff -- path/to/file.js
For each dimension below, read the checklist in the DETAIL section and apply it:
For each finding, decide:
Provide:
Check semantic correctness, logic, and type safety.
Questions to ask:
else, incomplete switch)Red flags:
if !valid instead of if valid)Example feedback:
BLOCKING: In line 45, `user.email` is accessed without null check.
If user creation fails mid-transaction, email will be undefined.
SUGGESTION: Add early return on line 32:
if (!validateInput(data)) return null;
instead of wrapping entire function in if-block.
Check architecture, interfaces, and design patterns.
Questions to ask:
Red flags:
Example feedback:
BLOCKING: Adding `user.role` check in the API route breaks the
permission-at-boundary pattern. Auth should be enforced in middleware,
not scattered across handlers.
SUGGESTION: Extract email parsing into a standalone utility function
rather than inline regex. Makes it reusable and testable.
Check naming, clarity, and documentation.
Questions to ask:
Red flags:
x, y for coords)usr, proc, calc)Example feedback:
SUGGESTION: Rename `processData` to `validateAndTransformUserInput`.
Current name doesn't explain what kind of data or what kind of processing.
SUGGESTION: Break this 8-line conditional into a helper function:
if (user.status === 'active' && user.verified && !user.suspended) {
// ... 20 lines ...
}
→ helper: isUserEligible(user)
Check efficiency, algorithms, and resource usage.
Questions to ask:
Red flags:
Example feedback:
SUGGESTION: Move `JSON.parse(config)` outside the loop (line 12).
Currently parsing the same config every iteration.
SUGGESTION: Use Set instead of Array for user lookup (line 8).
Current O(n) lookup inside loop → O(n²) overall. Set gives O(1).
Check coverage, edge cases, and test quality.
Questions to ask:
Red flags:
Example feedback:
BLOCKING: No tests added for the new `parseEmail` function.
Add tests for: valid email, invalid format, empty string, null.
SUGGESTION: Test error case on line 5. What happens if API fails?
Currently only testing happy path.
Check vulnerabilities, auth, secrets, and injection risks.
Questions to ask:
Red flags:
Example feedback:
BLOCKING: User ID on line 18 is used directly in SQL query without
parameterization. Vulnerable to SQL injection.
→ Use parameterized query: db.query('SELECT * FROM users WHERE id = ?', [userId])
BLOCKING: API key hardcoded on line 5. This will leak if pushed to repo.
→ Move to environment variable: process.env.OPENAI_API_KEY
For PRs with many files or thousands of lines:
Example:
This PR is quite large. I've reviewed:
- Core auth changes (6/8 files) — LGTM
- Utility refactor (sampled 5 files) — Consistent pattern, approved
- Tests (spot-check) — Coverage looks good
Recommendation: For next round, consider splitting refactors by domain
(auth, API, database) so reviews can be focused.
For architectural decisions, designs that touch multiple systems, or complex patterns:
Example:
Design question: Why direct user-to-database model vs. service layer?
This works for current scale, but will make caching and multi-tenant
support hard later. Worth discussing if those are on the roadmap.
If you expect to cache: add a service layer now.
If you expect to stay monolithic: fine as-is.
When reviewing refactors or migrations:
Example:
BLOCKING: In the refactor from Map to Object, iteration order is lost.
If code depends on insertion order, this breaks behavior.
→ Verify all callers don't assume order, or use Map.
SUGGESTION: The new version is ~20% faster (good!), but readability
dropped. Consider adding a comment explaining the performance trade-off.
When reviewing changes to external code or dependencies:
Example:
BLOCKING: Package `left-pad` has a known supply chain attack history.
Use built-in padStart() instead.
SUGGESTION: Consider lighter dependency (2kb vs 50kb).
Similar functionality in `tiny-validator` or as 10-line utility function.
/review-pr — Full PR review lifecycle with feedback loopcode-reviewer agent — Run 6D review automatically (provided by harness-kit plugin or project .claude/agents/code-reviewer.md)CLAUDE.md — Project-specific review standards