peterfriese/system-one-foundation-models/jev-foundation-models
Claude Code and agent skill by peterfriese/system-one-foundation-models
- community
Checking that the SKILL.md file is still in the repository.
Evaluate TypeSafe Jev System One decision models natively through Apple's Foundation Models framework in Swift 6. Use when building iOS 27+, macOS 27+, or visionOS 27+ apps that evaluate strongly-typed @Generable structs and enums using LanguageModelSession, implementing confidence routing (RoutingPolicy, NoulJudgement, ScoreValue), configuring resilient network retries (RetryPolicy), securing mobile traffic via App Check proxy transports, or writing deterministic offline unit tests with MockJevTransport.
Install
npx vskill@latest install peterfriese/system-one-foundation-models/jev-foundation-modelsSKILL.md
Jev Foundation Models Bridge
[!TIP]Modern Multi-Backend Standard: For projects requiring on-device inference via Core ML (LayaOnDevice) or local self-hosted evaluation (LayaFoundationModels) alongside TypeSafe Jev cloud, refer to the unifiedsystem-one-foundation-modelsskill and package target. This skill remains focused on TypeSafe Jev cloud evaluation, resilience policies, and App Check security proxy architectures.
This skill guides the design, implementation, and testing of applications integrating TypeSafe AI's Jev System One decision model via Apple's Foundation Models framework (FoundationModels) in Swift 6.
1. Core Mental Model: Decisions, Not Chat
Jev is a System One decision model, not a text-generating LLM. It evaluates application state against a set of typed questions in a single forward pass, returning calibrated probabilities and discrete categorical decisions in 40–150ms.
- Prompt $\to$ Application State: The text passed to
session.respond(to:)represents current application context (support tickets, sensor readings, transaction logs, user inputs, or parsed documents). - `@Generable` Type $\to$ Decision Questions: The struct or enum defines the typed questions being asked over that state.
- Dual Signal Output:
- The Answer: What the model judged (
response.contentcontaining typed enum choices, booleans, or rubric scores). - The Calibrated Confidence / Probability: Whether to automate the action (
response.judgement(...),response.decision(...),response.scoreValue(...)).
2. @Generable Schema Modeling Rules
SchemaTranslator maps Apple @Generable types directly to Jev decision primitives. Follow these mapping rules strictly:
| Swift Type & Annotations | Jev Primitive | Question Key Convention | Behavior / Output | |
|---|---|---|---|---|
Bool | `noul` | Field name (e.g. "isUrgent") or "root" | Calibrated probability of truth ($0.0 \dots 1.0$). Decodes to Swift Bool. | |
enum: String | `choice` | Field name (e.g. "department") or "choice" | Discrete categorical selection among defined enum cases. | |
Int or Double + @Guide(.range(min...max)) | `score` | Field name (e.g. "frustrationLevel") or "root" | Ordinal rubric scoring mapped to integer/numeric levels with continuous weighting. | |
@Guide(description: "...") | `instructions` | N/A | Natural language instructions steering Jev's judgment. | |
Nested @Generable struct | `nested questions` | Dot-notation (e.g. "metadata.priority") | Evaluates hierarchical sub-properties concurrently. |
Negative Constraints (Strictly Forbidden)
- ❌ No unconstrained `String` properties: Jev does not generate free-form text. A
Stringproperty without enum choices throwsJevError.invalidSchema. - ❌ No unstructured collections: Arrays of open-ended values (
[String]) or dictionaries are not supported. - ❌ No text generation requests without schemas: Calling
session.respond(to: "Hello")without agenerating:argument throwsJevError.structuredOutputRequired. - ❌ No tool calling:
LanguageModelCapabilitiesfor Jev only includes[.guidedGeneration]. It does not supportToolexecution.
Correct Schema Example
3. Canonical Call-Site, Telemetry & Confidence Routing
Always use standard Apple Foundation Models APIs (LanguageModelSession)—do not introduce proprietary session wrappers:
Confidence Routing with RoutingPolicy
Never write naive if prob > 0.5 checks. In Jev:
- `0.50` indicates maximum epistemic uncertainty, not "half true".
- The undecided band ($0.35 \dots 0.65$) indicates the model is genuinely undecided (
answer == nil). - A probability of
0.05is a confident "no" ($\text{decisiveness} = \max(p, 1 - p) = 0.95$), which routes to.autowithanswer: false.
Use RoutingPolicy to map calibrated signals into three operational actions (.auto, .confirm, .escalate):
Rubric Scoring Telemetry with ScoreValue
For @Guide(.range(...)) score properties, Jev returns probability-weighted positions across rubric levels:
4. HTTP Resilience & Swift 6 Cooperative Cancellation
Configure automated retry backoff via RetryPolicy on JevLanguageModel:
Cooperative Cancellation
In Swift 6 concurrency, task cancellation must never be swallowed or converted into a generic error:
- `CancellationError` is NEVER wrapped in `JevError`: If a parent
Taskis cancelled (e.g., user navigates away in SwiftUI),CancellationErrorpropagates directly. - Retry sleeps abort immediately upon cancellation.
5. Production Mobile Architecture (JevTransport)
Never embed `TYPESAFE_API_KEY` inside client application binaries.
In production iOS, macOS, or visionOS apps, route requests through a backend reverse proxy (such as a Firebase Cloud Function, Vapor backend, or Cloudflare Worker) protected by Apple App Attest / Firebase App Check.
The repository includes a ready-to-use reference transport in Integrations/FirebaseAppCheckProxy/FirebaseAppCheckTransport.swift:
6. Deterministic Offline Testing with Swift Testing (@Test)
Always test decision workflows deterministically without live network access or API credentials using MockJevTransport:
7. Implementation Nuances & Troubleshooting
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/jev-foundation-models/SKILL.md
Popularity
- 7-day trend score
- 0
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
[](https://verified-skill.com/skills/peterfriese/system-one-foundation-models/jev-foundation-models)