# PasteCode > Prompts, rules, checklists, and context packs for AI coding agents. A static library of copy-paste prompts, rules, checklists, and context packs for AI coding agents like Cursor, Claude Code, Codex, and Windsurf. ## Prompts - [Prompt to Add Better Auth to Next.js with PostgreSQL](https://pastecode-71y.pages.dev/prompts/add-better-auth-to-nextjs.md): A copy-paste prompt for adding Better Auth and PostgreSQL session handling to a Next.js App Router project. - [Prompt to Add Cloudflare R2 File Upload](https://pastecode-71y.pages.dev/prompts/add-cloudflare-r2-file-upload.md): Copy-paste AI prompt to add Cloudflare R2 presigned upload URLs to a Next.js App Router project with server-side validation. - [Prompt to Add Dark Mode with Tailwind CSS v4](https://pastecode-71y.pages.dev/prompts/add-dark-mode-with-tailwind.md): AI agent prompt to add system-aware dark mode to a Next.js app using Tailwind CSS v4 CSS variables and next-themes, with no flash on load. - [Prompt to Add PostgreSQL Full-Text Search](https://pastecode-71y.pages.dev/prompts/add-postgres-full-text-search.md): Copy-paste AI prompt to add native PostgreSQL full-text search with tsvector, GIN index, and ranked results to an existing Next.js app. - [Prompt to Add a Sitemap and robots.txt](https://pastecode-71y.pages.dev/prompts/add-sitemap-and-robots-txt.md): AI agent prompt to add a dynamically generated sitemap.xml and a correct robots.txt to a Next.js or Astro project for better search indexing. - [Prompt to Add Stripe Checkout to a Next.js App](https://pastecode-71y.pages.dev/prompts/add-stripe-checkout-to-nextjs.md): AI agent prompt to add Stripe Checkout with webhook handling, customer portal, and subscription status to a Next.js App Router project. - [Prompt to Build a Cloudflare Worker API Proxy](https://pastecode-71y.pages.dev/prompts/build-a-cloudflare-worker-api-proxy.md): Copy-paste AI prompt to build a Cloudflare Worker that proxies and rate-limits external API calls, adds auth headers, and caches responses. - [Prompt to Build a Next.js AI Tool Directory](https://pastecode-71y.pages.dev/prompts/build-a-nextjs-ai-tool-directory.md): AI agent prompt to build a searchable Next.js AI tool directory with MDX data files, category filters, and static generation. - [Prompt to Build a SaaS Pricing Page in Next.js](https://pastecode-71y.pages.dev/prompts/build-a-saas-pricing-page.md): Copy-paste AI prompt to build a SaaS pricing page in Next.js with Tailwind, toggle billing, and Stripe-ready plan data. - [Prompt to Build an Astro Static SEO Site](https://pastecode-71y.pages.dev/prompts/build-an-astro-static-seo-site.md): Copy-paste prompt for scaffolding a fully optimized Astro static site with content collections, sitemap, og-images, and TypeScript. - [Prompt to Create a GitHub Actions Deploy Workflow](https://pastecode-71y.pages.dev/prompts/create-a-github-actions-deploy-workflow.md): AI agent prompt to generate a production GitHub Actions CI/CD workflow for a Next.js app with type-check, test, build, and deploy steps. - [Prompt to Create an Admin Dashboard in Next.js](https://pastecode-71y.pages.dev/prompts/create-an-admin-dashboard.md): AI agent prompt to build a protected Next.js admin dashboard with data tables, server-side auth guards, and a sidebar layout using Tailwind. - [Prompt to Generate OG Images at Build Time](https://pastecode-71y.pages.dev/prompts/generate-og-images-at-build-time.md): AI agent prompt to generate per-page Open Graph images at build time in Astro or Next.js using Satori and sharp, with no external service. - [Prompt to Migrate a Next.js 14 App to Next.js 16](https://pastecode-71y.pages.dev/prompts/migrate-nextjs-14-to-16.md): Structured AI agent prompt to migrate a Next.js 14 App Router project to Next.js 16 with breaking-change handling and incremental steps. - [Prompt to Refactor a React Component Safely](https://pastecode-71y.pages.dev/prompts/refactor-a-react-component-safely.md): Structured AI agent prompt to refactor a complex React component with a read-audit-refactor-verify loop that prevents regressions. ## Rules - [AGENTS.md Rules for an Astro Static Site](https://pastecode-71y.pages.dev/rules/agents-md-for-astro-static-site.md): A drop-in AGENTS.md for Astro static sites that keeps AI agents on-stack, prevents SSR drift, and enforces content collection conventions. - [AGENTS.md Rules for a Next.js SaaS App](https://pastecode-71y.pages.dev/rules/agents-md-nextjs-saas.md): A drop-in AGENTS.md that keeps AI coding agents on-stack and on-convention in a Next.js SaaS codebase. - [AI Coding Rules for Auth and Security](https://pastecode-71y.pages.dev/rules/ai-rules-for-auth-and-security.md): AGENTS.md rules for authentication and security that prevent agents from rolling custom crypto, leaking secrets, or bypassing authorization checks. - [AI Coding Rules for PostgreSQL Apps](https://pastecode-71y.pages.dev/rules/ai-rules-for-postgresql-apps.md): AGENTS.md rules for PostgreSQL-backed apps covering query safety, migration discipline, indexing conventions, and preventing agents from writing N+1 queries. - [AI Coding Rules for SEO Content Sites](https://pastecode-71y.pages.dev/rules/ai-rules-for-seo-content-sites.md): AGENTS.md rules for SEO-focused content sites that prevent duplicate metadata, enforce structured data, and keep agents from breaking crawlability. - [AI Coding Rules for Static Site Performance](https://pastecode-71y.pages.dev/rules/ai-rules-for-static-site-performance.md): AGENTS.md rules for static site performance that enforce Core Web Vitals, image optimization, font loading, and prevent agents from shipping render-blocking resources. - [AI Coding Rules for TypeScript Strict Projects](https://pastecode-71y.pages.dev/rules/ai-rules-for-typescript-strict-projects.md): AGENTS.md rules for TypeScript strict-mode projects that eliminate any types, enforce narrowing patterns, and prevent agents from compiling-but-wrong code. - [Claude Code Rules for Prisma Projects](https://pastecode-71y.pages.dev/rules/claude-code-rules-for-prisma-projects.md): Claude Code rules for Prisma ORM projects covering migration safety, query patterns, relation loading, and preventing agents from corrupting the schema. - [Codex Rules for Cloudflare Workers](https://pastecode-71y.pages.dev/rules/codex-rules-for-cloudflare-workers.md): Codex rules for Cloudflare Workers projects that prevent Node.js API usage, enforce binding patterns, and keep agents within the Workers runtime constraints. - [Cursor Rules for Tailwind CSS and shadcn/ui](https://pastecode-71y.pages.dev/rules/cursor-rules-for-tailwind-shadcn.md): Cursor rules that enforce Tailwind v4 conventions and shadcn/ui component patterns, preventing agents from reinventing primitives that already exist. ## Playbooks - [Prompt-to-PR: Add a Pricing Page](https://pastecode-71y.pages.dev/playbooks/add-a-pricing-page.md): SOP for generating a production pricing page with monthly/annual toggle, feature matrix, and Stripe Checkout links in a Next.js Tailwind project. - [Prompt-to-PR: Add a Sitemap and robots.txt](https://pastecode-71y.pages.dev/playbooks/add-a-sitemap-and-robots.md): SOP for adding a dynamic XML sitemap and robots.txt to a Next.js or Astro project — correct lastmod, priority, and crawl rules for production SEO. - [Prompt-to-PR: Add an Admin Data Table](https://pastecode-71y.pages.dev/playbooks/add-an-admin-table.md): SOP for adding a server-side paginated, sortable, searchable admin data table in Next.js using TanStack Table and a PostgreSQL query — no ORM magic. - [Prompt-to-PR: Add Better Auth to a Next.js App](https://pastecode-71y.pages.dev/playbooks/add-better-auth-to-a-nextjs-app.md): Full SOP for wiring Better Auth into a Next.js App Router project — sessions, email/password, OAuth, and middleware protection in one pass. - [Prompt-to-PR: Add Cloudflare R2 File Upload](https://pastecode-71y.pages.dev/playbooks/add-cloudflare-r2-upload.md): End-to-end SOP for wiring presigned R2 uploads into a Next.js or Cloudflare Workers app — bucket binding, presigned URLs, and client upload flow. - [Prompt-to-PR: Add Dark Mode](https://pastecode-71y.pages.dev/playbooks/add-dark-mode.md): End-to-end SOP for adding flicker-free dark mode to a Next.js Tailwind app using next-themes — class strategy, system preference, and persisted toggle. - [Prompt-to-PR: Add Pagefind Search to an Astro Site](https://pastecode-71y.pages.dev/playbooks/add-pagefind-search-to-astro.md): The full SOP for adding static, zero-backend search to an Astro site with Pagefind — from first prompt to PR description. - [Prompt-to-PR: Add PostgreSQL Full-Text Search](https://pastecode-71y.pages.dev/playbooks/add-postgres-full-text-search.md): SOP for adding native PostgreSQL full-text search with tsvector, GIN index, ts_rank, and a Next.js search API — no third-party search service needed. - [Prompt-to-PR: Build a Static SEO Site with Astro](https://pastecode-71y.pages.dev/playbooks/build-a-static-seo-site-with-astro.md): Complete SOP for scaffolding a content-driven static SEO site with Astro, Tailwind, MDX content collections, sitemap, and canonical tags from scratch. - [Prompt-to-PR: Migrate Next.js 14 to 16](https://pastecode-71y.pages.dev/playbooks/migrate-nextjs-14-to-16.md): Step-by-step SOP for migrating a Next.js 14 App Router project to Next.js 16 — Turbopack, React 19, async APIs, and caching changes covered. ## Checklists - [Checklist for Reviewing AI-Generated API Routes](https://pastecode-71y.pages.dev/checklists/review-ai-generated-api-routes.md): A human review checklist for REST and RPC API routes written by AI coding agents — authentication, input validation, rate limiting, and error handling. - [Checklist for Reviewing AI-Generated Auth Code](https://pastecode-71y.pages.dev/checklists/review-ai-generated-auth-code.md): A human review checklist for authentication code written by AI coding agents — sessions, JWTs, OAuth flows, and authorization logic for web apps. - [Checklist for Reviewing AI-Generated Cloudflare Workers](https://pastecode-71y.pages.dev/checklists/review-ai-generated-cloudflare-workers.md): A human review checklist for Cloudflare Workers code written by AI coding agents — runtime limits, KV, D1, bindings, and security at the edge. - [Checklist for Reviewing AI-Generated GitHub Actions](https://pastecode-71y.pages.dev/checklists/review-ai-generated-github-actions.md): A human review checklist for GitHub Actions workflows written by AI coding agents — secret exposure, supply chain attacks, permissions, and deployment safety. - [Checklist for Reviewing AI-Generated Next.js Code](https://pastecode-71y.pages.dev/checklists/review-ai-generated-nextjs-code.md): A human review checklist for Next.js code written by AI coding agents — App Router, Server Components, data fetching, and deployment correctness. - [Checklist for Reviewing AI-Generated Prisma Migrations](https://pastecode-71y.pages.dev/checklists/review-ai-generated-prisma-migrations.md): A human review checklist for Prisma schema changes and migrations written by AI coding agents — data loss, locking, and irreversible operations. - [Checklist for Reviewing AI-Generated SEO Pages](https://pastecode-71y.pages.dev/checklists/review-ai-generated-seo-pages.md): A human review checklist for SEO-targeted pages written by AI coding agents — metadata, structured data, canonical URLs, and Core Web Vitals for Astro and Next.js. - [Checklist for Reviewing AI-Generated SQL Queries](https://pastecode-71y.pages.dev/checklists/review-ai-generated-sql.md): A human review checklist for SQL written by AI coding agents — correctness, injection, performance, and migrations. - [Checklist for Reviewing AI-Generated Stripe Code](https://pastecode-71y.pages.dev/checklists/review-ai-generated-stripe-code.md): A human review checklist for Stripe integration code written by AI coding agents — webhook security, idempotency, race conditions, and payment flows. - [Checklist for Reviewing AI-Generated Tailwind UI](https://pastecode-71y.pages.dev/checklists/review-ai-generated-tailwind-ui.md): A human review checklist for Tailwind CSS UI components written by AI coding agents — accessibility, responsiveness, dark mode, and purge safety. ## Failures - [How to Fix AI Breaking the Cloudflare Workers Runtime](https://pastecode-71y.pages.dev/failures/ai-breaks-cloudflare-workers-runtime.md): AI agents import Node.js built-ins like fs, crypto, and path into Cloudflare Workers, causing runtime errors because the Workers runtime is not Node.js. - [How to Fix AI Creating React Hydration Mismatches](https://pastecode-71y.pages.dev/failures/ai-creates-hydration-mismatches.md): AI agents generate React components that render different HTML on the server and client, triggering hydration errors and broken UI on first load. - [How to Fix AI Forgetting Environment Variable Validation](https://pastecode-71y.pages.dev/failures/ai-forgets-env-validation.md): AI agents read process.env values directly without validation, causing silent undefined bugs and missing startup errors when env vars are absent. - [How to Fix AI Generating Invalid Prisma Relations](https://pastecode-71y.pages.dev/failures/ai-generates-invalid-prisma-relations.md): AI agents generate Prisma schema relations with missing back-relations, wrong referential actions, or mismatched field types that fail prisma validate and prisma migrate. - [How to Fix AI Ignoring SEO Metadata](https://pastecode-71y.pages.dev/failures/ai-ignores-seo-metadata.md): AI agents scaffold Next.js and Astro pages without title tags, Open Graph metadata, or canonical URLs, shipping pages that are invisible to search engines and social crawlers. - [How to Fix AI Coding Agents Inventing Fake npm Packages](https://pastecode-71y.pages.dev/failures/ai-invents-fake-npm-packages.md): Why AI agents hallucinate npm packages that don't exist, how to spot it, and how to stop it. - [How to Fix AI Overusing useEffect](https://pastecode-71y.pages.dev/failures/ai-overuses-useeffect.md): AI agents reach for useEffect to handle derived state, event transforms, and data fetching that should instead use useMemo, event handlers, or Server Components. - [How to Fix AI Putting Server Code in Client Components](https://pastecode-71y.pages.dev/failures/ai-puts-server-code-in-client-components.md): AI agents leak database queries, secret env vars, and Node.js APIs into 'use client' components, exposing server-only logic to the browser bundle. - [How to Fix AI Coding Agents Using Outdated Next.js APIs](https://pastecode-71y.pages.dev/failures/ai-uses-outdated-nextjs-apis.md): AI agents frequently generate Next.js code using deprecated Pages Router patterns, getServerSideProps, and removed APIs that break App Router projects. - [How to Fix AI Writing Insecure SQL](https://pastecode-71y.pages.dev/failures/ai-writes-insecure-sql.md): AI agents build SQL queries with string interpolation instead of parameterized statements, introducing SQL injection vulnerabilities into production database code. ## Context Packs - [AI Tool Directory — Context Pack](https://pastecode-71y.pages.dev/context/ai-tool-directory.md): Copyable context pack for an AI tool directory site built with Astro and PostgreSQL, so agents understand the submission flow, tagging system, and content model from prompt one. - [Astro Static SEO Site — Context Pack](https://pastecode-71y.pages.dev/context/astro-static-seo-site.md): A copyable context pack describing an Astro static SEO site so an AI agent can work in it correctly from the first prompt. - [Cloudflare Workers App — Context Pack](https://pastecode-71y.pages.dev/context/cloudflare-workers-app.md): Copyable context pack for a Cloudflare Workers application with D1, KV, R2, and Hono so your AI agent understands the edge runtime constraints from the first prompt. - [Next.js SaaS Starter — Context Pack](https://pastecode-71y.pages.dev/context/nextjs-saas-starter.md): Copyable context pack for a Next.js SaaS app with App Router, Better Auth, Stripe billing, and Postgres so your AI agent works correctly from prompt one. - [PostgreSQL Search App — Context Pack](https://pastecode-71y.pages.dev/context/postgres-search-app.md): Copyable context pack for a full-text and vector search application backed by PostgreSQL with pgvector, so your AI agent writes correct SQL and migration code from the start.