Skip to content

Add postgres-database-migration and ghost-database skills#101

Open
cevian wants to merge 15 commits intomainfrom
postgres-database-migration
Open

Add postgres-database-migration and ghost-database skills#101
cevian wants to merge 15 commits intomainfrom
postgres-database-migration

Conversation

@cevian
Copy link
Copy Markdown
Contributor

@cevian cevian commented Apr 8, 2026

Summary

  • Add postgres-database-migration skill: DDL lock reference, safe migration patterns (add/drop/rename columns, type changes, NOT NULL, FK, indexes, PK redefinition), timeout strategies, transaction strategy, rollback planning, fork-based testing, and advanced considerations. Reference files for backfill strategies, validation queries, and a complete end-to-end example.
  • Add ghost-database skill: Ghost CLI and MCP integration, Spaces vs dedicated instances, database lifecycle management (create, fork, pause, resume, delete), read-only access, and when to use Ghost.
  • Update postgres router skill with new Migrations and Database Management sections, plus symlinked references for reliable path resolution.

Test plan

  • ./bun run validate-skills passes for all skills
  • Symlinks in postgres/references/ resolve correctly
  • npx skills add timescale/pg-aiguide --list shows the new skills

🤖 Generated with Claude Code

cevian and others added 3 commits April 8, 2026 14:19
Comprehensive guide for safe PostgreSQL schema migrations: DDL lock
reference, safe migration patterns, timeout strategies, rollback planning,
and fork-based testing. Reference files provide backfill strategies,
validation queries, and a complete end-to-end example.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add ghost-database skill covering Ghost CLI, MCP integration, Spaces,
  dedicated instances, and database lifecycle management
- Add postgres-database-migration and ghost-database to the postgres
  router skill with symlinked references
- Symlink migration sub-references (backfill, validation, complete example)
  into the router for reliable path resolution

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Spaces are the account-level container with shared compute hours.
Dedicated instances are a promotion path for always-on databases,
not a separate tier.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Member

@nathanjcochran nathanjcochran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only reviewed the Ghost skill. Largely looks good to me, but I left a handful of comments.

It's also worth noting that the skill mentioned dedicated databases but they aren't technically support yet, so we might want to wait to merge this until that work is done? And at that point, we'll want to add info about the additional commands for creating/forking dedicated instances, as well as the payment-related commands (i.e. ghost payment).

Additionally, we might want to talk a bit about API keys (i.e. the ghost api-key commands) and how to use them to access the API programatically? Seems like it could be useful in some cases (e.g. if building an app that integrates with Ghost directly, or if setting up a CI pipeline that forks a database to run tests against).

cevian and others added 8 commits April 9, 2026 14:10
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Commands take the database ID (e.g. abc123), not the name.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Added: api-key, logout, config, mcp, feedback, version, completion.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cevian
Copy link
Copy Markdown
Contributor Author

cevian commented Apr 9, 2026

Re: dedicated instances — leaving them in for now since dedicated instance support should be merged soon. We can update with the additional commands (ghost payment, etc.) when that lands.

cevian and others added 4 commits April 9, 2026 15:10
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fork-based testing doesn't catch concurrent traffic issues. For most apps
this is fine. For very high-uptime apps, PgDog mirroring can replay
production traffic against the fork.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Additional features:
- **CLI and MCP native:** create and query databases from the terminal or any MCP-compatible agent
- **Instant forking:** full database copies in seconds for safe experimentation
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we were avoiding "instant", since few people consider 90s to be instantaneous.

Comment on lines +36 to +64
## Installation

Multiple installation methods are provided. If you aren't sure, use the first one.

### Install Script (macOS/Linux/WSL)

```bash
curl -fsSL https://install.ghost.build | sh
```

### Install Script (Windows PowerShell)

```powershell
irm https://install.ghost.build/install.ps1 | iex
```

### Debian/Ubuntu

```bash
curl -s https://packagecloud.io/install/repositories/timescale/ghost/script.deb.sh | sudo os=any dist=any bash
sudo apt-get install ghost
```

