mirror of
https://github.com/bitbaum/botsmann.git
synced 2026-12-04 08:39:12 +01:00
- Add Transformers.js for local embeddings generation - Create document upload API with Supabase Storage - Create document processing pipeline (parse, chunk, embed) - Create semantic search API using pgvector - Create RAG chat API combining search + LLM - Add documents page UI with upload, process, and chat - Add database migration for document status columns - Configure Next.js to externalize ONNX packages Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
4.0 KiB
4.0 KiB
AGENTS.md - Botsmann
A README for AI coding agents. Works with Claude Code, Cursor, GitHub Copilot, OpenAI Codex, and other AI tools.
Project Overview
Botsmann is an AI bot platform with intelligent assistants for legal, medical, research, and language learning domains.
| Aspect | Details |
|---|---|
| Framework | Next.js 14 (App Router) |
| Language | TypeScript |
| Styling | Tailwind CSS + DaisyUI |
| Database | MongoDB (Mongoose) |
| Deployment | Vercel |
| Testing | Jest + React Testing Library |
Dev Environment
# Install dependencies
npm install
# Start development server
npm run dev
# Run linting
npm run lint
# Run tests
npm run test
# Production build
npm run build
Required environment variables: Copy .env.example to .env and fill in values.
Testing Instructions
# Run all tests
npm run test
# Watch mode
npm run test:watch
Tests live alongside components in __tests__/ directories.
Before committing: Run npm run lint && npm run build to catch errors.
Code Style Guidelines
TypeScript
- Use strict typing, minimize
any - Prefer interfaces over type aliases for objects
- Use
typefor unions and intersections
React Components
- Functional components with hooks only
- Named exports (except page components)
- Props interface above component
File Naming
- Components:
PascalCase.tsx - Utilities:
camelCase.ts - Types:
camelCase.types.ts
Imports Order
- React/Next.js imports
- Third-party libraries
- Local components
- Local utilities
- Types
- Styles
Project Structure
botsmann/
├── app/ # Next.js App Router
│ ├── api/ # API routes
│ │ ├── consultations/ # Consultation endpoints
│ │ ├── health/ # Health check
│ │ └── waitlist/ # Waitlist signup
│ ├── bots/ # Bot pages
│ │ ├── legal-expert/
│ │ ├── medical-expert/
│ │ ├── research-assistant/
│ │ └── swiss-german-teacher/
│ ├── about/
│ ├── contact/
│ └── solutions/
├── components/ # Shared UI components
├── lib/ # Utility functions
├── types/ # TypeScript definitions
├── data/ # Static data (bot configs)
├── public/ # Static assets
└── docs/ # Documentation
├── BEST_PRACTICES.md # Coding principles
├── SHARED_CONTEXT.md # Tech stack details
└── COMMANDS.md # npm scripts
PR Guidelines
Commit Message Format
type(scope): description
type: feat|fix|chore|docs|style|refactor|test
scope: component or area affected
Examples:
feat(bots): add new Swiss legal expert botfix(api): handle empty request bodychore(deps): update Next.js to 14.1
Pre-commit Checklist
npm run lintpassesnpm run buildsucceeds- Tests pass (if applicable)
- No hardcoded secrets
Security Considerations
- Never commit
.envfiles - Always validate API inputs with Zod
- Use environment variables for secrets
- Check for exposed credentials before pushing
Key Files
| File | Purpose |
|---|---|
.claude/CLAUDE.md |
Claude Code instructions |
docs/BEST_PRACTICES.md |
DRY, SSOT, SoC principles |
docs/SHARED_CONTEXT.md |
Architecture details |
docs/COMMANDS.md |
npm script reference |
data/bots.ts |
Bot configurations |
Common Tasks
Adding a New Bot
- Create directory:
app/bots/[bot-name]/ - Add
page.tsxwith bot UI - Register in
data/bots.ts - Add API route if needed:
app/api/[bot-name]/
Adding an API Route
- Create file:
app/api/[route]/route.ts - Export HTTP method handlers (GET, POST, etc.)
- Use Zod for request validation
- Return
NextResponse.json()
Last Updated: 2026-01-07