Token导航 LogoToken导航TokenDH.com
运维和基础设施只读github未标认证来源可访问许可证需确认审计通过

pgpm-deploy-lifecyclepgpm 部署生命周期

Agent Skill

用于辅助云资源、部署、容器、基础设施和运维自动化任务。它适合让 Agent 检查配置、整理部署步骤、分析资源状态、生成排障思路或辅助云服务接入。使用时需要明确目标环境、账号权限、区域和资源组,区分本地测试与生产操作;涉及删除资源、重启服务、修改网络或权限配置时,应先确认影响范围。

总安装

194

周安装

8

GitHub Stars

公开资料未说明

下载量

63
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:pgpm-deploy-lifecycle(pgpm 部署生命周期)
来源仓库:https://github.com/constructive-io/constructive-skills
仓库路径:skills/pgpm-deploy-lifecycle
安装命令:
npx skills add https://github.com/constructive-io/constructive-skills --skill pgpm-deploy-lifecycle
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/constructive-io/constructive-skills --skill pgpm-deploy-lifecycle

简介

用于辅助云资源、部署和基础设施运维自动化。

  • 适合检查配置、整理部署步骤或分析资源状态。
  • 使用时需明确目标环境、账号权限和资源组。
  • 区分本地测试与生产操作,避免误删或重启关键服务。
  • 修改网络或权限时应先评估影响范围。pgpm-deploy-lifecycle 属于运维和基础设施类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

pgpm Deploy Lifecycle

The complete deploy → verify → revert lifecycle for pgpm database modules.

When to Apply

Use this skill when:

  • Deploying database changes with pgpm deploy
  • Reverting deployments with pgpm revert
  • Verifying deployed state with pgpm verify
  • Tagging deployment points with pgpm tag
  • Checking deployment status with pgpm migrate status
  • Running full-cycle tests with pgpm test-packages

Core Concept

pgpm deployments are deterministic and plan-driven. Every change is tracked in pgpm.plan, and each change has exactly three scripts:

  • deploy/ — applies the change
  • verify/ — confirms it was applied correctly
  • revert/ — undoes the change

pgpm handles transactions automatically — you just write the SQL.

Deploy

Basic Deploy

# Deploy all pending changes for the current module
pgpm deploy

# Deploy with database creation (if database doesn't exist)
pgpm deploy --createdb

# Deploy a specific module by name
pgpm deploy my-module

# Deploy all modules in the workspace
pgpm deploy --workspace --all

What Happens During Deploy

  1. Dependency resolution — reads .control file, resolves all required extensions and pgpm modules
  2. Extension creation — native Postgres extensions get CREATE EXTENSION IF NOT EXISTS
  3. Module dependency deploy — pgpm modules from extensions/ are deployed first (topological order)
  4. Plan execution — each change in pgpm.plan is executed in order:

- Checks if already deployed (via tracking schema) - Runs the deploy script - Records the change in the tracking schema

  1. Automatic verification — after deploy, verify scripts run to confirm state

Deploy to a Tag

# Deploy only up to a specific tag
pgpm deploy --to @v1.0.0

Deploy Options

OptionDescription
--createdbCreate the target database if it doesn't exist
--workspaceOperate at workspace level
--allDeploy all modules (with --workspace)
--to @tagDeploy up to a specific tag
--yesSkip confirmation prompts

Verify

Verify checks that deployed changes are actually in the expected state.

# Verify all deployed changes
pgpm verify

# Verify a specific module
pgpm verify my-module

What Happens During Verify

For each deployed change, pgpm runs the corresponding verify/ script. Verify scripts typically use SELECT statements that will fail if the expected objects don't exist:

-- verify/schemas/app/tables/users.sql
SELECT id, email, name, created_at
FROM app.users
WHERE FALSE;

If any verify script fails, pgpm reports which changes are in a bad state.

Revert

Revert undoes deployed changes in reverse order.

# Revert the last deployed change
pgpm revert

# Revert to a specific tag
pgpm revert --to @v1.0.0

# Revert all changes
pgpm revert --all

# Revert with confirmation skip
pgpm revert --yes

What Happens During Revert

  1. Changes are reverted in reverse plan order (last deployed = first reverted)
  2. Each revert script runs (e.g., DROP TABLE, DROP FUNCTION)
  3. The change is removed from the tracking schema
  4. Verify scripts run to confirm the revert

Revert Options

OptionDescription
--to @tagRevert back to a specific tag (exclusive — the tag itself stays)
--allRevert all deployed changes
--yesSkip confirmation prompts

Tagging

Tags mark specific points in the deployment plan for targeted deploy/revert.

# Tag the current state
pgpm tag v1.0.0

# Tag with a description
pgpm tag v1.0.0 -m "Initial release"

Tags appear in pgpm.plan as:

@v1.0.0 2024-01-15T10:00:00Z user <user@example.com> # Initial release

Using Tags

# Deploy up to a tag
pgpm deploy --to @v1.0.0

# Revert to a tag (keeps the tag, reverts everything after it)
pgpm revert --to @v1.0.0

Status

Check what's deployed and what's pending.

# Show deployment status
pgpm migrate status

This shows:

  • Which changes are deployed
  • Which changes are pending (in plan but not yet deployed)
  • The current tag (if any)

Full-Cycle Testing

pgpm test-packages runs a full deploy → verify → revert → deploy cycle to validate that all scripts work correctly in both directions.

# Full cycle test for current module
pgpm test-packages --full-cycle

# Full cycle test for all workspace modules
pgpm test-packages --full-cycle --workspace --all

This is the gold standard for validating migrations — it proves:

  1. Deploy scripts apply correctly
  2. Verify scripts confirm the deployed state
  3. Revert scripts cleanly undo everything
  4. Re-deploy works (proving revert was complete)

Common Workflows

First-time workspace deploy

Prerequisite: Ensure PostgreSQL is running and environment is loaded. See pgpm-docker and pgpm-env skills for setup.
pgpm admin-users bootstrap --yes
pgpm deploy --createdb --workspace --all --yes

Deploy after adding new changes

pgpm deploy
pgpm verify

Revert a bad deploy

pgpm revert --yes
# Fix the issue, then redeploy
pgpm deploy

Tag a release and deploy to that point

pgpm tag v1.0.0
pgpm deploy --to @v1.0.0

Validate all migrations (CI)

Note: In CI, start Postgres and load env vars first. See pgpm-docker and pgpm-env skills, or github-workflows-pgpm for CI-specific patterns.
pgpm admin-users bootstrap --yes
pgpm test-packages --full-cycle --workspace --all

Tracking Schema

pgpm tracks deployments in a PostgreSQL schema (typically pgpm_migrate). This contains:

  • changes table — records each deployed change with timestamp and deployer
  • tags table — records tagged points

This is how pgpm knows what's already deployed and what's pending.

Troubleshooting

IssueCauseFix
role "authenticated" does not existMissing bootstrapRun pgpm admin-users bootstrap --yes
database "mydb" does not existDatabase not createdUse pgpm deploy --createdb
Deploy fails mid-waySQL error in a deploy scriptFix the script, pgpm revert the failed change, redeploy
Verify fails after deployDeploy script didn't create expected objectsCheck deploy script matches verify expectations
Revert failsRevert script references objects that don't existCheck for dependencies between changes
Already deployedChange was previously deployedCheck pgpm migrate status — may need pgpm revert first

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.41%
按下载量换算22

Claude

32.76%
按下载量换算21

Cursor

18.78%
按下载量换算12

Gemini CLI

8.63%
按下载量换算5

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills