17copied
Stripe webhook handler that verifies the signature correctly (Next.js App Router)
import Stripe from "stripe";
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);9copied
Works locally, breaks in production: the difference list I check first
1. Node version: what the host runs versus what you run. Compare `node -v` with the build log.
2. Environment variables: same names, set for the right environment, no trailing spaces or quotes.12copied
Getting a Lovable project into your own repo and local editor
1. In Lovable, connect GitHub and push. The repo is now the source of truth, not the chat history.
2. Clone it, run `npm install`, and copy the environment variables into `.env.local`.10copied
Slicing a feature so the agent actually finishes each piece
1. Write the feature as a list of things I can click: "I can add a tag", "I can see my tags", "I can remove one".
2. Each slice touches the whole stack: migration, query, action, screen. Never all the database first.9copied
CLAUDE.md section for migrations the agent is allowed to write
## Database changes
9copied
Server-side proxy for a third-party API key (Next.js route handler)
// app/api/ai/route.ts
import { NextResponse } from "next/server";8copied
Next.js middleware that protects routes and keeps the session fresh
// middleware.ts
import { createServerClient } from "@supabase/ssr";8copied
Batch-per-session workflow for big renames with Claude Code
1. grep -rl OldName src/ > files.txt
2. split -l 10 files.txt batch_8copied
Pre-commit hook that stops a secret from reaching GitHub
1. Put the check in a hook rather than in your memory:
7copied
Rate limit a route handler with Postgres and no extra service
create table if not exists rate_hits (
key text not null,6copied
Prompt for reading a production log line you do not understand
Here is a log line from production. Do not change code.
4copied
Plan-first prompt: make the agent write the plan before touching files
Before you change anything, write a plan:
1. The files you will touch, one line each, with what changes in them.18copied
CLAUDE.md section that stops Claude Code from re-implementing helpers
## Before you write code
11copied
CLAUDE.md rules for the commits your agent writes
## Commits
7copied
Playwright smoke test for magic-link login
// tests/login.spec.ts
import { test, expect } from "@playwright/test";7copied
CLAUDE.md for a FastAPI service: the layout and the rules that hold it
## Layout
6copied
Supabase magic link: production checklist
1. Redirect URLs in Supabase Auth contain the production URL with /** at the end.
2. Site URL is the production URL, not localhost.6copied
GitHub Actions job that runs typecheck, lint and tests on every pull request
# .github/workflows/ci.yml
name: ci5copied
FlatList performance checklist for Expo
1. getItemLayout when rows have a fixed height.
2. Row component in React.memo; keyExtractor returns a stable id.4copied
CLAUDE.md section for an Expo app the agent cannot run
## You cannot run this app