Checks
September 16, 2026 ยท View on GitHub
Husky hooks, npm run validate, and the test commands that gate commits and
pushes. See the setup index for the other setup pages.
git commitruns the Huskypre-commithook, which formats staged JavaScript/TypeScript/JSON/Markdown/CSS files withoxfmt, appliesoxlint --fixto staged JavaScript/TypeScript files, runsnpm run typecheckfor the repo, and runsnpm run migrations:checkbefore the commit is created.git pushruns the Huskypre-pushhook, which executesnpm run test:push(CI=1test:node+test:workers) so pushes are blocked when those suites fail. Those are the same Nx targets the CI Node / Workers jobs run, so a remote-cache hit is possible after push. Playwright E2E stays innpm run validateand the CI E2E job. The push hook stops short of that suite because Playwright E2E is heavier than the unit gate, and a failed e2e leg skips the unit gate when the push is retried with--no-verify. Bundler artifacts live undersrc/node_modules/.kody-generated/. Local origin development uses Vite;wrangler-env.tsstill wraps D1/types and sibling worker deploys. Playwright setsCLOUDFLARE_ENV=testso Vite skips platform/runtime auxiliary workers. Cursor Cloud Agent VMs keep Cursor's hook dispatcher ascore.hooksPathand compose Husky throughnpm run hooks:ensure(prepareruns it afterhusky; Cloud Agent environmentstartshould run it too) sopre-pushstill reaches.husky/_โ see cloud-agents.md. Vitest's defaulttestTimeoutis 20s so the workers pool's first Durable Object RPC in a file (~10s) does not fail the default budget (see decision 0011); the push gate also setsCI=1so worker count and Nx cache hashes match GitHub Actions.- Because the commit hook already enforces formatting, lint fixes, and typechecking, agents do not need to run those checks separately before every commit unless they want earlier feedback or are validating a larger change set before opening a PR.
- Push-time hooks intentionally stop short of
npm run validate; Playwright E2E, MCP E2E, and repo-wide format checks remain explicit checks because they are heavier than the push gate. npm run validateis the single authoritative local gate. It is read-only and executesformat:check,lint,typecheck,test:node,test:workers, Playwright E2E, MCP E2E,backup:build,status:build,nx-cache:build,jobs:build,runtime:build,platform:build,primitives:check,migrations:check,deploy-guardrails:check,docs:check-temporal,docs:check-decisions, andmermaid:checkin parallel, reporting every failure (sibling checks are not aborted on the first failure, including when one of the docs or mermaid checks fails). The unit-test and Playwright legs setCI=1so timeouts, worker limits, and Nx cache hashes match the contended parallel layout used in GitHub Actions. CI runs the same checks as parallel jobs (๐งน Static, ๐งช Node, โ๏ธ Workers, ๐ MCP, ๐ญ E2E, aggregated by โ Validate). Ifnpm run validatepasses locally, CI will pass. Trusted writers (Cloud Agent environments, and same-repo validate) setNX_SELF_HOSTED_REMOTE_CACHE_SERVERand the write token so Nx uploads task artifacts tohttps://nx-cache.kody.codes. Forkpull_requestvalidate uses the read token and can only GET (see decision 0019, decision 0038, decision 0040, andpackages/nx-cache/readme.md). Those cached scripts run throughtools/run-nx.tsso a mid-run remote-cache transport flake cannot fail validate after the tasks already succeeded.npm run deploy-guardrails:checkprotects reviewed Durable Object migration history and bindings in both Wrangler configs, requires exact allowlisting for class deletion, and rejects destructive Cloudflare CLI operations in automatically triggered GitHub Actions jobs.npm run validate:fixrunsformat+lint:fixand is the explicit opt-in for mutating auto-fixes. It is never required to passvalidate.npm run formatapplies formatting updates on its own.npm run test:pushruns the sametest:nodeandtest:workerssuites enforced by the Huskypre-pushhook and by the CI Node / Workers jobs.npm run test:e2e:runensures Playwright Chromium is installed before the suite starts, sonpm run validateself-heals on a fresh machine.- Use
npm run test:e2e:installwhen you want to prefetch Playwright browsers ahead of time instead of waiting for the first E2E run. CI caches~/.cache/ms-playwrightand runstest:e2e:ensure, so a lockfile-matching cache hit skips the download and never runsapt-get(--with-depsis local-only;apt-get updatecan hang the E2E job past the 15-minute timeout). npm run test:e2e:runruns the Playwright suite through Nx and depends on a cachedworker:prepare-e2e-envtarget for.envbootstrap plus an uncachedworker:prepare-playwrighttarget that checks the local Chromium install.npm run test:mcpruns MCP server E2E tests and also depends on the cachedworker:prepare-e2e-envtarget, which writespackages/worker/.envfrom.env.examplewhen needed and backfillsCOOKIE_SECRETbefore the test run.