用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Dadmin88/hermes-agency --skill contract-value-object-review命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | contract-value-object-review |
| description | Use when reviewing bounded schema/value-object diffs. |
| version | 1.0.0 |
| author | Hermes Agent |
| license | MIT |
| platforms | ["linux","macos","windows"] |
| metadata | {"hermes":{"tags":["code-review","contracts","value-objects","immutability","canonicalization","unicode","validation"],"related_skills":["requesting-code-review","runtime-architecture-auditing","test-driven-development"]}} |
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.
NO BLOCKER or blocker path/line plus the smallest viable fix. Separate non-blocking test gaps from release blockers.Treat every public constructor as part of the contract, not just from_dict, from_json, or deserialization helpers.
TypeError, UnicodeError, RecursionError, KeyError, AttributeError, and OverflowError paths..encode(), iteration, mapping access, or serialization.A frozen outer dataclass is not enough. Trace every nested field reachable from public constructors.
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.
__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.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.repr/logging/durable-state paths, and cleanup after partial-copy failure. A normal valid capability control must still copy and then clean up successfully.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.
Compare parser and constructor paths side by side. A Git object ID supporting SHA-1 and SHA-256 is exactly 40 or 64 lowercase hexadecimal characters: no prefixes, whitespace, uppercase, or other lengths. Enforce identical grammar at from_dict and direct-constructor boundaries. Validate digest strings by exact type, grammar, and length before regex operations or hashing.
Canonical identity must depend only on semantic content. Use deterministic key ordering and compact serialization; exclude floating point or define an explicit cross-runtime representation. Normalize tuple/mapping values into one JSON-compatible form before hashing. Round-trip through canonical serialization, reorder input object keys, and mutate caller inputs after construction; hashes should remain stable. Reject unordered inputs unless deterministic ordering is explicitly part of the contract.
Inspect imports and consumers for runtime neutrality: logical contracts must not select a node/backend/scheduler, include host paths or execution plans, persist runtime state, or trigger side effects merely by construction or canonicalization.
When a public SDK accepts both legacy convenience values and structured message objects, review the conversion boundary as part of the contract—not merely the protobuf wrapper.
Message/Part objects) into the wire message. Assert that text, raw bytes, media type, and metadata survive each path; a text-only compatibility helper must not silently discard structured fields.text/plain text or raw bytes with a non-text media type).str(...), .get(...), iteration, or protobuf assignment. Do not silently stringify invalid text/media values or let protobuf TypeError/AttributeError escape when the SDK promises a domain-level validation error. Defaults must be presence-aware: do not use truthiness fallbacks such as value or b"", value or "text/plain", or value or {} before validation, because explicit falsey values (False, 0, "", []) are malformed inputs, not missing fields.For a compact structured-message adapter checklist and reproduction matrix, see references/sdk-structured-transport-boundary.md.
Use the compact matrix in references/bounded-contract-review.md. Prefer focused tests and direct probes over broad suites. Record actual outputs and limitations; never claim a test ran when setup prevented it.
Report:
path:line — concise violated invariant.NO BLOCKER and list concise validation notes.A frequent blocker is list(value) used to freeze a collection. If the contract requires list/tuple semantics, add an exact type guard, then normalize to a tuple. This prevents accidental strings/mappings/sets, nondeterministic hashes, and leaked errors.
See references/bounded-contract-review.md for reusable probes, failure classifications, and review transcript patterns.
基于 SOC 职业分类