JavaScript Web App Standard

The javascript-web-app profile covers browser applications built from owned HTML, CSS, and JavaScript. It is the compatibility profile for no-build browser apps and existing checked-JavaScript ports. New reusable browser runtimes and JavaScript-facing libraries should use the greenfield TypeScript profiles defined in TypeScript Standard. The default JavaScript-profile posture is no-build: source files are served directly by a host app or static file server until a package manager, bundler, or transpiler is clearly justified.

Profiles

javascript-web-app
Generic browser runtime profile for plain HTML, CSS, JavaScript, tests, docs, contracts, and hygiene ratchets.
python-js-app
Python package or FastAPI-style application that serves a browser runtime. It inherits the web rules and adds uv, Hatchling, Ruff, Pyright, and Python-to-browser API contract expectations.

default_javascript_web_standard

Returns the generic no-build browser JavaScript and CSS profile.

default_python_js_standard

Returns the Python-served browser application profile.

render_javascript_web_standard

Renders the generic browser profile for human or machine use.

render_python_js_standard

Renders the Python-served browser app profile for human or machine use.

No-Build Default

A build step is optional. Projects may use native browser JavaScript, explicit script load order, ES modules, or manifest-ordered IIFEs. If a Node toolchain is introduced, package.json and its lockfile must be committed and CI must run the declared lint/test/build scripts.

Import maps, direct ES modules, and modern CSS are preferred when they keep source inspectable in the browser. Build tools are allowed when they remove real complexity, such as package dependency resolution, reusable TypeScript libraries, generated assets, or browser automation infrastructure.

Source Boundaries

Documentation Layout

JavaScript profiles require a canonical JavaScript standard design doc. Repositories may keep the legacy root page docs/design/javascript-standard.html or use the foldered design-doc layout docs/design/standards/javascript.html. Projects with another deliberate layout may configure the canonical path:

[documentation.standard_docs]
javascript = "docs/design/standards/javascript.html"

JavaScript Rules

TypeScript Migration

Checked JavaScript is a migration bridge. Existing projects may use jsconfig.json, tsconfig.json with allowJs, JSDoc, and // @ts-check while porting, but new owned modules should move toward .ts or .tsx. Convert reusable module boundaries first, then shared state and event contracts, then leaf DOM wiring. Projects that adopt a TypeScript profile while still carrying owned JavaScript must document that temporary state with [typescript.migration].

JavaScript Tests

CSS Rules

Web Components

Web Components means the platform custom element, Shadow DOM, template, and slot APIs. The standard is to build owned wn-* primitives when a UI pattern is reused or needs lifecycle, accessibility, encapsulated DOM, or a stable event contract.

WASM

Agent-Time Visual Verification

Agents changing UI must open the app in a browser, inspect the rendered state, and use screenshots or DOM checks to verify that important controls, canvas content, panels, dialogs, and responsive states are not broken. CI should still test the underlying algorithms, contracts, and generated files without depending on human visual judgment.

Command Surface

Repositories must expose simple verbs even when the underlying shell differs. The required verbs are install, update, build, test, and signoff. Optional verbs include clean, dev, and run.

Existing repositories may keep PowerShell, shell, Make, package scripts, or Python wrappers. New cross-platform repositories should prefer a small Python or uv-backed orchestrator with thin platform wrappers when native shell behavior diverges.

Signoff

No-build projects should provide dependency-free scripts/js_hygiene.py and scripts/css_hygiene.py ratchets, plus Rack L99 tests that call them. Projects with Node tooling may satisfy the same role through committed package scripts and lockfiles.

Web signoff should include type checking, CSS token hygiene, JS/CSS hygiene, deterministic module tests for non-DOM logic, browser smoke where feasible, Python API contract tests for served apps, and release validation for generated standalone HTML bundles.