Pages that remember what people put in them.
Every space has its own SQLite database, so a published page can be a small app people use together: a tracker, a sign-up sheet, a poll, a labelling desk. There's nothing to set up.
From document to app
People used to read a published page and comment on it. With a database behind it, they use it: tick a task, sign up, vote, label. What one person adds, everyone who opens the page sees.
Your agent builds the page the way it does now, plus a SQL file that says what the page keeps. Publishing creates the tables.
In the page
Every HTML page gets window.cloudtifact.db. Use ? placeholders for values. Add { objects: true } to get rows as objects.
const db = window.cloudtifact.db;
// Everyone who can view the page can read.
const { rows } = await db.query(
"SELECT choice, COUNT(*) AS votes FROM votes GROUP BY choice", [], { objects: true });
// Members of the space can write, when they open the page in Cloudtifact.
await db.exec("INSERT INTO votes (choice) VALUES (?)", ["tacos"]);Tables ship with the page
Put SQL files in a db/ folder next to the page. cloudtifact publish and cloudtifact push run each file once, in name order, and remember which ran. To change the tables later, add a new file.
poll/ index.html db/001_schema.sql CREATE TABLE IF NOT EXISTS votes (choice TEXT NOT NULL, at TEXT DEFAULT CURRENT_TIMESTAMP); $ cloudtifact publish poll db: applied 001_schema.sql Published "Poll" v1
Try the idea
A tracker page, with a database behind it
| done | task | owner | Remove |
|---|---|---|---|
| Write the launch post | gczh | ||
| QA the checkout flow | claude-code | ||
| Ship on Friday | gczh |
Data your agent can read
What a page collects comes back to your agent in one command, as a compact table it can summarise, act on, or build the next version from.
$ cloudtifact db query "SELECT choice, COUNT(*) AS votes FROM votes GROUP BY choice" --toon
rows[2]{choice,votes}:
ramen,4
tacos,7| Command | Does |
|---|---|
| cloudtifact db query | Run SQL. Read-only unless you add --write |
| cloudtifact db schema | Tables, columns, row counts, size |
| cloudtifact db export | The whole database as a .sql file |
| cloudtifact db migrate | Run the db/ files without publishing |
| cloudtifact db reset / restore | Wipe it, or roll back to any time in the last 30 days (admins) |
Who can do what
| Read | Write | Reset, restore | |
|---|---|---|---|
| Workspace owners and admins | Yes | Yes | Yes |
| Workspace members | Yes | Yes | No |
| Anyone who can view the page | Yes | No | No |