Bibliothèque › Mods

Automatisme (hook)

Protection contre les changements Supabase distants

Empêche Claude de modifier un projet Supabase hébergé via la CLI, tout en laissant le travail local libre, avec un crochet PreToolUse.

Comment l'utiliser

Dans Claude Code, lance ces commandes :

npx claude-code-templates@latest --hook security/supabase-remote-guard

Ouvrir le dépôt d'origine

Le contenu

Le contenu est réservé aux abonnés

Compris dans SuperPrompt : copiez, téléchargez et installez toutes les fiches, avec les six agents métier x10. 7 jours gratuits, puis 97 € par an, résiliable en trois clics.

Description d'origine, en anglais

Stops Claude from changing a hosted Supabase project while leaving local work alone. A PreToolUse hook denies supabase CLI commands that write to the linked or remote project however they are launched (npx, bunx, pnpm dlx, sh -c, env prefixes, && chains): db push (unless --local or --dry-run), db reset --linked/--db-url, migration repair, migration up/squash --linked/--db-url, functions deploy/delete, secrets set/unset, config push, projects/orgs create, projects delete, branches create/update/delete, domain, network, SSL, SSO, backup and postgres-config changes, storage rm/mv/cp without --local. It also denies any command that names a hosted Supabase database host (db.<ref>.supabase.co, *.pooler.supabase.com), so psql, pg_dump, prisma or a script with a production connection string cannot reach it. For the Supabase MCP server it is an allowlist: only list_*, get_*, search_docs, generate_typescript_types and execute_sql with one read-only statement (no comments, no write keywords, no side-effect functions such as net.*, cron.*, vault.*) pass; every other tool, including ones added later, is denied. supabase start, db reset, migration new, test db and gen types --local keep working,

D'où vient cette fiche

Création de davila7, publiée sur davila7/claude-code-templates sous licence MIT.

Le contenu est reproduit tel quel, dans le respect de sa licence. Le titre, le résumé et le classement en français sont rédigés par SuperPrompt.