Agent skill

Dry Code Review

by espennilsen in espennilsen/pi

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

MITAuto-check passedDevelopment

Install Dry Code Review

skills CLI
$ npx skills add espennilsen/pi --skill dry-code-review -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install espennilsen/pi dry-code-review --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/espennilsen/pi.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/dry-code-review/dry-code-review .claude/skills/dry-code-review && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
dry-code-review
GitHub stars
122
Token cost
~1.7k tokens
SKILL.md length
554 words
Files
2 (incl. scripts)
Skills in repo
36
Repo updated
First seen
Licence
MIT

At a glance

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

  • Works in 5 steps: Setup & Discovery → Automated Scanning → Manual Analysis → …
  • The user asks to review code for duplication
  • SKILL.md covers Overview, Workflow, Plan File Template and Important Guidelines
  • Runs Shell scripts from its folder; calls bash

What it does

Dry Code Review is an agent skill from espennilsen/pi. 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"…

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including scripts (for example `scripts/find_duplicates.sh`).

It sits in Development, covering Code review, Project scaffolding and Code quality. The licence is MIT.

When your agent uses it

  • The user asks to review code for duplication
  • Reduce repetition
  • Apply DRY principles
  • Refactor for reusability

Example prompts

  • “clean up my code”
  • “find repeated patterns”
  • “too much boilerplate”
  • “/dry-code-review”

Requirements

  • A Bash shell

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Setup & Discovery
  2. Automated Scanning
  3. Manual Analysis
  4. Findings & Recommendations
  5. Summary & Prioritization

What it can do on your machine

Read from SKILL.md and the folder at commit 79d019b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • bash

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Dry Code Review loads about 1.7k tokens when it runs. Until then it costs about 158 tokens; SKILL.md has 554 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~158
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from espennilsen/pi at commit 79d019b, republished under its MIT licence (© espennilsen). 554 words, ~1,728 tokens.

Download SKILL.mdSave it as .claude/skills/dry-code-review/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
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.

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
Show full SKILL.md (205 more words)Show less
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>

## Findings

### Summary
| Category               | 🔴 High | 🟡 Medium | 🟢 Low | Total |
|------------------------|---------|----------|--------|-------|
| Literal Duplication    |         |          |        |       |
| Structural Duplication |         |          |        |       |
| Logical Duplication    |         |          |        |       |
| Cross-Cutting          |         |          |        |       |
| **Total**              |         |          |        |       |

### Detailed Findings

#### DRY-001: <Title>
- **Category**: <category>
- **Severity**: 🔴/🟡/🟢
- **Locations**:
  - `path/to/file1.ts:L10-L25`
  - `path/to/file2.ts:L30-L45`
- **Description**: <what is duplicated>
- **Recommendation**: <how to fix>
- **Effort**: S/M/L

<!-- Repeat for each finding -->

## Prioritized Action Plan

### Quick Wins (Small effort, immediate value)
1. <action item>

### High-Impact Refactors (Medium/Large effort)
1. <action item>

### Nice-to-Have (Low priority)
1. <action item>

## Risk Notes
- <things to watch out for when refactoring>

## Review Log
- YYYY-MM-DD: Review initiated
- YYYY-MM-DD: <phase completed>

Important Guidelines

  • Don't over-DRY: Not all repetition is bad. Flag but note when duplication is acceptable (e.g., test readability, intentional denormalization, simple 2-line patterns)
  • Respect boundaries: Code that looks similar but serves different domains may rightfully be separate (bounded contexts)
  • Consider churn: Frequently modified code benefits more from DRY than stable code
  • Preserve clarity: A refactoring that makes code harder to read is not an improvement
  • Track progress: Update the plan file checkboxes as each phase completes
  • Be specific: Always include file paths and line numbers, never vague references

© espennilsen, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (scripts) in skills/dry-code-review/dry-code-review of espennilsen/pi.

  • SKILL.md
  • scripts/find_duplicates.sh

Open the folder on GitHubat commit 79d019b

Compare with similar skills

Dry Code Review next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Dry Code Review compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Dry Code Review this skillespennilsen/pi122—~1.7kAutomated safety check: PassMIT
Dignified Python Standardsdocling-project/docling69k—~1.5kAutomated safety check: PassApache-2.0
Clean Code GuardamElnagdy/guard-skills1.3k2 repos~4.3kAutomated safety check: PassMIT
Maintainable Code for iPolloWorkDevin-AXIS/iPolloWork6.8k—~2.7kAutomated safety check: PassCustom licence
Cyclomatic Complexitysaurabhkumar8112/cyclomatic-complexity-skill405—~761Automated safety check: PassApache-2.0
Code ReviewerYikai-Liao/symusic1891 repos~1.3kAutomated safety check: PassMIT

