Token导航 LogoToken导航TokenDH.com
前端设计只读github未标认证来源可访问许可证需确认审计通过

value-object值对象

Agent Skill

value-object 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

380

周安装

16

GitHub Stars

公开资料未说明

下载量

133
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:value-object(值对象)
来源仓库:https://github.com/efesto-cloud/skills
仓库路径:skills/value-object
安装命令:
npx skills add https://github.com/efesto-cloud/skills --skill value-object
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/efesto-cloud/skills --skill value-object

简介

value-object 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。

  • 适用于前端设计类任务,可协助值对象建模和设计。
  • 通过 npx skills add 命令从 GitHub 安装,需确认权限范围和维护状态。
  • 使用前建议检查是否会触发联网、命令执行或文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Value Object Skill

Generates or refactors immutable TypeScript value objects — domain primitives that encapsulate validation, normalization, and conversion logic.

Note: This skill focuses on patterns for creating value objects and does not require specific npm packages. However, if you're integrating with @efesto-cloud packages, you may want to install @efesto-cloud/entity for the IEntityMapper interface when creating persistence mappers.

Decision: what to generate

RequestOutput
Single primitive (email, UUID, phone, color…)Interface + scalar wrapper class
Composite (address, money, date range…)Interface + composite class accepting IFoo raw shape
Mentions persistence or transport layerAlso generate mapper/FooMapper.ts
Improving/retrofitting existing codeAdd missing factory + toRaw/toJSON without renaming

File layout

src/
├── value_object/
    ├── IFoo.ts          # Interface / raw shape
    └── impl/
        └── Foo.ts       # Immutable implementation

Use relative imports for internal files.

Core rules — always apply

  • private constructor — creation only via factory
  • public static create(raw): T — validate, normalize, throw new Error("…") on invalid
  • public readonly on every field — no mutation after construction
  • toRaw() — returns the primitive or a plain object; inverse of create()
  • toJSON() / toDto() — returns the interface shape for serialization

See ./references/value-object-templates.md for concrete implementations.

Scalar wrapper

  • Constructor accepts a single primitive (string, number)
  • toRaw() returns that primitive directly
  • Interface has a single named field: {value: string}

Composite value object

  • Constructor accepts the full IFoo shape
  • create(raw: IFoo) validates required fields; normalizes strings with .trim()
  • toRaw() returns a plain object matching IFoo

Mapper (persistence / transport only)

  • Separate class: FooMapper.fromRaw(raw) → Foo, FooMapper.toRaw(foo) → RawType
  • Do not put database or transport concerns inside the value object itself

Validation

  • null / undefined input → throw, do not silently produce a broken object
  • Normalize in the factory (.trim(), .toLowerCase()) before storing
  • Throw new Error("descriptive message") — keep it simple, no custom error classes unless asked

Special cases

CaseKey notes
EmailValidate @ presence; normalize to lowercase; toRaw() returns string
PhoneDecide in factory: strip non-digits or keep formatted
UUIDValidate format with regex; do not generate inside the value object
Password hashStore hash only; no plain-text field; toRaw() must not accidentally expose the hash
Money / Currencyamount as integer cents + currency as ISO string; never use floats
Date rangeValidate start < end; expose computed helpers (duration(), contains(d)) if useful
ColorValidate hex or RGB; normalize to one canonical format
Nullable wrappingAccept null in fromRaw(); return null from toRaw() if value is absent

If improving existing code

  1. Keep existing names (IEmailAddress, EmailAddress, EmailAddressRaw, etc.)
  2. Add missing create() / fromRaw() factory with validation
  3. Make constructor private if it is not already
  4. Add toRaw() / toJSON() if absent
  5. Do not restructure unrelated logic or rename symbols

Output style

  • Modern TypeScript; .ts file extensions in imports
  • export default for the implementation class
  • Keep generated code short and readable — one responsibility per file

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.7%
按下载量换算49

Claude

32.1%
按下载量换算43

Cursor

17.84%
按下载量换算24

Gemini CLI

9.43%
按下载量换算13

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills