Claude-skill-registry build-and-deploy
Build and deploy this Next.js LangChain retrieval agent application with Supabase vector store. Use when building, deploying, setting up vector store, or preparing the project for production.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/build-and-deploy" ~/.claude/skills/majiayu000-claude-skill-registry-build-and-deploy && rm -rf "$T"
manifest:
skills/data/build-and-deploy/SKILL.mdsource content
Build and Deploy LangChain Retrieval Agent
CRITICAL: For Vercel, you MUST use
thenvercel build --prod. Do NOT usevercel deploy --prebuilt --prodorvercel --proddirectly - these will fail due to Git author permission issues in VM environments.vercel deploy --prod
Workflow
1. Setup Environment Variables
Read
to see all required variables:.env.example
cat .env.example
Create
by reading values from current environment:.env
For each variable in
.env.example, read the value from the current environment and write to .env. Example approach:
# Read .env.example and create .env with values from current environment while IFS= read -r line || [[ -n "$line" ]]; do # Skip comments and empty lines [[ "$line" =~ ^#.*$ || -z "$line" ]] && continue # Extract variable name (before = sign) var_name=$(echo "$line" | cut -d'=' -f1) # Get value from environment var_value="${!var_name}" # Write to .env echo "${var_name}=${var_value}" >> .env done < .env.example
Or manually inspect
.env.example and create .env with the required values from environment variables.
2. Install Dependencies
yarn install
3. Setup Supabase Vector Store
Get the database connection URL from Supabase Dashboard:
- Go to Settings → Database → Connection string → URI
- Copy the URI and add it to
as.envSUPABASE_DB_URL
yarn setup-db
This creates the pgvector extension, documents table, and match_documents function in your Supabase project.
4. Build
yarn build
5. Deploy
Vercel:
All vercel CLI commands require
-t <token> or --token <token> for authentication.
# Pull project settings (also links project, creates .vercel/project.json) vercel pull --yes -t $VERCEL_TOKEN # Push env vars to Vercel (first time only) # Must add to each environment separately while IFS='=' read -r key value; do [[ "$key" =~ ^#.*$ || -z "$key" || -z "$value" ]] && continue for env in production preview development; do printf '%s' "$value" | vercel env add "$key" $env -t $VERCEL_TOKEN done done < .env # Build locally for production vercel build --prod -t $VERCEL_TOKEN # Deploy prebuilt vercel deploy --prebuilt --prod --yes -t $VERCEL_TOKEN
Netlify:
# Import all env vars from .env (first time only) netlify env:import .env # Deploy netlify deploy --prod
Critical Notes
- VERCEL PREBUILT MODE IS MANDATORY: Always use
followed byvercel build --prod
. Never usevercel deploy --prebuilt --prod
orvercel --prod
withoutvercel deploy --prod
flag.--prebuilt - Supabase Required: Need a Supabase project (free tier works)
- Vector Store Setup: Run
to create tables automaticallyyarn setup-db - Environment Variables: All values come from current environment - inspect
for required variables.env.example - OpenAI for Embeddings: OPENAI_API_KEY is always required for vector embeddings
- No Dev Server: Never run
in VM environmentyarn dev