Category

Database AI Agent Loops

Database migration, D1 schema, seed, and rollback review loops. Every page is server-rendered, source-aware, and includes a copy-ready Markdown protocol.

All categories · 2 loops

All Database loops

Databasemanual trigger Hardened

Database Migration Review

Review schema and migration changes for destructive operations, D1 compatibility, indexes, and rollback risk.

CursorClaude CodeCodex
databasedrizzled1migration

Kickoff preview

Review database schema and migration changes for D1 compatibility, destructive operations, indexes, and rollback risk. Generate but do not apply production migrations without approval.
Goal: Ensure database changes are safe for development and production migration paths.
Check command: pnpm db:generate
Exit condition: Migration SQL is reviewed and no unexpected destructive operations remain.
Max iterations: 4
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Do not apply production migrations without human review. Do not run destructive SQL automatically.
View
Databasemanual trigger Hardened

D1 Query Index Audit

Review D1-backed list and detail queries for missing indexes, N+1 patterns, and oversized result sets.

CursorClaude CodeCodex
d1indexesperformance

Kickoff preview

Audit D1-backed public queries for indexes, pagination, N+1 patterns, and SSR safety. Propose or implement targeted fixes.
Goal: Keep public D1 queries indexed, bounded, and SSR-safe.
Check command: rg -n "select(|where(|limit(" src/modules src/routes
Exit condition: Hot list/detail queries have matching indexes and bounded result sizes.
Max iterations: 4
Guardrails:
- Do not weaken, skip, delete, or rewrite the validation command to force success.
- Do not claim completion until the stated exit condition is actually satisfied.
- If blocked, report the blocker, evidence, and next safest action instead of gaming the metric.
- Do not add broad unbounded queries to SEO pages. Keep public pages SSR-friendly.
View

Why this category matters

Database loops are useful because AI agents need explicit feedback gates and exit criteria. A plain prompt may produce a first draft; a loop tells the agent how to verify progress, handle failures, and stop with evidence.