# Build complete Prism apps

> This is where the UOR Foundation works out how to build a complete Prism app, and refines the way it is done. New to Prism? Start at uor.foundation, the Foundation's home for Prism and the Foundry portal.

Every practice here is shown on real projects and checked before it goes live. Start with a tutorial, follow a how-to guide for the task in front of you, and look up details in the reference. Copy an example, or study a whole project in a case study. What works here goes back upstream to uor.foundation and Foundry, so the whole ecosystem builds on it.

## Ways to start building

- [Turn a Rust project into a Prism model](https://afflom.github.io/prism-devrel/case-studies/uorust/getting-started/) (tutorial): Run UORust on a sample workspace and check what it writes. Then read a Rust function beside the LexLean it became.
- [Build your first Prism app](https://afflom.github.io/prism-devrel/start/) (tutorial): Describe your app once, as a structured prompt, and Prism writes every facet of it, proves what it promises and publishes it.
- [Example apps](https://afflom.github.io/prism-devrel/examples/) (Examples): Small apps, each built from one prompt and verified, grouped by the pattern they follow. Copy one and change it.
- [Case studies](https://afflom.github.io/prism-devrel/case-studies/) (Case studies): Whole Prism projects, read record by record at a pinned commit, from their users to their proofs. Each one updates as its project grows.

## Evaluate: Does Prism solve my problem, and can I trust what it claims?

- [How one prompt becomes every facet](https://afflom.github.io/prism-devrel/start/explanation/index.md) (explanation): Why the behavior and a few choices determine a whole Prism app, and what checks each facet.

## Learn: How do I build my first working app?

- [Turn a Rust project into a Prism model](https://afflom.github.io/prism-devrel/case-studies/uorust/getting-started/index.md) (tutorial): Run UORust on a sample workspace and check what it writes. Then read a Rust function beside the LexLean it became.
- [Build your first Prism app](https://afflom.github.io/prism-devrel/start/index.md) (tutorial): Describe your app once, as a structured prompt, and Prism writes every facet of it, proves what it promises and publishes it.
- [The facets of a Prism app](https://afflom.github.io/prism-devrel/facets/index.md) (reference): Each facet a Prism model has, and the standard it follows. The counts come from every case study.
- [Architecture facet](https://afflom.github.io/prism-devrel/facets/architecture/index.md) (explanation): What this facet holds and the standard it follows. Then how each case study uses it.
- [Design views facet](https://afflom.github.io/prism-devrel/facets/design/index.md) (explanation): What this facet holds and the standard it follows. Then how each case study uses it.
- [Features and journeys facet](https://afflom.github.io/prism-devrel/facets/features/index.md) (explanation): What this facet holds and the standard it follows. Then how each case study uses it.
- [Security and threat model facet](https://afflom.github.io/prism-devrel/facets/security/index.md) (explanation): What this facet holds and the standard it follows. Then how each case study uses it.
- [Quality facet](https://afflom.github.io/prism-devrel/facets/quality/index.md) (explanation): What this facet holds and the standard it follows. Then how each case study uses it.
- [Behavior and proofs facet](https://afflom.github.io/prism-devrel/facets/behavior/index.md) (explanation): What this facet holds and the standard it follows. Then how each case study uses it.
- [System and release facet](https://afflom.github.io/prism-devrel/facets/system/index.md) (explanation): What this facet holds and the standard it follows. Then how each case study uses it.
- [Extension facets facet](https://afflom.github.io/prism-devrel/facets/extension/index.md) (explanation): What this facet holds and the standard it follows. Then how each case study uses it.
- [Application facet](https://afflom.github.io/prism-devrel/facets/application/index.md) (explanation): What this facet holds and the standard it follows. Then how each case study uses it.

## Build: How do I make my app do what I need?

- [How to build a decision table app](https://afflom.github.io/prism-devrel/guides/decision-table/index.md) (how-to guide): Write a prompt for a decision table app, check it, prove it with the gate and publish it.
- [How to build a policy decision app](https://afflom.github.io/prism-devrel/guides/policy-decision/index.md) (how-to guide): Write a prompt for a policy decision app, check it, prove it with the gate and publish it.
- [How to build a state machine app](https://afflom.github.io/prism-devrel/guides/state-machine/index.md) (how-to guide): Write a prompt for a state machine app, check it, prove it with the gate and publish it.
- [How to verify an app before you publish it](https://afflom.github.io/prism-devrel/guides/verify/index.md) (how-to guide): Build the app from its prompt in a copy of the template, and pass its whole gate in the locked SDK.
- [How to publish an app on GitHub Pages](https://afflom.github.io/prism-devrel/guides/publish/index.md) (how-to guide): Give the app its own repository from the template, whose workflow proves it and serves it on GitHub Pages.
- [How to give an AI agent the prism_prompt tool](https://afflom.github.io/prism-devrel/guides/agent-tool/index.md) (how-to guide): Hand an agent the prism_prompt tool, so it writes prompts that the builder checks and builds.
- [Prompt reference](https://afflom.github.io/prism-devrel/start/reference/index.md) (reference): Every member of a prism/prompt/1 prompt, the command line and the MCP tool prism_prompt.
- [Prism source](https://afflom.github.io/prism-devrel/start/source/index.md) (reference): The shared files every app is built on, and where each one comes from.

## Examples

Small apps, each built from one prompt and verified, grouped by the pattern they follow. Copy one and change it.

- [Example apps](https://afflom.github.io/prism-devrel/examples/index.md) (Overview): Apps built from one prompt each, grouped by pattern, and verified before they go live.
- [Rule 30 cell](https://afflom.github.io/prism-devrel/examples/rule-30-cell/index.md) (Decision tables): Find the next state of one Rule 30 cell from its neighbours, so every row of the pattern can be replayed and checked.
- [Strike die](https://afflom.github.io/prism-devrel/examples/karst-zero-strike/index.md) (Decision tables): Roll one strike die in Karst: Zero Horizon, with cover and momentum. Then every roll in a fight can be replayed.
- [Wise deferral](https://afflom.github.io/prism-devrel/examples/ciris-deferral/index.md) (Decision tables): Decide if a CIRIS agent goes ahead, asks a Wise Authority first, or stops. Then each of its choices can be checked later.
- [Current support](https://afflom.github.io/prism-devrel/examples/legal-matter-support/index.md) (Decision tables): Tell if a PrismLegal matter is current. A legal strategy should only rest on support that is checked, grounded and up to date.
- [Header work](https://afflom.github.io/prism-devrel/examples/btc-header-work/index.md) (Decision tables): Decide if a block header's hash meets its target, so any node can check the proof of work from the header alone.
- [Plant attunement](https://afflom.github.io/prism-devrel/examples/garden-attunement/index.md) (Decision tables): Decide if a player's gesture in Verdant Resonance reaches the plant they face. The garden then answers the same walk the same way.
- [Capability route](https://afflom.github.io/prism-devrel/examples/uorust-capability/index.md) (Decision tables): Decide how UORust records a Rust target by the effect it reaches. Every effect becomes a threat in the model, and nothing hides as pure.
- [Publish gate](https://afflom.github.io/prism-devrel/examples/devrel-publish-gate/index.md) (Decision tables): Decide if Prism-DevRel may publish its pages, so no reader ever sees a page that gets the model wrong.
- [Proposal admission](https://afflom.github.io/prism-devrel/examples/foundry-admission/index.md) (Decision tables): Decide if a router's proposal joins the app. A stale, unclear or clashing proposal never becomes part of it.
- [Compression admission](https://afflom.github.io/prism-devrel/examples/uorc-admission/index.md) (Decision tables): Decide if a new UORC archive replaces the best one so far. A smaller size must never come at the cost of lost data.
- [Quorum commit](https://afflom.github.io/prism-devrel/examples/bft-commit/index.md) (Decision tables): Decide if a round of votes commits a block. A validator commits only when enough others agree, and only once it holds the block itself.
- [Address admission](https://afflom.github.io/prism-devrel/examples/addr-admission/index.md) (Decision tables): Decide if a value gets a UOR-ADDR address. Two values that mean the same thing share one label, and a broken value gets none.
- [Dataflow policy](https://afflom.github.io/prism-devrel/examples/dataflow-policy-check/index.md) (Decision tables): Decide if a Prism dataflow script is accepted, rejected for breaking a policy, or an error. A script that leaks memory or personal data is never accepted.
- [Draft admission](https://afflom.github.io/prism-devrel/examples/lexlean-mcp-draft-admission/index.md) (Decision tables): Decide if LexLean MCP takes a draft from an AI model. No file path leaves its folders, and no draft goes over the owner's limits.
- [Coded matmul admission](https://afflom.github.io/prism-devrel/examples/matmul-coded-admission/index.md) (Decision tables): Decide if a coded matrix request is computed, or which error it gets. The checks run in the order the LexLean Matmul protocol sets.
- [UTQC row honesty](https://afflom.github.io/prism-devrel/examples/utqc-row-honesty/index.md) (Decision tables): Decide if a row of the UOR Atlas UTQC dictionary passes the honesty check, so no row claims more than its source shows.
- [Calculator protocol](https://afflom.github.io/prism-devrel/examples/calculator-protocol/index.md) (Decision tables): Sort a Calculator request by the kind of answer it gets. A bad, unknown or too-large request never gets a number back.
- [Requantization clamp](https://afflom.github.io/prism-devrel/examples/mnist-requant-clamp/index.md) (Decision tables): Sort how the MNIST network squeezes a 32-bit sum into an 8-bit value, so no value ever falls outside 0 to 255.
- [JCS NFC admission](https://afflom.github.io/prism-devrel/examples/jcs-nfc-admission/index.md) (Decision tables): Give the one refusal code for a broken JSON document, or let it through. Then every tool refuses the same input with the same code.
- [Two-seed bar](https://afflom.github.io/prism-devrel/examples/r4-seed-gate/index.md) (Decision tables): Decide if a two-seed UOR-R4 run beats its baselines, so a result inside the noise is never called a win.
- [Docs sync](https://afflom.github.io/prism-devrel/examples/site-docs-sync/index.md) (Decision tables): Decide what the nightly docs sync does to uor.foundation. The site must never swap its docs for an empty or unchecked release.
- [Open policy](https://afflom.github.io/prism-devrel/examples/holo-open-policy/index.md) (Policy decisions): Decide if Holo Search opens the app an address names. Nothing runs unless its bytes match the address, its model checks and its tests pass.
- [Namespace authorization](https://afflom.github.io/prism-devrel/examples/kappa-namespace-authorization/index.md) (Policy decisions): Decide if kappa-registry lets someone change a namespace. Only its owner, a key holder or a short chain of trust can write.
- [Axiom policy](https://afflom.github.io/prism-devrel/examples/lexlean-axiom-policy/index.md) (Policy decisions): Decide if a declaration uses only the axioms its source allows. Then lexlean verify publishes nothing that rests on more.
- [GNAF claim wording](https://afflom.github.io/prism-devrel/examples/gnaf-claim-wording/index.md) (Policy decisions): Decide which words a GNAF document may use for a claim. No README or ledger may say more than the Lean kernel checked.
- [Emporous admission](https://afflom.github.io/prism-devrel/examples/emporous-admit-policy/index.md) (Policy decisions): Decide if Emporous lets an object into a namespace. Each object must come from someone who is allowed to add it there.
- [Portal publication](https://afflom.github.io/prism-devrel/examples/foundry-web-publication/index.md) (Policy decisions): Decide if foundry-web may publish a portal release. Only the exact build that was checked and approved can go live.
- [MCP task lifecycle](https://afflom.github.io/prism-devrel/examples/mcp-task-lifecycle/index.md) (State machines): Find an MCP task's next state, so a client that polls, updates or cancels it always sees the state the protocol would write.
- [Container lifecycle](https://afflom.github.io/prism-devrel/examples/prismpm-container-lifecycle/index.md) (State machines): Move a PrismPM holo container through its Docker life. A holo that fails its check never runs, and a running one is never removed.
- [Atlas walk controls](https://afflom.github.io/prism-devrel/examples/atlas-explorer-walk/index.md) (State machines): Find the next state of the Atlas Explorer view from the button pressed. Then each walk through the E8 orbit can be replayed step by step.
- [Vault escrow lifecycle](https://afflom.github.io/prism-devrel/examples/vault-escrow-lifecycle/index.md) (State machines): Find the next status of an escrow in the PrismPM Vault from the step applied to it. Then locking, release and refund can be replayed.
- [Release lifecycle](https://afflom.github.io/prism-devrel/examples/template-release-lifecycle/index.md) (State machines): Move a template release from build to accept, one step at a time. No release is accepted before every step has passed in order.
- [Organization lifecycle](https://afflom.github.io/prism-devrel/examples/foundry-org-lifecycle/index.md) (State machines): Move a Foundry organization through its life. Only its own admins can switch it on, pause it or retire it.

## Case studies

Whole Prism projects, read record by record at a pinned commit, from their users to their proofs. Each one updates as its project grows.

- [Case studies](https://afflom.github.io/prism-devrel/case-studies/index.md) (Overview): Whole Prism projects, each read record by record: who it is for and how its model is built.
- [How UORust was modeled](https://afflom.github.io/prism-devrel/case-studies/uorust/index.md) (UORust): Who the UORust model is for and what they care about. Then how those concerns became facets.
- [Architecture walkthrough](https://afflom.github.io/prism-devrel/case-studies/uorust/architecture/index.md) (UORust): Who UORust is for, what they care about, its parts and how they connect.
- [Design views in OPM and UML](https://afflom.github.io/prism-devrel/case-studies/uorust/design/index.md) (UORust): Every design view of UORust, drawn. It shows things, steps, parts, messages and states.
- [Features and journeys](https://afflom.github.io/prism-devrel/case-studies/uorust/features/index.md) (UORust): What UORust does, the calls that do it, the rows that accept it, and the paths people take.
- [Security and threat model](https://afflom.github.io/prism-devrel/case-studies/uorust/security/index.md) (UORust): The assets of UORust, its threats, risks and controls, and the risks it accepts on purpose.
- [Quality model (ISO/IEC 25010)](https://afflom.github.io/prism-devrel/case-studies/uorust/quality/index.md) (UORust): What good quality means for UORust, and the numbers that measure it.
- [Behavior and proofs](https://afflom.github.io/prism-devrel/case-studies/uorust/behavior/index.md) (UORust): Every theorem of UORust, and how it is proved. The Lean kernel checks each one.
- [System and release](https://afflom.github.io/prism-devrel/case-studies/uorust/system/index.md) (UORust): What UORust ships, its release manifest, and how its holo goes live.
- [Extension facets](https://afflom.github.io/prism-devrel/case-studies/uorust/extensions/index.md) (UORust): The records UORust adds of its own. They sit beside the standard facets.
- [Command reference](https://afflom.github.io/prism-devrel/case-studies/uorust/cli/index.md) (UORust): Every command and option of the UORust tool, read from its source. Also the commands its gate runs.
- [Slides and video script](https://afflom.github.io/prism-devrel/case-studies/uorust/slides/index.md) (UORust): One slide for each facet of UORust, with a script to read over it.
- [Record explorer](https://afflom.github.io/prism-devrel/case-studies/uorust/explorer/index.md) (UORust): Search every record of UORust by name, facet or text. Each result links to the pages that teach it.
- [llms.txt and Markdown twins](https://afflom.github.io/prism-devrel/case-studies/uorust/agents/index.md) (UORust): The UORust case study as plain text for agents. It has llms.txt, a twin of each page and a feed.
- [How Prism-DevRel was modeled](https://afflom.github.io/prism-devrel/case-studies/prism-devrel/index.md) (Prism-DevRel): Who the Prism-DevRel model is for and what they care about. Then how those concerns became facets.
- [Architecture walkthrough](https://afflom.github.io/prism-devrel/case-studies/prism-devrel/architecture/index.md) (Prism-DevRel): Who Prism-DevRel is for, what they care about, its parts and how they connect.
- [Design views in OPM and UML](https://afflom.github.io/prism-devrel/case-studies/prism-devrel/design/index.md) (Prism-DevRel): Every design view of Prism-DevRel, drawn. It shows things, steps, parts, messages and states.
- [Features and journeys](https://afflom.github.io/prism-devrel/case-studies/prism-devrel/features/index.md) (Prism-DevRel): What Prism-DevRel does, the calls that do it, the rows that accept it, and the paths people take.
- [Security and threat model](https://afflom.github.io/prism-devrel/case-studies/prism-devrel/security/index.md) (Prism-DevRel): The assets of Prism-DevRel, its threats, risks and controls, and the risks it accepts on purpose.
- [Quality model (ISO/IEC 25010)](https://afflom.github.io/prism-devrel/case-studies/prism-devrel/quality/index.md) (Prism-DevRel): What good quality means for Prism-DevRel, and the numbers that measure it.
- [Behavior and proofs](https://afflom.github.io/prism-devrel/case-studies/prism-devrel/behavior/index.md) (Prism-DevRel): Every theorem of Prism-DevRel, and how it is proved. The Lean kernel checks each one.
- [Extension facets](https://afflom.github.io/prism-devrel/case-studies/prism-devrel/extensions/index.md) (Prism-DevRel): The records Prism-DevRel adds of its own. They sit beside the standard facets.
- [Slides and video script](https://afflom.github.io/prism-devrel/case-studies/prism-devrel/slides/index.md) (Prism-DevRel): One slide for each facet of Prism-DevRel, with a script to read over it.
- [Record explorer](https://afflom.github.io/prism-devrel/case-studies/prism-devrel/explorer/index.md) (Prism-DevRel): Search every record of Prism-DevRel by name, facet or text. Each result links to the pages that teach it.
- [llms.txt and Markdown twins](https://afflom.github.io/prism-devrel/case-studies/prism-devrel/agents/index.md) (Prism-DevRel): The Prism-DevRel case study as plain text for agents. It has llms.txt, a twin of each page and a feed.
- [How Rule 30 was modeled](https://afflom.github.io/prism-devrel/case-studies/rule30/index.md) (Rule 30): Who the Rule 30 model is for and what they care about. Then how those concerns became facets.
- [Architecture walkthrough](https://afflom.github.io/prism-devrel/case-studies/rule30/architecture/index.md) (Rule 30): Who Rule 30 is for, what they care about, its parts and how they connect.
- [Security and threat model](https://afflom.github.io/prism-devrel/case-studies/rule30/security/index.md) (Rule 30): The assets of Rule 30, its threats, risks and controls, and the risks it accepts on purpose.
- [Quality model (ISO/IEC 25010)](https://afflom.github.io/prism-devrel/case-studies/rule30/quality/index.md) (Rule 30): What good quality means for Rule 30, and the numbers that measure it.
- [Behavior and proofs](https://afflom.github.io/prism-devrel/case-studies/rule30/behavior/index.md) (Rule 30): Every theorem of Rule 30, and how it is proved. The Lean kernel checks each one.
- [Slides and video script](https://afflom.github.io/prism-devrel/case-studies/rule30/slides/index.md) (Rule 30): One slide for each facet of Rule 30, with a script to read over it.
- [Record explorer](https://afflom.github.io/prism-devrel/case-studies/rule30/explorer/index.md) (Rule 30): Search every record of Rule 30 by name, facet or text. Each result links to the pages that teach it.
- [llms.txt and Markdown twins](https://afflom.github.io/prism-devrel/case-studies/rule30/agents/index.md) (Rule 30): The Rule 30 case study as plain text for agents. It has llms.txt, a twin of each page and a feed.
- [How Verdant Resonance was modeled](https://afflom.github.io/prism-devrel/case-studies/verdant-resonance/index.md) (Verdant Resonance): Who the Verdant Resonance model is for and what they care about. Then how those concerns became facets.
- [Behavior and proofs](https://afflom.github.io/prism-devrel/case-studies/verdant-resonance/behavior/index.md) (Verdant Resonance): Every theorem of Verdant Resonance, and how it is proved. The Lean kernel checks each one.
- [Extension facets](https://afflom.github.io/prism-devrel/case-studies/verdant-resonance/extensions/index.md) (Verdant Resonance): The records Verdant Resonance adds of its own. They sit beside the standard facets.
- [Slides and video script](https://afflom.github.io/prism-devrel/case-studies/verdant-resonance/slides/index.md) (Verdant Resonance): One slide for each facet of Verdant Resonance, with a script to read over it.
- [Record explorer](https://afflom.github.io/prism-devrel/case-studies/verdant-resonance/explorer/index.md) (Verdant Resonance): Search every record of Verdant Resonance by name, facet or text. Each result links to the pages that teach it.
- [llms.txt and Markdown twins](https://afflom.github.io/prism-devrel/case-studies/verdant-resonance/agents/index.md) (Verdant Resonance): The Verdant Resonance case study as plain text for agents. It has llms.txt, a twin of each page and a feed.
- [How Foundry was modeled](https://afflom.github.io/prism-devrel/case-studies/foundry/index.md) (Foundry): Who the Foundry model is for and what they care about. Then how those concerns became facets.
- [Behavior and proofs](https://afflom.github.io/prism-devrel/case-studies/foundry/behavior/index.md) (Foundry): Every theorem of Foundry, and how it is proved. The Lean kernel checks each one.
- [Slides and video script](https://afflom.github.io/prism-devrel/case-studies/foundry/slides/index.md) (Foundry): One slide for each facet of Foundry, with a script to read over it.
- [Record explorer](https://afflom.github.io/prism-devrel/case-studies/foundry/explorer/index.md) (Foundry): Search every record of Foundry by name, facet or text. Each result links to the pages that teach it.
- [llms.txt and Markdown twins](https://afflom.github.io/prism-devrel/case-studies/foundry/agents/index.md) (Foundry): The Foundry case study as plain text for agents. It has llms.txt, a twin of each page and a feed.
