Imported from donaldfilimon/MLAI-CORPORATION-WWW (
AGENTS.md). Install upstream withnpx skills add donaldfilimon/MLAI-CORPORATION-WWW. Copyright stays with the author.
AGENTS.md
This is the canonical MLAI integration guide; CLAUDE.md points here. Read the
app-local AGENTS.md for web/mobile/website-app and apps/quasar/README.md for Quasar.
Boundaries
apps/webis the canonical Next.js website. Do not restore the retired mobilewww/snapshot or collapse the website into an Expo static mock.apps/mobileis the Expo companion. Preserve its native CloudKit versus encrypted-local fallback distinction and its signed-device acceptance gap.apps/quasarholds Quasar's service, shared package and Expo app, which are members of the root workspace, plustemplates/next-site, which stays outside it with its own lockfile because it is copied per generated site.apps/website-appis the imported local Next.js application. Keep its shared UI, agent scaffold, SQLite/Better Auth, worker and Python lockfile together. Run its commands from that app directory.apps/research-sitesis the generated static export of the research collection, imported with its history on 2026-09-16. It has zero dependencies and no install step. Never hand-edit itspublic/: regenerate it withapps/web/scripts/export-research.tsxand keep the manifest provenance.packages/contractscontains names and types, not publishable benchmark values. App content sources remain authoritative for copy and figures.packages/toolingholds repository checks and the isolated website-app gate wrapper.check:topologyrunsbun packages/tooling/src/check-topology.ts.- The root is orchestration only. Run app-native gates independently and report their results independently.
- Every app except
apps/research-sites(no dependencies) and the Quasar template installs through one root Bun workspace: one rootbun.lock, no app lockfiles,linker = "isolated"in the rootbunfig.toml. The workspace list in the rootpackage.jsonnames each member; there is deliberately noapps/*glob. - The React type graphs still differ: the Next apps use React 19.2 types and
the Expo apps use SDK 53's 19.0 types. The isolated linker gives each app its
own view, and two mechanisms keep third-party declarations (which often
import
reactwithout depending on@types/react) on the right copy. The rootpackage.jsonpins the Next-side@types/react/@types/react-domandbunfig.toml'shoistPatternkeeps those two out of Bun's hidden fallback directory, so such declarations resolve to the root pin. Each Expo app typechecks throughtsconfig.typecheck.json, which mapsreactto its own types. Do not remove either mechanism, and never switch the linker tohoistedwithout re-running every app's typecheck. - The isolated linker exposes only declared dependencies. Declare every package an app or its scripts import; do not rely on another package's dependencies being reachable.
Commands
Use Bun 1.4 (packageManager and CI), not npm, pnpm, or yarn. The lockfile is
lockfileVersion: 2; Bun 1.3 rewrites it instead of failing.
bun run install:all # bun install at the root (every workspace)
bun run check # aggregate gate: check:topology && check:workflows && check:tooling && check:web && check:mobile && check:quasar && check:website-app && check:research-sites
bun run check:topology
bun run check:workflows
bun run check:tooling
bun run check:research-sites
bun run check:web
bun run check:mobile
bun run check:quasar
bun run check:website-app
bun run dev:web # cd apps/web && bun run dev
bun run dev:mobile # cd apps/mobile && bun run start
bun run dev:website-app # cd apps/website-app && bun run dev
bun run dev:quasar # cd apps/quasar/apps/quasar && bun run start
For focused work, change into the affected app and follow its local docs. Never claim CloudKit, Cloud Run, GitHub Pages, or a live Anthropic generation from a local build alone.
Gate boundaries
install:allis a plain, non-frozenbun installat the root. Each CI job installs at the root withbun install --frozen-lockfile --filter @mlai/platform --filter <its workspaces>, and the topology job runsbun install --frozen-lockfile --lockfile-only, which fails when a manifest changed without the matchingbun.lockupdate.check:topologychecks that required paths exist (rootbun.lockandbunfig.toml, every workspace manifest, both Metro configs and both Expo typecheck configs), that no app lockfile exists, that no nested manifest declaresworkspaces, and that the isolated linker is set. It does not compile contracts or validate content, lockfile drift, or app behavior.check:workflowsruns pinned Actionlint 1.7.12 via Go (Go 1.25+ required; first run downloads the module). It checks workflow syntax and expressions, with optional ShellCheck and Pyflakes disabled.check:toolingrunsbun test packages/tooling/srcfor repository wrapper regressions; the aggregate gate and CI topology job include it.check:web:lintistsc --noEmit, then Node-only Vitest, then sitemap/llms generation and Next build. Fromapps/web, focus withbun run test src/__tests__/landing-page.test.ts; do not substitutebun test.check:mobile: TypeScript, Jest in-band, Expo lint, Expo web export. Fromapps/mobile:bun run test __tests__/cloud.test.ts --runInBand.check:quasar: the three Quasar typechecks (@quasar/*andquasar-app),bun test packages, then Expo web export fromapps/quasar/apps/quasar. Fromapps/quasar, focus withbun test packages/service/src/paths.test.ts(Bun's runner, unlike web/mobile).check:research-sites:bun testplusbun run build, which verifies the clean manifest, exact file inventory and every file hash before copyingpublic/to the ignoredout/.check:website-app: serial database migration, UI build, TypeScript, Vitest, Python pytest and Next build. Both stages share a temporaryMLAI_DATA_DIRremoved on exit; a nonempty explicit override is preserved and may be modified by migration/checks. Run app setup first for parser/model dependencies. CI covers formatting, research validation, TypeScript, Vitest, migration and build; it does not cover pytest, Playwright, or live integrations. The nested agent scaffold remains non-deployable under its ownAGENTS.md.- The root workspace lists Quasar's
packages/*andapps/*;templates/next-sitehas its own lockfile and is not built by that aggregate gate. - CI covers six jobs: topology, web, mobile, quasar, website-app and research-sites. Hosted runs have been blocked by a billing lock since 2026-09-08, so a red hosted check after that date is unmeasured, not a failing gate.
dev:quasarstarts only the Expo app. Start the service separately fromapps/quasarwithbun run --filter '@quasar/service' start; see its README for the unauthenticated LAN listener and provider-dependent acceptance flow.
Documentation
Root documents describe topology and cross-app rules. App documents describe app architecture and commands. Avoid copying long app instructions into the root; link to the authoritative file so the copies cannot drift.
Two permanent checkouts of this repository exist
~/dev/active/mlai and ~/dev/active/MLAI-CORPORATION-WWW are two full
checkouts of this same repository, both tracking origin/main. The second was
created deliberately, on Donald's explicit choice; it is not a worktree and not a
mistake to clean up. ~/dev/active/mlai stays the canonical one for ordinary work.
The consequences are easy to get wrong and expensive:
- A commit made in one checkout is invisible to the other until it is pushed and
fetched. Always
git fetchin the other before trusting any ahead/behind count, and never compare them without doing so. - Never edit the same file in both. There is no shared index and no warning; the two simply diverge and the second push conflicts.
- The directory name matches the repository name, which is exactly why it is the
tree most easily confused with
dev/active/mlai. Confirm which one a request means before editing.
Note also that apps/website-app was imported from the separate repository
donaldfilimon/mlai-website-app. Everything through its 801bdad was merged
here with history on 2026-09-16, and that repository has been archived
read-only on GitHub since the same day, so this tree is the only place to
develop the app. Provenance is in docs/website-app-import-manifest.json.
Git workflow (machine policy, 2026-08-27)
Work on the default branch in this canonical checkout. Do not create
branches or worktrees by default; they are for tasks that genuinely need
isolation, or when Donald asks. Any worktree or topic branch created here
must be merged back into this checkout's default branch, the worktree
removed, and the branch deleted, before pushing and before the task is
called done. Full policy: ~/.claude/CLAUDE.md (Git discipline).
GitHub Pages
- GitHub Pages publishes the static companion in
apps/web/site/via.github/workflows/pages.yml(Actions only). The legacygh-pagesbranch is retired; do not recreate it for deploys.