### Red Hat/Fedora

```bash
curl -s https://packagecloud.io/install/repositories/timescale/ghost/script.rpm.sh | sudo os=rpm_any dist=rpm_any bash
sudo yum install ghost
```
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this skill could benefit from some progressive disclosure, and this section in particular seems like it'd usually be a waste of tokens. You only need to install ghost once.

Copy link
Copy Markdown
Member

@nathanjcochran nathanjcochran Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. I think maybe we should try to decide whether this skill is mostly for getting Ghost set up the first time (in which case maybe listing all of the installation methods here is fine), or if we think it's useful as a continual reference for how to use Ghost. Personally, I'm kind of skeptical that it's going to be helpful once Ghost is already installed (since the MCP is self-describing anyways, and this skill would just be a conflicting source of information). See my other comment about that. I think maybe we should try to narrow in on exactly how/when we want this skill to be used, because I'm a little concerned that this skill could end up taking priority over using the Ghost MCP tools directly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's fair. I agree this skill is redundant with the MCP tools, and the skill description over-promises on what it is for in a way that could be problematic.

I kinda think there should be a "choosing a db provider" skill, and then possibly an "installing ghost" sub-page.

Comment on lines +89 to +90
# Open interactive psql session
ghost psql abc123
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to say that this requires psql to be installed and in your PATH

- Get a connection string for a Ghost database
- Run SQL queries against a Ghost database
- Resume or delete Ghost databases
- Set up the Ghost MCP server or CLI
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the Ghost MCP currently proxies the pg-aiguide MCP tools (including view_skill), are we at all concerned that this skill could create confusion for agents that are already using the Ghost MCP?

Like, if a user asks to fork a database, how will the agent decide between using this skill (which mostly recommends using ghost CLI commands directly, which is not really what we want if the MCP is installed) or just calling the ghost_fork tool? Maybe it would use the skill first and then still decide to call the MCP tool afterwards... but even in that case, using the skill would just be extra wasted tokens (the Ghost MCP is already self-describing, so if it's already installed, I don't think there's much more that this skill would help with, beyond maybe explaining some of the less well-documented features).

It seems like this skill is mostly geared towards setting up Ghost the first time and understanding its capabilities (e.g. when evaluating whether to use it). But if Ghost is already installed (as MCP server), I feel like this skill could potentially be counter-productive.

Any ideas for what we should do about that? We could potentially just filter this skill out when we proxy the view_skill tool, but we don't do anything like that currently (we proxy the tools as-is), and in any case, it wouldn't work for pre-existing versions of Ghost that are already in the wild.

Comment on lines +36 to +64
## Installation

Multiple installation methods are provided. If you aren't sure, use the first one.

### Install Script (macOS/Linux/WSL)

```bash
curl -fsSL https://install.ghost.build | sh
```

### Install Script (Windows PowerShell)

```powershell
irm https://install.ghost.build/install.ps1 | iex
```

### Debian/Ubuntu

```bash
curl -s https://packagecloud.io/install/repositories/timescale/ghost/script.deb.sh | sudo os=any dist=any bash
sudo apt-get install ghost
```

### Red Hat/Fedora

```bash
curl -s https://packagecloud.io/install/repositories/timescale/ghost/script.rpm.sh | sudo os=rpm_any dist=rpm_any bash
sudo yum install ghost
```
Copy link
Copy Markdown
Member

@nathanjcochran nathanjcochran Apr 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. I think maybe we should try to decide whether this skill is mostly for getting Ghost set up the first time (in which case maybe listing all of the installation methods here is fine), or if we think it's useful as a continual reference for how to use Ghost. Personally, I'm kind of skeptical that it's going to be helpful once Ghost is already installed (since the MCP is self-describing anyways, and this skill would just be a conflicting source of information). See my other comment about that. I think maybe we should try to narrow in on exactly how/when we want this skill to be used, because I'm a little concerned that this skill could end up taking priority over using the Ghost MCP tools directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants