| name | check-updates |
| description | Check for skills-for-postgres marketplace updates at session start. Compares local version against GitHub releases and shows changelog if updates are available. Use when the user wants to: (1) check for skill updates, (2) see what's new in skills-for-postgres, (3) verify current version. Triggers: "check for updates", "am I up to date", "what version", "update skills", "show changelog".
|
Check for Updates
This skill checks for updates to the skills-for-postgres marketplace at the start of each session.
When to Run
Run this check once per week when any skills-for-postgres skill is first invoked. Skip if already checked within the last 7 days.
Session State
The update check marker is stored in a persistent, user-level directory:
~/.config/postgres-skills/last-update-check.json
This file contains a JSON object with the UTC date (YYYY-MM-DD) of the last update check:
{
"postgres-skills": "2026-03-23"
}
Before checking, read ~/.config/postgres-skills/last-update-check.json:
- If the file exists and the date is within the last 7 days, skip the check.
- If the file is missing or the date is more than 7 days old, run the update check.
Update Check Procedure
Step 1: Get Local Version
Read the version field from the local package.json file.
Step 2: Fetch Latest Version
Method A — Git CLI (preferred)
git fetch origin main --quiet
git show origin/main:package.json
Method B — GitHub API
Use the GitHub API to read the remote package.json.
Step 3: Compare Versions
If the remote version is newer than the local version:
- Show the version difference
- Display the CHANGELOG entries between versions
- Provide update instructions
Step 4: Update Timestamp
Write the current UTC date to the check file:
mkdir -p ~/.config/postgres-skills
echo "{\"postgres-skills\": \"$(date -u +%Y-%m-%d)\"}" > ~/.config/postgres-skills/last-update-check.json
$dir = "$env:USERPROFILE\.config\postgres-skills"
New-Item -ItemType Directory -Path $dir -Force | Out-Null
@{ "postgres-skills" = (Get-Date).ToUniversalTime().ToString("yyyy-MM-dd") } | ConvertTo-Json | Set-Content "$dir\last-update-check.json"