This document outlines the coding conventions and standards that the AI agent should follow when working on the NoteTAIker project.
All commit messages must follow the Conventional Commits specification. This is enforced by commitlint and husky.
Format: <type>(scope): <description>
Common Types:
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)refactor: A code change that neither fixes a bug nor adds a featureperf: A code change that improves performancetest: Adding missing tests or correcting existing testschore: Changes to the build process or auxiliary tools and libraries such as documentation generation
Example:
feat(web): add login page components
fix(api): handle undefined user id in note creation
The project uses ESLint with a shared base configuration in packages/eslint-config/base.js.
- Unused Variables: Should be avoided. ESLint will warn about
no-unused-vars. - Console Logs: Use
console.warnorconsole.errorfor errors. Generalconsole.logis discouraged in the frontend but allowed in the API for startup/server logs. - Rules Enforcement: Pre-commit hooks run
bun run lint, which will fail the commit if there are linting errors.
Prettier is used for all TypeScript (.ts, .tsx) and Markdown (.md) files.
- Enforcement: ESLint treats Prettier violations as errors.
- How to format: Run
bun run formatto format all supported files in the workspace.
- Package Manager: Use
bun. Avoidnpm,yarn, orpnpm.bun run dev: Starts all applications in development mode.bun run build: Builds all applications.bun run lint: Runs linting across the entire workspace.
- Monorepo Structure:
apps/desktop: Main application (API + web frontend + Electrobun desktop).apps/: Also contains cli and website.packages/: Contains shared packages (eslint-config, etc.).
- Frameworks:
- Frontend: React (v19) with Vite, Tailwind CSS (v4), and React Router (v7).
- Backend: Hono (running on Bun) with Zod for validation.
- State Management: TanStack Query (React Query) for server state.
- Form Handling: React Hook Form.
- AI Integration: Vercel AI SDK (
ai,@ai-sdk/google, etc.). - Database: SQLite via
bun:sqlite+sqlite-vec. - Styling: Tailwind CSS (v4) with utility-first approach.
- Icons: Lucide React.
- Component Library: Primitive components from
cmdkfor command palettes, and custom Tailwind-based components. - TypeScript: Strictly used for both frontend and backend. Ensure types are shared via workspace packages where appropriate.
- Monorepo Structure:
apps/desktop/src/web: React frontend.apps/desktop/src/api: Hono backend.apps/desktop/src/main: Electrobun main process.packages/: Shared configurations and utilities.
- Code Style:
- Use functional components and hooks for React.
- Use Zod schemas for all data validation (API requests/responses).
- Prefer
lucide-reactfor icons. - Ensure all API endpoints are typed and consistent.
- Testing: Use
vitestfor backend testing. - Formatting: Always format files before finishing a task (
bun run format). - Commits: Always use conventional commits. If multiple changes are made, consider splitting them into logical commits or using a detailed description.
Note: This file serves as a reference for the AI agent to ensure consistency with the existing codebase and automation.