---
name: supabase-arch-e88e4bac2f59
description: >-
  Supabase 架構決策：RPC vs Edge Function 選型、新功能的技術路線取捨。NOT for 撰寫 migration SQL
  或 debug 既有 RLS policy，NOT for 前端狀態管理（走 pinia-store）。
---


# Supabase 架構決策指南

本 skill 只做架構選型：新功能該走 Server API、Postgres RPC、Edge Function、Trigger、pg_cron 或 Realtime。資料存取路徑（寫入走 Server API；client 直讀是否合法取決於 `modules.auth`）以 db-runtime 規約與 `server-api` skill 為準；migration SQL 交 `supabase-migration`，policy 內容交 `supabase-rls`。

# SOP

## Phase 1 -- 收斂需求特徵

1. READ 讀取功能需求，以及 consumer manifest（`.clade/manifest.json`）的 `modules.auth` 與 `modules.db-runtime`。
2. THINK 列出需求的特徵：是否呼叫第三方 API、是否接收外部 Webhook、是否處理檔案、是否碰金鑰、是否批次、是否跨表寫入、是否需要即時更新或排程。

## Phase 2 -- 判定技術路線

1. THINK 讀取 `rules/功能路由決策樹.md`，依 Phase 1 的特徵由上而下比對，第一個命中的分支即採用，並記下被跳過的較前分支與跳過理由。

## Phase 3 -- 輸出建議並做安全檢查

1. READ 讀取 `rules/Schema邊界與安全檢查判準.md`。
2. WRITE 輸出選定路線、命中的分支編號、schema 落點與已載入規則的逐條安全檢查結果；不符的項目寫成要修的設計點，不帶過。


---
Source attribution: YuDefine
Original project: https://github.com/YuDefine/nuxt-supabase-starter/blob/2987d936c8a6ea7f676c42528192416901bb3ee3/template/.claude/skills/supabase-arch/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2025-present YuDefine - 域定資訊工作室

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: YuDefine
Original project: https://github.com/YuDefine/nuxt-supabase-starter/blob/2987d936c8a6ea7f676c42528192416901bb3ee3/template/.claude/skills/supabase-arch/SKILL.md
Attribution basis: Source repository record

Fields of work: Development & Engineering, Product Management
Roles: Data Engineer, Backend Developer, Product Manager
Specialties: Database, API
Tools: Supabase
Country applicability: Country not specified
Classification basis: Source category, role and specialization labels
Instruction SHA-256: 7ccab4b4caf2b1f953b01dca0ad6ac9687084ffa7960efdd9e946365d3c4106f
