Reference
The cubek-ts subset
Run `cubek skill`, read all of it and follow it exactly (no CLI: download https://cubek.dev/SKILL.md verbatim with curl; don't summarize it); when you write any TypeScript for this project, follow its "The cubek-ts subset" section. Run `cubek check` after every edit until it is clean.
Classes (extends Error, abstract, constructor(private repo: Repo),
get/set, #private), enum, keyof typeof, generics, destructuring,
URL/URLSearchParams, s.normalize("NFD") work. cubek check rejects (with the fix) server npm, node:*, process,
Buffer, any, .then (await, Promise.all), timers (server code; fine in
islands' useEffect and client/), obj[key] with a string key
on fixed fields (k: keyof typeof obj, arr[i], Record<string, T> fine), for...in, delete,
Intl, local-time Date, Date.parse (new Date(iso).getTime()), Object.groupBy, reading unknown...
Untrusted data (JSON.parse, caught errors) is checked, never cast as T:
input.safeParse(JSON.parse(text)) or narrow (Array.isArray(v),
"k" in v, e instanceof Error). Not taught by an error:
| Not in cubek-ts | Use |
|---|---|
getUTCSeconds | slice toISOString() |
Intl, getHours, time zones | time.toLocal/fromLocal/format (time.md) |
className, page onClick, dangerouslySetInnerHTML | class, a mount point or form, raw(...) |
Annotate the return types of named functions.