gitnexus-claude-plugin/skills/gitnexus-review/SKILL.md
Review code changes with GitNexus from a GitHub PR URL or number, a branch/ref or commit range, or local staged, unstaged, and untracked changes. Use when the user asks for a code review, merge-risk assessment, regression hunt, missing-test analysis, or a verdict on whether a PR, branch, commit range, or local diff is safe.
npx skillsauth add abhigyanpatwari/gitnexus gitnexus-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Review the requested change surface without editing source, committing, pushing, posting, or resolving threads. A later explicit request may authorize those actions. Use GitNexus for structural evidence and source inspection for proof; neither substitutes for the other.
Accept these forms:
| Input | Review surface |
| ------------------------------------------------------ | --------------------------------------------------------------------------- |
| PR URL, owner/repo#42, #42, or bare number | GitHub PR |
| base...head | Merge-base range |
| base..head | Exact two-dot range |
| Branch, tag, or commit | Ref against the repository default branch |
| local, staged, unstaged, or working-tree wording | Local changes |
| No target | Current branch's open PR; otherwise local changes; otherwise current branch |
An explicit target always wins. Interpret a bare number as a PR only in a
GitHub repository with working gh authentication; otherwise ask for a ref or
URL. If implicit mode finds both branch commits and local changes, review them
as two labeled surfaces rather than silently dropping or blending either one.
Record the resolved target kind, repository root, default branch, base SHA,
head SHA, merge-base when applicable, and included local states. Resolve the
default branch from remote metadata (refs/remotes/<remote>/HEAD or GitHub
repository metadata); use main or master only as an explicit fallback and
say when doing so.
Use gh pr view/gh api to pin the PR number, repository, title, URL, base
ref, base SHA, head ref, and head SHA. Fetch those exact commits without
switching the user's branch. Compute git merge-base <base> <head> and use
that SHA as the review base: GitHub PR diffs are merge-base diffs, while
detect_changes(scope: "compare") is a two-dot comparison.
Use the local git diff <merge-base> <head> as the complete diff source of
truth; use GitHub metadata for PR facts and review state. For fork PRs, fetch
the pull ref or the contributor remote instead of assuming the head branch
exists on origin.
Resolve every ref to a commit before reviewing. For a branch or A...B, use
the merge-base as the comparison base. For an explicit A..B, honor A as
the exact base. Do not compare a feature branch directly with a moving default
branch tip when merge-base semantics were intended.
Inspect git status --short, the staged diff, the unstaged diff, and every
untracked file. Use detect_changes with staged, unstaged, or all as
requested. Untracked files are not guaranteed to appear in Git diff or graph
mapping, so read them directly and list them in the review provenance.
The graph and diff must describe the same head. Reuse an existing worktree only when it is at the exact target SHA. Otherwise create a temporary detached worktree for the PR/ref head, review there, and remove only that temporary worktree afterward. Never switch or reset the user's current worktree.
Check GitNexus status in the target worktree. If stale, run
node .gitnexus/run.cjs analyze --index-only before trusting graph results
(temporary worktrees never carry the gitignored run.cjs — fall back to the
installed gitnexus CLI, then npx gitnexus), and include --pdg in that
same refresh when the diff plausibly touches trust or data-flow boundaries,
so the taint pass below doesn't pay a second full analyze. Taint and
dependence evidence needs that PDG layer: when the workflow's taint pass
finds it missing, rebuild with analyze --pdg --index-only and record the
rebuild in provenance. For local changes, refresh the index so new or
modified source is represented.
If an exact target checkout/index cannot be established, state the limitation
and do not claim a complete graph-backed review.
detect_changes against the exact surface:
...: scope: "compare", base_ref: <merge-base SHA>.A..B: scope: "compare", base_ref: <A SHA> from a worktree
at B.scope: "staged", "unstaged", or "all".
Pass worktree when the MCP server is attached elsewhere.impact with includeTests: true for each behaviorally changed
symbol. Prioritize public contracts, shared types, control flow, persistence,
security boundaries, and error handling; skip mechanical/generated changes.d=1) dependent that is outside the diff. A dependent
outside the diff is a lead, not automatically a bug—verify the changed
contract and caller behavior in source.context on key or ambiguous symbols and inspect affected execution
flows. Read the surrounding implementation and tests at cited locations.explain on the changed files or symbols and judge its
source→sink taint findings against the diff: a flow the change
introduces, or a sanitizer/guard the change removes, is a finding; a
pre-existing flow is context, not a defect of this change. When the
change claims to guard or sanitize something, verify with pdg_query:
what controls the changed statement, and where its values flow. This
needs a --pdg index; if one cannot be built, state that the taint pass
was skipped rather than implying coverage.INCREMENTAL_SCHEMA_VERSION (the
incremental write set covers only changed files, so new cross-file edges
never reach an existing index without the bump), the parse-store
SCHEMA_BUMP, and both bench fingerprint sets.Depth comes from matching reviewers to what actually changed, not from one
generalist pass. After workflow step 2, group the changed files and symbols
by the functional areas the graph already knows — the index's cluster
listing; context names each symbol's cluster — and give each touched area
an expert lens: a reviewer charged with that domain's contracts, invariants,
and failure modes, grounded in the repo's own material (architecture docs,
agent rules, the domain's tests) before judging the diff. A lens verifies,
not just reads: when the changed code is a pure function reachable from the
repo's own toolchain — parsers, extractors, capture emitters, formatters —
execute it on the candidate failing shape (a scratch probe, deleted
afterward) and cite the observed output. An empirical probe outranks source
reading in the evidence hierarchy; role swaps, dead branches, and
error-recovery-dependent behavior repeatedly pass a reading and fail a
ten-line probe. The numbered
workflow runs exactly once; dispatch the lens passes after step 6, handing
each lens the evidence already collected rather than letting lenses repeat
the impact, context, or taint calls. In GitNexus
itself, for example: shared ingestion-pipeline changes get an ingestion
expert plus one language expert per changed language extractor; embeddings
changes an embeddings expert; LadybugDB/storage changes a Ladybug expert.
Four cross-cutting lenses run regardless of domain:
any/as any
escapes, module boundaries typed. Judge by the repo's contract, never a
universal style bar.Scale effort to the surface: a single-domain change of a few files gets one combined pass covering its domain lens plus the four cross-cutting checks; a multi-domain change gets one lens per touched area — run as parallel subagents where the harness supports them, each scoped to its own files plus the shared graph evidence, and as sequential passes otherwise. Never spawn a lens for a domain the diff does not touch. Merge lenses that ground in the same material — two lenses reading the same files pay twice for one read's coverage, so give one reviewer both charges. Where the harness offers model or effort tiers, run mechanical lenses (rename sweeps, doc-consistency checks) on a cheaper tier and reserve the strongest engine for adversarial judgment. Every lens reports through the Finding standard below; merge and dedup before the verdict, dropping anything without a concrete failing scenario.
Six dispatchable lane definitions ship with this skill in ci-personas/ —
read-only reviewers restricted to Read/Glob/Grep plus the safe graph
tools. Five are finder lanes: ci-correctness-lens, ci-security-lens,
ci-blast-radius-lens, ci-coverage-lens, and ci-adversarial-lens
(which assumes the change is broken and constructs reachable failure
scenarios the pattern checks miss). They carry the verification
dimensions of the numbered workflow across every touched domain; domain
grouping and the four cross-cutting checks above remain the
orchestrator's charge. The sixth, ci-critic-lens, is a gate, not a
finder — it audits the finished draft.
When the harness supports subagents and these lanes are registered as
agents (the CI review workflow installs them from its trusted control
checkout; a local harness may register them by copying ci-personas/*.md
into ~/.claude/agents/ or the project's .claude/agents/), run the
expert-lens pass as follows. First establish your own graph evidence —
make at least one substantive context call on a changed symbol yourself,
before dispatching any lane, since lane calls never satisfy the evidence
this skill or its runner requires. Then dispatch all five finder lanes in
parallel in a single message. Give each lane the diff, the changed-file
manifest, the exact base and head identifiers, the checkout paths, and the
slice of changed files matching its charge.
Treat every lane report as an unverified claim: re-anchor each finding to the diff, the source, or your own graph queries before it enters the review; dedup across lanes; drop anything without a concrete failing scenario. Lane tool calls never substitute for evidence this skill or its runner requires from the orchestrating conversation itself.
After composing the complete draft review, dispatch ci-critic-lens with
the full draft body plus the same context. On DEFECTS, repair the draft
and re-dispatch the critic once; if defects remain after the second pass,
fix what you accept, note the unresolved critic objections in the
coverage section, and proceed — the critic hardens the review; it never
blocks it. This fail-open is deliberate: the critic is bounded to two
passes so it cannot deadlock or wedge the run, and the review is still
gated by the runner's own evidence and schema checks. (This is distinct
from the separate gitnexus-pr-swarm-review skill, whose interactive
roster treats its critic as a hard gate that must clear before emission;
this CI lane must always emit a review or a clean failure.) If subagent
dispatch is unavailable or any lane fails, run that lane's charge inline —
the lanes structure the work; they never gate it.
Report a finding only when the reviewed change introduces a concrete defect, regression, security issue, compatibility break, material coverage gap, or a maintainability cost with a concrete carrying scenario (a dead knob, a duplicated contract, a drift-prone copy). Each finding must include:
path:line anchor;Do not report style preferences, pre-existing issues, raw risk counts, or speculation as defects. Do not infer safety from zero graph hits. Calibrate overall risk from consequence, reachability, reversibility, and test evidence, not from the number of changed symbols alone.
Lead with findings in severity order. If there are none, say so explicitly. Then provide:
## Review: <target>
### Findings
- [HIGH|MEDIUM|LOW] `path:line` — <problem, evidence, impact, remediation>
### Change and blast-radius summary
- Target/base/head/merge-base and local states reviewed
- Changed symbols and affected execution flows
### Coverage and residual risk
- Tests present, tests missing, graph/diff limitations
### Verdict
APPROVE | REQUEST CHANGES | NEEDS DISCUSSION
For a branch or local review, use READY, NOT READY, or NEEDS DISCUSSION
instead of a PR approval action. Include the exact target SHAs so a later run
can tell whether the evidence is stale.
tools
Use when the user asks about GitNexus itself — available tools, how to query the knowledge graph, MCP resources, graph schema, or workflow reference. Examples: "What GitNexus tools are available?", "How do I use GitNexus?"
development
Review code changes with GitNexus from a GitHub PR URL or number, a branch/ref or commit range, or local staged, unstaged, and untracked changes. Use when the user asks for a code review, merge-risk assessment, regression hunt, missing-test analysis, or a verdict on whether a PR, branch, commit range, or local diff is safe.
development
Review code changes with GitNexus from a GitHub PR URL or number, a branch/ref or commit range, or local staged, unstaged, and untracked changes. Use when the user asks for a code review, merge-risk assessment, regression hunt, missing-test analysis, or a verdict on whether a PR, branch, commit range, or local diff is safe.
testing
Use when executing an engineering plan produced by gitnexus-plan (or a small bounded task directly) — implements step by step with GitNexus impact checks before every symbol edit, tests from the plan's scenarios, and detect_changes gating every commit. Examples: "/gitnexus-work docs/plans/2026-07-11-gitnexus-plan-ingestion-retry.md", "/gitnexus-work" (latest plan), "execute the plan".