docs/PLAN.md is the spec: no design judgment; anything unclear is a question in the PR, not a guess.
- Public API: typed (no
any/interface{}), explicit, sequential, minimal; no generics ([T any]) orreflectwithout benchmarked allocation/performance justification and owner approval; never export a symbol only a test uses. - One intent, one path: the old path is deleted in the same change. No silent fallback,
TODO, commented code or stub. - Fail at compile time, else a loud diagnostic — never silently. Zero values deny.
- A defect in a dependency is reported, never wrapped or patched here.
- No string literals in logic: named constants. The same logic never lives in two repos: import the package the plan names; if you find an existing one the plan does not name that already does what you are about to write, say so in the PR instead of writing it.
cmd/*/main.go: parse flags, inject, print/exit only. stdout = data, stderr = logs, exit codes are the contract.- WASM code:
webtyp/fmt,webtyp/time,webtyp/jsoninstead of stdlib (imported without alias asfmt,time,json— nevertinytime); nomap;dom.Elementembedded by value. css.go,svg.go,js.go,html.gocarry//go:build !wasm; nossr.go, nofront.go.- Build tags:
wasm/!wasmonly when the API does not exist on that platform;browser/!browserwhen an app's file belongs to another binary; a library carries no destination tag (the linker drops what a binary never calls). One main per folder, no destination tag:web/browser/main.go→web/public/browser.wasm,web/server/main.go→web/server/server,web/edge/main.go→web/edge/edge.wasm. - Code and keys in English; UI text is
lang.Text, translations live inlang.json. Comments and docs: English inwebtyp/*; inveltylabs/*every README,docs/*file, diagram and code comment is in Spanish, written for a reader with little technical background, and each exported symbol's comment shows a short usage example. - A translation key is reused, never duplicated as a near-identical phrase (
"not a valid integer"+"not a valid decimal number"repeats"not a valid"three ways instead of composing it once) — every library ships to WASM/TinyGo, so each unreused phrase is dictionary rows AND binary bytes, in every consumer, forever. A token that doesn't need translating (a kind/type name likeint) is passed as data (a variable), never as a string literal — a literal becomes a dictionary key whether or not it needed one. - Tests cover behaviour and domain rules, never the look (CSS, colours, markup order, class strings). In
tests/(external package), real stack with fakes only at the edge; rungotest. - Docs (
README.md,docs/*) updated with the API; permanent docs never linkdocs/PLAN.md. - Before the PR:
git diff --stat mainlists every file of the plan's stages, and nothing the plan did not order is deleted.
appkitc is a development tool: it writes the main files of a webtyp appkit app (web/server, web/browser, migrate, config/services). It never runs in production and no app imports it: each app pins it with a tool line in its go.mod and webtyp dev runs go tool appkitc.
- Stdlib is legitimate here. This repo runs on the developer's machine, never in the browser or in a server binary: keep
fmt,os,text/template,go/astas they are. Do NOT "fix" them towebtyp/fmt. (The files undertests/fixtureapp/are the exception: they are an app, so they usewebtyp/fmt.) - Dependency direction:
appkitcimportswebtyp.com/server(project detection,MainConfig, flag names) and the libraries the templates call; neitherservernorappkitmay ever importappkitc. tests/fixtureapp/is a compiled fixture. Its hand-written files (config/app.go,config/services/{backend,mcp,server}.go,config/screens/browser.go) are edited by hand; its generated files (web/server/main.go,web/browser/main.go,migrate/main.go,config/services/{migrations,removed}.go) are goldens: never edit them by hand, regenerate withAPPKITC_UPDATE_FIXTURE=1 gotest.- Templates change only together with the library API they call. A template that does not compile against the libraries in
go.modmust failgotesthere, never in an app. - Never write
go.mod/go.sumlines by hand: onlygo getandgo mod tidy.