Metakit / Why rules should be data
Why Effect Schema needs inspectable expressions (and what changes when you have them)
If you already use Effect and effect/Schema, you know the value of keeping structure as data. Because an Effect Schema carries an inspectable SchemaAST, one declaration gives you TypeScript types, runtime decoding, encoding, JSON Schema, and Arbitrary test generators without writing them four times.
That stops the moment you write a business rule or a state transition. A rule like "reserved may not exceed the balance" is a JavaScript function, so you write it again as a SQL CHECK, again as a disabled button and again in a test, and nothing proves an update cannot break it.
@doeixd/metakit is a package that keeps such a rule as data, a small expression tree attached to your Effect Schema, so the browser, the database, the form and a prover all read the one copy. You can run all of it in one file: examples/metakit/src/demo.ts. Install it with pnpm add @doeixd/metakit effect.