backend_safeguard
Installation
SKILL.md
Backend Safeguard Protocol (Supabase + Vercel API)
1. Database Schema & Migration Safety
- Migrations:
- NEVER edit a previous migration. Always create a new one.
- Migration files must be numbered/timestamped sequentially.
- Destructive changes (DROP COLUMN) require explicit user confirmation.
- Supabase Specifics:
- Use
pg_jsonschema(if available) orCHECKconstraints for complex JSON data. - Indexes: Ensure Foreign Keys have indices if used in JOINs frequentyl.
- Use
2. RLS (Row Level Security) "Ironclad" Rules
- Enablement:
ALTER TABLE "table_name" ENABLE ROW LEVEL SECURITY;is MANDATORY. - Policies:
- Must have separate policies for SELECT, INSERT, UPDATE, DELETE (unless absolutely identical).
auth.uid()MUST be checked for user-specific data.service_roleusage in client is FORBIDDEN.
Related skills
More from cityfish91159/maihouses
agentic_architecture
Enforces high-level architectural thinking, separation of concerns, and scalability checks before coding.
19code-review-excellence
程式碼審查最佳實踐指南。當進行 PR review、代碼審查或用戶提到「review」、「審查」時使用。
19nasa_typescript_safety
Adapts NASA's "Power of 10" safety rules for high-reliability TypeScript code.
18frontend_mastery
Advanced React patterns, performance optimization, and state management rules.
18code-simplifier
|
18type-checker
執行 TypeScript 類型檢查並修復類型錯誤。當遇到類型錯誤、需要類型定義、或用戶提到「type」、「類型」時使用。
18