一键导入
python-serialization-boundaries
Design or review Python serialization boundaries as semantic translation gates for API, database, and message payloads.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Design or review Python serialization boundaries as semantic translation gates for API, database, and message payloads.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | python-serialization-boundaries |
| description | Design or review Python serialization boundaries as semantic translation gates for API, database, and message payloads. |
| complexity | medium |
| risk_profile | ["ambiguity_sensitive"] |
| inputs | ["boundary kind (API request/response, database row, queue message, or transport contract)",{"directionality":"inbound, outbound, or PATCH-like partial input"},"fields requiring omitted vs explicit null vs unchanged meaning preservation","primitives needing normalization (UUID, datetime, decimal, enum-like values)","whether nested objects or collections must be converted deeply","whether output contract is intentionally lossy or non-round-trip","whether the schema is local or shared across callers or services"] |
| outputs | ["review-ready rule set or design recommendation for semantic serialization boundaries","defaults for inbound/outbound DTO separation, missing/null handling, type normalization, deep conversion, and local-vs-shared schema ownership","local reference and branching examples for common boundary choices and anti-patterns"] |
| use_when | ["designing or reviewing how API payloads, database rows, or queue messages enter Python code","deciding where raw dict/JSON/row/message shapes should become internal objects, records, or semantic values","PATCH-like updates must distinguish omitted, explicit null, and unchanged intent","deciding whether input and output DTOs should differ or output may be intentionally lossy","deciding whether a boundary schema should stay local or become a shared external contract"] |
| do_not_use_when | ["task is mainly a json.dumps/json.loads tutorial or framework/schema library selection question","task is mainly about choosing dataclass, Enum, ABC, or Protocol; use python-model-selection","task is mainly about exception hierarchy or translation; use python-error-handling","task is mainly about package gateways, imports, or public export policy; use python-module-boundaries","task is mainly about package/distribution layout or scaffold/retrofit execution","task is mainly about broad architecture, dependency direction, ORM/query design, or infrastructure setup"] |
Choose clear semantic translation rules for data crossing API, database, and message-queue boundaries so raw transport shapes stop early and internal logic works with normalized meaning instead of leaked payload structure.
Use this skill when:
dict / JSON / row / message shapes should become
internal objects, records, or semantic valuesnull, and unchanged
intentDo not use this skill when:
json.dumps / json.loads tutorial or framework/schema
library selection questionEnum, ABC, or Protocol;
use python-model-selectionpython-error-handlingpython-module-boundariespython-package-layout, python-project-init-greenfield, or
python-project-retrofitnull vs unchanged meaningdict/list payloads.null, and unchanged intent separately; use a neutral
sentinel-style framing when None is a real business value.str -> UUID, ISO timestamp string -> timezone-aware
datetime, numeric string -> Decimal, or transport code -> internal
symbolic value.None, normalize user_id to UUID and
expires_at to timezone-aware datetime, and emit a response DTO that omits
internal audit fields.dicts through service methods, let None mean
both "field not sent" and "clear the field", keep nested raw lists of dict,
or insist the response must mirror the input shape because both are JSON.This skill defines semantic translation rules at API, database, and message boundaries. It does not cover:
python-type-hints-strictEnum, ABC, or Protocol →
python-model-selectionpython-error-handling__all__, and import policy →
python-module-boundariespython-package-layout, python-project-init-greenfield,
python-project-retrofitBefore proceeding, confirm:
SOFT FAIL — ask and wait before continuing:
null vs unchanged meaning is unclear → ask before recommending PATCH-like sentinel handlingBLOCKED — stop and redirect:
dataclass, Enum, ABC, or Protocol → redirect to python-model-selectionpython-error-handlingreference.md: semantic-gatekeeper framing, hard rules, adjacent-skill
handoff map, and framework notes; also includes verification criteria, red
flags, and common rationalizations to support reviewexamples.md: branching examples for PATCH semantics, asymmetric DTOs, type
normalization, deep conversion, lossy output, and local-vs-shared schema
choicesREVIEW.md: reviewer verdict and checklist results from the agent-skill-reviewer approval passWrapper workflow recipe for parent Codex sessions that need to coordinate Python topic delivery with repo-local planner, implementer, and reviewer agents while preserving shared artifact-contract boundaries.
Shared contract for repo-local Codex workflow artifacts. Use when creating, updating, or reviewing custom agents, wrapper skills, and their validation so paths, minimal schemas, and role boundaries stay consistent.
Implement one source SDK API or safe same-family batch from planner output using request-test-first porting, minimal implementation, response and error contract checks, optional tracker updates, and an explicit final decision.
Plan a source SDK API client port before implementation by collecting source evidence, drafting request contracts, classifying risk and stop flags, and preparing implementer handoff output for one endpoint family or safe same-family batch.
Query step status (pending/done) in plan/<topic>/<topic>.step.md with minimal token cost and explicit blocking when incomplete.
Run the sense_env.py scaffold to discover or assert facts about the repository environment. Use this when you need a structured JSON snapshot of the current environment state, or when you need to evaluate a contract's sensing assertions.