patterns

Enforce Zod validation, Clerk authentication, and Drizzle ORM patterns in API routes.

3|Updated Jan 22, 2026
One-click install
npx skills add https://github.com/brief-hq/brief-wiggum --skill patterns-brief-hq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: patterns
Source: https://github.com/brief-hq/brief-wiggum/tree/main/.claude/skills/patterns
Command: npx skills add https://github.com/brief-hq/brief-wiggum --skill patterns-brief-hq

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures code adheres to Brief's established patterns, security requirements, and architectural decisions, preventing common vulnerabilities and maintaining code quality.

Core Features & Use Cases

  • API Route Standards: Enforces Zod validation, authentication checks, and standardized error handling for API routes.
  • Database Integrity: Guides developers on using Drizzle ORM with Supabase, emphasizing Row Level Security (RLS) and proper organization filtering.
  • Security Best Practices: Details secure authentication methods (Clerk, API Keys), input validation with Zod, and common vulnerability prevention (XSS, IDOR).
  • Architectural Decision Validation: Integrates with brief ask --mode check to validate proposed changes against existing decisions.
  • Component Reuse: Promotes the use of the TailStack design system (@/components/ui/*) and proper component organization.

Quick Start

Use the patterns skill to validate the API route code for authentication and Zod schema compliance.

Frequently Asked Questions about patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce Zod validation and authentication checks in API routes?

To enforce Zod validation and authentication in API routes, apply Clerk checks alongside strict input validation. This standardizes error handling and prevents unauthorized access before processing requests.

How does Row Level Security work with Drizzle ORM and Supabase?

Row Level Security (RLS) with Drizzle ORM and Supabase works by enforcing database-level access controls through proper organization filtering. This ensures queries only return data the user is authorized to access.

What is the best way to prevent XSS and IDOR vulnerabilities in web applications?

Preventing XSS and IDOR vulnerabilities requires secure authentication via Clerk, strict input validation using Zod schemas, and enforcing Row Level Security to block unauthorized data access.

Can I validate architectural decisions against existing code patterns automatically?

You can validate architectural decisions automatically by integrating with the `brief ask --mode check` command. This validates proposed changes against established patterns to maintain architectural governance and code consistency.

Do I need to use the TailStack design system for component development?

Using the TailStack design system via `@/components/ui/*` is required for component development to ensure proper component organization and reuse. This maintains UI consistency and architectural alignment.