code-quality-principles

Reviews code against SOLID, DRY, YAGNI, KISS, and DDD layering principles.

Updated Aug 22, 2026
One-click install
npx skills add https://github.com/balajirags/aifsd-kit --skill code-quality-principles-balajirags
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: code-quality-principles
Source: https://github.com/balajirags/aifsd-kit/tree/main/docs/skills/code-quality-principles
Command: npx skills add https://github.com/balajirags/aifsd-kit --skill code-quality-principles-balajirags

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code that passes a blocking P1/P2 review gate can still accumulate design debt: bloated methods, duplicated logic, premature abstractions, N+1 queries, and controllers bypassing service layers. This Skill provides a consistent checklist of design principles and anti-patterns so reviewers catch structural quality issues that a correctness-focused gate misses. ## Core Features & Use Cases - Design principle checks: Nine concrete rules covering Single Responsibility, DRY, YAGNI, KISS, Dependency Inversion, DDD entity/validator separation, service-layer enforcement, N+1 query detection, and streaming of large payloads. - Anti-pattern catalog: Named smells to flag, such as 30+ line multi-responsibility methods, magic numbers, speculative abstractions with one implementation, and lazy-load loops in JPA. - Non-blocking report format: A Markdown output template for reporting quality findings separately from the blocking P1/P2 review verdict. - Use Case: During a pull request review of a Spring service, use this Skill to spot that OrderService validates, persists, and formats in one method and that findAllById plus per-item lazy loading triggers N+1 queries, then report both as non-blocking quality notes. ## Quick Start Review the attached diff against the code quality principles and report any SOLID, DRY, or N+1 violations as non-blocking notes.

Frequently Asked Questions about code-quality-principles

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

FAQPage Schema
How do I review code for SOLID principle violations?▼

Check each class and function for a single reason to change, verify dependencies point at abstractions rather than concrete types, and flag methods doing multiple distinct jobs. This Skill lists nine concrete rules plus anti-patterns to apply during review.

How to detect N+1 queries in JPA code review?▼

Look for loops over a JPA collection where each iteration triggers a lazy-loaded fetch, such as findAllById followed by per-item getItems calls. Check the generated SQL, not just the Java code, and fix with a fetch join or batch query.

What is the difference between entity validation and request validation in DDD?▼

Business rules determining what an entity can do belong as methods on the entity itself, while input and format checks determining whether a request should proceed belong in a separate validator. Blending both into one validation pass is an anti-pattern.

When should duplicated code be extracted under DRY?▼

Extract duplicated validation, error handling, or business logic once it appears a second time with the same intent. The rule targets real duplication of intent, not superficially similar code, and discourages leaving copy-pasted logic in place.

Are code quality findings blocking in this review process?▼

No. These quality findings are reported separately from the P1/P2 blocking review gate using a dedicated Markdown format labeled as non-blocking notes. They flag design debt without preventing an otherwise correct change from merging.