Opinionated defaults and standards for building TypeScript web products and web-technology repos, covering monorepo layout, rendering, surfaces, routing, IDs, key generation, domains, origins, env contracts, branches, deployment, DNS, auth, data ownership, media, jobs, AI model routing, billing, admin, responsive layout, fonts, product UX, and release operating philosophy. Load this skill early and keep it loaded for any web work: whenever planning, deciding, designing, scaffolding, auditing, naming, reviewing, or implementing anything in a web app, marketing site, signed-in app, SaaS, extension, desktop, or mobile surface built with HTML, CSS, JS, or TS. This includes backend-only web product pieces, such as an API route, a reactive backend function, or a webhook handler, since env contracts, auth, data ownership, and deployment are opinions this skill holds regardless of whether a given file renders UI. When unsure whether it applies, load it. Almost every decision in a web repo touches an opinion it holds.

Frontmatter

name: "web-repository-opinions"
description: "Opinionated defaults and standards for building TypeScript web products and web-technology repos, covering monorepo layout, rendering, surfaces, routing, IDs, key generation, domains, origins, env contracts, branches, deployment, DNS, auth, data ownership, media, jobs, AI model routing, billing, admin, responsive layout, fonts, product UX, and release operating philosophy. Load this skill early and keep it loaded for any web work: whenever planning, deciding, designing, scaffolding, auditing, naming, reviewing, or implementing anything in a web app, marketing site, signed-in app, SaaS, extension, desktop, or mobile surface built with HTML, CSS, JS, or TS. This includes backend-only web product pieces, such as an API route, a reactive backend function, or a webhook handler, since env contracts, auth, data ownership, and deployment are opinions this skill holds regardless of whether a given file renders UI. When unsure whether it applies, load it. Almost every decision in a web repo touches an opinion it holds."
metadata:
  author: "Leeor Nahum"
  version: "1.26.0"

Web Repository Opinions

A web product is more than its Git repo. The real product is code plus database, backend functions, object storage, provider dashboards, environment variables, webhooks, scheduled jobs, deployed app settings, and DNS. Keep those layers explicit so the product can build, deploy, and ship without hidden coupling.

Build around the thing the user came to do. A product should feel like its core workflow, not a generic dashboard with feature panels attached.

These are opinionated defaults, not a single product spec. Apply what fits the repo. The named tools below are swappable defaults. The paradigms around them are not.

Default Stack

Prefer these unless the product has a stronger reason not to. Swap the tool, keep the paradigm.

  • Monorepo: Turborepo with pnpm workspaces
  • Framework: Next.js App Router with TypeScript
  • Styling: Tailwind CSS, shadcn/ui, lucide-react
  • App data and live sync: Convex
  • Auth: Clerk
  • Billing: Stripe
  • Heavy media bytes: Cloudflare R2
  • Hosting: Vercel
  • DNS: Cloudflare
  • Transactional email: Resend
  • Rich text: BlockNote or equivalent block JSON
  • LLM calls: Vercel AI SDK over a hosting-aware, swappable gateway (production model and provider pools are product-specific)

Reference Loading

This skill's substance lives in its references. The map below only points to them, so consult the skill for decisions and not just implementation. Before acting on any topic, read every reference that could touch it, in full, including the ones that seem only adjacent, and read deeply rather than skim. Bias hard toward loading: if a reference might cover what you are about to plan, decide, name, review, or build, read it rather than guess. Loading more references, and reading each completely, is cheap. Acting on a topic blind, or on a half-read reference, is not. Re-read the owning reference whenever a decision in its area comes back up.

Architecture:

Rendering and feel:

Surfaces:

Identity and URLs:

Runtime and environment:

Auth and data:

Media and jobs:

Money and admin:

Frontend and UI:

Operating philosophy:

Core Non-Negotiables

  • The product feels like its core object first. Secondary features attach to it.
  • Every view is URL-addressable so any state can be linked, shared, and restored.
  • One canonical route model per concept. Do not keep long and short versions alive at once.
  • Short, stable, non-sensitive IDs in private URLs. Never slugs for private, renameable objects.
  • Split the public site from the signed-in app by audience and runtime posture.
  • Name and isolate integrations by role so any single system can be swapped without rewriting callers.
  • Build product capabilities with product-shaped inputs and outputs so UI, API, MCP, jobs, and webhooks can compose them without owning their rules.
  • Enforce authorization once at the boundary every client crosses, capability-granular.
  • Heavy bytes live in object storage. The database owns metadata and live state.
  • A reactive backend is wired end to end so the UI updates live, not by manual refetch.
  • One durable owner per fact. User-edited values outrank generated values, and generated values outrank defaults.
  • Compatibility requires an explicit supported contract. Current intended behavior replaces unreleased mistakes.
  • Env holds secrets and true environment variance. Product decisions live in code.
  • Same env key names across stages. Values change by store, not the key.
  • Branches are deployment roles: dev is local, preview is hosted staging on dev resources, main is production.
  • Charge quota before expensive work. Expensive jobs retry only on user action. Failed states must be actionable.
  • User-facing failures use product-owned copy. Raw exception, provider, framework, request, and stack details stay internal.
  • A change is done when the runtime it depends on is true, not when TypeScript compiles.

Web Repository Audit

When invoked to audit a web repo:

  1. Classify public versus signed-in surfaces and whether their rendering posture matches.
  2. Inspect URL IDs, route paths, query-state restoration, and link stability across reorganization.
  3. Check auth bootstrap, workspace creation, and permission-gated UI that hides unavailable actions.
  4. Confirm per-runtime env contracts, no root env clutter, and same key names across stages.
  5. Check ownership boundaries, external sources, search scope, media storage, and bounded data work.
  6. Verify user-facing failures, partial results, feedback, and responsive interaction states remain coherent.
  7. Confirm branch-to-stage mapping, deploy gating, migrations, webhooks, DNS records, and provider setup are documented near the runtime contract.
  8. Report mismatches by category and file area, never by leaking secret values or one-off product names.

Several references end with an "Ask before" line for their riskiest changes, such as production domains, DNS, credentials, billing mode, public sharing, and provider resources. Honor those where the topic lives.