andersonlimahw/lemon-ai-hub/type-safe-contracts

Claude Code and agent skill by andersonlimahw/lemon-ai-hub

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Build provider-neutral typed AI contracts with JSON Schema validation, adapters for native or generic LMs, bounded repair, and explicit failure handling.

Install

npx vskill@latest install andersonlimahw/lemon-ai-hub/type-safe-contracts

SKILL.md

The same SKILL.md was published earlier as andersonlimahw/lemon-ai-hub/type-safe-contracts.

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

mermaid
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

  1. Reject unknown question/result types and missing options.
  2. Ensure probability values are finite and within [0,1]; validate distribution sum with documented tolerance.
  3. Allow at most one schema-repair retry unless evidence justifies more.
  4. On invalid/low-confidence output, use declared safe fallback. Never silently coerce.
  5. Pin provider model/version after calibration; aliases can move.
  6. 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.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
16
Repository forks
3
7-day trend score
19

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/andersonlimahw/lemon-ai-hub/type-safe-contracts/badge)](https://verified-skill.com/skills/andersonlimahw/lemon-ai-hub/type-safe-contracts)

Something wrong with this skill or its page? Tell us.