schema0-web-crud
Installation
SKILL.md
Web Feature Development
Web only. Requires
apps/web/to exist. Skip this entirely ifapps/web/does not exist.
Web Stack
- React Router v7 + TanStack DB + TanStack React Table
- oRPC for API (NOT tRPC)
- Drizzle ORM + drizzle-zod for schema
- shadcn/ui components (Dialog, AlertDialog, DataTable, Form)
- react-hook-form + zodResolver for forms
import { z } from "zod/v4"everywhere -- NEVERimport z from "zod"
Implementation Order
For every new entity, create files in this exact sequence:
- Database Schema (
packages/db/src/schema/{entities}.ts) - API Router (
packages/api/src/routers/{entities}.ts) - Query Collection (
apps/web/src/query-collections/custom/{entities}.ts) - Dialog (
apps/web/src/components/ui/data-table/custom/{entities}/{Entities}Dialog.tsx) - Form (
apps/web/src/components/ui/data-table/custom/{entities}/{Entities}Form.tsx) - Table Columns (
apps/web/src/components/ui/data-table/custom/{entities}/{Entities}Column.tsx) - Component Index (
apps/web/src/components/ui/data-table/custom/{entities}/index.ts) - List Route (
apps/web/src/routes/_auth.{entities}.tsx) - Detail Route (
apps/web/src/routes/_auth.{entities}_.$id.tsx) - Sidebar entry (
apps/web/src/components/app-sidebar.tsx)
Key Rules
queryFnMUST useclient.{entity}.selectAll({})directly -- neverfetchCustomResources.loaderMUST be exported as a named export (React Router v7).- Delete uses AlertDialog (2-step confirm). NEVER use
window.confirm(). - Form
handleSubmitMUST include theonInvalidcallback for debugging. - Edit form schema MUST NOT include
id-- Dialog adds it after submission. - Actions column uses
aria-label="Edit"/aria-label="Delete"(used by tests). - Never perform database operations in loaders -- loaders only call ORPC client methods.
References
references/collections.md-- Collection pattern, Dialog pattern, Form pattern, index exportreferences/table-columns.md-- Base columns template, customization examples (date, badge, boolean, price, etc.)references/views.md-- List Route pattern, Detail Route pattern, sidebar entry, loader requirementreferences/orchestration.md-- Execution order diagram, post-creation steps, completion verification
Related skills
More from schema0/skills
schema0-dev
>-
23schema0-mobile
Mobile platform patterns — React Native / Expo, worker architecture, ORPC client, and navigation
17schema0-rls
Row-level security setup — RLS policies, authenticated database connections, and user-scoped data access
17schema0-ai
AI SDK integration with ORPC — chat streaming, prompt-response, tool calling, and provider configuration
17schema0-testing
Testing guide for web and mobile platforms — bun:test, Jest, PGlite, 3-layer validation, and test templates
17schema0-cli
CLI commands for sandbox execution, deployment, version management, secrets, and third-party integrations
17