Files
ai_agent/.claude/rules/frontend.md
T
furyhawk 8351e73d39 feat: add Zustand stores for conversation, file preview, sidebar, theme, and knowledge base selection
- Implemented `conversation-store` for managing conversations and messages.
- Created `file-preview-store` to handle file preview state.
- Added `sidebar-store` for sidebar visibility management.
- Developed `theme-store` for theme persistence and management.
- Introduced `kb-selection-store` for managing active knowledge base selections with persistence.

chore: define API and chat types

- Added types for API responses, authentication, chat messages, conversations, and projects.
- Defined interfaces for various entities including users, sessions, and message ratings.

build: configure TypeScript and testing setup

- Set up `tsconfig.json` for TypeScript configuration.
- Created `vitest.config.ts` for testing configuration with Vitest.
- Added `vitest.setup.ts` for global test setup including mocks for Next.js router and media queries.
- Configured Vercel deployment settings in `vercel.json`.
2026-06-11 16:54:43 +08:00

759 B

description, globs
description globs
Frontend conventions for Next.js
frontend/**/*.ts
frontend/**/*.tsx
frontend/**/*.css

Frontend Conventions

Stack

  • Next.js 15 with App Router
  • TypeScript strict mode
  • Tailwind CSS for styling
  • i18n support built-in

Structure

  • Pages in frontend/src/app/ following Next.js App Router conventions
  • Reusable components in frontend/src/components/
  • API client functions in frontend/src/lib/
  • Types in frontend/src/types/

Conventions

  • Use "use client" directive only when component needs client-side interactivity
  • Prefer Server Components by default
  • Use fetch with proper error handling for API calls
  • Keep components small and focused — extract when a component exceeds ~100 lines