Similar skills

  • Dignified Python Standards

    docling-project/docling

    Applies opinionated production Python conventions chosen by the project's Python version: modern type syntax, pathlib, explicit checks and interface guidance.

    69k GitHub stars~1.5k tokensUpdated today
    DevelopmentAuto-check passed
  • Clean Code Guard

    amElnagdy/guard-skills

    Reviews generated or changed production code against Clean Code, SOLID, DRY, KISS, YAGNI and LLM-specific failure modes before it ships, in any language.

    1.3k GitHub starsUsed in 2 repos~4.3k tokens
    DevelopmentAuto-check passed
  • A code-change gate for the iPolloWork repository: search and reuse first, keep one source of truth, justify every new file or dependency, and audit the change.

    6.8k GitHub stars~2.7k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Cyclomatic Complexity

    saurabhkumar8112/cyclomatic-complexity-skill

    Refactor code to reduce cyclomatic complexity so it stays readable, maintainable, and aligned with the long-term vision of the codebase, not just optimized for AI comprehension.

    405 GitHub stars~761 tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Code Reviewer

    Yikai-Liao/symusic

    Analyzes code diffs and files to identify bugs, security vulnerabilities (SQL injection, XSS, insecure deserialization), code smells, N+1 queries, naming issues, and architectural concerns, then…

    189 GitHub starsUsed in 1 repo~1.3k tokens
    DevelopmentAuto-check passed
  • QML Coding Best Practices

    x-tools-author/x-tools

    Applies QML best practices when writing, reviewing, refactoring or debugging QML code, with Qt 5 and Qt 6 import rules and concise, rule-silent output.

    1.1k GitHub starsUsed in 1 repo~3.4k tokens
    DevelopmentAuto-check passed

More from espennilsen/pi

All 36 skills in this repo
  • GitHub

    espennilsen/pi

    Interact with GitHub repos, PRs, issues, CI, and notifications via the pi-github extension commands and gh CLI.

    122 GitHub stars~1k tokensUpdated 17 days ago
    Auto-check passed
  • Skill Creator

    espennilsen/pi

    Create, review, and improve skills for Pi agents. An agent skill from espennilsen/pi.

    122 GitHub stars~2.1k tokensUpdated 17 days ago
    Auto-check passed
  • Extract Design System

    espennilsen/pi

    Reverse-engineer a design system from a live website (public URL or localhost).

    122 GitHub stars~2k tokensUpdated 17 days ago
    Auto-check passed
  • PDF Reader

    espennilsen/pi

    Read and extract content from PDF files — text, tables, metadata, and images.

    122 GitHub stars~1.6k tokensUpdated 17 days ago
    Auto-check passed
  • Google Workspace

    espennilsen/pi

    Manage Google Workspace via the gws CLI — Drive, Gmail, Sheets, Docs, Slides, People, Chat, Meet, Forms, and cross-service workflows.

    122 GitHub stars~3.4k tokensUpdated 17 days ago
    Auto-check passed
  • Herdr Operations

    espennilsen/pi

    A skill your agent uses when inspecting or operating Herdr sessions, workspaces, tabs, panes, agents, terminal output, agent messaging, or waits.

    122 GitHub stars~525 tokensUpdated 17 days ago
    Auto-check passed

Categories

Questions about Dry Code Review

What does Dry Code Review do?

Perform a comprehensive DRY (Don't Repeat Yourself) code review on a codebase. Dry Code Review is an agent skill from espennilsen/pi. Perform a comprehensive DRY (Don't Repeat Yourself) code review on a codebase.

When should I use Dry Code Review?

Dry Code Review fits situations like: the user asks to review code for duplication; reduce repetition; apply DRY principles; refactor for reusability.

How do I install Dry Code Review in Claude Code?

Run `npx skills add espennilsen/pi --skill dry-code-review -a claude-code`. Or copy the skill folder (skills/dry-code-review/dry-code-review in espennilsen/pi) into .claude/skills/dry-code-review in your project. Claude Code loads it when a task matches its description.

How do I install Dry Code Review in Codex?

Run `npx skills add espennilsen/pi --skill dry-code-review -a codex`. Or copy the skill folder (skills/dry-code-review/dry-code-review in espennilsen/pi) into .agents/skills/dry-code-review in your project. Codex loads it when a task matches its description.

Can I use Dry Code Review in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add espennilsen/pi --skill dry-code-review -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/dry-code-review, .gemini/skills/dry-code-review, .github/skills/dry-code-review and .opencode/skills/dry-code-review in your project.

What does Dry Code Review need to run?

Going by SKILL.md and its folder, Dry Code Review needs a shell for the scripts in its folder and the command-line tools its instructions call (bash). Our summary lists: A Bash shell.

Does Dry Code Review access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Dry Code Review safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Dry Code Review use?

Dry Code Review is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Dry Code Review use?

About 1.7k tokens (SKILL.md is roughly 6.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Dry Code Review?

Skills that share tags, products or a category with Dry Code Review: Dignified Python Standards (docling-project/docling, 69k stars), Clean Code Guard (amElnagdy/guard-skills, 1.3k stars), Maintainable Code for iPolloWork (Devin-AXIS/iPolloWork, 6.8k stars) and Cyclomatic Complexity (saurabhkumar8112/cyclomatic-complexity-skill, 405 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Dry Code Review?

espennilsen (a GitHub user) maintains it in espennilsen/pi, which has 122 GitHub stars. The repository holds 36 skills in this directory. The repository was last updated on September 21, 2026.

Source: espennilsen/pi on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.