Command Palette

Search for a command to run...

Назад к скиллам
скилл № 25992

contract-value-object-review

Use when reviewing bounded schema/value-object diffs.

БесплатноБез исполняемых скриптов
Dadmin88от Dadmin88★ 52 звезды на GitHub

Установить contract-value-object-review в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Contract and Value-Object Review

Use when

Use for bounded read-only reviews of schema/value-object changes: frozen dataclasses, DTOs, recipe/config documents, parser contracts, canonical JSON identities, hashes, revisions, and other runtime-neutral domain values. This is a class-level review skill, not a feature-specific checklist.

Review boundary

  1. Resolve the exact worktree and base revision before inspecting code.
  2. Confirm the diff scope and status, including untracked files when relevant.
  3. Read changed implementation and direct tests; inspect nearby consumers only to verify runtime neutrality and public-constructor reachability.
  4. Do not edit files or run broad tests when the task is explicitly bounded/read-only. Use only focused tests or small direct probes authorized by the task.
  5. Return either NO BLOCKER or blocker path/line plus the smallest viable fix. Separate non-blocking test gaps from release blockers.

Constructor parity and error boundaries

Treat every public constructor as part of the contract, not just from_dict, from_json, or deserialization helpers.

  • Enumerate direct constructors, classmethods, and public normalization entry points.
  • Parser and direct-constructor validation must accept and reject the same semantic values.
  • Invalid inputs must consistently raise the domain-specific error. Look for leaked TypeError, UnicodeError, RecursionError, KeyError, AttributeError, and OverflowError paths.
  • Type guards should run before regex matching, .encode(), iteration, mapping access, or serialization.
  • Do not rely on dataclass annotations as runtime validation.
  • If a nested object has its own constructor contract, require the exact intended type or a clearly specified protocol rather than a lookalike that bypasses validation.

Deep immutability

A frozen outer dataclass is not enough. Trace every nested field reachable from public constructors.

  • Copy caller-owned mutable lists into tuples.
  • Copy nested lists recursively into tuples.
  • Copy mappings into read-only mappings and recursively normalize values.
  • Validate before or during normalization so invalid mutable inputs cannot pass through coercion.
  • Do not coerce arbitrary iterables unless iterable semantics are explicit. Strings and mappings may be accidentally accepted; sets and other unordered iterables can make canonical ordering and hashes nondeterministic.
  • Mutate original inputs after construction and verify the value and identity remain unchanged.

Capability-bearing value objects and side-effect boundaries

A frozen or redacted dataclass is not automatically a safe capability. Treat every direct constructor, dataclasses.replace, and low-level mutation path as reachable when the value controls filesystem or other irreversible side effects.

  1. Put ordinary invariant checks in __post_init__, but also revalidate at the side-effect boundary. A caller can manufacture a frozen instance with object.__setattr__ or dataclasses.replace; use-site checks must not trust that construction previously ran correctly.
  2. Require exact domain types for capability-bearing values and reject arbitrary lookalike objects before attribute access. Validate every field that affects authority: source path type and root constraints, bounded destination filename grammar, identity snapshot fields, owner UID, size, and provider-neutral reference identity.
  3. Derive the destination only from a fixed execution-owned root plus one freshly validated plain filename. Check that the resulting path remains directly under the root, create it with exclusive/no-follow flags, and make cleanup prove that no execution copy remains outside the owned slot.
  4. Filesystem TOCTOU checks must repeat the complete source invariant at every relevant phase, not only device/inode/size identity. Recheck regular-file type, same UID, exact 0600 mode, single hard link, and size bound both before copying and after the read; reject and remove the destination copy on any mismatch. Open with O_NOFOLLOW and read through the source FD so the canonical source is never modified.
  5. Add adversarial probes for forged exact instances, traversal-like destination names, symlink sources/targets, mode or link-count changes between checks, arbitrary objects with explosive hooks, plaintext repr/logging/durable-state paths, and cleanup after partial-copy failure. A normal valid capability control must still copy and then clean up successfully.

Controlled Unicode and canonical UTF-8

Find every .encode("utf-8"), json.dumps(..., ensure_ascii=False), and canonicalization boundary. Lone surrogates and malformed Unicode must produce the public domain error, not leaked UnicodeEncodeError. Apply the same policy to ordinary text, extension values, extension keys, repository/identifier fields, and nested values reaching canonicalization. Preserve exception causes only as implementation detail.

Revision and digest parity

Compare pa

Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/bounded-contract-review.md
  • references/sdk-structured-transport-boundary.md

FAQ

Что делает скилл contract-value-object-review?

Use when reviewing bounded schema/value-object diffs.

Как установить скилл contract-value-object-review?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл contract-value-object-review запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить contract-value-object-review с