Development Workflow
Overview
Use this file for day-to-day implementation choices, TypeScript conventions, and keeping code, tests, and docs synchronized.
Working Rules
- Preserve the existing Koa, TypeScript, Vite, VitePress, and Vitest stack.
- Avoid adding new JavaScript business files; keep application logic in TypeScript.
- JavaScript maintenance scripts are acceptable when matching existing
scripts/*.jspatterns. - Keep changes scoped to the requested behavior and nearby ownership boundaries.
- Reuse existing types before adding new public types. Put shared types in
src/types/. - Reuse existing response helpers so public response structures stay consistent.
- Do not introduce a new dependency unless it is part of the task and the existing stack cannot reasonably solve the problem.
- Do not change the default port
3200unless the user explicitly asks for it. - Keep implementation, tests, and documentation synchronized for user-visible behavior changes.
Recommended Flow
- Read the relevant service, controller, route, type, and test modules.
- Implement upstream API behavior in
src/services/. - Wire HTTP behavior in
src/controllers/. - Register or adjust routes in
src/routes/router.ts. - Update shared types, tests, and docs when the public surface changes.
- Run the smallest useful validation first, then the required handoff checks.
Documentation Changes
- API behavior changes should update the corresponding page under
docs/api/. - Usage or setup changes should update
docs/guide/or other existing documentation pages. - Keep VitePress configuration changes in
docs/.vitepress/config.mjs.