data-validation
Data Validation - Input Sanitisation & Schema Patterns
Validation patterns ensuring all data entering the system is validated at boundaries: user input via Zod (frontend), API requests via Pydantic (backend). No unvalidated data crosses a trust boundary.
Description
Defines Zod and Pydantic validation patterns for all data entering the system at trust boundaries. Covers form validation, API request schemas, type-safe contracts, Australian-specific validators (ABN, phone, postcode), and schema composition strategies.
When to Apply
Positive Triggers
- Creating or modifying form inputs with user data
- Defining API request/response schemas (Pydantic models)
- Adding Zod schemas for frontend validation
- Reviewing code for missing input validation
- Building new API endpoints that accept POST/PUT/PATCH data
- User mentions: "validation", "Zod", "Pydantic", "schema", "sanitise", "input"
More from cleanexpo/unite-hub
tdd
Use when implementing any feature or bug fix. Hard gate — no production code without a failing test first. Applies to vitest (apps/web/) and pytest (apps/backend/). Triggers on "implement", "add feature", "fix bug", "new component", "new endpoint", or any code-writing task.
1idea-to-production
Plain-English pipeline from idea to production — routes user requests to the right phase and agent
1oauth-flow
OAuth 2.0 and OIDC integration with PKCE, Supabase Auth providers, and redirect URI validation
1health-check
>-
1csv-processor
>-
1vector-search
>-
1