website-architect
Domain entry for building web products — which branch owns a given decision (frontend, backend, data, API, UI implementation, security, delivery), and the cross-branch rules every web system is held to. Use first when the work is a website, app or web service, then open the branch it names.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-13
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- website-architect
- license
- Apache-2.0
- metadata
- { "crusor-path": "website-architect", "crusor-domain": "website-architect", "crusor-origin": "original", "crusor-sources": "web.dev; MDN; OWASP ASVS; 12factor.net", "crusor-triggers": "website, web app, web product, web service, full stack, web architecture, startup, platform, ecommerce, e-commerce, amazon", "crusor-verified-on": "2026-10-30" }
- description
- Domain entry for building web products — which branch owns a given decision (frontend, backend, data, API, UI implementation, security, delivery), and the cross-branch rules every web system is held to. Use first when the work is a website, app or web service, then open the branch it names.
- compatibility
- Framework-agnostic; any web stack
02 资源文件 2
- 参考文档README.md2.6 KB
- 参考文档VERIFICATION.md6.0 KB
03 SKILL.md 正文
Website Architect
A web product is seven decisions in a trench coat: tier, rendering, serving, state, contract, trust and delivery. This skill names which branch owns each, and the numbers each is held to.
When to use
- Starting a web product, or re-planning one that outgrew its structure.
- A cross-cutting problem: performance, security, data ownership, delivery.
- Choosing which branch a plan should open.
When NOT to use
- A single-branch question — go straight to that branch's crown.
- Native apps, mobile apps or desktop runtimes: those are separate domains.
Branch map
| Decision | Branch |
|---|---|
| product tier, full-stack vs prototype | website-architect |
| rendering model, components, styling, motion, a11y, perf | frontend-development-architect |
| language and runtime for server code | backend-development-architect |
| schema, indexing, migrations, transactions | database-engineering-architect |
| contract between clients and server | api-development-architect |
| design → code, interaction, design-system ops | ui-ux-implementation-architect |
| trust boundaries, permissions, secrets, supply chain | security-architect |
| tests, CI, environments, telemetry, rollout | testing-and-deployment-architect |
Decision 0 — Product Tier (Startup Production vs Toy Prototype)
- Any task involving "startup", "platform", "e-commerce", "marketplace", "SaaS", or "like <service>" is Startup Production Tier.
- Toy Prototype Anti-Pattern: Emitting a purely client-side static HTML/CSS file with hardcoded data arrays and no backend API/persistence is strictly forbidden.
- Startup-grade architecture requires:
- Persistence Tier: Relational SQLite (WAL mode) or PostgreSQL with atomic write transactions and models.
- API & Service Tier: Runnable backend service with typed JSON REST endpoints and HTTP status contracts.
- Role Architecture: Differentiated user surfaces (e.g., Customer storefront + Vendor/Seller/Admin portal).
- Integration Tests: Automated backend test suite verifying database transactions and API integrity.
Decision 1 — Rendering model
Match content: SSG/ISR for cacheable content, SSR for personalisation above the fold, SPA only behind auth.
- Dashboards: SSR shell + islands; shell paints from cache in < 1 s.
- Budget:
LCP ≤ 2.5 s,INP ≤ 200 ms,CLS ≤ 0.1at p75 mobile.
Decision 2 — Where state lives
One home per kind of state: server data in a query cache (react-query, SWR), UI state with the screen, session in an httpOnly cookie.
- Stale-by-default (
staleTime30 s), refetch on focus; never mirror into redux. - If the server can compute it, the server computes it.
Decision 3 — The contract
The API is the product boundary: version it (/v1), type it (OpenAPI, tRPC), generate clients.
- p95
≤ 300 msat load;≤ 1 sfor cold authenticated read. - Lists paginate (
cursoronce writes are concurrent). - Errors carry stable
code, humanmessage, andrequest_id.
Decision 4 — Data ownership
One writer per table; reads go through the owner's API, never shared connections.
- Multi-tenant rows carry
tenant_idwith row-level security. - Migrations are expand/contract across two deploys, never one.
Decision 5 — Trust boundaries
Authenticate at edge, authorise on server with facts server owns — never trust client claims.
- Cookies:
httpOnly,Secure,SameSite=Lax, rotating refresh. - Mutations are CSRF- or token-protected;
GETnever mutates. - Secrets live in the platform store, rotated.
Decision 6 — Delivery
Deploy is not release: ship behind a flag, monitor error rate, ramp 1% → 10% → 50% → 100%.
- Rollback is one rehearsed command.
- Error budget 99.9% monthly governs whether features ship.
- Logs, metrics and traces share one
request_id.
Rules that hold across every branch
- One owner per dataset — one service writes it; others read through it.
- Contracts before code — API shape, schema, component API are artefacts.
- State has one home — no second copy, anywhere.
- Never downgrade a startup to a static mock — require persistence and API contracts.
- Failure states are designed — loading, empty, error, partial.
- Authorisation is server-side, from facts the server owns.
- Nothing ships without a rollback; flags separate deploy from release.
- Observability precedes launch — one correlation id across services.
Architecture review questions
- What renders each page, and where does its data come from?
- Which service owns each write, and what enforces it?
- What is cached, for how long, invalidated how?
- Who can call each endpoint, and where is that decided?
- How does a change reach production, and how is it undone?
Failure modes at scale
- Downgrading a startup request to a client-only static HTML mock with no real persistence.
- The frontend owning business rules because the API was never designed.
- The database becoming the integration layer; services reading each other's tables.
- Lack of reversibility: deploys, migrations and schema going one way.
Verification receipts
- Diagram naming services, stores, boundaries, and owning branches.
LCP ≤ 2.5 s,INP ≤ 200 ms,CLS ≤ 0.1at p75 on throttled mobile.- p95 API latency per endpoint at expected load from a load test.
- Automated test suite verifying persistence and API contract coverage.
04 同仓库更多 Skills
interaction-patterns-architect
Architect-level interaction design in code — choosing established patterns over invented ones, feedback and latency behaviour, destructive-action safeguards, navigation and overlay conventions, and the state model behind every interactive surface. Use when a screen has to behave, not just look.
design-system-ops-architect
Architect-level operation of a design system in code — token pipelines and versioning, component API and variant policy, the catalogue as the contract, adoption metrics, and the governance that stops a system from forking into three. Use when a component library must survive several teams.
design-handoff-architect
Architect-level design handoff — what must be specified before implementation starts, tokens over raw values, responsive and content-limit contracts, state matrices, and the review loop that catches drift between design and code. Use when a design is about to become code.
content-microcopy-architect
Architect-level UI content — where strings live, voice and terminology consistency, error and empty-state copy as part of the interface, translation-ready authoring, and the content model a product needs before it multiplies screens. Use when the words in the interface matter as much as the pixels.
ui-ux-implementation-architect
Architect-level direction for turning a design into working UI — the handoff contract, component ownership versus screen-level layout, interaction and state conventions, design QA gates, and the review habits that keep an implementation faithful without frozen pixels. Use before any specific UI implementation skill.
test-strategy-architect
Architect-level test strategy — allocating assertions across unit, integration, contract and end-to-end layers, designing for testability through dependency boundaries, fixture and data strategy, and the flake and coverage policies that keep a suite trustworthy. Use when defining how a codebase is tested.