agentleFS
vectorize-iovectorize-io/hindsight-skills/skills/hindsight-upgrade/SKILL.md

hindsight-upgrade

Skill18 starsChanged 7 months agoMITView on GitHub

Check for and install hindsight-skills updates. Detects new versions, offers upgrade options, and shows what changed.

  • Deletes or force-pushes

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. About 0 are common, 3 are distinctive, and 12 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 12

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Automatically by the preamble: when UPGRADE_AVAILABLE or JUST_UPGRADED is detected

    line 10
  2. Very specific:

    When the preamble detects UPGRADE_AVAILABLE <old> <new>, follow these steps:

    line 17
  3. Very specific:

    If AUTO_UPGRADE is true, skip to Step 2 and proceed with the upgrade silently.

    line 31
  4. Very specific:

    If AUTO_UPGRADE is false, use AskUserQuestion to ask:

    line 33
  5. Very specific:

    Always auto-upgrade: run hindsight-config set auto_upgrade true, then proceed to Step 2

    line 45
  6. Distinctive:

    Snooze 24h: write snooze file and stop

    line 46
  7. Very specific:

    Never ask: run hindsight-config set update_check false and stop

    line 54
  8. Very specific:

    If INSTALL_SOURCE is empty or the path doesn't exist, tell the user:

    line 66
  9. Distinctive:

    Check if the install source is a git repo:

    line 86
  10. Distinctive:

    Read the CHANGELOG.md from the installed skill and show the user what changed between their old version and the new version:

    line 129
  11. Very specific:

    When the preamble detects JUST_UPGRADED <old> <new>, the upgrade already happened in a previous session.

    line 150
  12. Very specific:

    When invoked directly as /hindsight-upgrade:

    line 156
  13. Very specific:

    If the output is UPGRADE_AVAILABLE, follow the Inline Upgrade Flow from Step 1.

    line 172
  14. Very specific:

    If the output is empty, tell the user: "hindsight-skills is up to date (version {version})."

    line 174
  15. Very specific:

    If the output is JUST_UPGRADED, show What's New.

    line 176

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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 false and 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"
fi

Git install:

_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):

_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
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)

# 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

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.