Contributing
Contributions are welcome. The codebase is small and opinionated — please follow the existing conventions so new code stays structurally consistent.
Fork and clone
Section titled “Fork and clone”git clone https://github.com/<your-username>/kilat.gitcd kilatbun installCreate a branch
Section titled “Create a branch”git checkout -b feat/my-featureUse a descriptive prefix: feat/, fix/, docs/, chore/.
Follow AGENTS.md
Section titled “Follow AGENTS.md”Read AGENTS.md
before writing code. It documents the hard rules that keep the architecture
intact:
- Routes live in
src/server/routes/<feature>.routes.ts— one file per URL namespace, handlers inline, GET renders and POST actions together. src/server/is flat exceptroutes/. No feature subfolders. Extract a module only when logic is reused across routes.- All SQL lives in
db.tsas async query functions. Schema changes are new numbered migration files — never edit an applied migration. - Env is read per-request via
initConfig(env)inconfig.ts. Never readprocess.envin other modules. - Validation via TypeBox at the route level.
- TypeScript:
strict+noUncheckedIndexedAccess+verbatimModuleSyntax. Type-only imports useimport type. No ORM, noany. - CSS is co-located —
styles.cssis global base only; component/page styles live in sibling.cssfiles.
Run checks before submitting
Section titled “Run checks before submitting”bun run typecheck # tsc --noEmitbun run test # bun test --isolateBoth must be green. Also rebuild and smoke-test in the browser if you touched the client — a green build + green tests does not mean the page works (check the browser console for runtime errors).
bun run build && bun run devKeep docs in sync with code
Section titled “Keep docs in sync with code”If your change alters behavior, config, or conventions, update the
documentation in site/src/content/docs/ to match. Docs that describe
behavior that no longer exists are worse than no docs.
Check:
- The relevant page under
auth/,deployment/,database/,extending/ troubleshooting.mdxif you hit and fixed a Workers-specific pitfall- The sidebar in
site/astro.config.mjsif you add a new page
Submit
Section titled “Submit”- Push your branch.
- Open a pull request against
main. - Describe what changed and why. Reference any related issues.
- Ensure CI (typecheck + tests) passes.
Keep changes minimal and conventional — delete dead code rather than leaving shims or aliases behind a rename.