# AgentSite — Install Patterns
<!--
ref: @agentsite/install-patterns
tags: [agentsite, install, nginx, snippet, ssr, edge, index]
triggers: [installing agentsite, which install pattern, install pattern names and tiers, changing install docs, writing install copy]
trigger_prompt: When choosing, documenting, or changing how a customer installs AgentSite.
category: reference
complements: [@agentsite/project]
version: 8
updated_at: 2026-10-24T21:32:02.211Z
-->
The five GA install patterns and the invariants that govern them. Nginx leads.
Fetch this when: installing agentsite; which install pattern; install pattern names and tiers; changing install docs; writing install copy.
This is a branch **index**, deliberately small. The detail lives in the leaves below — fetch one, not all of them.
## Leaves
| Leaf | Fetch it when |
|---|---|
| [`@agentsite/install-nginx`](@agentsite/install-nginx) | installing via nginx, or checking the dogfooded marketing site |
| [`@agentsite/install-snippet-contract`](@agentsite/install-snippet-contract) | describing what the snippet does, UA behavior, where it lives |
| [`@agentsite/install-ssr-edge`](@agentsite/install-ssr-edge) | Next/Nuxt/edge installs, or someone proposes a pre-render CLI |
---
## Install pattern names and tiers
**All shipped install patterns are GA — Nginx, Express, Express-Sidecar, Edge, streaming-SSR SDK. Customer-facing surfaces are count-neutral (never quote a number — patterns are listed by name so adding/removing one doesn't require a sweep). Nginx leads. INSTALL.md is the source of truth; SKILL.md and agentsiteDocs are thin pointers.**
Customer-facing install patterns. Names not letters since 2026-05-17. **Count-neutral text since 2026-05-29.**
**Shipping today (GA, no badge):**
- **Nginx** (was Pattern F) — thin nginx, no code in customer deploy. **Preferred / "our favorite" install** — leads the list on the features page.
- **Express** (was Pattern A) — static SPA + Node container.
- **Express-Sidecar** (was Pattern B) — non-streaming SSR framework + Node sidecar. _Under reassessment as of 2026-05-29 — open question whether this stays in the lineup, gets renamed, or absorbs into another pattern. Don't scaffold a demo for it yet; don't drop it from existing surfaces either._
- **Edge** (was Pattern C) — Vercel / CF Pages / Netlify edge runtime via `agentsite-edge.mjs`. Promoted from pre-release to GA 2026-05-21.
- **SDK — Streaming SSR** — `@agentsite/sdk` render hooks for RSC, Next App Router, Nuxt 3 streaming, SvelteKit streaming, Suspense streaming. Promoted from pre-release to GA 2026-05-21.
**Why count-neutral.** Hard-quoted counts (`five GA install patterns`, `four shipped patterns`) ran out of date the moment Edge graduated, and every count update is a multi-file sweep. The 2026-05-29 alignment swept ~13 surfaces and re-established the rule: enumerate by name when listing, otherwise use `the install patterns` / `the GA install patterns` / `several patterns`.
**How to apply:**
1. **INSTALL.md (repo root) is the single source of truth.** Served at `https://api.agentsite.app/install.md` by `DocsController.ts`. Frontmatter subtitle is count-neutral.
2. **Nginx leads** in customer-facing pattern lists (features page, marketing copy). It's the "no code in your deploy" install we consider the cleanest. **Note:** install.md's body section ordering is _Express → Express-Sidecar → Nginx → SDK → Edge_; that's a structural decision not yet revisited (lead-pattern reorder = separate change).
3. **SKILL.md and agentsiteDocs.ts are thin pointers** — they summarize when each pattern applies and tell the agent/reader to fetch `/install.md`.
4. **Further-out roadmap (no install yet):** njs (SPEC Chunk 45), CloudFront (workspace/2026-05-13-cloudfront-edge-install-spec.md), Python, PHP. No build-time pre-render CLI — SPAs are runtime-rendered by design.
5. **Internal source code (`RenderController.ts`, `SiteController.ts`, `SiteRepository.ts`, `SPEC.md`, `workspace/2026-05-16-pattern-f-thin-nginx-spec.md`) still uses the letter form.** Not renamed; treat as equivalent.
6. **When asked to add a new install pattern:** add it to INSTALL.md first (matrix + section + decision rule update). Then update SKILL.md and agentsiteDocs.ts pattern lists. Don't introduce a count anywhere.
7. **Reference demo for Express-Sidecar — still gap.** install.md L410 says "No reference demo yet." Don't fill until the reassessment (point 2 above) lands.
## Install docs and demos are the source of truth
**For any install-pattern task (Nginx / Express / Express-Sidecar / SDK streaming / Edge), the canonical references are content/install.md §X and the matching demos/after/<fw>/ directory. Don't re-derive recipes. Maintain bidirectional cross-references between install.md sections and demo READMEs — silent drift is the historical failure mode.**
When a task touches an install pattern, the canonical references are `content/install.md §<Pattern>` and the matching `demos/after/<fw>/` reference implementation. Use them verbatim. Don't re-derive the Dockerfile / nginx config / sidecar shape from first principles.
**Why:** Two compounding failure modes have hit this surface:
1. **2026-05-18 Nginx dogfood switch** — drifted into deriving the recipe from scratch (env.js mechanism, port choice, /_raw handling, Link headers) before opening `demos/after/nginx-container/`. The documentation is meant to lead you to success. The doc + Coastline reference were already byte-exact §3a; the dogfood just needed to mirror them.
2. **2026-05-31 cross-ref drift audit** — found every demo URL in install.md still pointed at `agentsite/integration` after the public mirror moved to `agentsite/install`, plus lovable-edge README lacked the back-link the other 5 demos had. Took a manual sweep to fix; no tooling to prevent recurrence.
## The canonical surfaces (as of 2026-05-31)
**Source-of-truth side:**
- `content/install.md` — pattern picker + per-pattern recipe + reference-implementations table. Served at `https://api.agentsite.app/install.md` by `DocsController`.
- `demos/after/<fw>/` — runnable reference implementation per pattern. Each has its own README.
- `backend/src/controller/ExampleController.ts` — serves single files from `demos/after/` at `/example/<pattern>/<file>` for one-curl installs (allow-list of 7 file paths today).
**Mirror side:**
- `agentsite/install` — public GitHub mirror of `demos/`. Auto-synced from main on every push to `demos/**` via `.github/workflows/mirror-demos.yml` (uses `mirror-examples.sh` for the actual rsync, identical to the local-invocation path).
- A local mirror checkout, located by `AGENTSITE_INSTALL_DIR`.
## Bidirectional cross-ref convention
Every install pattern is required to have:
1. **Forward ref** — `install.md` references `demos/after/<fw>/` either in-prose ("see demos/after/next/ for runnable references") AND in the §Reference implementations table at the bottom of install.md. Links point at `https://github.com/agentsite/install/tree/main/demos/after/<fw>` — _not_ `agentsite/integration` (that repo is private, links 404 for customers).
2. **Back-ref** — each `demos/after/<fw>/README.md` opens with a `Install pattern: [/install.md §<X>](https://api.agentsite.app/install.md#<anchor>)` callout near the live-demo link.
Express-Sidecar is an exception while reassessment is in progress — no demo dir yet, the §Reference implementations row says "No reference demo yet."
## How to apply
- **Before designing anything install-related:** read the relevant `## <Pattern>` section in `content/install.md` and the matching `demos/after/<fw>/README.md`. Both. They're coupled by design.
- **When adding a new install pattern:** ship together — install.md section + demo dir + demo README with back-link + §Reference implementations row pointing at the public `agentsite/install` URL + (if it has stable one-file install artifacts) an entry in `ExampleController.buildAllowList()`.
- **When renaming a pattern:** sweep both forward and back refs in the same commit. The rename is not done until `grep -rE '<old-name>' content/install.md demos/after/` returns clean.
- **Deviations** are fine when the dogfood / customer has a real need not covered by the recipe (e.g., agentsite.app's `/env.js` for SPA runtime config) — call them out as deltas from the recipe, don't quietly redesign the recipe itself.
- **No CI guard exists today** for cross-ref drift. Worth adding a `devops/scripts/check-install-cross-refs.sh` that fails when (a) a `demos/after/<fw>/` dir lacks `README.md` with a `[/install.md` back-link, or (b) install.md's table references a `demos/after/<fw>/` that doesn't exist, or (c) any `agentsite/integration` URL slips back in. Until then, this memory IS the convention.
---
*Related: `@protocol/onboarding` · `@protocol/optimizer-install` · `@agentsite/render-outputs` · `@agentsite/platform-conventions` · `@agentsite/project`*
---
*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*
*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*