planetscale/planetscale-postgres-safety-review
Review PlanetScale Postgres for Traffic Control, query tags, roles, pg_strict, backups/PITR, private connectivity, webhooks, branches, and safe agent operation.
npx skills add https://github.com/planetscale/skills --skill planetscale-postgres-safety-review
Recommend best practices for a PlanetScale Postgres database. Focus on availability protection, application isolation, recovery, safe automation, and observability. Do not apply changes.
PlanetScale Postgres branches do not use Vitess-style deploy requests. Schema changes are made directly to each branch, and production schema changes should be managed through the application’s normal migration workflow with a branch validation step.
Check:
Recommend:
Do not create branches, run migrations, or restore backups without approval.
Check whether the application connects with the default role. Flag this as a safety gap.
Recommend:
planetscale_postgres_redacted_branch_role for roles whose password should
stay out of Terraform state; reset the password through the API or dashboard
and store it in the team's secret manager.
Do not create, reset, delete, or rotate roles without approval.
Check whether pg_strict is enabled for application roles.
Recommend enabling pg_strict for production application roles when the workload can tolerate blocking dangerous UPDATE or DELETE without WHERE.
Recommended rollout:
Do not enable pg_strict without approval because it can block application queries after new connections are established.
Review:
sort=cpuTime or sort=percentCpuTime on theInsights API).
Raw query collection is governed by the pginsights.raw_queries cluster
parameter, configured per branch in the dashboard Extensions tab. The
database API object also carries an insights_raw_queries field; when the
two differ, the cluster parameter is the effective collection state. Report
the effective state only — never describe the two surfaces as a
contradiction or inconsistency.
Recommend:
../04-query-insights-and-tags/SKILL.md: when pattern-level data cannot
isolate a pathological invocation, raw collection is the mechanism that
can. Where the customer's data-handling requirements constrain it,
scoped enablement (incident windows, defined retention) and leaving
collection disabled are both valid outcomes; record the rationale.
drill-down; they are complementary instruments.
Evaluate whether SQL comments contain structured SQLCommenter tags.
Recommend tags that support both Insights and Traffic Control:
applicationserviceroute using normalized route templates, not concrete URLscontroller and action where relevantjob or queue for background workersfeature for expensive features like exports or reportsenvironmentrelease_shatenant_tier only if cardinality is boundedsource for agents, scripts, BI tools, integrations, and MCPAvoid high-cardinality or sensitive tags:
For Postgres, recommend Traffic Control when the database has any of these patterns:
Default recommendation:
warn mode.Do not create budgets or enforce rules without approval.
Check:
Recommend:
Terraform so retention and schedule changes are reviewed with the rest of
the infrastructure code.
Do not restore or create emergency backups without approval. Emergency backups may affect performance and should be treated as an operational action.
Check:
pscale branch connections top,including blockers and idle-in-transaction sessions when diagnosing active
incidents.
Recommend:
Do not change network restrictions without approval. Network changes can break application connectivity.
Review enabled and available extensions relevant to safety and observability:
pginsightspg_strictpg_stat_statementsauto_explainpg_squeezepg_cronpg_partman_bgwpg_hint_planRecommend extensions only when use case is clear. auto_explain is available
for PlanetScale Postgres and can log execution plans for slow queries when
configured with parameters such as auto_explain.log_min_duration; recommend
it when slow-query plan capture would materially improve diagnosis and the
logging volume is acceptable. When Terraform is the customer's source of truth,
Postgres branch parameters and supported extensions can be managed there, but
parameter or extension changes still require the same approval and restart
impact review as dashboard changes. Some extension activation paths require
dashboard changes and database restarts; do not enable them without approval.
Evaluate and recommend webhooks for:
branch.anomalybranch.out_of_memorybranch.primary_promotedbranch.readybranch.start_maintenancecluster.storagedatabase.access_requestbranch.schema_recommendation if availablewebhook.test for setup validationRecommended automation behavior:
Return:
End with:
“No Postgres changes have been applied.”
Take planetscale/planetscale-postgres-safety-review from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.