Skip to content
cccskills
FreePublished on GitHub

value-objects

Analyze code for primitive obsession and plan value object extractions around domain concepts, validation, and grouped primitive fields. Use when the user says `/value-objects`, asks for value object refactoring, or runs `/refactor:value-objects`.

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md2.1 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Analyze the class provided in $ARGUMENTS for instances of primitive obsession and suggest value object extractions.

Instructions:

  1. Examine the given class for primitive types that represent domain concepts
  2. Identify groups of related primitives that could be encapsulated into value objects
  3. Look for common patterns that indicate primitive obsession:
    • Multiple string/number parameters representing a single concept (e.g., street, city, state, zip for an address)
    • Validation logic scattered throughout the class for primitive values
    • Methods that operate on groups of related primitives
    • Repeated primitive type combinations across methods
    • Business rules applied to primitive values

Patterns to detect:

  • Money/Currency: Variables like price, cost, amount, fee, salary with currency
  • Email: String fields for email addresses lacking validation
  • Phone Numbers: Strings or numbers representing phone data
  • Addresses: Multiple fields like street, city, state, zipCode
  • Date Ranges: Separate startDate/endDate fields
  • Coordinates: Latitude/longitude pairs
  • Percentages: Numeric values representing percentages
  • Identifiers: Strings or numbers used as IDs
  • URLs: String representations of URLs
  • Names: Multiple fields like firstName, lastName, middleName

Output format:

  1. List each identified primitive obsession case
  2. Suggest a value object name and structure
  3. Provide a brief implementation example with:
    • Constructor with validation
    • Relevant methods (equality, toString, etc.)
    • Any domain-specific behavior
  4. Show how to refactor the original class to use the value object
  5. Explain the benefits of each extraction

Focus on improving code expressiveness, encapsulation, and type safety while reducing duplication and scattering of domain logic.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Automates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with web pages, fill forms, take screenshots, test web applications, or extract information from web pages.

The English summary is being prepared. Showing the original description.

SDiamante13/dotfiles10Updated Oct 2, 2026

Rebuilds session context after a clear by reading git history, plans, and beads state. Triggers on 'catch up'.

The English summary is being prepared. Showing the original description.

SDiamante13/dotfiles10Updated Oct 2, 2026

Generate a bullet-point summary of branch changes for a PR description. Triggers on "changelog", "pr summary", "summarize branch", or "/changelog".

The English summary is being prepared. Showing the original description.

SDiamante13/dotfiles10Updated Oct 2, 2026

commit

Free

Commit the current changes with quality checks, status review, staged diff inspection, appropriate tests, and a clear commit message. Use when the user says "commit", "c", asks to make a commit, or wants changes saved in git.

The English summary is being prepared. Showing the original description.

SDiamante13/dotfiles10Updated Oct 2, 2026

Refactor code to remove dead code, useless comments, unused variables, and unused imports. Use when asked to declutter a class, clean up noisy code, remove cruft, or run `/refactor:declutter`.

The English summary is being prepared. Showing the original description.

SDiamante13/dotfiles10Updated Oct 2, 2026

dry

Free

Refactor duplicated code by extracting helpers, shared abstractions, or clearer reusable structure. Use when asked to apply DRY, remove duplication, consolidate repeated logic, or run `/refactor:dry`.

The English summary is being prepared. Showing the original description.

SDiamante13/dotfiles10Updated Oct 2, 2026

See all skills by SDiamante13

Report a problem with this skill