# Foldkit

TypeScript frontend framework built on Effect that uses The Elm Architecture. One immutable Model, typed Messages, a single update function, and side effects returned as Commands.

**Type:** library
**Added:** 2026-10-18
**Author:** [Devin Jameson (@devinjameson)](https://x.com/devinjameson)
**Link:** https://foldkit.dev/
**Topics:** Frontend, AI Coding, Open Source
**Tags:** effect-ts, typescript, agents, testing

---

Scaffold with:

```bash
npx create-foldkit-app@latest
```

The Model is defined with Effect Schema, and every change goes through `update`, which returns the next Model plus any Commands. Commands only describe a side effect, and the runtime runs it. Pure updates make testing easy. Story tests read like Given/When/Then: `given(model)`, then `message(...)`, then assert on the Commands and the resulting Model. Scene tests exercise the view through accessible locators without a DOM. DevTools logs every Message and can rewind the Model, and a DevTools MCP server gives agents the same view of a running app: they can inspect state, query Message history and dispatch Messages. MIT, pre-1.0, so minor releases can still break things.

It's the F in the CAFE stack (Cloudflare, Alchemy, Foldkit, [Effect](/directory/effect)). The idea is that with a fixed loop of Messages, update and Commands, a coding agent has less architecture to invent. [Alchemy](https://alchemy.run) covers the infrastructure as TypeScript ("Infrastructure as Effects") and has a `Cloudflare.Website.Foldkit` resource that deploys an app without a Wrangler config. The reference app is [Effect-TS/cafe](https://github.com/Effect-TS/cafe), a chat app where agents write a failing test first, get it passing locally with `alchemy dev`, then rerun it against real Cloudflare. Cloudflare also has an official [Foldkit guide for Workers](https://developers.cloudflare.com/workers/framework-guides/web-apps/foldkit/) that covers SPA, SSG and SSR.

Repo: [foldkit/foldkit](https://github.com/foldkit/foldkit)

---

## Links

- Directory entry: https://andrey-markin.com/directory/foldkit
- All directory entries: https://andrey-markin.com/directory
- Contact: https://andrey-markin.com/#contact
