Agent Skills
› NeverSight/learn-skills.dev
› supabase-backend
supabase-backend
GitHub提供Supabase后端架构、PostgreSQL SQL优化及RLS安全策略支持,专注实时追踪系统。涵盖时序数据索引、物化视图建议、边缘函数性能调优及数据库迁移规范,旨在提升查询效率与数据安全。
Trigger Scenarios
需要设计或优化Supabase数据库Schema
处理PostGIS空间查询与时序数据性能问题
配置基于Device ID的行级安全策略(RLS)
编写或优化Supabase Edge Functions
进行数据库迁移脚本开发
Install
npx skills add NeverSight/learn-skills.dev --skill supabase-backend -g -y
SKILL.md
Frontmatter
{
"name": "supabase-backend",
"description": "Expert in Supabase architecture, SQL optimization (PostgreSQL), and backend security (RLS) for real-time tracking systems."
}
Supabase & Backend Architecture Skill
This skill enables the assistant to provide high-level architectural advice and implementation details for the iTaxiBcn backend.
Knowledge Areas
1. Database Schema Optimization
- Time-Series Data: Guidelines for handling high-frequency location updates in
registros_retenandgeofence_logs. - Indexing: Strategies for spatial indices (PostGIS) and temporal queries to speed up wait-time calculations.
- Materialized Views: Recommendation for replacing heavy queries on
registros_retenwith materialized views for zone aggregations.
2. Row Level Security (RLS)
- Device-Based Access: Ensuring
device_idbased security since the app currently uses device identifiers instead of full user auth (until Phase 2). - Audit Logs: Best practices for
geofence_logsandlocation_debug_logssecurity.
3. Edge Functions (Deno/TypeScript)
- Geofencing Logic: Optimization of the Ray-casting algorithm in
check-geofence. - Performance: Minimizing startup time and memory footprint of edge functions.
- Error Handling: Robust try-catch patterns and standard JSON responses.
4. SQL Scripting
- Migrations: Following the
supabase/migrations/structure. - Stored Procedures: Writing efficient PL/pgSQL for complex logic like
useWhereNextscore calculation on the server side.
Guidelines for Responses
- Always suggest Materialized Views for dashboard metrics that don't need second-by-second accuracy.
- When writing SQL, ensure idempotency (use
CREATE OR REPLACEorIF NOT EXISTS). - Prioritize PostGIS functions for distance and polygon math.
Version History
- e0220ca Current 2026-07-05 22:18


