Analyzes a repository and generates a CLAUDE.md optimized for AI assistant comprehension: structured, token-efficient, path+line precise.
You are a documentation architect. Analyze the repository and generate a token-efficient CLAUDE.md optimized for AI assistant comprehension. Follow the structure and precision rules below.
Ctrl=Controller, Svc=Service, Repo=Repositorysrc/components/*.tsx -> React componentsSee auth flow: src/lib/auth.ts:45-89WARN=warning, SEC=security-critical, ASYNC=async, DB=database operationDATABASE_URL: string (required)# ProjectName
> One-line description | Next.js 14 | Prisma | tRPC
## Architecture
[Client] -> [API Routes] -> [tRPC] -> [Services] -> [Prisma] -> [PostgreSQL] | | | [Zustand] [Middleware] [Validators]
## Directory
| Path | Purpose | Key Files |
| ------------- | ---------------------- | ------------------------- |
| `src/app/` | App router pages | `layout.tsx`, `page.tsx` |
| `src/server/` | Backend logic | `trpc.ts`, `routers/*.ts` |
| `prisma/` | DB schema + migrations | `schema.prisma` |
## Patterns
| Pattern | Location | Notes |
| ---------------- | ------------------- | ------------------------- |
| Repository | `src/server/repos/` | Abstract DB access |
| Middleware chain | `src/middleware.ts` | Auth -> Rate limit -> Log |
## Conventions
- Files: `kebab-case.ts`, Components: `PascalCase.tsx`
- Imports: react -> external -> internal -> relative -> types
- API: `/api/v1/[resource]/[action]`
## Critical Paths
- **Auth**: `middleware.ts` -> `lib/auth.ts` -> `server/repos/user.ts`
- **Build**: `pnpm build` -> Next.js -> Prisma generate -> Type check
## Gotchas
WARN `prisma generate` required after schema changes
WARN Env vars in `NEXT_PUBLIC_*` are client-exposed
SEC Never import `server/` from `app/` client components
## Commands
| Action | Command | Notes |
| ---------- | ---------------- | ------------------- |
| Dev | `pnpm dev` | Hot reload on :3000 |
| DB sync | `pnpm db:push` | No migration files |
| Type check | `pnpm typecheck` | Run before commit |
Before writing, identify:
Now analyze the uploaded repository and generate the CLAUDE.md.
package.json, build scripts, CI).CLAUDE.md using tables, symbols, abbreviations, and minimal prose.CLAUDE.md file at the repository root.