Code Style & PRs
TypeScript
- Strict mode is enabled. No
anyunless unavoidable. - Use
import type { ... }for type-only imports. - Path alias
@/*maps to./src/*. - All env vars are read through
src/config/index.ts— neverprocess.envdirectly in business logic.
React
"use client"directive on all interactive components and pages that use hooks.- API routes are server-side only — no
"use client"insrc/app/api/. - Components in
src/components/ui/are shadcn/ui — don’t modify them directly, add overrides in parent components.
Database
- All DB access through repository classes in
src/modules/db/repositories/. - No raw Prisma calls in API routes or processors — use repositories.
- Run
pnpm db:generateafter schema changes,pnpm db:migrateto apply.
API routes
- Validate inputs at the route level before passing to repositories or queues.
- Return consistent error shapes:
{ error: string }with appropriate HTTP status. - Use
NextResponse.json()— notResponse.json().
Linting
pnpm lintESLint with Next.js rules. Fix all lint errors before opening a PR. No lint suppression comments without a comment explaining why.
Submitting a PR
- Fork the repo and create a branch:
git checkout -b feat/your-feature - Make your changes with focused commits
- Run
pnpm lintand fix any errors - Open a PR against
mainwith a clear description of what changed and why - Link any related issues
Commit message format
type: short description
Types: feat, fix, docs, refactor, test, choreExamples:
feat: add HeadingHierarchyEngine scan engine
fix: prevent duplicate pages in crawl discovery
docs: update environment variables referenceNext steps
Last updated on