Dev SOP Knowledge Base
Production-grade build methodology — 46 topics. Agent API at /api/topics
Claude API Advanced Patterns: Thinking, Streaming, Batches, and Agentic Loops
Advanced Claude API patterns — adaptive thinking (claude-opus-4-6), streaming with finalMessage, Batches API at 50% cost, Files API for multi-request uploads, agentic tool use loops, RAG pipeline, and multi-provider routing via Bedrock/Vertex.
Claude API: Tool Use, Agentic Loops, and Structured Outputs
Claude API tool use patterns in TypeScript — tool runner, manual agentic loops, structured outputs with output_config, streaming, and production best practices.
Claude Code Sub-Agents: Architecture, Delegation, and Meta-Agent Patterns
How Claude Code sub-agents actually work — system prompt vs user prompt distinction, agent file structure, delegation flow, and the meta-agent pattern for building agents that build agents.
Clerk Authentication: Setup, Middleware, Webhooks, and User Management
Clerk authentication integration for Next.js — installation, middleware configuration, auth in Server Components and API routes, user metadata, webhook sync to database, and production gotchas including auto-blocking behavior.
Code Review, QA Validation, and Pre-Release Gates
Code review checklist, automated QA gates, pre-release validation — TypeScript/lint checks, security review patterns, accessibility gates, performance budgets, and the structured fix attestation format for bug commits.
OpenAI Codex CLI: Commands, Sandbox Modes, and Workflow Patterns
OpenAI Codex CLI quick reference — installation, authentication, sandbox modes (suggest/auto/full), slash commands, workflow patterns, and comparison with Claude Code equivalents.
Convex Real-Time Patterns: Queries, Mutations, Actions, and Scheduling
Convex real-time database patterns — reactive queries, transactional mutations, external-IO actions, React hooks, file storage, scheduled functions, and critical constraints (no v.map/v.set, no undefined, no unbounded collect).
Convex Schema Design, Indexes, and Query Patterns
Convex schema definition, index design, query/mutation/action patterns, and critical anti-patterns for real-time reactive database development.
Core Web Vitals Optimization: LCP, INP, and CLS
Definitive Core Web Vitals reference covering LCP, INP, and CLS thresholds, diagnosis flow, and concrete optimizations for Next.js applications.
Reverse Engineering Private APIs: SaaS Endpoint Discovery and Replay
Pattern for discovering and replaying private SaaS API endpoints — network tab capture, auth extraction, Playwright session state, httpx replay, schema mapping, token refresh, and rate limiting.
GitHub + Vercel Deployment: Automated CI/CD for Next.js SaaS
Automated Next.js deployment via GitHub + Vercel — repo setup, Vercel project linking, GitHub Actions CI pipeline, environment variable management, preview deployments, and production rollback procedures.
Docker Mastery: Multi-Stage Builds, Security, and Compose Orchestration
Docker production reference — multi-stage builds for Node.js/Next.js, non-root user hardening, secrets management, Docker Compose production/dev patterns, image optimization, health checks, .dockerignore, and cross-platform builds.
Docker Multi-Stage Builds: Production Patterns and Security Hardening
Docker multi-stage build patterns for Next.js and Node.js, security hardening, Docker Compose production setup, image size optimization, and health checks.
Drizzle ORM: Schema Definition, Queries, Migrations, and Type Safety
Drizzle ORM patterns for PostgreSQL — schema definition, type-safe queries, relations, migrations workflow, transactions, and integration with Supabase and PlanetScale. Covers the Drizzle vs Prisma tradeoff.
Environment Variable Setup and Management for Node.js and Next.js
Environment variable setup, validation, and management for Next.js and Node.js projects — covering local dev, preview, and production environments with Zod validation.
Git Workflow, Branching Strategy, and Commit Conventions
Git workflow for solo and team development — feature branch strategy, commit message conventions, PR process, merge vs rebase tradeoffs, git worktrees for parallel work, and common recovery operations.
GitHub Actions: CI/CD Workflows, Security, and Caching
Production GitHub Actions patterns: workflow syntax, secrets management, caching strategies, matrix testing, reusable workflows, and combined CI/CD pipelines.
Hindsight: Biomimetic Memory System for AI Agents
Hindsight memory system — retain/recall/reflect operations, memory bank design, tag schema, deployment modes (local/cloud/self-hosted), Python and Node.js SDK integration, and retrieval strategy selection.
Next.js API Routes, Middleware, and Edge Runtime Patterns
Next.js 14/15 App Router API patterns — route handlers, middleware for auth/rate limiting, edge runtime functions, Zod validation at boundary, streaming responses, error handling conventions, and CORS configuration.
Next.js App Router Architecture: File Conventions and Layout Patterns
Definitive reference for Next.js 14-16 App Router file conventions — layouts, loading states, error boundaries, route groups, parallel routes, and intercepting routes.
Next.js Server Actions: Form Handling, Validation, and Mutations
Next.js Server Actions for form handling — Zod validation, useActionState hook, optimistic updates, revalidation, and error handling patterns.
OpenClaw: Self-Hosted AI Agent Platform Configuration and Operations
OpenClaw self-hosted AI agent platform — gateway architecture, config file structure, channel setup (Telegram/Discord/WhatsApp), skills, memory files, cron jobs, VPS installation, Tailscale lockdown, and troubleshooting.
Parallel Worktree Agents: N Competing Implementations from One Plan
Run multiple Claude Code agents in parallel git worktrees to generate competing implementations of a feature, then merge the best. Covers init, execute, compare, and merge phases.
PDF and Document Processing: Extraction, Conversion, and AI Analysis
PDF and document processing patterns — text extraction with pypdf and pdfplumber, OCR with tesseract, markdown conversion, chunking for RAG, table extraction, and Claude API document analysis via Files API.
Playwright Browser Automation: CLI, Scripting, and Agent Integration
Playwright CLI quick reference and scripting patterns — navigation, clicks, form fills, screenshots, PDF capture, session state persistence, auth replay, and multi-session parallel automation.
PRD to Production: SaaS Build and Deployment Checklist
End-to-end SaaS build and deployment process — PRD creation via guided conversation, GSD build phases, GitHub push, Vercel production deployment, Stripe sandbox-to-production migration, Supabase URL updates, and env var audit.
Python Async Patterns, Click CLIs, and Production Script Conventions
Python production patterns — asyncio concurrency, httpx async HTTP, Click CLI framework, set -euo pipefail Bash equivalents, error handling, rate limiting, progress bars, and script conventions for automation pipelines.
Python Async Patterns: asyncio, Type Hints, and Production Best Practices
Production Python patterns: asyncio concurrency, type hints, dataclasses, context managers, and error handling for API integrations and data pipelines.
RAG Pipeline: Chunking, Embeddings, Vector Search, and Retrieval
Production RAG pipeline — document chunking strategy (500 tokens, 50 overlap), Voyage AI embeddings, pgvector in Supabase, hybrid search (semantic + BM25 with RRF), reranking, and augmented generation with citations.
RapidAPI, API Patterns, and HTTP Client Best Practices
API integration patterns — RapidAPI authentication, generic HTTP client wrapper, rate limiting, retry logic, pagination helpers, error handling conventions, and TypeScript type safety for external APIs.
React Advanced Hooks, Patterns, and Performance Optimization
Advanced React patterns — custom hooks for async state, useMemo/useCallback optimization, useReducer for complex state, data fetching with SWR/TanStack Query, context with selectors, portals, and concurrent mode patterns.
React Advanced Patterns: Compound Components, Render Props, and Performance
Production React patterns including compound components, render props, custom hooks, memoization strategy, and React 18 concurrent features.
App Scaffolding Workflow: Next.js 15 from Zero to Running
Step-by-step workflow for scaffolding a new Next.js 15 app with TypeScript, Tailwind CSS 4, ShadCN, and Supabase from zero to dev server running.
VPS Server Hardening: UFW, SSH, Fail2ban, and Nginx Security
VPS security hardening checklist — SSH key authentication, UFW firewall rules, Fail2ban setup, nginx security headers, automatic security updates, non-root deployment user, and Tailscale for private access.
ShadCN/ui and Tailwind: Component Patterns and Named CSS Classes
ShadCN/ui component patterns for Next.js — installation, custom component variants, form integration with react-hook-form and Zod, data tables, dark mode, and the named CSS class convention (never raw Tailwind in TSX).
SignalWire Agents SDK: Building Voice AI Agents with SWAIG
SignalWire Agents SDK reference for building voice AI agents — AgentBase setup, SWAIG tool registration, FunctionResult patterns, DataMap for API passthrough, and multi-agent server deployment.
SignalWire Voice AI Agents: SWML, SWAIG, and the Python Agents SDK
SignalWire voice agent development — SWML verb structure, SWAIG tool-calling functions, data_map serverless handlers, Python AgentBase SDK, Call Flow Builder nodes, and IVR-to-AI migration patterns.
Stateful Agent Evaluation: Datasets, Graders, and CI Gates
Evaluation framework for memory-capable agents — dataset formats, target modes, extractor types, rubric grading, and CI gate patterns. Covers multi-turn testing and memory block verification.
Stripe Integration: Subscriptions, Webhooks, and Customer Portal
Stripe integration patterns for SaaS — checkout sessions, subscription management, webhook signature verification, customer portal, metered billing, and sandbox-to-production migration checklist.
Supabase RLS, Migrations, Backup, and Production Patterns
Supabase production patterns — Row Level Security policies, migration workflow (always create rollback), backup strategies, point-in-time recovery, storage setup, edge functions, and common pitfalls.
Trigger.dev: Background Jobs, Scheduled Tasks, and Long-Running Workflows
Trigger.dev background job patterns — task definitions, scheduled cron jobs, batch processing, retry configuration, wait/sleep, concurrency limits, and integration with Next.js API routes for job triggering.
TypeScript Advanced Types: Generics, Utility Types, and Type Guards
Production TypeScript patterns: conditional types, mapped types, template literal types, branded types, discriminated unions, and full-stack type safety with Zod.
TypeScript Full-Stack Type Safety: Shared Types, API Contracts, and Zod
Full-stack TypeScript type safety patterns — sharing types between frontend and backend, API contract validation with Zod, database type generation, and safe error handling.
TypeScript and Zod: Type Safety, Boundary Validation, and Schema Patterns
TypeScript production patterns with Zod — boundary validation at API inputs/outputs, schema composition, discriminated unions, branded types, transform pipelines, error formatting, and inference patterns for full-stack type safety.
Vercel API: Deployments, Environment Variables, and Domains
Vercel REST API and CLI reference for managing deployments, environment variables, domains, and project lifecycle programmatically.
Vercel API and CLI: Deployments, Projects, Domains, and Env Vars
Vercel REST API and CLI reference — deployments, projects, domains, DNS, environment variables, teams, webhooks, edge config, and CI/CD automation. 200+ endpoints across 30 categories.