dry-code-reviewer

Detect deeply nested loops with duplicated logic in JavaScript/TypeScript code.

7|Updated Dec 5, 2023
One-click install
npx skills add https://github.com/mParticle/aquarium --skill dry-code-reviewer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dry-code-reviewer
Source: https://github.com/mParticle/aquarium/tree/main/.claude/skills/dry-code-reviewer
Command: npx skills add https://github.com/mParticle/aquarium --skill dry-code-reviewer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Detects deeply nested loops with duplicated inline logic and recommends extracting into small, named functions. Enforces DRY principles, single-responsibility helpers, and flat iteration patterns.

Core Features & Use Cases

  • Detects multi-level looping structures and inline duplication.
  • Recommends extracting named helpers to improve readability and maintainability.
  • Provides guidance during code reviews to surface refactor opportunities in loop-heavy code.

Quick Start

Run a code-review pass on a target repository to surface nested loops and generate refactor recommendations.

Frequently Asked Questions about dry-code-reviewer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor deeply nested loops in JavaScript to enforce DRY principles?

To refactor deeply nested loops in JavaScript for DRY principles, you extract duplicated inline logic into small, named helper functions. This flattens iteration patterns and improves readability while preserving original behavior during code reviews.

What is the best way to detect duplicated inline logic in deeply nested loops?

The best way to detect duplicated inline logic in deeply nested loops is to run an automated code-review pass that identifies multi-level nesting structures and flags duplicated blocks for extraction into single-responsibility helpers.

Can I use automated code review to surface refactor opportunities in TypeScript codebases?

Yes, you can use automated code review to surface refactor opportunities in TypeScript codebases. It detects multi-level looping structures and recommends extracting named helpers to improve maintainability and enforce DRY principles.

How do I improve readability in loop-heavy JavaScript codebases without changing behavior?

To improve readability in loop-heavy JavaScript codebases without changing behavior, extract inline logic into descriptive named helper functions. This promotes flat iteration patterns and single-responsibility design while preserving the original execution flow.

When should I not use helper function extraction for nested loops?

You should not use helper function extraction for nested loops when the inline logic is entirely unique to a single iteration context and lacks duplication. Extracting non-repeated logic adds unnecessary indirection without improving maintainability or enforcing DRY principles.