clean-code-ch06-objects-and-data-structures

Detect data abstraction, Law of Demeter, and hybrid violations in codebases.

4|Updated Mar 28, 2026
One-click install
npx skills add https://github.com/hatlesswizard/clean-code-skills --skill clean-code-ch06-objects-and-data-structures
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-code-ch06-objects-and-data-structures
Source: https://github.com/hatlesswizard/clean-code-skills/tree/main/ch06-objects-and-data-structures
Command: npx skills add https://github.com/hatlesswizard/clean-code-skills --skill clean-code-ch06-objects-and-data-structures

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps ensure code adheres to the object-data boundary concepts from Clean Code Chapter 6, preventing data structures from leaking internal state and promoting proper object design.

Core Features & Use Cases

  • Detects data abstraction violations by flagging getters/setters that expose internal fields and check for overexposed data
  • Identifies Data/Object Anti-Symmetry and Law of Demeter violations, including train wrecks and deep navigation
  • Flags hybrids, DTOs with business logic, and Active Record misuse
  • Useful for code reviews and refactoring planning across OO projects, especially when evaluating classes that mix behavior and data

Quick Start

Run the analysis against your codebase to surface violations of data abstraction, train wrecks, and hybrids in object-oriented designs.

Frequently Asked Questions about clean-code-ch06-objects-and-data-structures

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

FAQPage Schema
How do I detect Law of Demeter violations and train wrecks in my codebase?

To find Law of Demeter violations, this Skill analyzes your codebase to flag train wrecks and deep navigation chains where objects call methods beyond their allowed direct references. It surfaces these risk areas to guide targeted refactoring.

What is the difference between an object and a data structure in clean code?

The object and data structure distinction centers on data abstraction: objects hide internal state behind behavior, while data structures expose data. This Skill identifies object/data anti-symmetry by flagging classes that improperly mix both patterns.

How do I identify hybrid classes and Active Record misuse during a code review?

To identify hybrid classes and Active Record misuse during code review, this Skill flags Data Transfer Objects containing business logic and classes mixing procedural data exposure with object behavior. It then recommends architectural adjustments to resolve these anti-patterns.

How do I check for data abstraction violations like exposed getters and setters?

To check for data abstraction violations, this Skill scans object-oriented code for getters and setters exposing internal fields and evaluates classes for overexposed data. It enforces clean object-data boundaries by highlighting these structural leaks.

Can I automate refactoring guidance for DTOs with business logic in OO projects?

Yes, you can automate refactoring guidance for DTOs with business logic in OO projects by running this Skill. It targets Data Transfer Objects containing business logic and generates recommendations for architectural adjustments to properly separate data from behavior.