NEVER COMMIT ENVIRONMENT FILES TO GIT Never
git addorgit commitany.env*files except.env.example.
JobHunt is a job application tracking system built with Next.js 15, TypeScript, Supabase, and Shadcn UI.
NOTE: This file contains strict development rules for AI assistants ONLY. See README.md for project documentation.
BEFORE any commit, ALWAYS run and ensure these pass:
bun run lint # ESLint must pass with zero errors/warnings
bun run typecheck # TypeScript must compile with zero errors
bun run test # All tests must passIf quality gates fail, you MUST fix the issues before proceeding. No exceptions.
ABSOLUTELY FORBIDDEN:
- NEVER use
// eslint-disableor// eslint-disable-next-line- Fix the issue properly - NEVER use
// @ts-ignoreor// @ts-expect-error- Fix type issues correctly - NEVER use
anytypes - Always find or define proper types - NEVER bypass quality gates - All errors must be resolved, not suppressed
These bypasses are code smell indicators. If you're tempted to use them, the real issue needs fixing.
ALWAYS write tests BEFORE implementation.
Testing Strategy - Test Value, Not Lines:
- MUST TEST: Business logic (auth, CRUD, validation schemas)
- MUST TEST: Reusable UI components (buttons, forms, cards)
- MUST TEST: Error handling and edge cases
- SKIP: Thin library wrappers (Supabase clients, Next.js middleware)
- SKIP: Pure presentational components without logic
- SKIP: Configuration files
- Use Bun ONLY - no npm, pnpm, or yarn
- Lock file:
bun.lockbmust be committed - Installation:
bun installor simplybun
- Single Responsibility: Each file/function has one clear purpose
- Type Safety: Strict TypeScript, NO
anytypes - Error Handling: All operations must handle failures gracefully
- Proper Typing: Never bypass TypeScript with
@ts-ignore- define proper types instead
CRITICAL: Never use any types - Always find proper types
Quality Standards - NO BYPASSES ALLOWED:
- Define proper TypeScript interfaces and types for all data structures
- Use strict type checking - resolve all type errors properly
- Import types from libraries or define custom types
- For test mocks, use
Partial<T>,Pick<T>, or proper mock types - Never suppress ESLint rules - fix the underlying issue
Common Proper Solutions:
- Unused variables → Add underscore prefix (
_unusedVar) or remove them - Missing properties → Use proper interfaces with
Partial<T>orPick<T> - Type issues → Import correct types or define custom interfaces
- Complex types → Break down into smaller, manageable type definitions
- Business Logic: 80%+ coverage required
- Components: 70%+ coverage required
- Integration: Critical paths tested
- E2E: Planned for Phase 2
# Daily Development
bun run lint # ESLint validation
bun run typecheck # TypeScript compilation check
bun run test # Run all tests
bun run test:watch # Watch mode for TDD
# Coverage & Build
bun run test:coverage # Generate coverage report
bun run build # Production build verification- Tests passing (
bun run test) - CRITICAL - TypeScript compilation clean (
bun run typecheck) - CRITICAL - ESLint passing (
bun run lint) - CRITICAL - Build successful (
bun run build) - CRITICAL - Coverage targets met (
bun run test:coverage) - NO eslint-disable or @ts-ignore comments in code - CRITICAL
- All database calls must be typed with Supabase generated types
- All database operations must have error handling
- All queries must be tested with mocked Supabase client
- Row Level Security (RLS) policies must be respected
- All authenticated routes must verify user session
- Use Supabase Auth Helpers for Next.js
- Implement proper error handling for auth failures
- Use Shadcn UI components - Don't reinvent the wheel
- Responsive Design - Mobile-first approach
- Accessibility - WCAG 2.1 AA compliance required
- Dark Mode - Support via Tailwind dark: prefix
- Use Zod schemas for validation
- Implement proper error handling and user feedback
- Type all form data with proper interfaces
- Never break the main branch
- Always deployable after each phase
- All features must be fully functional when merged
- Check TODO.md for current phase requirements
- Write tests for the feature/component
- Implement to make tests pass
- Refactor while keeping tests green
- CRITICAL: Run
bun run lint && bun run typecheck && bun run test - Update TODO.md checkboxes
- Deploy to Vercel to verify working state
- Skip quality gates: Commit without running
bun run lint && bun run typecheck && bun run test - Skip tests: Writing implementation before tests
- Use wrong package manager: npm/pnpm/yarn instead of bun
- Break working state: Commit non-functional code
- Use
anytypes: Bypass TypeScript safety - Use eslint-disable: Suppress linting errors instead of fixing them
- Use @ts-ignore/@ts-expect-error: Suppress type errors instead of fixing them
- Skip error handling: Unhandled promise rejections
- Hardcode sensitive data: Use environment variables
- Ignore RLS policies: Direct database access without proper auth
- Run quality gates:
bun run lint && bun run typecheck && bun run testbefore every commit - Write tests first: TDD approach for all features
- Maintain working state: Every commit is deployable
- Strong typing: Explicit interfaces and return types - NO bypasses
- Fix, don't suppress: Resolve ESLint and TypeScript errors properly
- Handle errors: Graceful failure with user feedback
- Use environment variables: Never commit secrets
- Respect RLS: All database queries must respect user permissions
- Mobile-first design: Ensure responsive layouts