PrismDevRelOpen the app
Tutorials: Build your first Prism app

Learn

Turn a Rust project into a Prism modelBuild your first Prism app

// tutorial · Learn

Build your first Prism app

Describe your app once, as a structured prompt, and Prism writes every facet of it, proves what it promises and publishes it.

In this tutorial you build, check and ship one Prism app from one prompt. It takes four steps. The app is verified the first time its repository's workflow runs.

From one prompt to a live app1. Write a prompt: the rules, answers and examples, as JSON 2. Build: every facet, written as Prism source 3. Check: the Lean kernel proves each claim 4. Ship: GitHub Pages serves the verified app01Write a promptthe rules, answersand examples, asJSON02Buildevery facet,written as Prismsource03Checkthe Lean kernelproves each claim04ShipGitHub Pagesserves theverified appFrom one prompt to a live app1. Write a prompt: the rules, answers and examples, as JSON 2. Build: every facet, written as Prism source 3. Check: the Lean kernel proves each claim 4. Ship: GitHub Pages serves the verified app01Write a promptthe rules, answers and examples,as JSON02Buildevery facet, written as Prismsource03Checkthe Lean kernel proves each claim04ShipGitHub Pages serves the verifiedapp
From one prompt to a live app. What happens to your prompt. The first two steps run in this page; the last two run in your repository on GitHub.
The data in this figure
StepWhat happens
1. Write a promptthe rules, answers and examples, as JSON
2. Buildevery facet, written as Prism source
3. Checkthe Lean kernel proves each claim
4. ShipGitHub Pages serves the verified app
  1. Load the first example. In the builder below, Start from already shows Rule 30 cell (afflom/rule30). Its app is a prism/spec/1 spec. It lists the request fields, the answers, the rules in order, the properties Lean must prove, and examples.
  2. Build it. Press Build the app. The builder runs in this page and sends nothing anywhere. You see what the app will claim, and every file it wrote, one module per facet.
  3. Change one rule and build again. Change a rule's answer so that it contradicts an example, and build. The builder refuses and names the example. Put the rule back. Every prompt is checked before anything is written.
  4. Download and ship it. Press Download .zip and run the commands under Ship. The repository's gate, just vv, checks every claim. Its Pages workflow proves the app with the Lean kernel and publishes it.

Build an app

Ship

gh repo create OWNER/prism-NAME --template UOR-Foundation/template --public
gh api -X POST repos/OWNER/prism-NAME/pages -f build_type=workflow
git -c core.autocrlf=false clone https://github.com/OWNER/prism-NAME.git
cd prism-NAME
git rm -q app/src/Contract.lex.tex crates/conformance/tests/contract.rs features/suites/contract.feature
unzip -o ../prism-NAME.zip
git add -A && git commit -m "Build the app from its prompt" && git push

NAME is the app's name: app.name in the prompt, such as rule-thirty-cell for Rule 30 cell. The download is prism-NAME.zip. First set repository in the prompt to OWNER/prism-NAME, so the page links to the right place.

Next

tutorialLearnMarkdown

Words on this page 5
facet
One view of a model, such as its architecture, its security or its quality. Each facet holds records.
Lean kernel
The small checker at the heart of the Lean prover. It accepts a proof only if every step follows the rules.
MCP
Model Context Protocol: an open protocol through which AI agents call tools such as the Prism builder.
XACML
OASIS eXtensible Access Control Markup Language 3.0: a policy decides permit, deny, not applicable or indeterminate.
prompt
One JSON document that describes an app. The builder turns it into every facet of a Prism model.