swiftship/internal/skills/data/features/supabase/SKILL.md
Supabase Swift SDK patterns for auth, database, and storage. Use when implementing app features related to supabase.
npx skillsauth add abdullah4ai/apple-dev-docs supabaseInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You MUST set up the Supabase backend BEFORE writing any Swift code. Follow this exact order:
mcp__supabase__execute_sql — columns, types, foreign keys, constraints, indexesALTER TABLE ... ENABLE ROW LEVEL SECURITYstorage.objectsupdated_at, denormalized counters, etc.mcp__supabase__list_tables and mcp__supabase__list_storage_bucketsmcp__supabase__get_auth_config to confirm providers are enabled (auto-configured by nanowave)Config/AppConfig.swift — Supabase URL + anon keySupabaseService.swift — shared clientCodable + CodingKeys matching the table columns you just createdNEVER skip Phase 1. If you write Swift code that references tables that don't exist, the app will crash at runtime.
Initialize SupabaseClient once in a shared service. Use PKCE auth flow (default for mobile).
import Supabase
@Observable
final class SupabaseService {
static let shared = SupabaseService()
let client: SupabaseClient
private init() {
client = SupabaseClient(
supabaseURL: URL(string: AppConfig.supabaseURL)!,
supabaseKey: AppConfig.supabaseAnonKey
)
}
}
Store Supabase credentials as static constants — injected by nanowave during build.
enum AppConfig {
static let supabaseURL = "https://PROJECT_REF.supabase.co"
static let supabaseAnonKey = "YOUR_ANON_KEY"
}
authentication skill (AuthService, guards, modes) — this skill covers only the Supabase auth API callsrepositories skill — this skill covers Supabase API patterns used inside concrete repository implementationsmcp__supabase__get_auth_config to verify, use mcp__supabase__configure_auth_providers only if manual adjustment is neededmcp__supabase__execute_sql — run SQL queries (SELECT, DML)mcp__supabase__list_tables — list tables in schemasmcp__supabase__apply_migration — track DDL as versioned migrationsmcp__supabase__list_storage_buckets — list storage bucketsmcp__supabase__get_project_url — get project URL for Swift clientmcp__supabase__get_anon_key — get anon key for Swift clientmcp__supabase__get_logs — query project logsmcp__supabase__configure_auth_providers — enable/disable auth providers (apple, google, email, phone, anonymous)mcp__supabase__get_auth_config — check current auth provider configurationmcp__supabase__set_secrets — set edge function environment variables (name/value pairs)mcp__supabase__list_secrets — list all project secretsmcp__supabase__delete_secrets — delete secrets by nametesting
Use for 3D games: racing, 3D sports, board games, marble maze, tower defense, bowling. SceneKit + SceneView architecture, 3D scene hierarchy, physics, game loop, primitives, materials, cameras, particles, audio.
documentation
Game UI patterns: SwiftUI HUD overlays on SpriteKit, menus (main/pause/game-over), virtual joystick/d-pad, score displays, health bars, tutorial onboarding.
tools
Download free game sprites/textures/3D models and generate procedural assets. Covers nw_download_asset tool, texture factories, sprite atlas organization, 3D model loading, and programmatic asset creation.
testing
Use for 2D games: arcade, puzzle, sports, ping pong, platformer, shooter, 2D racing. SpriteKit + SpriteView architecture, scene hierarchy, physics, game loop, audio, particles, game feel.