contract-value-object-review
Use when reviewing bounded schema/value-object diffs.
от 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
- Resolve the exact worktree and base revision before inspecting code.
- Confirm the diff scope and status, including untracked files when relevant.
- Read changed implementation and direct tests; inspect nearby consumers only to verify runtime neutrality and public-constructor reachability.
- 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.
- Return either
NO BLOCKERor 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, andOverflowErrorpaths. - 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.
- Put ordinary invariant checks in
__post_init__, but also revalidate at the side-effect boundary. A caller can manufacture a frozen instance withobject.__setattr__ordataclasses.replace; use-site checks must not trust that construction previously ran correctly. - 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.
- 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.
- 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
0600mode, single hard link, and size bound both before copying and after the read; reject and remove the destination copy on any mismatch. Open withO_NOFOLLOWand read through the source FD so the canonical source is never modified. - 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
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
- 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), без исполняемых скриптов.
Похожие скиллы
mcp-builder
AnthropicGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
claude-api
AnthropicReference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
algorithmic-art
AnthropicCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
mcp-integration
AnthropicThis skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…