Skip to content
Back to skills

Oop Design Review

ASecurity

Review object responsibilities, cohesion, encapsulation, and collaboration using SOLID and GRASP. Use for object-oriented design review, not implementation scaffolding.

  • 2 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 19, 2026
ai-agentskotlinrefactoringapi

Works with

  • api

Security analysis

A100/100

Pro scans all 9 files and shows the line behind each finding

Scanned November 19, 2026

npx -y skills add ch4570/vulpora --skill oop-design-review --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Oop Design Review?

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

Security grade badge for Oop Design Review
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ch4570-oop-design-review/badge)](https://www.skillsdirectory.com/skills/ch4570-oop-design-review)

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: oop-design-review
description: Review object responsibilities, cohesion, encapsulation, and collaboration using SOLID and GRASP. Use for object-oriented design review, not implementation scaffolding.
---

# Object-Oriented Design Review (OOP Design Review)

A skill that diagnoses and improves design smells using the **roles, responsibilities, and
collaboration** and responsibility-driven design of Cho Young-ho's "Object" and "The Reality and
Misconception of Object Orientation", together with SOLID, GRASP, and the cohesion/coupling
principles.
For grounding facts, see this skill's `reference/kb/` (SOLID, GRASP, cohesion/coupling,
encapsulation/invariants, composition vs. inheritance, the Law of Demeter); for the principles, see
`reference/principles.md`. The index is `reference/kb/INDEX.md` (if you can't find the path, search
with Glob).

## Review order (proceed exactly like this)

1. **Diagnose responsibility placement** — Is the logic piled up in a service far away from the
   data (the entity) (anemic domain)?
2. **Tell, Don't Ask** — Code that calls `getX()` and then decides externally and `setY()`s →
   delegate to the object that holds that data.
3. **Encapsulation** — Is mutable internal state (collections/state) exposed as-is → read-only +
   mutating methods.
4. **Dependency direction** — Does a stable abstraction depend on an unstable concrete (DIP
   violation) → invert via an interface (port).
5. **Persistence leakage** — The domain depends directly on EntityManager/`@Repository`, the entity
   is exposed all the way to the API → separate them.
6. **Report** — Before/After + application steps. Don't break persistence invariants or transaction
   semantics (separate out behavior changes).

## Design smell → prescription

| Smell | Prescription |
|---|---|
| Anemic domain (logic concentrated in the service) | Extract+Move into a domain method (`order.cancel()`) |
| Tell-Don't-Ask violation / message chain | Delegate the message to the collaborator, Hide Delegate |
| Encapsulation violation (mutable exposure) | Read-only exposure + mutate via an intention-revealing method |
| Misplaced responsibility (Feature Envy) | Move Function — to the data holder |
| Concrete dependence (`new Impl()`) | Interface (port) + constructor DI (DIP) |
| Behavior decided by type branching | Use polymorphism (sealed/strategy) — pair with `design-pattern-apply` |

## Rules
- **Decide responsibility by "who is the most natural to bear it"** (behavior first, not data).
- When turning something into an entity method, make the entity uphold the **persistence
  invariants** (identifier/association consistency).
- Changing transaction boundaries or association fetching is a **behavior impact** → separate it
  from pure refactoring and mark it.

## Example (anemic domain → rich domain)
```kotlin
// Before — the service pulls out entity data to decide/assemble (Anemic + Ask)
if (order.getStatus() == OPEN && order.getItems().isNotEmpty()) order.setStatus(CANCELLED)
// After — the entity performs the responsibility with its own invariants (Tell, Don't Ask)
order.cancel()   // validates state/conditions internally
```

Files in this skill

  • SKILL.md3.1 KB
  • reference/kb/INDEX.md3.3 KB
  • reference/kb/cohesion-coupling.md3.7 KB
  • reference/kb/composition-over-inheritance.md3.4 KB
  • reference/kb/encapsulation-invariants.md4.2 KB
  • reference/kb/grasp.md4.3 KB
  • reference/kb/law-of-demeter.md3.1 KB
  • reference/kb/solid.md5.5 KB
  • reference/principles.md5.9 KB

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.

View all in ai-agents →

Comments

Loading comments…

Newsletter

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