Template is where they come together. For the problems almost every product has, such as deciding who can do what, the pieces also work without the template: a rules engine, a permissions library, the screens for building rules, and a way to say which step a record can move to next. Most of them already run in production.
Stop rediscovering what you need to build.
The same shapes of problem come up in product after product. Usually each one gets a one-off solution, often right next to another problem with the same shape. Each building block takes one of those problems and solves it once, in a shape you can reuse wherever it shows up.
A SaaS app where the hard parts are already built.
Template is like shadcn, but for the whole SaaS app: you start a product from it and own the code. On day one:
- People sign in with email, with an account they already have elsewhere, or with keys for scripts.
- They work in organizations and teams, each with its own roles.
- Each person sees and changes only what they're allowed to.
- Sensitive data stays encrypted, and the keys can be replaced on a schedule.
- Changes to the records you choose are kept in a log, with who made each one.
- Slow work runs in the background, and screens update live.
- Your product emails people and tells other systems when something happens.
- Admin and superadmin screens are included.
Start a product from template, and own all of it.
Template is a working SaaS app with the parts nearly every product needs already built. You copy it once and build your product in that copy. Nothing stays tied to a service of ours. Kingdom, the hosted hub on the agentic side, started from template the same way.
How you start
- Create your own repository from it. Template is a GitHub template repository under MIT, so the new repository is yours, every line of it.
- Run it on your machine.
bun run setup && bun run localSetup installs the packages, starts Postgres, Redis and file storage in Docker, and seeds the database. Local runs the API with the web, admin and superadmin apps. - Put it online when you are ready.
bun run initA guided setup creates the project's accounts on GitHub, PlanetScale, Railway, Vercel, Cloudflare and Resend, and keeps their secrets in Infisical. - Build your product on top. Add your own models and routes. Each route registers itself and regenerates the typed API client, and who may use a new model is a few rules in the permissions schema.
What you own
- All of the code, in your repository. Change any of it, including the parts that came with template.
- The building blocks, as MIT packages from npm that you update when you choose.
- Docs written for people and for coding agents, and the repo's Foundry setup, so an agent working in your product is reminded of what is already there.
Template has no plugin system and no hidden framework. Each solved problem is ordinary code in your repository, documented where it lives, so you can read it, change it or replace it.
For the problems almost every product has.
You can use each one without the template.
- Building blocks
- Developer experience
- Agentic
- Governance
- Closed source
- Done
- Under construction
- Planned
- Builds on
- Reads its map
- Goes through a Signet
- Under construction
- To a planned piece
Hover or focus any piece to light what it builds on and what builds on it.
- templateThe whole SaaS appBuilt on prisma-map, json-rules, permissions, rules-builder, atlas, transitions, gloss
- rules-builderRule screensBuilt on json-rules
- transitionsLifecyclesBuilt on json-rules, permissions
- permissionsWho can do whatBuilt on prisma-map, json-rules
- json-rulesRulesBuilt on prisma-map
- prisma-mapData shape
Read the map as text
How to read the map: colour shows which part a piece belongs to (amber building blocks, teal developer experience, lime agentic, blue outside your machine, violet governance; charcoal marks closed source and pink marks a connection that goes through a Signet). Fill shows status: a solid block is done, a block in scaffolding is under construction, a dashed outline is planned. Lines show the relation: solid builds on or runs with, dotted reads prisma-map's map, pink goes through a Signet, a scaffold-dashed line is under construction (on the technical graph: what template will adopt), a long-dashed grey line reaches a planned piece.
- prisma-map: Your Prisma schema, readable at runtime. Built on config.
- json-rules: One rule that runs in memory, in Prisma and in SQL. Built on prisma-map (reads its map), config.
- permissions: RBAC, ABAC and ReBAC on your own records. Built on prisma-map (reads its map), json-rules, config.
- transitions: Declarative lifecycles. Built on json-rules, permissions, config.
- rules-builder: A headless rule builder. Built on json-rules, config.
- atlas: A map of your code. Built on json-rules, config.
- gloss: Explanations kept out of the source. Built on config.
- config: The shared toolchain and theme.
- worktrees: A worktree per task, with its own database and ports.
- init: Sets up hosting, database and secrets for a new project.
- CI rules: Checks that hold the codebase to its own conventions.
- template: The whole SaaS app, built from the libraries. Under construction. Built on prisma-map, json-rules, permissions, rules-builder, atlas, config, worktrees, init, CI rules, transitions (to adopt), gloss (to adopt).
- Foundry: The workspace around your agent. Under construction. Built on agent-session, Archive, Signet, json-rules, gloss, config. Foundry pairs with Kingdom; the pairing is a Signet. Foundry runs each agent session on your machine. Foundry sends every session to Archive. Oracle measures and tunes Foundry's docs and Wardens.
- agent-session: Runs each Claude Code and Codex session. Built on json-rules. Foundry runs each agent session on your machine.
- Archive: Keeps every agent session. Built on agent-session, Signet. A local Archive pairs with Kingdom through a Signet. Foundry sends every session to Archive. Oracle reads the sessions Archive keeps.
- KCP: Runs your CLIs through Kingdom. Under construction. Built on Signet. KCP will run your provider CLIs through Kingdom (in progress: it signs in today).
- Kingdom: The permission hub. Closed source. Under construction. Built on Signet, Archive, agent-session, permissions, json-rules, prisma-map, rules-builder. Foundry pairs with Kingdom; the pairing is a Signet. A local Archive pairs with Kingdom through a Signet. KCP will run your provider CLIs through Kingdom (in progress: it signs in today). Artifactory will sign in with Kingdom (planned).
- Signet: A revocable pass on the owner's terms. Built on json-rules.
- Artifactory: Sharing what agents make, signed in with Kingdom. Planned. Artifactory will sign in with Kingdom (planned).
- Oracle: Measures whether a correction stuck. Closed source. Built on agent-session, Archive, Foundry. Oracle measures and tunes Foundry's docs and Wardens. Oracle reads the sessions Archive keeps.
- bench: Our challenge set for coding agents. Built on agent-session.
- The whitepaper: How groups set rules and hold each other to them. The whitepaper explains why; the Inixiative project is the goal.
- The Inixiative project: change.org meets Kickstarter on blockchain: a time-series governance platform, with tokenization. Planned. The whitepaper explains why; the Inixiative project is the goal. Livestock is a product that runs on the Inixiative platform.
- Livestock: Tokenized cattle trusts in Uruguay and Argentina, a product on the Inixiative platform. Closed source. Planned. Livestock is a product that runs on the Inixiative platform.
prisma-map
Lets the other pieces read how your data is shaped while the app runs.
json-rules
Write a rule once, such as "only managers on this team", and check it in the app or when searching the database.
permissions
Decides who can see and change each record, from the data you already have.
transitions
Says which step a record can move to next, and who may move it, such as draft to approved.
rules-builder
The screens for building those rules, offering only choices that will work.
One rule language, from the database to the screen.
Each piece reads the one beneath it. A rule a tenant writes in the builder is the same JSON that permissions checks and that the database query filters by, so the three never disagree.
prisma-map describes your data.
It reads the Prisma client you already generate and lists each model, its fields, how records relate and which side holds the foreign key. Every piece after it reads this map instead of guessing at your schema.
json-rules writes rules over that data.
A rule is plain JSON naming those fields, such as "the status is open and the person is on the record's team". The same rule checks one record in memory, or compiles to a Prisma query or a SQL WHERE clause that finds every matching row. Because a rule is data, you can store it, validate it and let a tenant edit it.
permissions are rules about who can do what.
Roles, walks along relations (a member of an organization can read its projects) and conditions on the record and on the person acting are all json-rules rules, decided on the rows you already have. There is no second store to keep in sync, and anything a person hands on is checked against what they could do themselves.
transitions are rules about a record's lifecycle.
They say which moves are open from the current state, such as draft to approved, and who may make each one, by asking permissions. The same rules list the actions open on one record and compile to a query for every record an action is open to.
rules-builder is the screens for editing rules.
It reads the same map and offers only the fields and operators the engine can run, so whatever a person builds will run.
template puts them in one SaaS app you own.
Template uses prisma-map, json-rules, permissions and rules-builder for its data, its rules and who can do what, alongside sign-in, organizations, background jobs, email and the admin screens. Transitions works beside it and is not wired into template yet.
Tools for working on the code.
These tools help while you build, and none of them ends up in your product. Atlas keeps a map of what is where in the code. Gloss keeps notes about the code out of the code, and hands them to an agent when it reads that file. Config gives every project the same setup.
Template comes with its own: several copies of a project can run side by side without colliding, a guided setup creates a new project's accounts and services, and automatic checks stop code that rebuilds something the project already has.
atlas
Keeps a map of what is where in your code, and fails the build when the map goes out of date.
gloss
Keeps notes about the code out of the code, and hands them to an agent when it reads that file.
config
Gives every project the same tools and settings, and checks they stay in step.
worktrees
Run several copies of a project side by side, one per branch or agent, without them colliding.
init
A guided setup that creates a new project's accounts and services and keeps their secrets safe.
CI rules
Automatic checks that stop code that rebuilds something the project already has.
conditional-form
PausedForms whose show, hide and validation logic is the same rules the server uses. Not recommended for use.