Imported from ericlibardi/linkshortenerproject (
AGENTS.md). Install upstream withnpx skills add ericlibardi/linkshortenerproject. Copyright stays with the author.
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/ before writing any code. Heed deprecation notices.
Agent Instructions — Link Shortener Project
This file is the entry point for LLM agents working in this codebase. Detailed coding standards are separated into topic files under docs/.
BLOCKING REQUIREMENT: You MUST read every relevant file in
.github/instructions/BEFORE writing a single line of code. This is not optional. Skipping this step will produce incorrect code.
Do not rely on training-data assumptions about Next.js, Clerk, Tailwind, or shadcn — their APIs have changed significantly. When uncertain about any Next.js API, read node_modules/next/dist/docs/ first.
Agent Rules
STOP. Before you write any code, you MUST complete steps 1 and 2 below. There are no exceptions.
- Before writing any Next.js code, check
node_modules/next/dist/docs/index.mdto understand what version is in use. - MANDATORY — Read every
.github/instructions/file that is relevant to your task. Do not generate any code until this is done. Use the Documentation Index below to identify which files apply. - Never guess at breaking-changed APIs — consult the docs listed here first.
- If you are uncertain whether a doc applies, read it anyway. The cost of reading is always lower than the cost of writing incorrect code.
Critical Breaking Changes
These are the most common places where LLM training-data knowledge is wrong for this project.
| What you might assume | Reality in this project |
|---|---|
Middleware lives in middleware.ts |
NEVER use middleware.ts — it is deprecated in Next.js 16 and will not work. Use proxy.ts instead (Next.js 16 renamed Middleware to Proxy) |
<SignedIn> / <SignedOut> for conditional UI |
<Show when="signed-in"> — Clerk v7 replaced those components |
tailwind.config.js for theme customization |
app/globals.css @theme block — Tailwind v4 is CSS-first, no config file |
params is a plain object in page props |
params is a Promise — must be awaited in Next.js 16 |
Use router.push() for server-side redirects |
redirect() from next/navigation in Server Components/Actions |
auth() returns synchronously |
auth() is async — always await auth() |
Documentation Index
CRITICAL: Reading the relevant file(s) below is a hard prerequisite. Do NOT generate any code — not even a single line — until you have read every applicable doc. Treat this the same way you would treat a compile error: nothing proceeds until it is resolved.
For detailed guidelines on specific topics, refer to the modular documentation in the .github/instructions/ directory.
| File | Read when... |
|---|---|
| .github/instructions/authentication.md | Anything involving Clerk, user identity, or route protection |
| .github/instructions/components.md | Building any UI — buttons, inputs, dialogs, cards, or any visual element |
| .github/instructions/data-fetching.instructions.md | Fetching data from an API or database |
| .github/instructions/server-actions.instructions.md | Writing or modifying any server action (actions.ts) |