type-safe-contracts
Build provider-neutral typed AI contracts with JSON Schema validation, adapters for native or generic LMs, bounded repair, and explicit failure handling.
от Andersonlimahw★ 19 звёзд на GitHub
Установить type-safe-contracts в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Об этом скилле
Type-Safe Contracts
Boundary
Define one provider-neutral DecisionSpec; implement adapters. Internal schemas are not provider wire schemas: adapters enforce current criteria shape, cardinality, context, and media limits.
native: provider returns typed probabilities directly.structured-output: LM uses JSON Schema/tool calling.prompt-parse: last-resort JSON extraction; stricter validation and lower trust.
All adapters normalize into same validated result (references/decision-result.schema.json). Types generated by SDK do not replace runtime validation. After schema validation, run equivalent of scripts/validate_result.py: answer IDs/types match questions, selected Choice exists, probability keys match criteria, distributions sum to 1 within documented tolerance, and Score range matches levels.
Pipeline
flowchart LR
A[Application] --> S[DecisionSpec]
S --> D{Adapter}
D --> N[Native decision model]
D --> L[Structured-output LM]
D --> P[Prompt/parse fallback]
N --> V[Runtime validator]
L --> V
P --> V
V --> C[Pure policy/composer]
C --> X[Action]
C --> F[Fallback/review]
D -. usage .-> U[Usage ledger]
V -. retries/failures .-> U
C -. route .-> U
Failure policy
- Reject unknown question/result types and missing options.
- Ensure probability values are finite and within
[0,1]; validate distribution sum with documented tolerance. - Allow at most one schema-repair retry unless evidence justifies more.
- On invalid/low-confidence output, use declared safe fallback. Never silently coerce.
- Pin provider model/version after calibration; aliases can move.
- Hash cache by model/version, canonical state, question semantics, and schema version. Do not include policy weights when raw answers remain reusable.
Preserve raw response for audit after redaction. Never log API keys, secrets, or sensitive state.
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл type-safe-contracts?
Build provider-neutral typed AI contracts with JSON Schema validation, adapters for native or generic LMs, bounded repair, and explicit failure handling.
Как установить скилл type-safe-contracts?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл type-safe-contracts запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
AnthropicToolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
access
AnthropicManage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
configure
AnthropicSet up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
access
AnthropicManage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…