The api client now calls normalizePath() to strip accidental /api/ prefixes. This prevents the recurring /api/api/ double-prefix bug. Added convention note to .claude/CLAUDE.md so future workers know.
1.2 KiB
1.2 KiB
KanzlAI Coding Conventions
Go (backend/)
- Standard library style — prefer stdlib over third-party packages where reasonable
go vetandgo testmust pass before committing- Package layout:
cmd/for entry points,internal/for private packages - Error handling: return errors, don't panic. Wrap with context via
fmt.Errorf("operation: %w", err) - Naming: follow Go conventions (MixedCaps, not snake_case)
- No global mutable state
TypeScript / Next.js (frontend/)
- TypeScript strict mode (enabled in tsconfig.json)
- App Router (src/app/) — no Pages Router
- Use server components by default,
"use client"only when needed - Tailwind CSS v4 for styling — no CSS modules or styled-components
- ESLint must pass before committing
- Import aliases:
@/maps tosrc/ - Bun as package manager (not npm/yarn/pnpm)
- API paths: NEVER include
/api/prefix. Theapiclient inlib/api.tsalready hasbaseUrl="/api". Writeapi.get("/cases")NOTapi.get("/api/cases"). The client auto-strips accidental/api/prefixes but don't rely on it.
General
- No secrets in code — use environment variables
- Commit messages:
feat:,fix:,build:,refactor:,docs:,test:,chore: