Database Migrations
affaan-m/ECC
Safe, reversible database migration patterns: forward-only production changes, expand-contract zero-downtime renames, concurrent indexes, batched backfills, and per-tool workflows for PostgreSQL…
Fix Node.js pg-pool not reconnecting after CloudSQL connection reset (ECONNRESET).
$ npx skills add divinevideo/divine-mobile --skill pg-pool-cloudsql-reconnect -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install divinevideo/divine-mobile pg-pool-cloudsql-reconnect --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/divinevideo/divine-mobile.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/pg-pool-cloudsql-reconnect .claude/skills/pg-pool-cloudsql-reconnect && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "pg-pool-cloudsql-reconnect" agent skill from https://github.com/divinevideo/divine-mobile/tree/main/.agents/skills/pg-pool-cloudsql-reconnect into .claude/skills/pg-pool-cloudsql-reconnect/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pg-pool-cloudsql-reconnect", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/divinevideo/divine-mobile/tree/main/.agents/skills/pg-pool-cloudsql-reconnectType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add divinevideo/divine-mobile --skill pg-pool-cloudsql-reconnect -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install divinevideo/divine-mobile pg-pool-cloudsql-reconnect --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/divinevideo/divine-mobile.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/pg-pool-cloudsql-reconnect .agents/skills/pg-pool-cloudsql-reconnect && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "pg-pool-cloudsql-reconnect" agent skill from https://github.com/divinevideo/divine-mobile/tree/main/.agents/skills/pg-pool-cloudsql-reconnect into .agents/skills/pg-pool-cloudsql-reconnect/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pg-pool-cloudsql-reconnect", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add divinevideo/divine-mobile --skill pg-pool-cloudsql-reconnect -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install divinevideo/divine-mobile pg-pool-cloudsql-reconnect --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/divinevideo/divine-mobile.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/pg-pool-cloudsql-reconnect .cursor/skills/pg-pool-cloudsql-reconnect && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "pg-pool-cloudsql-reconnect" agent skill from https://github.com/divinevideo/divine-mobile/tree/main/.agents/skills/pg-pool-cloudsql-reconnect into .cursor/skills/pg-pool-cloudsql-reconnect/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pg-pool-cloudsql-reconnect", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/divinevideo/divine-mobile.git --path .agents/skills/pg-pool-cloudsql-reconnect--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add divinevideo/divine-mobile --skill pg-pool-cloudsql-reconnect -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install divinevideo/divine-mobile pg-pool-cloudsql-reconnect --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/divinevideo/divine-mobile.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/pg-pool-cloudsql-reconnect .gemini/skills/pg-pool-cloudsql-reconnect && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "pg-pool-cloudsql-reconnect" agent skill from https://github.com/divinevideo/divine-mobile/tree/main/.agents/skills/pg-pool-cloudsql-reconnect into .gemini/skills/pg-pool-cloudsql-reconnect/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pg-pool-cloudsql-reconnect", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install divinevideo/divine-mobile pg-pool-cloudsql-reconnectInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add divinevideo/divine-mobile --skill pg-pool-cloudsql-reconnect -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/divinevideo/divine-mobile.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/pg-pool-cloudsql-reconnect .github/skills/pg-pool-cloudsql-reconnect && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "pg-pool-cloudsql-reconnect" agent skill from https://github.com/divinevideo/divine-mobile/tree/main/.agents/skills/pg-pool-cloudsql-reconnect into .github/skills/pg-pool-cloudsql-reconnect/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pg-pool-cloudsql-reconnect", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add divinevideo/divine-mobile --skill pg-pool-cloudsql-reconnect -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install divinevideo/divine-mobile pg-pool-cloudsql-reconnect --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/divinevideo/divine-mobile.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/pg-pool-cloudsql-reconnect .opencode/skills/pg-pool-cloudsql-reconnect && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "pg-pool-cloudsql-reconnect" agent skill from https://github.com/divinevideo/divine-mobile/tree/main/.agents/skills/pg-pool-cloudsql-reconnect into .opencode/skills/pg-pool-cloudsql-reconnect/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "pg-pool-cloudsql-reconnect", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
pg-pool-cloudsql-reconnectFix Node.js pg-pool not reconnecting after CloudSQL connection reset (ECONNRESET).
Pg Pool Cloudsql Reconnect is an agent skill from divinevideo/divine-mobile. Fix Node.js pg-pool not reconnecting after CloudSQL connection reset (ECONNRESET). Use when: (1) Retries fail with same ECONNRESET error despite retry logic, (2) "Connection terminated" or "connection already closed" errors persist across retries, (3) "remaining connection slots are reserved" errors in CloudSQL, (4) High-concurrency Node.js app with pg-pool and CloudSQL/managed PostgreSQL. The pool caches dead connections - you must recreate the pool, not just retry.
Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Databases, covering Error handling. It works with Node.js and PostgreSQL. The licence is MPL-2.0.
5 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit 8d5fbf2. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
gcloudFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use gcloud, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Pg Pool Cloudsql Reconnect loads about 1.2k tokens when it runs. Until then it costs about 125 tokens; SKILL.md has 300 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from divinevideo/divine-mobile at commit 8d5fbf2, republished under its MPL-2.0 licence (© divinevideo). 300 words, ~1,234 tokens.
.claude/skills/pg-pool-cloudsql-reconnect/SKILL.md (or your agent's skills folder).Node.js applications using pg-pool with CloudSQL (or other managed PostgreSQL) fail to
recover from connection resets. Retry logic appears to work but keeps failing with the
same ECONNRESET error because the pool caches dead connections.
read ECONNRESETConnection terminatedconnection already closedremaining connection slots are reserved for non-replication superuser connectionspg-pool maintains a pool of database connections. When CloudSQL resets connections (due to timeout, maintenance, or connection limits), the pool still holds references to those dead connections. Simply retrying the operation uses the same dead connection from the pool.
Instead of just retrying, recreate the entire pool on connection reset errors:
export class PostgresDatabase {
private pool: Pool;
private config: PostgresConfig;
constructor(config: PostgresConfig) {
this.config = config;
this.pool = this.createPool();
}
private createPool(): Pool {
const pool = new Pool({
...this.config,
max: 25, // Adequate for concurrency
idleTimeoutMillis: 30000, // Close idle connections
connectionTimeoutMillis: 10000, // Timeout for new connections
keepAlive: true, // TCP keepalive
});
pool.on('error', (err) => {
console.error('Pool error:', err.message);
});
return pool;
}
private async reconnect(): Promise<void> {
console.log("Reconnecting to database...");
try {
await this.pool.end();
} catch {
// Ignore cleanup errors
}
this.pool = this.createPool();
await this.pool.query("SELECT 1"); // Verify connection
console.log("Database reconnected");
}
private async withRetry<T>(
operation: () => Promise<T>,
maxRetries = 3
): Promise<T> {
for (let attempt = 0; attempt < maxRetries; attempt++) {
try {
return await operation();
} catch (error) {
const msg = error instanceof Error ? error.message : String(error);
const needsReconnect =
msg.includes("ECONNRESET") ||
msg.includes("Connection terminated") ||
msg.includes("connection already closed") ||
msg.includes("remaining connection slots");
if (!needsReconnect || attempt === maxRetries - 1) {
throw error;
}
const delay = 1000 * Math.pow(2, attempt);
console.log(`Connection error, reconnecting in ${delay}ms...`);
await new Promise(r => setTimeout(r, delay));
// KEY: Recreate the pool, don't just retry
await this.reconnect();
}
}
throw new Error("Max retries exceeded");
}
}Retrying with the same pool uses cached dead connections. The fix is to:
pool.end() to close all connectionsInstance tier matters: db-f1-micro only supports ~25 connections. Use db-g1-small or larger for concurrent workloads.
Check max_connections:
gcloud sql instances describe INSTANCE --format='value(settings.tier)'Cloud SQL Proxy: Doesn't help with connection pooling - it just tunnels TCP. Consider PgBouncer for true connection pooling.
After implementing:
pool.on('error') handler prevents uncaught exceptions from crashing the appmax pool size to match your concurrency level plus headroom© divinevideo, MPL-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in .agents/skills/pg-pool-cloudsql-reconnect of divinevideo/divine-mobile.
Open the folder on GitHubat commit 8d5fbf2
Pg Pool Cloudsql Reconnect next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Pg Pool Cloudsql Reconnect this skilldivinevideo/divine-mobile | 265 | — | ~1.2k | Automated safety check: Pass | MPL-2.0 | |
| Database Migrationsaffaan-m/ECC | 274k | 4 repos | ~3k | Automated safety check: Pass | MIT | |
| Azure Postgres TSmicrosoft/skills | 3.1k | 5 repos | ~3.3k | Automated safety check: Pass | MIT | |
| Flox Environmentsaffaan-m/ECC | 274k | — | ~2.8k | Automated safety check: Pass | MIT | |
| Sap Cap Capiresecondsky/sap-skills | 460 | — | ~4.4k | Automated safety check: Pass | GPL-3.0 | |
| Full Stack Developertheneoai/awesome-skills | 183 | — | ~2.2k | Automated safety check: Pass | MIT |
affaan-m/ECC
Safe, reversible database migration patterns: forward-only production changes, expand-contract zero-downtime renames, concurrent indexes, batched backfills, and per-tool workflows for PostgreSQL…
microsoft/skills
Connect to Azure Database for PostgreSQL Flexible Server from Node.js/TypeScript using the pg (node-postgres) package.
affaan-m/ECC
Floxで再現可能なクロスプラットフォーム開発環境を作成します — Nixに基づく宣言的な環境マネージャー。次の場合は必ずこのスキルを使用してください: システムレベルの依存関係(コンパイラー、データベース、openssl・libvips・BLAS・LAPACKなどのネイティブライブラリー)を持つプロジェクトを設定する場合…
secondsky/sap-skills
SAP Cloud Application Programming Model (CAP) development skill using Capire documentation.
theneoai/awesome-skills
Elite Full-Stack Developer skill with mastery of modern frontend frameworks (React, Vue, TypeScript), backend systems (Node.js, Python, Go), databases (PostgreSQL, MongoDB, Redis), and DevOps…
manaflow-ai/cmux
Sets the backend TypeScript and Cloud VM rules for cmux: Effect-based services, thin route handlers, Postgres as source of truth, migrations and provider secrets.
divinevideo/divine-mobile
Fix ArgoCD ExternalSecret deployment failing with "namespace X is not permitted in project Y".
divinevideo/divine-mobile
Art direction for any content — reads text, PDF, Word, HTML, PPT, then proposes 2-3 creative directions with photography style, mood, and visual language.
divinevideo/divine-mobile
Fix "Null check operator used on a null value" errors when an object is set to null during an async await.
divinevideo/divine-mobile
Add custom metadata headers (x-amz-meta-) to AWS v4 signed requests for GCS S3-compatible API.
divinevideo/divine-mobile
Fix password/secret authentication failures caused by trailing newlines when creating Google Cloud secrets (or similar) with bash here-strings.
divinevideo/divine-mobile
Fix silent video/media processing failures caused by URL extraction code that filters on file extensions (.mp4, .webm, .webp).
Works with
Categories
Fix Node.js pg-pool not reconnecting after CloudSQL connection reset (ECONNRESET). Pg Pool Cloudsql Reconnect is an agent skill from divinevideo/divine-mobile.js pg-pool not reconnecting after CloudSQL connection reset (ECONNRESET).
Pg Pool Cloudsql Reconnect fits situations like: retries fail with same ECONNRESET error despite retry logic; connection terminated; connection already closed errors persist across retries; remaining connection slots are reserved errors in CloudSQL.
Run `npx skills add divinevideo/divine-mobile --skill pg-pool-cloudsql-reconnect -a claude-code`. Or copy the skill folder (.agents/skills/pg-pool-cloudsql-reconnect in divinevideo/divine-mobile) into .claude/skills/pg-pool-cloudsql-reconnect in your project. Claude Code loads it when a task matches its description.
Run `npx skills add divinevideo/divine-mobile --skill pg-pool-cloudsql-reconnect -a codex`. Or copy the skill folder (.agents/skills/pg-pool-cloudsql-reconnect in divinevideo/divine-mobile) into .agents/skills/pg-pool-cloudsql-reconnect in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add divinevideo/divine-mobile --skill pg-pool-cloudsql-reconnect -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pg-pool-cloudsql-reconnect, .gemini/skills/pg-pool-cloudsql-reconnect, .github/skills/pg-pool-cloudsql-reconnect and .opencode/skills/pg-pool-cloudsql-reconnect in your project.
Going by SKILL.md and its folder, Pg Pool Cloudsql Reconnect needs the command-line tools its instructions call (gcloud). Our summary lists: Node.js.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Pg Pool Cloudsql Reconnect is published under the MPL-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 1.2k tokens (SKILL.md is roughly 4.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Pg Pool Cloudsql Reconnect: Database Migrations (affaan-m/ECC, 274k stars), Azure Postgres TS (microsoft/skills, 3.1k stars), Flox Environments (affaan-m/ECC, 274k stars) and Sap Cap Capire (secondsky/sap-skills, 460 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
divinevideo (a GitHub organization) maintains it in divinevideo/divine-mobile, which has 265 GitHub stars. The repository holds 103 skills in this directory. The repository was last updated on October 7, 2026.
Source: divinevideo/divine-mobile on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.