diff --git a/CLAUDE.md b/.claude/CLAUDE.md similarity index 80% rename from CLAUDE.md rename to .claude/CLAUDE.md index d294808..ac5c8d9 100644 --- a/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -6,15 +6,13 @@ The project uses British English - strictly. ## Tech Stack -- **Next.js 16** with App Router (not Pages Router) -- **React 19.2.0** (latest with new features like Actions, `use` hook) -- **React Compiler** enabled for automatic optimisations -- **TypeScript 5** with strict mode -- **Tailwind CSS v4** with PostCSS -- **CI/CD** Vitest, Playwright, GitHub Actions, Vercel -- **Biome** for linting/formatting (replaces ESLint + Prettier) -- **Lefthook** for Git hooks (pre-commit: lint, typecheck, unit tests; pre-push: E2E tests) -- **Clerk** for authentication (installed via shadcn/ui CLI with `@clerk/themes`) +- **Framework**: Next.js 16 (React 19, App Router, React Compiler, TypeScript 6) +- **Styling**: Tailwind CSS 4 +- **Auth**: Clerk 7 (`@clerk/nextjs`, `@clerk/ui` shadcn theme) +- **Testing**: Vitest 4 + Testing Library (unit), Playwright 1.58 (E2E) +- **Quality**: Biome 2.4 (lint + format, replaces ESLint/Prettier) +- **Git Hooks**: Lefthook 2.1 (pre-commit: lint, typecheck, unit; pre-push: E2E) +- **Deployment**: Vercel (Preview on PR, Production on merge) ## Key Commands @@ -59,6 +57,9 @@ npx shadcn@latest --help # CLI help - Tailwind v4 uses `@import "tailwindcss"` syntax (not `@tailwind` directives) - Next.js 16 Dynamic route `params` is a Promise - must await: `{ params }: { params: Promise<{ id: string }> }` - Next.js 16 Middleware renamed to Proxy - `middleware.ts` → `proxy.ts` (but still uses `clerkMiddleware()` function) +- `cacheComponents` enabled - uncached async data must be in `` or marked `"use cache"` +- `cacheComponents` enabled - route segment configs deprecated (`dynamic`, `revalidate`, `fetchCache`) +- `cacheComponents` enabled - Edge Runtime not supported ## Authentication (Clerk) diff --git a/.claude/commands/coderabbit.md b/.claude/commands/coderabbit.md index 47d4085..27198eb 100644 --- a/.claude/commands/coderabbit.md +++ b/.claude/commands/coderabbit.md @@ -9,19 +9,19 @@ allowed-tools: Bash(gh api:*), Read, Glob, Grep Parse `$1` to extract owner, repo, and comment ID. ```bash -# strips analysis chain +# strips analysis chain, includes diff context gh api repos/OWNER/REPO/pulls/comments/COMMENT_ID \ - --jq '.body | gsub("
\\s*🧩 Analysis chain[\\s\\S]*?
\\s*"; "")' \ - > z_rabbit_comment.md + --jq '"## Diff context\n\n```diff\n" + .diff_hunk + "\n```\n\n## Comment\n\n" + (.body | gsub("
\\s*🧩 Analysis chain[\\s\\S]*?
\\s*"; ""))' \ + > x_coderabbit_COMMENT_ID.md ``` -**Important:** Write `z_rabbit_comment.md` to the project root (current working directory), not `/tmp/`. +**Important:** Write `x_coderabbit_COMMENT_ID.md` to the project root. ## 2. Evaluate CodeRabbit AI is not always right. -Evaluate the comment `z_rabbit_comment.md` against the context of our codebase and files it references. Assess: +Evaluate the comment `x_coderabbit_COMMENT_ID.md` against the context of our codebase and files it references. Assess: | Criterion | Question | |-----------|----------| @@ -43,3 +43,17 @@ Evaluate the comment `z_rabbit_comment.md` against the context of our codebase a ## Output Format Well structured, use emojis, if using tables keep width <100 chars for readability. + +## Replying to CodeRabbit on GitHub + +When you recommend skipping a fix, ask whether the user would like to reply to CodeRabbit. + +To reply to a PR review comment, use `in_reply_to` on the pull comments endpoint: + +```bash +gh api repos/OWNER/REPO/pulls/PULL_NUMBER/comments \ + -f body="@coderabbitai ..." \ + -F in_reply_to=COMMENT_ID +``` + +Never reply to a CodeRabbit comment unless confirmed by the user. diff --git a/.claude/commands/commit.md b/.claude/commands/commit.md index dd1d3f7..b721a49 100644 --- a/.claude/commands/commit.md +++ b/.claude/commands/commit.md @@ -1,36 +1,36 @@ --- -description: Create git commit for staged changes using template +description: Create git commit message following template +argument-hint: "[additional instructions]" --- # Create a clear Git commit message for **staged** changes +Additional user instructions: $ARGUMENTS + 1. Analyse staged changes with commands in `` tags -2. Apply commit template `