CapgeminiDCX AI Playground Hackathon 2026
Build labChapter 6 of 6Reference
Jump to section

Cheat sheet

Commands, the API changes that break old tutorials, the habits that mattered, and a primary-source reference index.

Cheat sheet

Commands worth memorising

vercel env pull .env.local        # sync env vars from the linked project
vercel --prod                     # deploy to production
npx @ai-sdk/devtools@latest       # inspect every LLM call → localhost:4983
npx @ai-sdk/codemod upgrade v7    # migrate an older AI SDK project

API changes that break old tutorials

Old (pre-v5)Current (AI SDK v7)
useCompletion from 'ai/react'useChat from '@ai-sdk/react'
toDataStreamResponse()createUIMessageStreamResponse({ stream: toUIMessageStream(...) })
openai('gpt-4o-mini')'provider/model' via AI Gateway
generateObject()Output.object() on generateText / an agent
hand-rolled tool loopToolLoopAgent
stopWhen: stepCountIs(n)stopWhen: isStepCount(n)
useChat({ api })useChat({ transport: new DefaultChatTransport({ api }) })
@vercel/postgresNeon via the Vercel Marketplace
runtime = 'edge' for speedNode by default; both on Fluid compute

The six habits that made the difference

  • Six-block prompts — data, layout, components, states, constraints, done-when. Every time.
  • Context layer first — AGENTS.md and skills before code. It's why the prompts stayed short.
  • Contracts before code — one Zod schema per boundary. The form, the DB, and the model cannot disagree.
  • toModelOutput always — rich data to your app, cheap tokens to the model.
  • Design the failure — every external call: timeout, retry, documented degraded path. Then test it.
  • Deterministic in code — the model decides what to do. Never what a number is.

Reference index

Primary sources only. The ecosystem changed enough between 2024 and 2026 that secondary material is often confidently out of date — when something here disagrees with a blog post, trust these.

Generation — v0

Context layer — instructions and skills

Application layer — AI SDK v7

Platform — routing, runtime, execution

Data, protection, operations

Correctness and security

Progress in the original lab was stored per-browser. Every block above is copy-pasteable.