agentsclimarketplace

Object oriented programming paradigm

Skill cookieMonsterDev/agents-skills/architecture-skills/object-oriented-programming-paradigm

Agent Skills for coding agents

Install
npx -y skills add cookieMonsterDev/agents-skills --skill object-oriented-programming-paradigm

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 5 stars5 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Explains and applies the object-oriented programming paradigm — classes, the four pillars (encapsulation, abstraction, inheritance, polymorphism), object relationships, SOLID, and design qualities — with idiomatic code examples in Python, C++, Java, C#, JavaScript, PHP, and Swift. Use when users ask about OOP concepts or SOLID principles, when they need help modeling a domain with classes and interfaces, when reviewing or refactoring class hierarchies, or when they want an OOP concept example in a specific language.

SKILL.md

8.6 KB, as published. Nobody here has run it

Object-Oriented Programming Paradigm

Ground OOP answers in the reference files bundled with this skill instead of improvising definitions. Each concept has a reference file explaining it and a folder of runnable examples in popular languages.

When to Use

  • The user names a concept directly ("show me encapsulation in Swift", "what is the Liskov substitution principle?")
  • The user describes a design problem that maps to a concept ("my subclass breaks when passed to code written for the base class")
  • The user asks to compare concepts ("composition vs inheritance?", "coupling vs cohesion?")
  • The user wants existing code reviewed or refactored against OOP principles (god classes, deep hierarchies, leaky abstractions, train-wreck call chains)

Workflow

  1. Identify the concept(s) from the user's question using the catalog below.
  2. Read the reference file at references/<concept>.md for the explanation, applicability, trade-offs, and related concepts.
  3. Read the language example at examples/<concept>/<concept>.<ext> when the user works in (or asks for) a specific language. Adapt it to their domain rather than pasting the generic example verbatim.
  4. Answer with: what the concept means, when it applies (and when it doesn't), and code adapted to the user's context.

If the user's problem does not call for object orientation, say so — plain functions and data structures are often simpler than a class model.

Concept Catalog

Building Blocks

The vocabulary of object-oriented code: what classes, objects, and contracts are.

ConceptIntentReference
Classes & ObjectsBundle state and behavior into a blueprint; instantiate independent objects from itreferences/classes-and-objects.md
Interfaces & Abstract ClassesSeparate a contract from its implementations; share partial implementation safelyreferences/interfaces-and-abstract-classes.md

The Four Pillars

The defining properties of the paradigm.

ConceptIntentReference
EncapsulationHide internal state behind a controlled interface that preserves invariantsreferences/encapsulation.md
AbstractionExpose a component's essential model while hiding operational detailreferences/abstraction.md
InheritanceDerive specialized classes from a base, reusing and extending its behaviorreferences/inheritance.md
PolymorphismLet one call site work across many concrete types (subtype, parametric, ad hoc)references/polymorphism.md

Object Relationships

How objects reference, own, and assemble each other.

ConceptIntentReference
Object RelationshipsDistinguish association, aggregation, and composition by ownership and lifetimereferences/object-relationships.md
Composition over InheritanceBuild behavior by assembling parts instead of extending deep hierarchiesreferences/composition-over-inheritance.md

SOLID Principles

Five principles for class design that keep change local.

PrincipleIntentReference
Single ResponsibilityGive each class one reason to changereferences/single-responsibility.md
Open/ClosedMake code open for extension without modifying what already worksreferences/open-closed.md
Liskov SubstitutionEnsure subtypes are usable anywhere their base type is expectedreferences/liskov-substitution.md
Interface SegregationPrefer many small client-specific interfaces over one fat interfacereferences/interface-segregation.md
Dependency InversionMake high-level policy depend on abstractions, not concrete implementationsreferences/dependency-inversion.md

Design Qualities

Cross-cutting qualities used to judge an object-oriented design.

ConceptIntentReference
Coupling & CohesionMinimize dependence between modules and maximize relatedness within themreferences/coupling-and-cohesion.md
Law of DemeterTalk only to immediate collaborators instead of reaching through object graphsreferences/law-of-demeter.md

Examples

Each concept has a folder examples/<concept>/ with self-contained, runnable examples named <concept>.<ext>:

LanguageFileNotes
Python<concept>.py
C++<concept>.cpp
Java<concept>.java
C#<concept>.cs
JavaScript<concept>.js
PHP<concept>.php
Swift<concept>.swift

Examples are limited to languages with first-class classes (or class-like syntax). Languages without classes — C, Go, Rust — are omitted; their reference files still note how each concept maps idiomatically when a user asks.

A language file may be absent when a concept does not translate meaningfully to that language; the concept's reference file notes such gaps (e.g. Swift structs and protocols as an alternative to deep class inheritance).

Answering Guidelines

  • Prefer the language's idiomatic form over a textbook Java-style class diagram (e.g. protocols and duck typing in Python, structs and protocols in Swift, closures where a one-method class would be ceremony).
  • Mention trade-offs and simpler alternatives, not just the mechanics — not every problem needs a class.
  • When comparing concepts, read both reference files and contrast intent, not structure.
  • Do not present deep inheritance hierarchies as the default way to reuse code; prefer composition and interfaces unless true subtype specialization exists.
  • When reviewing code, name the violated principle and show the minimal refactor, not a full rewrite.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.