Skip to content
Back to skills

Dry

ASecurity

Refactor duplicated code by extracting helpers, shared abstractions, or clearer reusable structure. Use when asked to apply DRY, remove duplication, consolidate repeated logic, or run `/refactor:dry`.

  • 8 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 9, 2026
code-qualityrefactoringdatabase

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add SDiamante13/dotfiles --skill dry --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Dry?

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

Security grade badge for Dry
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sdiamante13-dry/badge)](https://www.skillsdirectory.com/skills/sdiamante13-dry)

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: dry
description: Refactor duplicated code by extracting helpers, shared abstractions, or clearer reusable structure. Use when asked to apply DRY, remove duplication, consolidate repeated logic, or run `/refactor:dry`.
metadata:
  legacy-name: refactor:dry
---

# DRY Refactor

Ask the user for the file or directory to refactor. Support multiple files if a directory is provided.

## Process

Work through these steps in order, making a separate commit for each extraction:

1. **Extract simple helper methods** (strings, calculations, parsing)
   - Identify duplicated logic
   - Extract to focused method with clear name
   - Remove duplicated code immediately after extraction
   - Commit the extraction

2. **Extract complex methods with parameters**
   - Find similar code blocks with variations
   - Extract with parameters to handle variations
   - Remove duplicated code immediately after extraction
   - Commit the extraction

3. **Apply design patterns when beneficial**
   - Template Method, Strategy, etc. for structural duplication
   - Only when it improves readability/maintainability
   - Avoid over-engineering or premature abstraction
   - Remove duplicated code immediately after extraction
   - Commit the extraction

After EACH extraction:
- Run tests automatically
- If tests fail, revert the change immediately
- If tests pass and using IDE refactoring tool, commit: `. r <description>`
- If tests pass but manual refactoring, commit: `^ r <description>`
- Remove the now-duplicated code in the same commit

## Output

- If no duplication found, report "No duplication found"
- Otherwise provide brief summary at end (e.g., "Extracted 4 methods, removed 3 duplicated blocks")

## Commit Format

Use Arlo's Commit Notation (ACN):
- `. r extract saveToDatabase method` - IDE refactoring or provably safe
- `^ r extract validation logic` - Manual refactoring validated by tests

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.

Comments

Loading comments…

Newsletter

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