mcpField
N
ns-code-reviewer

ns-code-reviewer

github.com/nextstage-brasilTesting & quality070 installsUpdated 5d ago
Repository

About ns-code-reviewer

ns-code-reviewer is a skill for reviewing code changes against project rules and acceptance criteria. It guides workflow callers through a scored review and returns an approval, rejection, or blocked verdict with actionable findings when needed.

Key features

  1. 01Reviews diffs against project rules
  2. 02Checks acceptance criteria
  3. 03Applies a 1–10 score gate
  4. 04Provides actionable fix maps
  5. 05Supports ad-hoc and issue review

Use cases

  1. 01Reviewing a working-tree diff
  2. 02Checking issue changes against acceptance criteria
  3. 03Returning a consistent verdict to a workflow caller

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/nextstage-brasil/skills --skill ns-code-reviewer

After installing, type/ns-code-reviewerin Claude Code to confirm it loaded.

Bundled filesevals/evals.jsonreferences/review-fix-map.template.md

Details

From the project README

Code Reviewer

Deep constructive review vs project rules + acceptance criteria.

Caller contract (workflow callers)

Invoker: ns-code-coder, ns-code-autonomous, ns-execution-gitlab-issue (direct or harness reviewer-agent):

  • Caller must run this skill — MUST dispatch reviewer-agent when available (../ns-harness/references/subagent-dispatch.md); else read this SKILL.md in-session. No Cursor Task personas (senior-tech-lead-reviewer, bugbot, security-review) or improvised review.
  • Gate rules: ../ns-harness/references/review-gate-workflow.md.
  • Every response to workflow caller must end exact line: Code Review: {Approved|Rejected|Blocked}. Overall score in Executive Summary.

Harness discovery

See ../ns-harness/references/harness-discovery.md. Complete Session boot (blocking) before any other step — cold start this reviewer run; mid-session skip only if steps 1–7 done and files unchanged.

Workflow

  1. Session boot — Cold start reviewer-agent / this skill: Session boot steps 1–7 in harness-discovery.md (AGENTS.md + agents.local.md if present). Already booted same agent run (1–7 done), files unchanged: no re-read. Still judge diff vs AGENTS.md + project rules.
  2. git diff (git status if needed).
  3. Focus modified files + surrounding context.
  4. Start immediately — no permission ask.
Ad-hoc diff mode (from ns-code-coder)

Invoker passes working-tree diff only (no ISSUE_URL, no version-closure path):

  1. Review git diff on working tree.
  2. Apply Score gate + severity below.
  3. Last line to parent: Code Review: {Approved|Rejected|Blocked}
Version closure
  1. Apply Score gate; end chat with Code Review: {Approved|Rejected|Blocked}.
  2. Do not write code-review-report.md (or any persistent review report).
  3. Rejected / Blocked: minimal fix map in response (references/review-fix-map.template.md) — data another agent needs. No human prose, no positive findings, no history.
  4. Approved: Executive Summary + score + verdict line only (no fix map).
Issue review mode

Invoker passes ISSUE_URL (or project_id + issue_iid):

  1. Delegate issue context to ns-execution-gitlab-issue context flow or gitlab-issue-context-agent — no read_issue if synthesis block provided.
  2. Diff origin/<target>...origin/<source> from synthesis — never wrong branch.
  3. Requirement proof gate: every AC needs behavioral evidence; producer-only code without consumer = Critical.
  4. Verdict (exactly one): Approved | Rejected | Blocked — Score gate below.
  5. Post internal GitLab comment via mcp-gitlab-usage — first line: Code Review | YYYY-MM-DD HH:MM (UTC) | Verdict: {Approved|Rejected|Blocked}
  6. Last line to parent: Code Review: {Approved|Rejected|Blocked}
  7. Rejected/Blocked: GitLab comment = same minimal fix-map facts.

Score gate (all modes)

Every review must include overall score 1–10. Callers treat hard pass bar.

ScoreMeaningVerdict impact
10Ideal — ship as-isEligible for Approved
9Minimum passEligible for Approved
≤8Below barMust be Rejected (even zero Criticals)

Approved only when all true:

  1. Zero Critical findings
  2. Overall score ≥ 9/10 (target 10/10)
  3. Issue review mode: every AC PASS with behavioral evidence

Rejected when: any Critical, or score ≤ 8, or (Issue mode) any AC fails behavioral proof.

Scoring unit

Score quality of touched module/file after diff, not hunk-alone correctness. Minimal patch that leaves/worsens SSoT/DRY/OCP in that file cannot score 9–10.

Score caps (lowest that fits)
Condition in touched moduleMax score
New/changed behavior with config/lookup split across 2+ places (SSoT)7
Same resolution block copied in 2+ functions in diff scope (DRY)7
Predictable extension requires editing 3+ points in same file (weak OCP, e.g. provider)7
Diff correct, zero Critical, mediocre / inconsistent pattern in file7–8

9: zero Critical and smells above absent or resolved in touched module; predictable extension = one SSoT.

10: same as 9 plus no obvious fallback/redundancy; uniform pattern across file.

Anti-inflation
  • Forbidden: “minimal diff / tests pass / AC ok ⇒ 10”
  • Required in Executive Summary: one sentence justifying score vs rubric (e.g. “cap 7 — apiKey outside preset”)
Smell severity (SSoT / DRY / weak OCP)

Split SSoT or duplicated resolution in touched module ≥ Warning (not Suggestion only). Prefer Warning + score cap over auto-Critical for these smells. Keep Critical for bugs, security, AC failures. Score ≤ 8 already forces Rejected.

Review priorities

Within each section, order by severity:

  1. Critical (must fix before merge)
  2. Warning (should fix)
  3. Suggestion (consider)

Diff touches agent-api (or LangGraph runtime paths): load ../ns-langgraph-agents/references/anti-patterns.md. Placement, Prompt inject, Bind parity, Spec drift, colon wire names = Critical if violated.

SOLID and clean code
  • SRP, OCP, LSP, ISP, DIP
  • Naming, cyclomatic complexity, error handling, dead code
Performance, security, testability
  • N+1, unnecessary renders, missing validation
  • SQL injection, XSS, sensitive logs
  • Coupling that blocks testing

Required output format

Approved
Executive Summary
  • Score 1–10 (Score gate — pass ≥9, ideal 10)
  • One sentence justifying score vs score-cap rubric
  • Two-line overall assessment

Then: Code Review: Approved

Rejected / Blocked
Executive Summary
  • Score 1–10
  • One sentence justifying score
  • Two-line overall assessment
Fix map (agent)

Follow references/review-fix-map.template.md — actionable correction rows only. Omit positive findings, suggestions-only noise, history, long prose.

Then: Code Review: Rejected or Code Review: Blocked

Constraints

  • Read-only. No edit/create/delete product files — including code-review-report.md
  • Not substitutable. Workflow callers must invoke this skill by name; platform review subagents not equivalent unless human explicitly requests them this run
  • Direct, constructive; no personal criticism
  • No rewrite unrelated code
  • Findings from actual diff + rules read
  • Match project conventions visible in codebase
  • Fix map audience = another agent, not human

References

FileWhen
references/review-fix-map.template.mdRejected/Blocked response body
../ns-harness/references/artifact-layout.mdArtifact paths
mcp-gitlab-usagePosting internal review comments

Comments

Markdown supported