Under development

Alalaam is a work in progress. Everything here — the plan, the build status, and the historical content it describes — is draft material: not yet reliable, unverified, and subject to change without notice.

Product Requirements & Build Plan · signed off 2026-07-08 · build in progress

Alalaam العَلّام

One historical figure at the centre of their world, drawn as an evidence graph — who they met, who they may have met, and who they only knew through books. Demo subject: al-Khwarizmi, with 23 related figures.

Status: v0.3 shipped — explorer live · v0.4 live layer in progress teaser site live → alalaam.com pending NS switch base: moeghashim/PI-Starter repo: moeghashim/alalaam deploys to: Cloudflare Workers + D1 + DO implementer: Codex

Progress

GATE
Plan sign-offPRD reviewed, three gaps fixed, Cloudflare + PI-Starter decisions locked. Signed off by the owner 2026-07-08.
done
v0.0
FoundationPI-Starter merged into moeghashim/alalaam (42c4e82) · fork-boundary entry in progress.md · build/check/test/agent-check green locally · CI Required checks green on main.
done
v0.1
Engine — core + CLI@alalaam/core (deriveContext grammar, zod validation, Sheets ingestion) + alalaam CLI (7 commands) · seed:legacy reproduces all 23 tiers AND medallion categories · 29 tests · PR #1 merged.
done
v0.2
Skillskill/SKILL.md + CLI reference wrapping the alalaam CLI for Codex / Claude Code — two-writers rule front and centre · PR #2 merged.
done
v0.3
Web on CloudflareMajlis Explorer live at alalaam.mohanadgh.workers.dev — ring view, profile panel, multi-focal, compare, brand pages, EN/AR RTL · ring layout computed from data · PI-Starter Cloudflare kit at docs/pi-starter-cloudflare/ · PR #4 merged, 42 tests.
done
v0.4
Live layer — D1 + Durable ObjectsMigrations · alalaam db push · live-refresh: a synced change appears on the published site within seconds.
in progress
v0.5
Future (deferred)In-app editing admin · multi-user collaboration · a second subject.
deferred

The build, in three layers

1 · Core + CLI

A TypeScript engine (packages/core) plus an oclif alalaam binary (packages/cli) owning all data operations: pull from Google Sheets, validate, derive the evidence graph, compile artifacts.

2 · Skill

A local SKILL.md wrapping the CLI so a coding agent operates Alalaam's content through natural language instead of hand-editing data files.

3 · Web

Next.js Majlis Explorer + brand pages on Cloudflare Workers, reading the same core; D1 + a Durable Object give the published site live refresh on sync.

Foundation: PI-Starter → Cloudflare

The project is built on a clone of moeghashim/PI-Starter (npm workspaces, Next.js 16 in apps/web, Biome, strict TS, CI Required checks, Codex agent layer, append-only progress.md), pushed to moeghashim/alalaam. Starter conventions win over earlier plan drafts — npm replaces pnpm, Biome replaces ESLint/Prettier, tsx --test replaces Vitest.

Upstream deliverable — Cloudflare adaptation kit

PI-Starter targets Vercel; Alalaam is hosted on Cloudflare. The clone gains @opennextjs/cloudflare + wrangler.jsonc + open-next.config.ts, a provider-neutral replacement for the VERCEL=1 type-check escape hatch, and docs/deploying-to-cloudflare.md mirroring the starter's Vercel doc.

The generic subset is packaged as pi-starter-cloudflare/ (doc + config templates + patch, Alalaam bindings stripped) — ready to open as a PR against the original PI-Starter repo. Delivered in v0.3.

Stack

LayerChoice
LanguageTypeScript strict, ESM, Node 22 — shared types from core
Monoreponpm workspaces: packages/core · packages/cli · apps/web · workers/realtime · skill · data · migrations
CLIoclif, binary alalaam
Validationzod — schema + referential integrity over Sheet rows, errors name the offending row
AuthoringGoogle Sheets (read-only service account) → committed figures.seed.json → derived graph.derived.json
WebNext.js App Router on Cloudflare Workers via @opennextjs/cloudflare
Data / liveCloudflare D1 (load target, not authoring) + Durable Object version-stamp broadcast
StylingHandoff CSS token system ported verbatim — Editorial mood, ornament 0.5, motion on
QualityBiome · tsgo --noEmit · tsx --test · Conventional Commits · one PR per task · CI gate on every PR

Command surface

CommandDoes
alalaam sheet syncSheet → validate → compile → seed. Defaults to a dry-run diff; --write applies.
alalaam validateSchema + integrity checks; non-zero exit naming the offending row.
alalaam figure add / link addBootstrap tools — append to the seed; when a Sheet is configured they warn and print the exact Sheet rows to paste (two-writers rule).
alalaam compileSeed → graph.derived.json (tiers, categories, edge textures).
alalaam graph exportPrint a subject's derived graph as JSON.
alalaam db migrate / db pushv0.4 — apply D1 migrations; idempotent upsert + DO version bump → live refresh.
alalaam seed:legacyOne-time import of the 23 prototype figures — asserts category parity, keeps circle notes.
Two-writers rule

The Sheet is canonical and Sheets access is read-only, so anything written only to figures.seed.json dies at the next sheet sync --write. figure add / link add therefore warn loudly and print paste-ready Sheet rows; the dry-run diff surfaces any un-pasted local addition as a would-be deletion before it is lost.

Data model — review fixes locked in

The graph grammar — non-negotiable

Every visual property encodes a claim about the historical record. Rings = distance of certainty; edge texture = kind of evidence; weight/opacity = focus, never meaning.

Documented — solid brassMet & worked beside him. Ring 1, r 0.28×.
Possible — long-dash sandMay have crossed paths. Ring 2, r 0.39×.
Books, arrow in — lapisA source he read. Ring 3 left arc.
Books, arrow out — roseAn heir who read him. Ring 3 right arc.
brass — subject & patrons lapis — sources & teachers verdigris — peers rose — heirs sand — the wider age

Medallions are 16-segment conic rings with an Amiri initial — never a fabricated face. Full specs (sizes, arcs, dash patterns, motion) port verbatim from the handoff CSS in v0.3.

Non-goals

Review verdict & changelog

Verdict — 2026-07-07

Approve with revisions — all revisions now applied to PLAN.md. Architecture, sequencing, and design-fidelity sections were sound; three substantive gaps were found against the design handoff and fixed.

Build log