clean-codejs-objects

Object and class design patterns following Clean Code JavaScript.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "clean-codejs-objects" with this command: npx skills add damianwrooby/javascript-clean-code-skills/damianwrooby-javascript-clean-code-skills-clean-codejs-objects

Clean Code JavaScript – Object & Class Patterns

Table of Contents

  • Encapsulation
  • Immutability
  • Cohesion

Encapsulation

// ❌ Bad
user.name = 'John';

// ✅ Good
user.rename('John');

Immutability

// ❌ Bad
user.age++;

// ✅ Good
const updatedUser = user.withAge(user.age + 1);

Cohesion

// ❌ Bad
class User {
  calculateTax() {}
}

// ✅ Good
class TaxCalculator {
  calculate(user) {}
}

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

clean-codejs-functions

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

clean-codejs-modules

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

clean-codejs-naming

No summary provided by upstream source.

Repository SourceNeeds Review
clean-codejs-objects | V50.AI