From 1fe07f5bd1f12bccbf94ed0bc94d06394a49c245 Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Thu, 24 Sep 2026 21:08:09 -0700 Subject: [PATCH 1/2] Add AGENTS.md and stop stale route types from failing typecheck next dev wrote AGENTS.md and CLAUDE.md into every checkout that lacked its agent-rules block. AGENTS.md now holds project facts plus that block, so next dev leaves it alone. Screenshot fixture routes go in the gitignored src/app/fixtures/. pnpm typecheck now deletes .next/dev/types and runs next typegen, so a deleted route no longer fails it. Co-Authored-By: Claude Opus 5.5 (1M context) --- .gitignore | 3 +++ AGENTS.md | 37 +++++++++++++++++++++++++++++++++++++ CLAUDE.md | 1 + package.json | 2 +- 4 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 AGENTS.md create mode 100644 CLAUDE.md diff --git a/.gitignore b/.gitignore index 8f322f0..66e2946 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,6 @@ yarn-error.log* # typescript *.tsbuildinfo next-env.d.ts + +# temporary screenshot routes (see AGENTS.md) +/src/app/fixtures/ diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..2786431 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,37 @@ +# MarkerThing + +Exports Twitch stream markers as CSV clips (for LosslessCut) and YouTube chapters. Also serves an OBS embed of the live topic. Next.js App Router, Clerk sign-in with Twitch OAuth, Tailwind, Vitest. No database. Hosted on Vercel. + +## Facts + +- Marker parsing and export logic is pure and lives in `src/utils/markers.ts`, tested in `src/utils/markers.test.ts`. Put new logic there so it stays testable. Twitch API calls live in `src/utils/twitch-server.ts`. +- Local dev needs Clerk and Twitch keys in `.env.local`. The template is `src/.env.example`. +- Vercel env vars and project settings are production. Change them only when Theo asks. + +## Dependencies + +`packageManager` pins pnpm 8, which reads the v6 `pnpm-lock.yaml`. A newer global pnpm switches to the pinned version on its own. Install with `pnpm install --frozen-lockfile`. + +If your diff rewrites the lockfile to v9 or adds `pnpm-workspace.yaml`, the wrong pnpm ran. Revert both files. + +## Screenshot fixtures + +Put temporary routes for screenshots in `src/app/fixtures//page.tsx`. That folder is gitignored, so fixtures never ship. Render components with fake data instead of Twitch calls. + +A deleted route leaves stale types in `.next/` that fail a bare `tsc`. Use `pnpm typecheck`: it deletes `.next/dev/types` and regenerates `.next/types` first. To clean by hand, run `rm -rf .next/types .next/dev/types`. + +## Pull requests + +- Before you push, run the checks in `.github/workflows/ci.yaml`. +- Merge only when the branch is up to date with `main` and CI is green on that head. +- Greptile and CodeRabbit review PRs. CodeRabbit has an hourly rate limit. When it posts a rate-limit notice, continue without its review. + + + +# This is NOT the Next.js you know + +This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices. + +This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean. + + diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/package.json b/package.json index 089d165..c891400 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "build": "next build", "start": "next start", "lint": "eslint .", - "typecheck": "tsc --noEmit", + "typecheck": "rm -rf .next/dev/types && next typegen && tsc --noEmit", "test": "vitest run" }, "dependencies": { From 8c9e0e7fb3fa56684892fc301c8a97466a119cb2 Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Thu, 24 Sep 2026 23:19:36 -0700 Subject: [PATCH 2/2] Say that a local build still includes fixture routes Co-Authored-By: Claude Opus 5.5 (1M context) --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index 2786431..94fd3bd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -16,7 +16,7 @@ If your diff rewrites the lockfile to v9 or adds `pnpm-workspace.yaml`, the wron ## Screenshot fixtures -Put temporary routes for screenshots in `src/app/fixtures//page.tsx`. That folder is gitignored, so fixtures never ship. Render components with fake data instead of Twitch calls. +Put temporary routes for screenshots in `src/app/fixtures//page.tsx`. That folder is gitignored, so fixtures stay out of commits and Git deploys. Delete them when the screenshots are done, because a build from your checkout still includes them. Render components with fake data instead of Twitch calls. A deleted route leaves stale types in `.next/` that fail a bare `tsc`. Use `pnpm typecheck`: it deletes `.next/dev/types` and regenerates `.next/types` first. To clean by hand, run `rm -rf .next/types .next/dev/types`.