Lorebarn: a team wiki for specs, runbooks and the company handbook

Lorebarn: a team wiki for specs, runbooks and the company handbook

00 Markdown

Nested pages in markdown with live preview, version diffs and restore, presence on every page, and full-text search.

Agent specs

Agent
Claude Code, Opus 5.5 Medium
Time
17 min
Cost
$5.99*

Agents work faster and more accurately on Elements.

* Cost at API rates, September 2026.

Run it yourself

Paste this prompt into your AI agent. You get the finished app on your own machine, ready to change however you like.

Agent Chat
Install elements:
curl -fsSL 'https://install.elements.dev?os=darwin' | sh && export PATH=~/elements/bin:$PATH

Create an Elements app from the elementscode/demo-lorebarn scaffold:
cd ~/elements/projects
elements create lorebarn -scaffold=elementscode/demo-lorebarn
cd lorebarn

Start the app.

Need an AI agent?

In AI desktop apps, paste into the Code tab, not the general chat.

How it's built

Lorebarn needed a page tree that updates for everyone, a version kept on every save, presence on each page, full text search and email invites. Each of those is a part of Elements, so the agent spent its 17 minutes on the wiki itself.

What Elements gave the app

  • Live pages and tree. Pages are a LiveTable split by space, so a save, a new page or a move in the tree shows up in every open tree, page and home screen at once.
  • A version on every save. Each edit is checked against the latest version, keeps a snapshot in the same transaction, and tells a late editor who saved first. History restores a version through the same live table, so every open copy updates.
  • Presence. A channel tracks who is on each page and who is editing, and every open copy of the page shows the same people as they arrive, start typing and leave.
  • Full text search. Search ranks matches across every page and highlights them, from a weighted search column the migration defines.
  • Invites and roles. Admins invite members by email and change roles with @rpc calls that check for an admin first.
  • Data from SQL files. Migrations define the wiki and seed one admin, three members, three spaces with 23 nested pages, 64 saved versions and a pending invite.

What the project server gave the agent

The project server runs alongside the agent and answers as soon as a file is saved: it type-checks the templates, TypeScript and SQL, applies migrations and reruns the tests, so every question came back right away and the agent kept building.

What shipped

The app type-checks with zero errors and all 28 tests pass. Every page works on desktop and phone.

The code

Build it from scratch

To watch your agent build this app from an empty project, use the prompt we used instead. It takes longer than starting from the finished app above.

Agent Chat
Install elements:
curl -fsSL 'https://install.elements.dev?os=darwin' | sh && export PATH=~/elements/bin:$PATH

Create an Elements app:
cd ~/elements/projects
elements create lorebarn
cd lorebarn

Start the app, then build this:

Build a team wiki named lorebarn.

Accounts: admin and member. Admins invite members by email.

- Spaces (Engineering, Product, Handbook), each with a tree of pages that can
  nest.
- Pages are markdown with a live preview while editing.
- Every save keeps a version; see a page's history and the diff between two
  versions, and restore one.
- See who else is viewing or editing a page right now.
- Full text search across all pages.
- Recently edited pages on the home screen.

Seed one admin, three members, three spaces and about twenty pages of
realistic content with history. Show the seeded logins on the sign-in page.

Edits, the page tree and presence update in real time.

The weekly digest

New lessons, demos and posts from elements.dev, in one email a week.

Comments· 0