Skip to content
Back to skills

Review Changes

ASecurity

Review working-tree, branch, or PR changes on separate axes — Standards (repo conventions + a smell baseline), Spec (does it do what the active feature spec asked), and Security when the diff touches a trust boundary — with blast-radius and test-coverage checks. Graph tools accelerate when present; never required.

  • 4 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 17, 2026
ai-agentsrustgoshellrefactoringgitsecurityperformance

Security analysis

A100/100

Scanned November 17, 2026

npx -y skills add afu-it/safe-code --skill review-changes --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Review Changes?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Review Changes
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/afu-it-review-changes/badge)](https://www.skillsdirectory.com/skills/afu-it-review-changes)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: review-changes
description: Review working-tree, branch, or PR changes on separate axes — Standards (repo conventions + a smell baseline), Spec (does it do what the active feature spec asked), and Security when the diff touches a trust boundary — with blast-radius and test-coverage checks. Graph tools accelerate when present; never required.
argument-hint: "[file | function | branch | PR number]"
---

# Review Changes

Separate axes, never merged. Code can pass one and fail another, and merging lets one mask the other.

## Inputs

- The diff: no argument -> working tree vs the default diff base; file/function -> that target and its impact; branch -> vs `main`/`master`; PR number -> the checked-out PR branch or local diff.
- `.safe-code/context/code-standards.md` (documented repo standards).
- The active spec, if any: `.safe-code/context/feature-specs/<NN>-*.md` with `status: in-progress` (or the one the user names).
- Graph accelerators when a codegraph index is ready (`codegraph sync` first): `codegraph impact <symbol>` for high-risk changes, `codegraph callers <symbol>` for changed signatures, `codegraph affected <changed files>` for the tests the diff reaches (over-reports — the safe side). Without them: `git diff`, `rg`, direct reads. Read full source only for changed or high-impact files.

## Axis 1 — Standards

Does the change follow the documented standards, and does it avoid the smell baseline?

Smell baseline (Fowler), always carried against the diff: Mysterious Name · Duplicated Code · Feature Envy · Data Clumps · Primitive Obsession · Repeated Switches · Shotgun Surgery · Divergent Change · Speculative Generality · Message Chains · Middle Man · Refused Bequest. Plus two structural smells: a pure helper living in a heavy module drags that module into every importer (move it to a leaf module); two branches that check the same state with near-identical conditions leave a gap between them.

Binding rules: a documented repo standard always overrides the baseline; every smell is a labelled judgement call ("possible Feature Envy"), never a hard violation; skip anything tooling (lint, type-check, formatter) already enforces.

Test shapes to reject on this axis: **implementation-coupled** (mocks internal collaborators or asserts through a side channel — the tell is that it breaks on refactor while behaviour is unchanged); **tautological** (the assertion recomputes the expected value the way the code does, so it passes by construction — expected values must come from an independent source: a known-good literal, a worked example, the spec); **horizontally sliced** (all tests first, then all implementation — it verifies imagined behaviour); **substring-matched** (`contains("valid")` also passes on "invalid", or fails on a formatting change — assert the exact value or structure); **simulated-only** (fake timers or jsdom can hide bugs that exist only in the real runtime — ask for one real-runtime probe).

Evidence checks:

- A performance claim ("faster", "lighter") needs a before-baseline measured under the same conditions; without one it is labelled `hypothesis`. "Fewer lines" is not performance evidence.
- A changed setting that several paths share (timeout, pool size, retry count) is checked against each path's time budget using real latency, not just the path that motivated the change.
- Test depth by change size is allowed only when the project declares tiers in `code-standards.md`; never pick a lighter tier yourself — a short review compresses the report, never the verification.

## Axis 2 — Spec

Only when an active spec exists; otherwise report `Spec: no active spec`. Does the change implement what the spec asked?

- **Missing**: a requirement in the spec with no corresponding change.
- **Scope creep**: a change no requirement asked for (note it; it may be prefactoring, which is fine if labelled).
- **Wrongly implemented**: the requirement is addressed but the behaviour differs from the spec's Design / Verify When Done.
- **Reinvention**: the spec or change adds a new module, table, or harness where something existing already does most of the job — name the existing one.

## Axis 3 — Security

Only when the diff touches a trust boundary (input handling, queries, file paths, shell, outbound requests, auth, permissions, secrets, tenant scope, dependencies or CI, LLM or agent tool input); otherwise report `Security: no boundary touched`. Under safe-code, follow `references/security.md` (Part 2). Standalone, for each touched boundary name the lower-trust party, the control meant to stop misuse and where it is enforced, and the concrete result if it fails.

- `confirmed` — the path from input to result is traced in source; severity by demonstrated impact.
- `needs-validation` — depends on a named fact outside the repo; no severity.
- `hardening` — a missing extra layer with no reachable violation; never called a vulnerability.

No named party, boundary, and result -> not a finding. Never probe a deployed service or real accounts.

## Output

```text
## Standards
- [severity] path:line - issue, impact, fix
Worst issue: <one line, or none>

## Spec
- [missing | creep | wrong | reinvention] <requirement or change> - detail
Worst issue: <one line, or "no active spec">

## Security
- [confirmed <severity> | needs-validation | hardening] path:line - party, boundary, result, fix
Worst issue: <one line, or "no boundary touched">

## Summary
- Risk: <low|medium|high>
- Blast radius: <files/functions/flows>
- Tests checked: <commands or graph coverage>
- Open questions: <or none>
```

Findings first, ordered by severity **within** each axis; never re-rank across axes. Report only actionable findings.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.