# Next.js on Vercel solution docs

- [Protecting a signed-in app in the App Router, in three layers](https://agenticboilerplate.com/cookbook/nextjs-vercel/auth-checks-in-an-app-shell): A layout that checks the session is not enough, because layouts do not re-render on client navigation. Where the proxy, the layout and the page each check, and why.
- [The Compound Engineering loop, and where /ce-plan and /ce-work actually fit](https://agenticboilerplate.com/cookbook/nextjs-vercel/compound-engineering-loop): Agents that start typing immediately produce work nobody can review. Plan in a file, execute against it, then write down what you learned so the next pass is shorter.
- [Environment variables on Vercel, without leaking them into the browser](https://agenticboilerplate.com/cookbook/nextjs-vercel/env-vars-on-vercel-without-leaking-them): Next.js inlines env reads at build time, so one import can ship a server key to every visitor. Here is the boundary that prevents it and the checks that prove it held.
- [What each guard hook blocks, and how to extend one without breaking your session](https://agenticboilerplate.com/cookbook/nextjs-vercel/guard-hooks-and-how-to-extend-them): Claude Code hooks stop the mistakes that cost the most. Here is what each one refuses, how the exit codes work, and the safe way to add a rule of your own.
- [llms.txt for a SaaS site, generated from the same copy as the page](https://agenticboilerplate.com/cookbook/nextjs-vercel/llms-txt-for-a-saas-site): An llms.txt file tells AI agents what your product is and where the important pages are. Build it from the landing page's data so it never goes stale, and serve it as a static file.
- [Selling one-time purchases next to subscriptions without two billing systems](https://agenticboilerplate.com/cookbook/nextjs-vercel/one-time-purchases-vs-subscriptions): Model a lifetime deal as a one-time price that grants a plan, record it in a purchases table with a monotonic status, and resolve access from subscriptions and purchases in one rule.
- [A pricing page that renders with no database and no payment keys](https://agenticboilerplate.com/cookbook/nextjs-vercel/pricing-page-without-a-database): Keep the plan catalogue in code, map provider price ids through env vars, and make /pricing a static page whose buttons are plain links to a checkout route.
- [A privacy policy that lists the vendors you actually use](https://agenticboilerplate.com/cookbook/nextjs-vercel/privacy-policy-that-lists-your-real-vendors): GDPR and the US state privacy laws expect you to say who processes personal data for you. Let each integration add itself to the list, so the policy changes when the code does.
- [Rate limit checkout in Postgres, before the provider sees it](https://agenticboilerplate.com/cookbook/nextjs-vercel/rate-limiting-checkout-in-postgres): One small table and one atomic upsert keep a looping user from spending your payment provider's API limit, across every serverless instance, with no Redis.
- [Refunds and disputes should take access away, exactly once](https://agenticboilerplate.com/cookbook/nextjs-vercel/refunds-disputes-and-entitlements): Which webhook carries a refund or a dispute on each payment provider, how to find the purchase it belongs to, and how to revoke access without a late event giving it back.
- [Regenerating from agentic.config.json to see what upstream changed](https://agenticboilerplate.com/cookbook/nextjs-vercel/regenerate-from-config-and-diff): There is no sync service and no template remote. Regenerate a clean copy from your recorded selection, diff it against your repo, and take only the agent layer.
- [Rules, skills and agents, which one you actually need](https://agenticboilerplate.com/cookbook/nextjs-vercel/rules-skills-agents-when-to-use-each): The same instruction behaves completely differently depending on where you put it. Rules are ambient constraints, skills are invoked procedures, agents are delegated scopes.
- [Sample testimonials that never reach production](https://agenticboilerplate.com/cookbook/nextjs-vercel/sample-testimonials-without-the-ftc-risk): A landing page template needs quotes, logos and numbers to look finished, and publishing invented ones is illegal. Mark them as samples, show them in development, and drop them from the production build.
- [A collapsible sidebar that remembers its state without a flash](https://agenticboilerplate.com/cookbook/nextjs-vercel/sidebar-state-without-a-flash): Saving the sidebar's open or collapsed state in localStorage makes every page load jump. A cookie the server reads renders the right width in the first HTML.
- [Writing a path-scoped rule that agents actually follow](https://agenticboilerplate.com/cookbook/nextjs-vercel/writing-path-scoped-rules-agents-follow): Rules fail for two reasons: they load when nobody needs them, or they are unfalsifiable. Scope by path, write checkable statements, and give every rule an escape hatch.

---

Agentic Boilerplate: A Next.js repo your agent already knows. Free during launch, then $99 once.

- Site map for agents: https://agenticboilerplate.com/llms.txt
- Public API: https://agenticboilerplate.com/openapi.json
- Contact: agenticstudio@gmail.com
