supabase-environments
3
总安装量
2
周安装量
#55247
全站排名
安装命令
npx skills add https://github.com/mildtomato/agent-skills --skill supabase-environments
Agent 安装分布
opencode
2
gemini-cli
2
claude-code
2
github-copilot
2
codex
2
kimi-cli
2
Skill 文档
Supabase Environments System
Internal development guide for AI agents building the Supabase CLI environments system. This skill covers the three-environment model (development, preview, production), variable resolution, pull/push workflows, secret handling, branch-to-environment mapping, local file structure, and environment CRUD operations.
Original specification by: Julien Goux (jgoux)
Note: This skill is for Supabase internal development. Use when implementing the
supabase envCLI subsystem or building the environments infrastructure.
When to Apply
Reference these guidelines when:
- Implementing
envCLI commands (pull, push, list, set, unset, create, delete, seed) - Building variable resolution logic for local or deployed contexts
- Handling secret variables with write-only access patterns
- Implementing branch-to-environment mapping and branch-specific overrides
- Designing pull/push workflows with diff display and confirmation
- Managing local
.envand.env.localfile structure - Building bulk upsert API endpoints for environment variables
- Creating interactive seed workflows for environment setup
- Transitioning from local-first to remote-first development mode
- Implementing platform variable (implicit binding) vs user variable (env() syntax) systems
Rule Categories by Priority
Rules are organized by impact level and implementation priority:
| Priority | Category | Impact | Prefix | Count |
|---|---|---|---|---|
| 1 | Core Model | CRITICAL | model- |
3 |
| 2 | Security | CRITICAL | security- |
2 |
| 3 | Pull Workflow | HIGH | pull- |
2 |
| 4 | Push Workflow | HIGH | push- |
3 |
| 5 | Variable System | HIGH | variables- |
2 |
| 6 | Local Files | HIGH | local- |
2 |
| 7 | Branch Overrides | MEDIUM | branches- |
1 |
| 8 | Environment CRUD | MEDIUM | envs- |
2 |
| 9 | Transition | MEDIUM | transition- |
1 |
Quick Reference
CRITICAL â Core Model
- model-three-defaults â Protect the three default environments (development/preview/production cannot be deleted or renamed)
- model-flat-environments â Environments are flat with no inheritance (independent sets, no fallback chains)
- model-development-local-only â Development environment is local-only (not in branch mapping, used exclusively by cli dev)
CRITICAL â Security
- security-sensitive-fields â Sensitive fields must come from environment variables (no hardcoded secrets in config.json)
- security-secret-write-only â Secret variables are write-only (excluded from pull/list, @secret annotation, interactive prompt on push)
HIGH â Pull Workflow
- pull-full-replace â Pull performs full file replacement (no merge with existing .env)
- pull-resolve-branch-overrides â Pull resolves branch overrides automatically (server-side resolution, client gets final values)
HIGH â Push Workflow
- push-diff-display â Push must show a diff before applying (additions/changes/removals with confirmation)
- push-base-values-only â Push only sets base values, not branch overrides (use env set –branch for overrides)
- push-bulk-upsert â Push uses bulk upsert, not one-at-a-time operations (single PUT request)
HIGH â Variable System
- variables-canonical-names â Derive canonical variable names from config paths (SUPABASE_ prefix, path-to-underscore)
- variables-env-syntax â Use env() syntax for explicit variable references (user variables, canonical name overrides)
HIGH â Local Files
- local-env-files â Only two local files, both gitignored (.env + .env.local, no per-environment files)
- local-resolution-order â Local resolution follows OS, .env.local, .env priority
MEDIUM â Branch Overrides
- branches-per-variable-override â Branch overrides are per-variable, per-branch (set individually, not bulk)
MEDIUM â Environment CRUD
- envs-seed-workflow â Seed new environments with keep/edit/skip flow (interactive review)
- envs-crud-consistency â Environment CRUD uses consistent verbs and output
MEDIUM â Transition
- transition-link-prompt â Prompt to push local variables when linking a project (local-first to remote-first)
Structure
- rules/ â Individual focused rules (50-70 lines each) showing terminal output and UX patterns
- references/ â Comprehensive background documentation for deeper context
- AGENTS.md â Generated compilation of all rules (run
npm run build)
Agents should start with rules for immediate guidance, then consult references when deeper architectural understanding is needed.