Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
§6::TYPES_REGEN_AND_TEST_VALIDATION
// RCA-derived ordering invariants. Three process gaps caused CI failures in consuming repos.
// Encode as MUST/NEVER constraints — not advisory.
TYPES_REGEN_ORDERING::[
SEQUENCE::"supabase db reset → gen types → THEN pgTAP tests [NEVER reverse]",
INVARIANT::"Generate types ONLY from clean post-reset DB state",
VIOLATION_CAUSE::"pgTAP CREATE EXTENSION outside BEGIN...ROLLBACK persists pgtap into public schema",
SYMPTOM::"Generated types pick up pgTAP symbols (e.g. 146 extra) that CI rejects on clean reset",
MUST::"Run supabase db reset then immediately gen types before any pgTAP execution",
NEVER::"Generate types from a DB that has had pgTAP tests run against it"
]
DROPPED_OBJECT_SWEEP::[
TRIGGER::"Migration drops OR renames a constraint, column, or any named DB object",
REQUIRED_ACTION::"grep supabase/test*/ corpus for the dropped object name",
SCOPE::"Entire supabase/test*/ directory tree — all test files",
VIOLATION_CAUSE::"pg_depend sweep finds column dependents but misses TEST CORPUS assertions about the dropped constraint",
SYMPTOM::"Pre-existing expectation test fails against CI clean state",
MUST::"Update any test assertions referencing the dropped/renamed object in the same PR as the migration",
NEVER::"Ship a migration that drops/renames a named object without grepping the test corpus first"
]
CI_HEADER_REPRODUCTION::[
CONTEXT::"Sentinel header prepended to generated TypeScript types file",
VIOLATION_CAUSE::"Hand-composing the sentinel header drops trailing blank line vs CI heredoc format",
SYMPTOM::"Byte-level diff failure in CI despite correct type content",
FRAGILE_SEAM::"Sentinel header format is fragile until issue #842 resolved",
MUST::"Reproduce CI's exact generation step (e.g. cat sentinel-header.txt raw.ts > target)",
NEVER::"Hand-compose the sentinel header — reproduce the CI pipeline step verbatim"
]
§7::ANCHOR_KERNEL
TARGET::"spec-compliant Supabase operational guidance with CI-proven ordering invariants"
NEVER::[
generate_types_after_pgtap_run,
skip_test_corpus_grep_on_dropped_objects,
hand_compose_sentinel_header,
apply_migrations_without_validation_checklist,
bypass_CI_deployment_flow_except_emergency
]
MUST::[
reset_then_gen_types_before_pgtap,
grep_supabase_tests_for_dropped_object_names,
reproduce_CI_exact_header_generation_step,
validate_migrations_against_ADR_003,
use_read_only_MCP_tools_for_inspection
]
GATE::"DB reset → types regen → pgTAP order enforced? Test corpus swept for dropped objects? Sentinel header reproduced from CI step?"