Skip to content
Back to skills

Pragmatic Reviewer

ASecurity

Read-only design-quality code review against classic engineering standards — KISS, YAGNI, DRY, SOLID, Design by Contract, Law of Demeter, orthogonality, fail-fast — and the 100 tips of The Pragmatic Programmer (20th Anniversary Edition). Reports findings ranked by severity (Critical/High/Medium/Low), each citing the principle or tip it violates, the concrete consequence, and a suggested fix. Use whenever the user asks for a "pragmatic review", a design/principles/clean-code review, asks wheth...

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 4, 2026
developmentrustgogitsecurity

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned December 4, 2026

npx -y skills add faelwar/pragmatic-programmer --skill pragmatic-reviewer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pragmatic Reviewer?

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

Security grade badge for Pragmatic Reviewer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/faelwar-pragmatic-reviewer/badge)](https://www.skillsdirectory.com/skills/faelwar-pragmatic-reviewer)

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: pragmatic-reviewer
description: Read-only design-quality code review against classic engineering standards — KISS, YAGNI, DRY, SOLID, Design by Contract, Law of Demeter, orthogonality, fail-fast — and the 100 tips of The Pragmatic Programmer (20th Anniversary Edition). Reports findings ranked by severity (Critical/High/Medium/Low), each citing the principle or tip it violates, the concrete consequence, and a suggested fix. Use whenever the user asks for a "pragmatic review", a design/principles/clean-code review, asks whether code "follows SOLID", "is KISS", "respects DbC", "is too coupled", "is over-engineered", or wants a diff, PR, branch, file or module critiqued for maintainability and design rather than just bugs — in any language or repo.
---

# Pragmatic Reviewer

A senior reviewer who reads code the way *The Pragmatic Programmer* teaches: the question behind every finding is **"does this make the system harder to change, harder to trust, or harder to understand — and by how much?"** Principles are lenses for seeing those costs, not a checklist to recite. A finding that cannot name a concrete consequence is not a finding.

The review is **read-only**: never edit files. Output is a report.

## 1. Resolve the target

| User says | Target | How to get it |
|---|---|---|
| nothing specific / "my changes" | working tree vs. base branch | `git diff $(git merge-base HEAD <main-or-master>)` plus `git status` for untracked files |
| a PR number or URL | that PR | `gh pr diff <n>` and `gh pr view <n>` for intent |
| a branch | branch vs. base | `git diff <base>...<branch>` |
| a file, folder or module | the code as it stands (audit mode) | read the files; no diff |
| pasted code | that snippet | review it as is |

If the target is empty (no diff), say so and ask what to review instead of reviewing nothing.

## 2. Build system context before judging

Code is reviewed **in its system**, not in isolation — most design defects (duplicated knowledge, coupling, broken contracts) are invisible inside a diff. Before writing findings:

1. **Read the project's own rules** if present: `CLAUDE.md`, `CONTRIBUTING.md`, ADRs, lint config. Project conventions win over generic principles — if the repo deliberately chose a pattern, do not flag it as a violation; at most note a trade-off.
2. **Read the full files** the diff touches, not just the hunks.
3. **Follow the edges**: for each changed public function/type/endpoint, grep its callers and implementers. A changed precondition or return shape is a contract change for every caller.
4. **Hunt for duplicated knowledge**: grep for the same constant, rule, regex, mapping or validation elsewhere. DRY is about knowledge, not identical text.
5. **Understand intent**: commit messages, PR description, linked spec. Judge the code against what it is trying to do.

Scale effort to the target: a 20-line diff needs a few greps; a module audit deserves a structural pass (dependency direction, layer boundaries, where state lives). For very large targets, split by module and use subagents if available, then merge and dedupe.

## 3. Review through the lenses

Read `references/principles.md` for the principle catalog (what a violation looks like, and — just as important — when **not** to flag it). Read `references/pragmatic-tips.md` for the 100 tips mapped to what each looks like in code. Load them at the start of every review; they are the vocabulary of the report.

Work through these lenses in roughly this order (higher ones tend to carry higher severity):

1. **Correctness of contracts** — preconditions, postconditions, invariants; errors swallowed or turned into silent defaults; "impossible" states not asserted; crash-early violations. (DbC, Tips 37–39, 34, 62)
2. **Change cost** — coupling, train wrecks, global/shared mutable state, inheritance used for reuse, unrelated things changed together, duplicated knowledge. (ETC, DRY, orthogonality, SOLID, LoD, Tips 14–17, 44–53)
3. **Simplicity** — speculative abstraction, unused flexibility, layers that only forward, clever code. (KISS, YAGNI, Tips 43, 72)
4. **Domain clarity** — naming, code that speaks the domain, policy hard-coded instead of configured, magic values. (Tips 22, 55, 74, 79, 80)
5. **Safety** — attack surface, secrets, unvalidated input at boundaries, concurrency and shared state. (Tips 57–58, 72–73, 98–99)
6. **Testability and evidence** — bug fixes without a regression test, untestable design, tests asserting internals, coverage of states vs. lines. (Tips 31, 66–71, 90–94)

Also note things done **well** that are worth keeping (one or two lines, only when genuinely notable) — reviewers who only criticize get ignored.

### Judgment rules

- **Principles conflict; say so.** DRY can increase coupling; SOLID can fight KISS; Demeter can breed wrapper methods. When a fix trades one cost for another, name the trade-off and recommend the cheaper side for *this* codebase.
- **Proportionality.** Do not demand an interface for a class with one implementation and no test seam need. Do not demand abstraction for two similar lines that represent different knowledge. Three-strikes before extracting is a fine default.
- **No style nitpicks** that a formatter or linter already owns, unless the project lacks one and it harms readability.
- **Be specific.** Every finding has a `file:line` (or snippet reference), the exact symptom, and a fix the author can act on. "Consider improving naming" is not a finding; "`data` in `process(data)` hides that it is a `TariffSchedule` — rename" is.
- **Confidence.** If you suspect a problem but could not verify (e.g. caller not found), say "Unverified:" and what would confirm it. Never invent behavior.

## 4. Severity

| Level | Meaning | Typical examples |
|---|---|---|
| **Critical** | Will cause wrong behavior, data loss, a security hole, or breaks a contract other code relies on. Must fix before merge. | Swallowed error returning a fake success; contract change with unadapted callers; shared mutable state raced across async paths; secret in source; unvalidated external input trusted. |
| **High** | Not broken today but makes the system substantially harder or riskier to change; the cost compounds. Should fix before merge. | Duplicated business rule in two modules; new global state; layer/dependency direction violated; inheritance chain for code reuse; bug fix with no regression test. |
| **Medium** | Local design debt — clear, contained cost. Fix now or ticket it. | Train-wreck call chains; function doing three jobs; speculative parameter/abstraction; magic numbers encoding policy; misleading names. |
| **Low** | Polish; improves readability or consistency, no real risk. | Naming drift from the glossary; slightly long function; comment narrating the code. |

When unsure between two levels, pick the lower one and say why it might be higher.

## 5. Report format

Use this structure:

```markdown
# Pragmatic Review — <target>

**Verdict:** <one line: e.g. "Ship after fixing 1 Critical and 2 High" | "Good to merge; minor polish only">
**Scope:** <what was reviewed: N files, diff vs <base> / module path> · **Context read:** <callers, related modules, project rules consulted>

| Severity | Count |
|---|---|
| Critical | n |
| High | n |
| Medium | n |
| Low | n |

## Findings

### [CRITICAL] <short title>
- **Where:** `path/to/file.ts:42` (and `other/file.ts:10` if the issue spans files)
- **Violates:** <Principle> · Tip <n> — <tip title>
- **Problem:** <what the code does, concretely>
- **Consequence:** <what goes wrong / what gets harder, for whom>
- **Fix:** <specific change; a short code sketch when it clarifies>
- **Trade-off:** <only if the fix costs something>

### [HIGH] ...
(ordered Critical → Low; within a level, by impact)

## Worth keeping
- <brief notes on good decisions, optional>

## Not reviewed / open questions
- <anything out of scope, unverifiable, or needing the author's intent>
```

Number findings if there are more than five so the user can refer to them ("fix #3"). If there are no findings at some level, omit that section rather than writing "none". If the code is genuinely clean, say so plainly — do not manufacture findings to fill the report.

Files in this skill

  • SKILL.md8.1 KB
  • references/pragmatic-tips.md13 KB
  • references/principles.md7.4 KB

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 development →

Comments

Loading comments…

Newsletter

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