本文へ移動
cccskills
無料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`.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md2.1 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

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.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

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.

日本語の概要は準備中です。原文の説明を表示しています。

SDiamante13/dotfiles82026年10月2日 更新

catchup

無料

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

日本語の概要は準備中です。原文の説明を表示しています。

SDiamante13/dotfiles82026年10月2日 更新

changelog

無料

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

日本語の概要は準備中です。原文の説明を表示しています。

SDiamante13/dotfiles82026年10月2日 更新

commit

無料

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.

日本語の概要は準備中です。原文の説明を表示しています。

SDiamante13/dotfiles82026年10月2日 更新

declutter

無料

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`.

日本語の概要は準備中です。原文の説明を表示しています。

SDiamante13/dotfiles82026年10月2日 更新

dry

無料

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`.

日本語の概要は準備中です。原文の説明を表示しています。

SDiamante13/dotfiles82026年10月2日 更新

SDiamante13 のスキルをすべて見る

このスキルの問題を報告する