Skip to content
Agentmart
Submit a tool

dry-code-review

Perform a comprehensive DRY (Don't Repeat Yourself) code review on a codebase.

Skill by espennilsen

IndexedMIT★ 122
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/espennilsen-dry-code-review

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Perform a comprehensive DRY (Don't Repeat Yourself) code review on a codebase. Identifies duplicated code, repeated logic, redundant patterns, and opportunities for abstraction. Use this skill whenever the user asks to review code for duplication, reduce repetition, apply DRY principles, refactor for reusability, find copy-pasted code, deduplicate logic, or audit code quality with a focus on redundancy. Also trigger when users say things like "clean up my code", "find repeated patterns", "too much boilerplate", "reduce code duplication", or "refactor for maintainability". Works on any language or framework.

Use cases: security, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 26, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found
Runs as
Shell scripts

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/dry-code-review

What's inside

Skill name
dry-code-review
Description
Perform a comprehensive DRY (Don't Repeat Yourself) code review on a codebase. Identifies duplicated code, repeated logic, redundant patterns, and opportunities for abstraction. Use this skill whenever the user asks to review code for duplication, reduce repetition, apply DRY principles, refactor for reusability, find copy-pasted code, deduplicate logic, or audit code quality with a focus on redundancy. Also trigger when users say things like "clean up my code", "find repeated patterns", "too much boilerplate", "reduce code duplication", or "refactor for maintainability". Works on any language or framework.
License
MIT
Instructions
173 lines in SKILL.md · view on GitHub

Before installing

  • Ships executable scripts

Files (2)

  • SKILL.md
  • find_duplicates.sh · scripts/

SKILL.md (first lines)

# DRY Code Review Skill

Perform a structured, thorough code review focused on the DRY (Don't Repeat Yourself) principle. The review is planned and tracked via a markdown file in `plans/`.

## Overview

The DRY principle states: "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system." This skill systematically finds violations and recommends fixes.

## Workflow

### Phase 1: Setup & Discovery

1. **Create the tracking plan** in `plans/dry-review-<project-name>.md` using the template below
2. **Inventory the codebase**: List all source files, their languages, sizes, and roles
3. **Identify scope**: Confirm with the user which directories/files to include or exclude (e.g., skip `node_modules`, `vendor`, generated files, test fixtures)

### Phase 2: Automated Scanning

Run the scanning script to find likely duplication:

```bash
bash /path/to/dry-code-review/scripts/find_duplicates.sh <target_directory> [extensions]
```

The script detects:
- Identical or near-identical code blocks (3+ lines repeated)
- Repeated string literals and magic numbers
- Similar function signatures across files
- Repeated boilerplate and configuration patterns

Import/dependency lines are intentionally excluded from the duplicate-lines scan so they don't dominate the output.

### Phase 3: Manual Analysis

After automated scanning, perform deeper analysis by reading the codebase. Look for these DRY violation categories:

#### Category 1: Literal Duplication
- Copy-pasted code blocks (exact or near-exact)
- Repeated string literals / magic numbers
- Duplicate configuration values

#### Category 2: Structural Duplication
- Functions/methods that do the same thing with minor variations
- Repeated conditional logic (same if/else chains)
- Similar class structures that could share a base class or mixin
- Repeated error handling patterns

#### Category 3: Logical Duplication
- Same business logic expressed differently in multiple places
- Repeated validation rules
- Duplicate data transformation pipelines
- Same algorithm implemented in multiple places

#### Category 4: Cross-Cutting Duplication
- Repeated boilerplate across files (logging, auth checks, error wrappers)
- Similar API endpoint handlers
- Repeated test setup/teardown code
- Duplicate build/deploy configuration

### Phase 4: Findings & Recommendations

For each finding, document:

1. **ID**: Sequential identifier (DRY-001, DRY-002, ...)
2. **Category**: Which of the 4 categories above
3. **Severity**: 🔴 High (5+ repetitions or core logic) / 🟡 Medium (2-4 repetitions) / 🟢 Low (minor or cosmetic)
4. **Locations**: File paths and line numbers of all occurrences
5. **Description**: What is duplicated and why it matters
6. **Recommendation**: Specific refactoring approach
7. **Effort**: S / M / L estimate

#### Common Refactoring Recommendations

- **Extract Function/Method**: Pull repeated logic into a shared function
- **Extract Constant/Config**: Replace magic numbers and repeated literals
- **Create Base Class/Mixin**: Share behavior across similar classes
- **Use Higher-Order Functions**: Wrap repeated patterns (decorators, middleware)
- **Create Shared Utility Module**: Centralize cross-cutting concerns
- **Use Templates/Generics**: Parameterize structural duplication
- **Apply Strategy Pattern**: Replace repeated conditional branches
- **Consolidate Configuration**: Single source of truth for settings

### Phase 5: Summary & Prioritization

Update the plan file with:
- Total findings count by category and severity
- A prioritized action list (quick wins first, then high-impact refactors)
- Estimated effort for full remediation
- Risk notes (what could break if refactored carelessly)

## Plan File Template

The plan file MUST be created at `plans/dry-review-<project-name>.md` using this structure:

```markdown
# DRY Code Review: <Project Name>

## Review Metadata
- **Date**: YYYY-MM-DD
- **Reviewer**: Claude (AI-assisted)
- **Scope**: <directories/files reviewed>
- **Languages**: <languages found>
- **Total Files Scanned**: <count>
- **Total Lines of Code**: <count>

## Status
- [ ] Phase 1: Setup & Discovery
- [ ] Phase 2: Automated Scanning
- [ ] Phase 3: Manual Analysis
- [ ] Phase 4: Findings & Recommendations
- [ ] Phase 5: Summary & Prioritization

## Scope Definition
### Included
- <list of included paths>

### Excluded
- <list of excluded paths and reasons>

From espennilsen/pi, MIT.

More from espennilsen/pi

Signals

Stars
122
Forks
13
Open issues
1
Last commit (this folder)
Apr 22, 2026 (6 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from espennilsen

Cite this page

dry-code-review skill. Agent Mart. https://agentmart.dev/skills/espennilsen-dry-code-review (last updated 2026-10-24)