# gdp-ts

Guillermo Rauch's TypeScript take on Ghosts of Departed Proofs, made up of a library, lint presets and an agent skill. Sensitive functions require compile-time proofs that the caller actually ran the authorization or entitlement check.

**Type:** library
**Added:** 2026-10-21
**Source date:** 2026-10-04
**Author:** [Guillermo Rauch (@rauchg)](https://github.com/rauchg)
**Link:** https://github.com/rauchg/gdp-ts
**Topics:** Dev Tools, AI Coding, Open Source
**Tags:** typescript, security, auth, agents

---

Install it with:

```bash
pnpm add @gdp-ts/core
npx skills add rauchg/gdp-ts
```

The idea comes from Matt Noonan's Haskell `gdp`. `name(x, k)` gives a runtime value a name that exists only at compile time. A small trusted module in `proofs/` runs the real check and returns a proof or `null`, and only that module can create proofs. Data-layer functions like `disablePasswordProtection(project, proof: UserIsProjectAdmin<U, P>)` then ask for a proof about their exact arguments. If a route, Server Action or job skips the check, passes a raw id or passes a proof about a different value, the code does not compile.

`@gdp-ts/core` has no dependencies and needs TypeScript 5.4 or newer. The ESLint and Oxlint presets catch what the type checker can't, such as forging a proof with `as` or creating one outside `proofs/`. The skill is plain Markdown for coding agents: a checklist, a six-step adoption recipe, ways to read the type errors, and guidance on how far to take it. It doesn't replace a policy engine. A policy engine makes the decision, and gdp-ts makes sure that decision reaches the function that depends on it. The repo includes Express 5 and Drizzle + PGlite examples. MIT licensed.

---

## Links

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