# AGENTS.md — ZDDC ## Commands ```bash # Build all tools (writes to dist/ only) sh build.sh # Build single tool sh tool/build.sh # archive | transmittal | classifier | mdedit | landing # Cut a stable release (auto-increments patch version, tags, writes to website/releases/) sh tool/build.sh --release sh tool/build.sh --release 1.2.0 # explicit version # Cut an alpha/beta channel build (mutable, no git tag) sh tool/build.sh --release alpha sh tool/build.sh --release beta # Release all tools at once sh build.sh --release [version|alpha|beta] # Test all tools npm test # Test single tool npx playwright test tool # archive | transmittal | classifier | mdedit # Dev server (cache-busting HTTP, on port 8000) ./dev-server start ./dev-server stop ``` No lint, typecheck, or format commands exist — the project is plain sh + vanilla JS. ## Architecture Five independent single-file HTML tools (`archive`, `transmittal`, `classifier`, `mdedit`, `landing`). Each compiles to one self-contained `.html` in `dist/` with all CSS and JS inlined — the first four name their output `dist/tool.html`; `landing` writes `dist/index.html` (it's served at `/` by `zddc-server`). Tools share a small set of canonical helpers in `shared/` (filename parsing, ZDDC filter UI, theme, help) — see "Shared modules" below. ``` tool/ css/ source stylesheets (concatenated in order) js/ vanilla JS IIFEs (concatenated in order) template.html placeholder markers: {{CSS_PLACEHOLDER}}, {{JS_PLACEHOLDER}}, {{BUILD_LABEL}} build.sh assembles dist/tool.html dist/tool.html generated output — committed with `git add -f` shared/ base.css CSS tokens and primitives included first by every tool's CSS build zddc.js canonical filename/folder/revision parsers, formatters, status validation zddc-filter.js shared ZDDC project/status filter UI module theme.js light/dark theme switcher help.js shared help dialog module build-lib.sh POSIX sh helpers (ensure_exists, concat_files, build_timestamp) sourced by every tool's build.sh via: . "$root_dir/../shared/build-lib.sh" website/ index.html current stable landing (root URL) releases/ _v...html immutable stable release archives _stable.html -> ... symlink to current stable (highest semver) _alpha.html mutable; overwritten by --release alpha _beta.html mutable; overwritten by --release beta install.zip drop-in self-contained install (5 stable HTMLs + _template/ stubs) track-stable.zip level-2 stubs that track the current-stable channel track-alpha.zip level-2 stubs that track the alpha channel track-beta.zip level-2 stubs that track the beta channel bootstrap/ level1.html.tmpl per-project bootstrap template (relative ../.html) level2.html.tmpl level-2 channel-tracking bootstrap template README.md install / channel / pin docs ``` **Critical:** `dist/` files are gitignored but force-committed (`git add -f`). Never edit them directly. ## Shared CSS (`shared/base.css`) Included as the **first** positional arg to every tool's `concat_files` CSS call. Provides: - `:root` CSS custom properties — `--primary`, `--bg`, `--text`, `--border`, `--font`, etc. - Brand color: `--primary: #2a5a8a` (matches zddc.varasys.io) - Button primitive: `.btn`, `.btn-primary`, `.btn-secondary`, `.btn-sm`, `.btn-lg`, `.btn-link` - `.app-header` + `.app-header__title` chrome rules - `.build-timestamp`, `.hidden`, `.truncate`, webkit scrollbars **Do not** define these in any tool's own CSS — they come from shared. **Toast CSS** lives in `classifier/css/base.css` only (classifier is the only tool that uses toasts). ## Transmittal CSS quirks - `transmittal/css/base.css` overrides `html { font-size: 16px }` inside `@media screen` — this must stay. `shared/base.css` sets `14px`; transmittal's floating labels are rem-based and were designed for 16px. - The floating label position is defined in `transmittal/css/forms.css`, not Tailwind classes. If adding new Tailwind classes to `template.html`, add them to `transmittal/css/utilities.css` too — there is no Tailwind build step. ## Build system rules - Every `build.sh` sources `shared/build-lib.sh` first (provides `ensure_exists`, `concat_files`, `build_timestamp`). Set `root_dir` before sourcing. - Build scripts use **POSIX sh** (`#!/bin/sh` with `set -eu`), not bash. - `concat_files` accepts **positional args only** (not array names). - `awk` processes `template.html`, replacing `{{PLACEHOLDER}}` markers and stripping CDN `