code-quality-rules

Detect code duplication and poor decomposition in codebases.

3|Updated Feb 24, 2026
One-click install
npx skills add https://github.com/Doumajnik/template --skill code-quality-rules-doumajnik
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: code-quality-rules
Source: https://github.com/Doumajnik/template/tree/main/.github/skills/code-quality-rules
Command: npx skills add https://github.com/Doumajnik/template --skill code-quality-rules-doumajnik

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill solves the common pain point of inconsistent code quality, unnecessary duplication, and poor structural design that makes codebases hard to maintain, debug, and extend over time.

Core Features & Use Cases

  • Anti-Duplication Guidelines: Enforce DRY principles, eliminate redundant code, and prevent duplicated logic, parallel inheritance hierarchies, and shotgun surgery across modules.
  • Decomposition Best Practices: Break down large files, classes, and functions into single-responsibility components aligned with SOLID principles and domain-driven design boundaries.
  • Extraction Patterns: Identify and extract magic numbers, repeated logic, shared utilities, and configuration values into centralized, reusable locations.
  • Use Case: For example, when reviewing a pull request with duplicated validation logic across 3 API endpoints, use this Skill to identify the duplication, extract the shared validator into a central module, and split the large endpoint handler into smaller, focused functions.

Quick Start

Use the code-quality-rules skill to review the recent changes in the src/api/ directory for duplication, poor decomposition, and missing extractions, then provide a prioritized list of refactoring actions.

Frequently Asked Questions about code-quality-rules

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

FAQPage Schema
How do I eliminate code duplication across multiple API endpoints during a code review?

To eliminate code duplication during a code review, enforce DRY principles by identifying repeated validation logic across endpoints and extracting the shared validators into a central, reusable module. This process targets redundant logic and parallel inheritance hierarchies to improve maintainability.

What is the best way to decompose large files and classes for better maintainability?

The best way to decompose large files and classes is to break them down into single-responsibility components aligned with SOLID principles and domain-driven design boundaries. This structural decomposition prevents shotgun surgery across modules and makes codebases easier to debug and extend.

How do I extract magic numbers and configuration values from my source code?

To extract magic numbers and configuration values, identify hardcoded values scattered throughout the codebase and move them into centralized, reusable locations. Standardized extraction patterns for constants, shared utilities, and configuration values ensure consistent code quality.

Can I apply these code refactoring rules to general-purpose programming languages?

Yes, you can apply these code refactoring rules to general-purpose programming languages. The rules enforce DRY principles, SOLID-aligned single-responsibility decomposition, and standardized extraction patterns without relying on language-specific dependencies.

Why does poor structural decomposition make codebases hard to maintain over time?

Poor structural decomposition makes codebases hard to maintain because it leads to inconsistent code quality, unnecessary duplication, and scattered logic. This structural design decay forces shotgun surgery across modules whenever features are added or modified.