Code reviewer

From MinBZK/regelrecht · View interactive version

Code reviewer is an AI agent skill from the GitHub repository MinBZK/regelrecht. Performs critical code reviews using REVIEW.md guidelines. Evaluates code quality, architecture, testing, and domain-specific concerns (legal faithfulness, cross-law references, engine safety). Use after completing significant code changes or before merging.

How to use this skill

Skill file

Code Reviewer

Performs thorough, skeptical code reviews to catch issues before they reach production.

Mindset: Trust No One

Assume the author made mistakes. Even experienced developers:

Your job is to find these issues before they cause problems.

Step 1: Load Review Guidelines

Read REVIEW.md from the repository root. This contains the project context,

domain-specific review dimensions, severity scale, and skip rules. These guidelines

are the primary source of truth for what to check.

Step 2: Gather Context

# See what files changed
git diff --name-only HEAD~1

# See the full diff
git diff HEAD~1

# Or for staged changes
git diff --cached
  1. Identify all changed files
  2. Read the commit message or PR description
  3. Understand the intent of the changes

Step 3: Review the Changes

Only review lines that were actually changed in the diff.

Do NOT comment on:

You may read the full file to understand context, but every finding you report

has to point to a line that was added or modified in the diff. If a line was not

changed, it is out of scope — no matter how wrong it looks.

For each changed line/block:

  1. Understand the surrounding code — read enough context to judge the change
  2. Trace the data flow — where does data come from, where does it go?
  3. Check the boundaries — what happens at edges and limits?
  4. Apply REVIEW.md dimensions — check each applicable dimension from the guidelines

Questions to ask (about changed code only):

Step 3b: Does each new test pin what it claims?

A green test is not evidence. Ask of every test in the diff: if the line this

test covers were broken, would this test fail? Read the fixture against the

assertion and answer it, rather than trusting the test name or its doc-comment.

The failure is almost always the same: the test tells a scenario and the fixture

does not construct the premise of that scenario, so the assertion is trivially

true. A survey of this repository found fourteen of them — a longest-prefix test

with no shorter competing article, a retain test whose only candidate was

already filtered out upstream, an assertion about a variable nothing references,

sixteen test_files entries naming files that do not exist and that nothing

reads.

Concrete forms to check:

schema/latest/schema.json and against a real file in corpus/. One unit

check here passed for months against a reader that found nothing in any real

document, because both the reader and the fixture had the field one level too

high.

message prefix, on is_empty(), on an enum where a string carries the

behaviour, or assert!(!format!("{x:?}").contains("…")), which also passes on

Ok(..).

when the variant differs. Add a panic arm.

CHAIN[1] while its name and comment were about CHAIN[0], and passed

because both steps declare the same requirements.

nothing changed.

When the diff fixes a bug, the review also asks: **why was the existing test

green?** A bugfix without an answer to that question leaves the same blind spot

for the next bug in the same place. The fix for the test is to construct the

premise, not to add an assertion beside it.

Step 4: Run Tests (if applicable)

just test
just bdd

Step 5: Report

Use the severity scale from REVIEW.md. Provide a structured report:

## Code Review: {description}

### Summary
{One paragraph summary of changes and overall assessment}

### Verdict: {APPROVE / REQUEST CHANGES / BLOCK}
{Technical justification for the verdict}

### Critical Issues
- **{Issue title}** (`file:line`)
  - Problem: {What's wrong}
  - Impact: {Why it matters}
  - Fix: {How to fix it}

### Important Issues
- **{Issue title}** (`file:line`)
  - Problem: {What's wrong}
  - Impact: {Why it matters}
  - Fix: {How to fix it}

### Minor Issues
- `file:line` — {Brief description}

Red Flags

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.