# Jev Wiki

An **unofficial, agent-maintained knowledge base about Jev**, TypeSafe AI's System One model, built so that LLM coding agents (Claude, Codex, Cursor, Kimi, DeepSeek, anything that can fetch a URL) know everything they need to build software with Jev: the exact HTTP contract, models and prices, SDK signatures, the three question primitives, confidence semantics, known failure modes, architectural patterns, and all 18 official cookbooks.

It follows the [Karpathy "LLM Wiki" pattern](https://gist.github.com/karpathy/442a6bf555914893e9891c11519de94f) as used by [agentwikis.com](https://agentwikis.com/for-agents): immutable raw sources in `raw/`, LLM-written pages in `wiki/`, a schema in `CLAUDE.md`, and every page served as plain Markdown with YAML frontmatter.

## Ask your agent

Paste one of these into Claude Code, Codex, Cursor, or any agent that can fetch URLs.

**"Could Jev help my project?"**

```
Read https://jevwiki.ai/raw/wiki/ideas/consult.md and follow it exactly
(it tells you which one or two further pages to open). Then look at my project (this repo / the description
below) and give me the ranked shortlist it asks for: which decisions Jev fits, the primitive and criteria
sketch for each, estimated cost, caveats, and what you would NOT use Jev for.
Stay within about 15k tokens of wiki reading. Do not load llms.txt or llms-full.txt for this.
```

**"Audit my existing code for Jev opportunities"** (uses TypeSafe's own skill; community prompt via @k2sbhai)

```
npx skills add typesafe-ai/skills --skill typesafe-ai
```

```
Use /typesafe-ai to audit this project. Find every place where we make a slow or expensive LLM call
that is really a yes or no decision, a ranking, or a classification. For each one, tell me what Jev would
replace, what it would cost, and what would break if the answer is wrong. Then list 3 new features this
project could add if judgments were instant and nearly free. Don't change any code yet. Show me the list first.
```

**"Build this with Jev"**

```
Read https://jevwiki.ai/llms.txt and follow its "Build something with Jev" route
(agent playbook, HTTP API, jaggedness, then one SDK page and the closest cookbook). Then implement: <task>.
Use exact field names from the reference pages and gate actions on confidence.
```

## For agents: start here

```
curl https://jevwiki.ai/llms.txt
```

| URL (under `https://jevwiki.ai`) | What |
|---|---|
| `/llms.txt` | Task routing table, then an index of every page with a one-line summary and an estimated token size |
| `/llms-full.txt` | The entire wiki in one fetch (wikilinks resolved to absolute URLs) |
| `/index.json` | Same registry as JSON (slug, title, type, tags, sources, raw/html URLs) |
| `/raw/wiki/<section>/<slug>.md` | Any page as exact on-disk Markdown, frontmatter included |
| `/wiki/<section>/<slug>.md` | The same page as HTML for humans (send `Accept: text/markdown` to get redirected to raw) |
| `/raw/CLAUDE.md` | The schema: page format, inventory, maintenance workflows |
| `/raw/MANIFEST.json` | Every upstream source, its URL, fetch date, and repo commit |

Recommended reading order for a coding task:

1. `guides/agent-integration-playbook` — decision tree, checklist, code templates
2. `reference/http-api` or `reference/python-sdk` / `reference/javascript-sdk` — the contract you will code against
3. `concepts/jaggedness-jev-1-13` — what Jev gets wrong and how to design around it
4. the closest `cookbooks/*` page — real decompositions with verbatim `instructions` and `criteria`

Assessing whether Jev fits a project at all? Start at `ideas/consult` instead (community tier: a pattern index plus domain pattern pages, field reports, a repo index plus domain repo pages).

Wikilinks in raw pages look like `[[concepts/confidence]]` and resolve to `/raw/wiki/concepts/confidence.md`.

## Trust semantics

- **Scope** is declared in `llms.txt` (`Covers` / `Not covered` / `Current as of`). Anything newer than the snapshot date: read the live docs at <https://docs.typesafe.ai/llms.txt>.
- **Provenance**: every page lists its `sources:` in frontmatter, pointing at files in `raw/` (which map to upstream URLs via `raw/MANIFEST.json`).
- **Tiers**: pages under `ideas/` are community-sourced (`source_tier: community`, confidence capped at medium). Official pages win any conflict.
- **Confidence**: each page carries `confidence: high|medium|low`. Numbers, field names, and code come from the sources; inferences are marked "(inferred)"; marketing claims are attributed as claims.

## Layout

```
CLAUDE.md / AGENTS.md   schema, page inventory, workflows (ingest / query / lint / refresh)
raw/                    immutable sources: docs pages (.md), OpenAPI, SDK repos, site, blog, evals, press
wiki/                   the knowledge base (concepts, reference, patterns, cookbooks, guides, ideas, entities, syntheses)
scripts/build.mjs       lint + build dist/ (HTML, raw copies, llms.txt, llms-full.txt, index.json, sitemap)
scripts/refresh.mjs     re-fetch sources, diff, list wiki pages that need re-ingestion
site/                   Cloudflare Worker (routing + content negotiation), stylesheet (theconsigliere.ai Brand Standards v2.0), mark and favicon (generated by scripts/make_brand_assets.mjs)
```

## Maintaining it

```bash
npm install
npm run check      # lint: frontmatter, dangling wikilinks, orphans, required sections
npm run build      # produce dist/
npm run refresh    # re-fetch upstream, print a change report (raw/LAST_REFRESH.md)
npm run deploy     # build + wrangler deploy (Cloudflare Workers, static assets)
```

To update content after a refresh, open the repo in an agent that reads `CLAUDE.md` and say `ingest raw/<changed file>`; the schema tells it which pages to rewrite. The build refuses to ship dangling wikilinks.

## Credits

- **Nate B. Jones** — the four-placement routing on the pattern index, the UI-element pattern's design rules, the 50-case and shadow-mode check, and several first-hand measurements are digested, with his permission, from his member guide [Find the Jev-shaped problems in your software](https://unlock-ai.natebjones.com/guides/jev-shaped-problems). His audit prompt and recipe-card prompts live on his page, not here.
- Community patterns and repos are credited inline to the people who posted them. Official material is TypeSafe AI's.

## Status

Unofficial. Not affiliated with TypeSafe AI, Inc. Source material © TypeSafe AI and the cited authors; wiki text is derived from it for reference use. Report mistakes by opening an issue.
