Skip to content
Back to skills

Maintenance

ASecurity

Toggle the server-side login killswitch on a Supabase environment. Usage `/maintenance <env> <on|off>` (e.g. `/maintenance prod on`). Sets or unsets the `MAINTENANCE_MODE` secret on the login edge function, which short-circuits new logins with HTTP 503 when enabled. Existing sessions keep working.

  • 419 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 20, 2026
devopsbash

Works with

  • cli

Security analysis

A100/100

Scanned September 20, 2026

npx -y skills add pipecat-ai/gradient-bang --skill maintenance --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Maintenance?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Maintenance
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/pipecat-ai-maintenance/badge)](https://www.skillsdirectory.com/skills/pipecat-ai-maintenance)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: maintenance
description: Toggle the server-side login killswitch on a Supabase environment. Usage `/maintenance <env> <on|off>` (e.g. `/maintenance prod on`). Sets or unsets the `MAINTENANCE_MODE` secret on the login edge function, which short-circuits new logins with HTTP 503 when enabled. Existing sessions keep working.
---

# Maintenance Mode

Toggle the `MAINTENANCE_MODE` secret on a Supabase project's edge functions. When enabled, the `login` edge function returns HTTP 503 before any rate-limiting or DB work, blocking all new sign-ins.

## Parameters

`/maintenance <env> <on|off>` — both arguments required. If either is missing, ask.

- `dev` → env file: `.env.cloud.dev`
- `prod` → env file: `.env.cloud`

## Steps

### 1. Confirm intent for `prod on`

If the user is turning maintenance **on** for **prod**, briefly state what will happen (all new logins blocked) and ask the user to confirm before running the command. For `prod off` or any `dev` action, proceed without confirmation.

### 2. Source the env file and extract the project ref

The project ref is the subdomain of `SUPABASE_URL` in the env file:

```bash
set -a && source <env-file> && set +a
PROJECT_REF=$(echo "$SUPABASE_URL" | sed -E 's|https?://([^.]+)\..*|\1|')
```

### 3. Run the toggle

`on`:
```bash
npx supabase --workdir deployment secrets set MAINTENANCE_MODE=1 --project-ref "$PROJECT_REF"
```

`off`:
```bash
npx supabase --workdir deployment secrets unset MAINTENANCE_MODE --project-ref "$PROJECT_REF"
```

Secrets are read at runtime via `Deno.env.get()` in [login/index.ts](../../../deployment/supabase/functions/login/index.ts) — no redeploy needed.

### 4. Verify

```bash
npx supabase --workdir deployment secrets list --project-ref "$PROJECT_REF" | grep MAINTENANCE_MODE
```

Report the final state to the user (on/off).

## Optional message

If the user supplies a custom message (e.g. `/maintenance prod on "back in 10 min"`), also set:
```bash
npx supabase --workdir deployment secrets set MAINTENANCE_MESSAGE="<message>" --project-ref "$PROJECT_REF"
```

When turning off, also unset `MAINTENANCE_MESSAGE` **only if it's currently set** (unsetting a non-existent secret errors):
```bash
npx supabase --workdir deployment secrets list --project-ref "$PROJECT_REF" | grep -q MAINTENANCE_MESSAGE && npx supabase --workdir deployment secrets unset MAINTENANCE_MESSAGE --project-ref "$PROJECT_REF"
```

## Notes

- Always pass `--project-ref` explicitly; never rely on a linked project.
- This only controls the **server-side login killswitch**. The client-side `VITE_MAINTENANCE_MODE` flag in Vercel is separate, requires a rebuild to take effect, and hides the entire app (not just login). Don't touch it from this skill.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in devops →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.