Agent skill · lobehub

split-micro-app

Use for standalone micro apps: React Router SSR/SSG, Cloud overlays, Workers, CDN/R2, SEO/OG, gateway routes, previews, Docker integration and SSR bundle isolation.

What it needs

About 8k tokens when loaded.

What this skill does

Micro App: Split, SSR, SEO, Gateway Canonical living examples, both extracted 2026-08 — read the real files, this skill records the decisions and landmines, not copies of the code: apps/workbench (/verify, /acceptance) — all code in this repo, builds and deploys from OSS CI. apps/share (/share/t/:id, /share/page/:id) — renders Cloud-only surfaces, so it builds and deploys from lobehub-cloud CI. See §1b before touching it. apps/auth (/signin, /signup, …) — the SSG variant: ssr: false + prerender, so the worker carries no React at all (7KB). 18 locales x 4 routes of prerendered documents. Also renders Cloud-only surfaces (§1b). See §3b. Hosting One app, two serve paths. Do not mix them. Surface Who serves it Build ------------------- --------------------------------------- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Cloud Gateway (torii) → Worker (SSR) Cloud Next does not build:spa:<name>, copy spa-<name>, rewrite to /spa-<name>, or CDN-upload that prefix OSS / 子部署 Docker Next in the same image, client-rendered build:docker runs build:spa:<name>; <NAME>REQUIRED=1 on generateSpaTemplates; Dockerfile copies apps/<name>/package.json before pnpm i and public/spa-<name> into the runtime image generateSpaTemplates skips a missing dist/<name> HTML unless <NAME>REQUIRED=1. Cloud must skip. Docker must require. Do not revive Cloud SPATARGET=<name> Vite builds or a /spa-<name> middleware rewrite. The Docker chain per app, all five links or the route is dead: root build:docker script → copySpaBuildCore.ts target entry (dist/<name> → public/spa-<name>) → spaHtmlPaths.ts resolver + generateSpaTemplates block → src/app/spa-<name>/[locale]/[[...path]]/route.ts → middleware rewrite (src/libs/next/<name>Routes.ts + define-config.ts) plus the path in src/proxy.ts's matcher and, for public pages, in isPublicRoute. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills lobehub/split-micro-app--ebf51f

View the source on GitHub

Browse the @skills marketplace