cmd/: CLI entrypoints such aszen, daemon commands, and helper binaries.internal/: core application packages. Key areas includeinternal/proxy/(daemon proxy, routing, transforms),internal/config/,internal/daemon/,internal/web/, andinternal/middleware/.tests/: integration and e2e-style Go tests. Stable integration tests live intests/integration/.web/: Vite + React frontend source. Built assets are emitted tointernal/web/dist/; do not editdist/by hand.docs/andspecs/: design notes, contributor docs, and feature specs. Put architecture-heavy changes here when behavior changes.
make build: installs web deps, builds frontend, then buildsbin/zen.go test -race -short ./...: fast local validation across Go packages.go test -race ./tests/integration/...: stable integration coverage.go test -v -timeout 600s ./tests/...: broader e2e-style validation; slower and sometimes environment-sensitive.cd web && pnpm build: build frontend only.cd web && pnpm test -- --run --coverage: run frontend tests with coverage.
- Go code must be
gofmt-formatted; keep packages focused and fix root causes instead of layering workarounds. - Follow Go naming conventions: exported identifiers in
CamelCase, internal helpers incamelCase, tests asTestXxx. - Frontend code is TypeScript; use ESLint (
cd web && pnpm lint) and keep React components/types consistent with existing patterns. - Avoid editing generated artifacts directly, especially
internal/web/dist/.
- Prefer targeted tests first, then broader suites.
- Add unit/component tests next to code in
internal/<pkg>/*_test.go. - Add integration tests in
tests/integration/; if a test is CI-sensitive, guard it withSKIP_FLAKY_TESTS=trueas documented indocs/TESTING.md. - Maintain strong coverage in critical packages, especially
internal/proxy,internal/proxy/transform,internal/config, andinternal/web.
- Match existing history: use concise conventional prefixes such as
feat:,fix:,docs:,refactor:, or scoped forms likefeat(spec):. - Keep commits focused and explain behavior changes, not just file edits.
- PRs should include: purpose, risk level, affected packages, test evidence, and linked issue/spec when relevant.
- For proxy/routing/transform changes, call out protocol impacts and fallback behavior explicitly.