
Hindsight Upgrade
- 18 installs
- 12 repo stars
- Updated April 17, 2026
- vectorize-io/hindsight-skills
Helps with ai & agent building tasks during AI-assisted development.
About
hindsight-upgrade is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- hindsight-upgrade
- AI & Agent Building
- AI-coding skill
Hindsight Upgrade by the numbers
- 18 all-time installs (skills.sh)
- Ranked #10,736 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Jul 27, 2026 (Skillselion catalog sync)
npx skills add https://github.com/vectorize-io/hindsight-skills --skill hindsight-upgradeAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 18 |
|---|---|
| repo stars | ★ 12 |
| Last updated | April 17, 2026 |
| Repository | vectorize-io/hindsight-skills ↗ |
What it does
Helps with ai & agent building tasks during AI-assisted development.
Files
Hindsight Skills Upgrade
You manage upgrades for hindsight-skills. This skill is invoked in two ways:
1. Automatically by the preamble when UPGRADE_AVAILABLE or JUST_UPGRADED is detected 2. Directly by the user via /hindsight-upgrade
---
Inline Upgrade Flow (called by preamble)
When the preamble detects UPGRADE_AVAILABLE <old> <new>, follow these steps:
Step 1: Check auto_upgrade preference
# Check if auto-upgrade is enabled
_HS_BIN_DIR=""
for _d in ~/.claude/skills ~/.codex/skills ~/.kiro/skills ~/.factory/skills; do
[ -x "$_d/hindsight-upgrade/bin/hindsight-config" ] && _HS_BIN_DIR="$_d/hindsight-upgrade/bin" && break
done
[ -n "$_HS_BIN_DIR" ] && _AUTO_UPGRADE=$("$_HS_BIN_DIR/hindsight-config" get auto_upgrade 2>/dev/null || echo "false")
echo "AUTO_UPGRADE: ${_AUTO_UPGRADE:-false}"If AUTO_UPGRADE is true, skip to Step 2 and proceed with the upgrade silently.
If AUTO_UPGRADE is false, use AskUserQuestion to ask:
hindsight-skills {new} is available (you have {old}). How would you like to proceed?
Options:
- Upgrade now — Install the update and continue
- Always auto-upgrade — Install now and auto-upgrade in the future
- Snooze 24h — Remind me tomorrow
- Never ask — Disable update checks permanently
Handle each response:
- Upgrade now: proceed to Step 2
- Always auto-upgrade: run
hindsight-config set auto_upgrade true, then proceed to Step 2 - Snooze 24h: write snooze file and stop
# Snooze for 24 hours
_HS_STATE_DIR="${HINDSIGHT_SKILLS_STATE_DIR:-$HOME/.hindsight-skills}"
echo "{new_version} $(date +%s)" > "$_HS_STATE_DIR/update-snoozed"- Never ask: run
hindsight-config set update_check falseand stop
Step 2: Detect install type
# Read the install source breadcrumb
_HS_STATE_DIR="${HINDSIGHT_SKILLS_STATE_DIR:-$HOME/.hindsight-skills}"
_INSTALL_SOURCE=""
[ -f "$_HS_STATE_DIR/install-source" ] && _INSTALL_SOURCE=$(cat "$_HS_STATE_DIR/install-source")
echo "INSTALL_SOURCE: ${_INSTALL_SOURCE:-not found}"If INSTALL_SOURCE is empty or the path doesn't exist, tell the user:
I can't find the hindsight-skills installation. Please re-run setup from your clone:
```
cd /path/to/hindsight-skills && ./setup
```
And stop.
Step 3: Save old version
_HS_STATE_DIR="${HINDSIGHT_SKILLS_STATE_DIR:-$HOME/.hindsight-skills}"
_INSTALL_SOURCE=$(cat "$_HS_STATE_DIR/install-source")
_OLD_VERSION=$(cat "$_INSTALL_SOURCE/VERSION" 2>/dev/null | tr -d '[:space:]')
echo "OLD_VERSION: $_OLD_VERSION"Step 4: Upgrade
Check if the install source is a git repo:
_INSTALL_SOURCE=$(cat "${HINDSIGHT_SKILLS_STATE_DIR:-$HOME/.hindsight-skills}/install-source")
cd "$_INSTALL_SOURCE"
if [ -d .git ]; then
echo "INSTALL_TYPE: git"
else
echo "INSTALL_TYPE: vendored"
fiGit install:
_INSTALL_SOURCE=$(cat "${HINDSIGHT_SKILLS_STATE_DIR:-$HOME/.hindsight-skills}/install-source")
cd "$_INSTALL_SOURCE" && git pull origin main && ./setupVendored install (no .git directory — downloaded/copied, not cloned):
_INSTALL_SOURCE=$(cat "${HINDSIGHT_SKILLS_STATE_DIR:-$HOME/.hindsight-skills}/install-source")
_PARENT=$(dirname "$_INSTALL_SOURCE")
_NAME=$(basename "$_INSTALL_SOURCE")
cd "$_PARENT"
# Clone fresh, run setup, move into place
git clone https://github.com/vectorize-io/hindsight-skills.git "${_NAME}-upgrade-tmp"
cd "${_NAME}-upgrade-tmp" && ./setup
cd "$_PARENT"
rm -rf "$_NAME"
mv "${_NAME}-upgrade-tmp" "$_NAME"Step 5: Write marker and clear state
_HS_STATE_DIR="${HINDSIGHT_SKILLS_STATE_DIR:-$HOME/.hindsight-skills}"
echo "$_OLD_VERSION" > "$_HS_STATE_DIR/just-upgraded-from"
rm -f "$_HS_STATE_DIR/last-update-check"
rm -f "$_HS_STATE_DIR/update-snoozed"Step 6: Show What's New
Read the CHANGELOG.md from the installed skill and show the user what changed between their old version and the new version:
# Find the changelog
for _d in ~/.claude/skills ~/.codex/skills ~/.kiro/skills ~/.factory/skills; do
[ -f "$_d/hindsight-upgrade/CHANGELOG.md" ] && cat "$_d/hindsight-upgrade/CHANGELOG.md" && break
doneParse the changelog and display only the sections between the old and new versions. Format as:
hindsight-skills upgraded: {old} → {new}
>
{relevant changelog entries}
Then continue with the user's original task.
---
Handling JUST_UPGRADED
When the preamble detects JUST_UPGRADED <old> <new>, the upgrade already happened in a previous session. Show What's New (Step 6 above) and continue.
---
Standalone Usage
When invoked directly as /hindsight-upgrade:
Force check (bypass cache)
# Clear cache and run check
_HS_STATE_DIR="${HINDSIGHT_SKILLS_STATE_DIR:-$HOME/.hindsight-skills}"
rm -f "$_HS_STATE_DIR/last-update-check"
rm -f "$_HS_STATE_DIR/update-snoozed"
# Find and run the update check
for _d in ~/.claude/skills ~/.codex/skills ~/.kiro/skills ~/.factory/skills; do
[ -x "$_d/hindsight-upgrade/bin/hindsight-update-check" ] && "$_d/hindsight-upgrade/bin/hindsight-update-check" && break
doneIf the output is UPGRADE_AVAILABLE, follow the Inline Upgrade Flow from Step 1.
If the output is empty, tell the user: "hindsight-skills is up to date (version {version})."
If the output is JUST_UPGRADED, show What's New.
Config management
Users can also use /hindsight-upgrade to manage settings:
- "enable auto-upgrade" →
hindsight-config set auto_upgrade true - "disable update checks" →
hindsight-config set update_check false - "re-enable update checks" →
hindsight-config set update_check true - "show config" →
hindsight-config list
#!/usr/bin/env bash
# hindsight-config — read/write ~/.hindsight-skills/config.yaml
# Usage: hindsight-config get <key> | set <key> <value> | list
set -euo pipefail
STATE_DIR="${HINDSIGHT_SKILLS_STATE_DIR:-$HOME/.hindsight-skills}"
CONFIG_FILE="$STATE_DIR/config.yaml"
# Defaults (bash 3.x compatible — no associative arrays)
get_default() {
case "$1" in
auto_upgrade) echo "false" ;;
update_check) echo "true" ;;
*) echo "" ;;
esac
}
ensure_config() {
if [ ! -f "$CONFIG_FILE" ]; then
mkdir -p "$STATE_DIR"
cat > "$CONFIG_FILE" <<'EOF'
auto_upgrade: false
update_check: true
EOF
fi
}
# Read a value from the config file (simple YAML: "key: value" per line)
read_key() {
local key="$1"
ensure_config
local value
value=$(grep "^${key}:" "$CONFIG_FILE" 2>/dev/null | head -1 | sed 's/^[^:]*:[[:space:]]*//' || true)
if [ -z "$value" ]; then
get_default "$key"
else
echo "$value"
fi
}
# Write a value to the config file
write_key() {
local key="$1"
local value="$2"
ensure_config
if grep -q "^${key}:" "$CONFIG_FILE" 2>/dev/null; then
# Replace existing line — portable sed in-place
local tmp="$CONFIG_FILE.tmp"
sed "s/^${key}:.*/${key}: ${value}/" "$CONFIG_FILE" > "$tmp"
mv "$tmp" "$CONFIG_FILE"
else
echo "${key}: ${value}" >> "$CONFIG_FILE"
fi
}
# List all config values
list_config() {
ensure_config
cat "$CONFIG_FILE"
}
# ─── Main ────────────────────────────────────────────────────
case "${1:-}" in
get)
[ -z "${2:-}" ] && echo "Usage: hindsight-config get <key>" >&2 && exit 1
read_key "$2"
;;
set)
[ -z "${2:-}" ] || [ -z "${3:-}" ] && echo "Usage: hindsight-config set <key> <value>" >&2 && exit 1
write_key "$2" "$3"
;;
list)
list_config
;;
*)
echo "Usage: hindsight-config <get|set|list> [key] [value]" >&2
exit 1
;;
esac
#!/usr/bin/env bash
# hindsight-update-check — check for new hindsight-skills versions
#
# Output protocol (stdout):
# JUST_UPGRADED <old> <new> — a recent upgrade completed; show What's New
# UPGRADE_AVAILABLE <old> <new> — a newer version exists
# (nothing) — up to date, snoozed, or checks disabled
#
# Env overrides (for testing):
# HINDSIGHT_SKILLS_DIR — path to the skills repo (default: auto-detect)
# HINDSIGHT_SKILLS_REMOTE_URL — URL to fetch remote VERSION (default: GitHub raw)
# HINDSIGHT_SKILLS_STATE_DIR — path to state directory (default: ~/.hindsight-skills)
set -euo pipefail
# ─── Resolve paths ───────────────────────────────────────────
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
SKILL_DIR="${HINDSIGHT_SKILLS_DIR:-$(cd "$SCRIPT_DIR/.." && pwd)}"
STATE_DIR="${HINDSIGHT_SKILLS_STATE_DIR:-$HOME/.hindsight-skills}"
REMOTE_URL="${HINDSIGHT_SKILLS_REMOTE_URL:-https://raw.githubusercontent.com/vectorize-io/hindsight-skills/main/VERSION}"
CONFIG_BIN="$SCRIPT_DIR/hindsight-config"
CACHE_FILE="$STATE_DIR/last-update-check"
SNOOZE_FILE="$STATE_DIR/update-snoozed"
UPGRADED_FILE="$STATE_DIR/just-upgraded-from"
VERSION_FILE="$SKILL_DIR/VERSION"
# Cache TTLs in seconds
CACHE_TTL_UPTODATE=3600 # 60 min when up to date
CACHE_TTL_UPGRADE=43200 # 720 min when upgrade available
SNOOZE_DURATION=86400 # 24 hours
mkdir -p "$STATE_DIR"
# ─── Helpers ─────────────────────────────────────────────────
now_epoch() {
date +%s
}
version_gt() {
# Returns 0 (true) if $1 > $2 using sort -V
[ "$1" != "$2" ] && [ "$(printf '%s\n%s\n' "$1" "$2" | sort -V | tail -1)" = "$1" ]
}
# ─── Step 1: Check if update checks are enabled ─────────────
if [ -x "$CONFIG_BIN" ]; then
update_check=$("$CONFIG_BIN" get update_check 2>/dev/null || echo "true")
else
update_check="true"
fi
if [ "$update_check" = "false" ]; then
exit 0
fi
# ─── Step 2: Read local version ─────────────────────────────
if [ ! -f "$VERSION_FILE" ]; then
exit 0
fi
local_version=$(tr -d '[:space:]' < "$VERSION_FILE")
if [ -z "$local_version" ]; then
exit 0
fi
# ─── Step 3: Check just-upgraded marker ─────────────────────
if [ -f "$UPGRADED_FILE" ]; then
old_version=$(tr -d '[:space:]' < "$UPGRADED_FILE")
rm -f "$UPGRADED_FILE"
if [ -n "$old_version" ]; then
echo "JUST_UPGRADED $old_version $local_version"
exit 0
fi
fi
# ─── Step 4: Check cache freshness ──────────────────────────
if [ -f "$CACHE_FILE" ]; then
cached_status=$(head -1 "$CACHE_FILE" 2>/dev/null || echo "")
cached_time=$(sed -n '2p' "$CACHE_FILE" 2>/dev/null || echo "0")
cached_remote=$(sed -n '3p' "$CACHE_FILE" 2>/dev/null || echo "")
now=$(now_epoch)
if [ -n "$cached_time" ] && [ -n "$cached_status" ]; then
age=$((now - cached_time))
if [ "$cached_status" = "up-to-date" ] && [ $age -lt $CACHE_TTL_UPTODATE ]; then
# Still fresh, nothing to report
exit 0
fi
if [ "$cached_status" = "upgrade-available" ] && [ $age -lt $CACHE_TTL_UPGRADE ]; then
# Cache still valid — but check snooze before reporting
if [ -f "$SNOOZE_FILE" ]; then
snooze_version=$(awk '{print $1}' "$SNOOZE_FILE" 2>/dev/null || echo "")
snooze_time=$(awk '{print $2}' "$SNOOZE_FILE" 2>/dev/null || echo "0")
if [ "$snooze_version" = "$cached_remote" ] && [ $((now - snooze_time)) -lt $SNOOZE_DURATION ]; then
exit 0
fi
fi
echo "UPGRADE_AVAILABLE $local_version $cached_remote"
exit 0
fi
fi
fi
# ─── Step 5: Fetch remote version ───────────────────────────
remote_version=""
if command -v curl >/dev/null 2>&1; then
remote_version=$(curl -fsSL --max-time 5 "$REMOTE_URL" 2>/dev/null | tr -d '[:space:]') || true
elif command -v wget >/dev/null 2>&1; then
remote_version=$(wget -qO- --timeout=5 "$REMOTE_URL" 2>/dev/null | tr -d '[:space:]') || true
fi
# ─── Step 6: Validate response ──────────────────────────────
if [ -z "$remote_version" ]; then
exit 0
fi
# Must look like a semver (digits and dots, optionally with pre-release suffix)
if ! echo "$remote_version" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+'; then
exit 0
fi
# ─── Step 7: Compare and output ─────────────────────────────
now=$(now_epoch)
if version_gt "$remote_version" "$local_version"; then
# Write cache
printf 'upgrade-available\n%s\n%s\n' "$now" "$remote_version" > "$CACHE_FILE"
# Check snooze
if [ -f "$SNOOZE_FILE" ]; then
snooze_version=$(awk '{print $1}' "$SNOOZE_FILE" 2>/dev/null || echo "")
snooze_time=$(awk '{print $2}' "$SNOOZE_FILE" 2>/dev/null || echo "0")
if [ "$snooze_version" = "$remote_version" ] && [ $((now - snooze_time)) -lt $SNOOZE_DURATION ]; then
exit 0
fi
# New version or snooze expired — remove stale snooze
rm -f "$SNOOZE_FILE"
fi
echo "UPGRADE_AVAILABLE $local_version $remote_version"
else
# Up to date
printf 'up-to-date\n%s\n%s\n' "$now" "$remote_version" > "$CACHE_FILE"
fi
Changelog
0.1.0
Initial release of hindsight-skills.
/hindsight-architect— Design memory architectures for AI agents/hindsight-docs— Hindsight technical documentation reference/hindsight-upgrade— Version check and upgrade system- Shared preamble with environment detection (language, framework, deployment mode)
- Multi-agent support: Claude Code, Codex, Gemini CLI, Cursor, Kiro, Factory Droid
---
name: hindsight-upgrade
description: Check for and install hindsight-skills updates. Detects new versions, offers upgrade options, and shows what changed.
---
# Hindsight Skills Upgrade
You manage upgrades for hindsight-skills. This skill is invoked in two ways:
1. **Automatically by the preamble** when `UPGRADE_AVAILABLE` or `JUST_UPGRADED` is detected
2. **Directly by the user** via `/hindsight-upgrade`
---
## Inline Upgrade Flow (called by preamble)
When the preamble detects `UPGRADE_AVAILABLE <old> <new>`, follow these steps:
### Step 1: Check auto_upgrade preference
```bash
# Check if auto-upgrade is enabled
_HS_BIN_DIR=""
for _d in ~/.claude/skills ~/.codex/skills ~/.kiro/skills ~/.factory/skills; do
[ -x "$_d/hindsight-upgrade/bin/hindsight-config" ] && _HS_BIN_DIR="$_d/hindsight-upgrade/bin" && break
done
[ -n "$_HS_BIN_DIR" ] && _AUTO_UPGRADE=$("$_HS_BIN_DIR/hindsight-config" get auto_upgrade 2>/dev/null || echo "false")
echo "AUTO_UPGRADE: ${_AUTO_UPGRADE:-false}"
```
If `AUTO_UPGRADE` is `true`, skip to Step 2 and proceed with the upgrade silently.
If `AUTO_UPGRADE` is `false`, use `AskUserQuestion` to ask:
> hindsight-skills **{new}** is available (you have **{old}**). How would you like to proceed?
Options:
- **Upgrade now** — Install the update and continue
- **Always auto-upgrade** — Install now and auto-upgrade in the future
- **Snooze 24h** — Remind me tomorrow
- **Never ask** — Disable update checks permanently
Handle each response:
- **Upgrade now**: proceed to Step 2
- **Always auto-upgrade**: run `hindsight-config set auto_upgrade true`, then proceed to Step 2
- **Snooze 24h**: write snooze file and stop
```bash
# Snooze for 24 hours
_HS_STATE_DIR="${HINDSIGHT_SKILLS_STATE_DIR:-$HOME/.hindsight-skills}"
echo "{new_version} $(date +%s)" > "$_HS_STATE_DIR/update-snoozed"
```
- **Never ask**: run `hindsight-config set update_check false` and stop
### Step 2: Detect install type
```bash
# Read the install source breadcrumb
_HS_STATE_DIR="${HINDSIGHT_SKILLS_STATE_DIR:-$HOME/.hindsight-skills}"
_INSTALL_SOURCE=""
[ -f "$_HS_STATE_DIR/install-source" ] && _INSTALL_SOURCE=$(cat "$_HS_STATE_DIR/install-source")
echo "INSTALL_SOURCE: ${_INSTALL_SOURCE:-not found}"
```
If `INSTALL_SOURCE` is empty or the path doesn't exist, tell the user:
> I can't find the hindsight-skills installation. Please re-run setup from your clone:
> ```
> cd /path/to/hindsight-skills && ./setup
> ```
And stop.
### Step 3: Save old version
```bash
_HS_STATE_DIR="${HINDSIGHT_SKILLS_STATE_DIR:-$HOME/.hindsight-skills}"
_INSTALL_SOURCE=$(cat "$_HS_STATE_DIR/install-source")
_OLD_VERSION=$(cat "$_INSTALL_SOURCE/VERSION" 2>/dev/null | tr -d '[:space:]')
echo "OLD_VERSION: $_OLD_VERSION"
```
### Step 4: Upgrade
Check if the install source is a git repo:
```bash
_INSTALL_SOURCE=$(cat "${HINDSIGHT_SKILLS_STATE_DIR:-$HOME/.hindsight-skills}/install-source")
cd "$_INSTALL_SOURCE"
if [ -d .git ]; then
echo "INSTALL_TYPE: git"
else
echo "INSTALL_TYPE: vendored"
fi
```
**Git install:**
```bash
_INSTALL_SOURCE=$(cat "${HINDSIGHT_SKILLS_STATE_DIR:-$HOME/.hindsight-skills}/install-source")
cd "$_INSTALL_SOURCE" && git pull origin main && ./setup
```
**Vendored install** (no .git directory — downloaded/copied, not cloned):
```bash
_INSTALL_SOURCE=$(cat "${HINDSIGHT_SKILLS_STATE_DIR:-$HOME/.hindsight-skills}/install-source")
_PARENT=$(dirname "$_INSTALL_SOURCE")
_NAME=$(basename "$_INSTALL_SOURCE")
cd "$_PARENT"
# Clone fresh, run setup, move into place
git clone https://github.com/vectorize-io/hindsight-skills.git "${_NAME}-upgrade-tmp"
cd "${_NAME}-upgrade-tmp" && ./setup
cd "$_PARENT"
rm -rf "$_NAME"
mv "${_NAME}-upgrade-tmp" "$_NAME"
```
### Step 5: Write marker and clear state
```bash
_HS_STATE_DIR="${HINDSIGHT_SKILLS_STATE_DIR:-$HOME/.hindsight-skills}"
echo "$_OLD_VERSION" > "$_HS_STATE_DIR/just-upgraded-from"
rm -f "$_HS_STATE_DIR/last-update-check"
rm -f "$_HS_STATE_DIR/update-snoozed"
```
### Step 6: Show What's New
Read the CHANGELOG.md from the installed skill and show the user what changed between their old version and the new version:
```bash
# Find the changelog
for _d in ~/.claude/skills ~/.codex/skills ~/.kiro/skills ~/.factory/skills; do
[ -f "$_d/hindsight-upgrade/CHANGELOG.md" ] && cat "$_d/hindsight-upgrade/CHANGELOG.md" && break
done
```
Parse the changelog and display only the sections between the old and new versions. Format as:
> **hindsight-skills upgraded: {old} → {new}**
>
> {relevant changelog entries}
Then continue with the user's original task.
---
## Handling JUST_UPGRADED
When the preamble detects `JUST_UPGRADED <old> <new>`, the upgrade already happened in a previous session. Show What's New (Step 6 above) and continue.
---
## Standalone Usage
When invoked directly as `/hindsight-upgrade`:
### Force check (bypass cache)
```bash
# Clear cache and run check
_HS_STATE_DIR="${HINDSIGHT_SKILLS_STATE_DIR:-$HOME/.hindsight-skills}"
rm -f "$_HS_STATE_DIR/last-update-check"
rm -f "$_HS_STATE_DIR/update-snoozed"
# Find and run the update check
for _d in ~/.claude/skills ~/.codex/skills ~/.kiro/skills ~/.factory/skills; do
[ -x "$_d/hindsight-upgrade/bin/hindsight-update-check" ] && "$_d/hindsight-upgrade/bin/hindsight-update-check" && break
done
```
If the output is `UPGRADE_AVAILABLE`, follow the Inline Upgrade Flow from Step 1.
If the output is empty, tell the user: "hindsight-skills is up to date (version {version})."
If the output is `JUST_UPGRADED`, show What's New.
### Config management
Users can also use `/hindsight-upgrade` to manage settings:
- "enable auto-upgrade" → `hindsight-config set auto_upgrade true`
- "disable update checks" → `hindsight-config set update_check false`
- "re-enable update checks" → `hindsight-config set update_check true`
- "show config" → `hindsight-config list`
0.1.0