本文へ移動
cccskills
無料GitHub で公開

postgresql-planning

Plan and implement OpenMeld PostgreSQL business persistence, schemas and migrations, transactions, Hyperdrive access, and data cutover. Use for the shared relational database transition or PostgreSQL work; not for unrelated D1 performance fixes or OpenConnector's upstream database.

インストール方法を見る

含まれるファイル(1)

  • SKILL.md4.7 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

OpenMeld PostgreSQL Planning

All OpenMeld databases belong to the Amplift PlanetScale organization (amplift), never the operator's personal organization. Pass --org amplift explicitly; login defaults are not the resource owner.

The architecture is decided: Cloudflare Hyperdrive connects Workers to PlanetScale PostgreSQL. Start from current source, not a new vendor comparison or the superseded D1 capacity threshold. Production has used PostgreSQL since the 2026-10-04 cutover. Shared staging reuses openmeld-postgresql-stg through its own Hyperdrive binding and the guarded pnpm staging:deploy workflow. The former staging D1 database is retained for historical test-data inspection. Use standard PlanetScale Postgres for this foundation. Neki preview enrollment does not change the chosen engine or authorize a sharded database migration. The staging/local baseline is PostgreSQL 18 at the latest supported stable minor. Use older versions only for a demonstrated compatibility constraint. Production capacity changes require measured demand. Keep capacity stable while isolating code-path regressions; use the current workflow's metrics and query plans before recommending a larger machine.

Shortest useful start

  1. Read physical database ownership and the applicable section of the single PostgreSQL workflow.
  2. Run pnpm pg plan to see exact targets and migration checksums. Check tooling/postgresql/resources.json; a planned name is not a created resource.
  3. Read the touched business owner's source, schema and contracts. Define who writes each fact and which readers need a transaction. Do not recreate RuntimeCoordinator authority, Space Durable Object state, or R2 file bodies.
  4. Implement in the existing owning package. Use standard PostgreSQL SQL and the supported pg driver; do not build a D1 API emulator or a cross-database framework. Preserve externally visible IDs and shared schemas.
  5. Run pnpm pg:check for database infrastructure changes. For business work, add the smallest real PostgreSQL behavior checks for its failure boundary, then exercise affected consumers. Local infrastructure acceptance is not proof of cloud connectivity, production scale, or completed business migration.

Decisions that change implementation

  • Application Hyperdrive caching is disabled. Transactions use one client from BEGIN through COMMIT/ROLLBACK. Hyperdrive transaction pooling cannot preserve session settings, temporary tables, or session advisory locks between queries.
  • Migrations and backup tools use the direct TLS endpoint on port 5432. A single migration owner and PostgreSQL advisory lock serialize changes.
  • Keep PostgreSQL baseline/migrations under packages/db/postgresql/migrations. Never convert or edit already-applied D1 history in place. Review generated SQL for SQLite assumptions, timestamp units, JSON, ordering, conflict behavior, indexes, constraints and affected query plans.
  • Runtime roles receive only owning-schema/table grants. No default postgres, broad all-data roles, CREATE, TRUNCATE, role management or migration ledger access. Tenant authorization remains an explicit owner contract, not a schema name.
  • Use the workflow's exact target and Doppler allowlist. No credentials in Git, logs, chat, command arguments, or ordinary development environments.
  • Retain historical test data where practical, but synthetic staging acceptance does not authorize exporting production data into staging.

Before applying or cutting over

Use the workflow's migration and cutover checklist rather than copying it here. Check source identity, target identity, immutable migration checksums, lock ownership, runtime grants, restore evidence, mixed-version consumers and one data authority. A completed resource creation is not a completed migration.

Stop the affected operation on a mismatched environment/branch, unknown owner, applied migration drift, failed restore, unresolved production writers, exposed credentials, or missing tenant authorization. After PostgreSQL accepts new business writes, reverting the binding to old D1 would lose data: freeze and reconcile under the recovery plan. New legal agreements and payment/identity challenges require the human. Do not request approval again for already authorized, bounded infrastructure setup.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Debugs failing GitHub Actions CI runs for PostHog PRs, commits, and branches, and answers broad CI-health questions ("is CI red?", "is master green today?", "what's broken right now?"). Use when the user asks why CI is red, asks for the current CI or master status, or mentions a failing check, GitHub Actions run, Depot runner, workflow, job, shard, merge queue kick, flaky test, lint failure, typecheck failure, snapshot diff, migration check, generated types drift, or skills build failure. Start with the `hogli ci:insights` digest (cross-run CI history from engineering analytics), then guides read-only inspection, failure classification, smallest local reproduction with hogli, and safe reporting without rerunning CI or posting to GitHub. Running unattended as the "Master-red diagnosis" workflow: see references/master-red-incident.md.

日本語の概要は準備中です。原文の説明を表示しています。

amplifthq/opentag1,3582026年10月14日 更新

Use when closing out a feature, tidying developing/ documentation, or asked to check docs health — runs the lifecycle linter and applies the README deletion rules.

日本語の概要は準備中です。原文の説明を表示しています。

amplifthq/opentag1,3582026年10月14日 更新

Guides an agent through reproducing, root-causing, fixing, and validating flaky tests in the PostHog monorepo. Use when a test fails intermittently in CI but passes on rerun or locally, when `hogli ci:insights` or the debugging-ci-failures skill classifies a failure as a flaky test, when given a GitHub Actions URL for a flaky job, when asked to check Trunk Flaky Tests for a test, PR, or master, or when asked to deflake, stabilize, or fix a flaky Jest, pytest, or Playwright test. Core discipline: reproduce locally before changing anything, fix the root cause (never mask it with sleeps, retries, or bigger timeouts), and prove the fix with an N-run validation loop sized to the observed failure rate. Stabilizing is not the only valid outcome — the skill also gates whether the test should exist, so deleting a test that catches nothing real, or re-leveling one that flakes because of the level it runs at, are first-class endings.

日本語の概要は準備中です。原文の説明を表示しています。

amplifthq/opentag1,3582026年10月14日 更新

Use when deciding whether an OpenMeld change needs a Changelog entry, writing or publishing an entry, preparing release notes, validating Changelog projections, or historically backfilling missing changes.

日本語の概要は準備中です。原文の説明を表示しています。

amplifthq/opentag1,3582026年10月14日 更新

Maintain the official OpenMeld Changelog from repository evidence. Use when deciding whether a change needs a Changelog entry, writing or publishing an entry, preparing release notes, validating generated Changelog files, or historically backfilling missing changes.

日本語の概要は準備中です。原文の説明を表示しています。

amplifthq/opentag1,3582026年10月14日 更新

Official public OpenMeld Skill for agents using the `openmeld` CLI to consult the Center Agent, set up OpenMeld, connect local agents, create or request Agent Profiles, work in Organizations and Spaces, observe or stop Wakes, trace delivery, and repair local state.

日本語の概要は準備中です。原文の説明を表示しています。

amplifthq/opentag1,3582026年10月14日 更新

amplifthq のスキルをすべて見る

このスキルの問題を報告する