common-module

Provide type-safe value objects and precondition validation for Kotlin projects.

Updated Jan 11, 2026
One-click install
npx skills add https://github.com/gykk16/spring-skeleton --skill common-module
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: common-module
Source: https://github.com/gykk16/spring-skeleton/tree/main/.omc/skills/common-module
Command: npx skills add https://github.com/gykk16/spring-skeleton --skill common-module

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a standardized set of common utilities, value objects, and exception handling mechanisms to ensure consistency and robustness across the project.

Core Features & Use Cases

  • Type-Safe Value Objects: Use Email, PhoneNumber, Money, and Rate for enhanced data integrity.
  • Robust Exception Handling: Employ KnownException, BizRuntimeException, and BizException for clear error management.
  • Precondition Validation: Utilize knownRequired* functions for concise and safe input validation.
  • DateTime Utilities: Leverage DateFormatter, SearchDates, and range classes for efficient date and time operations.
  • String and DateTime Extensions: Benefit from convenient masking, formatting, and comparison functions.
  • Use Case: When creating a new user entity, ensure the email address is validated using the Email value object and that required fields are checked using knownRequiredNotBlank.

Quick Start

Use the common-module skill to create a new Money object representing 10000 Korean Won.

Frequently Asked Questions about common-module

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I validate type-safe value objects like Email and PhoneNumber in Kotlin?

Type-safe value objects like Email and PhoneNumber are validated by instantiating them directly. This approach encapsulates validation logic within the objects to ensure data integrity and prevent invalid states in Kotlin projects.

What is the best way to handle exceptions and precondition validation in Kotlin?

Exception handling and precondition validation are managed using KnownException, BizRuntimeException, and knownRequired* functions. These mechanisms provide clear error management and concise input validation to maintain robust code quality.

How do I standardize date and time operations for search ranges in Kotlin?

Date and time operations are standardized using DateFormatter and SearchDates range classes. These utilities facilitate efficient date formatting and range comparisons for consistent datetime processing across applications.

Can I use Kotlin extensions for string masking and formatting?

Yes, string masking and formatting are supported through built-in Kotlin extensions. These extensions provide convenient functions to manipulate and mask string data securely without writing repetitive boilerplate code.

When do I need precondition validation functions for required fields?

Precondition validation functions like knownRequiredNotBlank are needed when creating entities or processing inputs. They ensure required fields are checked concisely and safely before execution, preventing invalid data processing.