[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M75E366ZNK74JR019TY85VMY":3,"skill-same:01M75E366ZNK74JR019TY85VMY":81},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":34,"commitSha":35,"skillDirectory":36,"forksCount":37,"repositoryHtmlUrl":38,"repositoryHomepageUrl":39,"ownerHtmlUrl":40,"ownerBlogUrl":41,"ownerDescription":6,"updatedAt":42,"install":43,"resources":56},"01M75E366ZNK74JR019TY85VMY","gstack-upgrade",null,"Upgrade gstack to the latest version. Detects global vs vendored install,\nruns the upgrade, and shows what's new. Use when asked to \"upgrade gstack\",\n\"update gstack\", or \"get latest version\".\nVoice triggers (speech-to-text aliases): \"upgrade the tools\", \"update the tools\", \"gee stack upgrade\", \"g stack upgrade\".","agisota\u002Fold-one","agisota","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F121413592?v=4","01M75B4BRNT67EC1NDRT8QZEP2","01M75B4BS7QR9VP580MSCPTS3X",3,"MIT","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fgstack-upgrade\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: gstack-upgrade\nversion: 1.1.0\ndescription: |\n  Upgrade gstack to the latest version. Detects global vs vendored install,\n  runs the upgrade, and shows what's new. Use when asked to \"upgrade gstack\",\n  \"update gstack\", or \"get latest version\".\n  Voice triggers (speech-to-text aliases): \"upgrade the tools\", \"update the tools\", \"gee stack upgrade\", \"g stack upgrade\".\ntriggers:\n  - upgrade gstack\n  - update gstack version\n  - get latest gstack\nallowed-tools:\n  - Bash\n  - Read\n  - Write\n  - AskUserQuestion\n---\n\u003C!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->\n\u003C!-- Regenerate: bun run gen:skill-docs -->\n\n# \u002Fgstack-upgrade\n\nUpgrade gstack to the latest version and show what's new.\n\n## Inline upgrade flow\n\nThis section is referenced by all skill preambles when they detect `UPGRADE_AVAILABLE`.\n\n### Step 1: Ask the user (or auto-upgrade)\n\nFirst, check if auto-upgrade is enabled:\n```bash\n_AUTO=\"\"\n[ \"${GSTACK_AUTO_UPGRADE:-}\" = \"1\" ] && _AUTO=\"true\"\n[ -z \"$_AUTO\" ] && _AUTO=$(~\u002F.claude\u002Fskills\u002Fgstack\u002Fbin\u002Fgstack-config get auto_upgrade 2>\u002Fdev\u002Fnull || true)\necho \"AUTO_UPGRADE=$_AUTO\"\n```\n\n**If `AUTO_UPGRADE=true` or `AUTO_UPGRADE=1`:** Skip AskUserQuestion. Log \"Auto-upgrading gstack v{old} → v{new}...\" and proceed directly to Step 2. If `.\u002Fsetup` fails during auto-upgrade, restore from backup (`.bak` directory) and warn the user: \"Auto-upgrade failed — restored previous version. Run `\u002Fgstack-upgrade` manually to retry.\"\n\n**Otherwise**, use AskUserQuestion:\n- Question: \"gstack **v{new}** is available (you're on v{old}). Upgrade now?\"\n- Options: [\"Yes, upgrade now\", \"Always keep me up to date\", \"Not now\", \"Never ask again\"]\n\n**If \"Yes, upgrade now\":** Proceed to Step 2.\n\n**If \"Always keep me up to date\":**\n```bash\n~\u002F.claude\u002Fskills\u002Fgstack\u002Fbin\u002Fgstack-config set auto_upgrade true\n```\nTell user: \"Auto-upgrade enabled. Future updates will install automatically.\" Then proceed to Step 2.\n\n**If \"Not now\":** Write snooze state with escalating backoff (first snooze = 24h, second = 48h, third+ = 1 week), then continue with the current skill. Do not mention the upgrade again.\n```bash\n_SNOOZE_FILE=\"$HOME\u002F.gstack\u002Fupdate-snoozed\"\n_REMOTE_VER=\"{new}\"\n_CUR_LEVEL=0\nif [ -f \"$_SNOOZE_FILE\" ]; then\n  _SNOOZED_VER=$(awk '{print $1}' \"$_SNOOZE_FILE\")\n  if [ \"$_SNOOZED_VER\" = \"$_REMOTE_VER\" ]; then\n    _CUR_LEVEL=$(awk '{print $2}' \"$_SNOOZE_FILE\")\n    case \"$_CUR_LEVEL\" in *[!0-9]*) _CUR_LEVEL=0 ;; esac\n  fi\nfi\n_NEW_LEVEL=$((_CUR_LEVEL + 1))\n[ \"$_NEW_LEVEL\" -gt 3 ] && _NEW_LEVEL=3\necho \"$_REMOTE_VER $_NEW_LEVEL $(date +%s)\" > \"$_SNOOZE_FILE\"\n```\nNote: `{new}` is the remote version from the `UPGRADE_AVAILABLE` output — substitute it from the update check result.\n\nTell user the snooze duration: \"Next reminder in 24h\" (or 48h or 1 week, depending on level). Tip: \"Set `auto_upgrade: true` in `~\u002F.gstack\u002Fconfig.yaml` for automatic upgrades.\"\n\n**If \"Never ask again\":**\n```bash\n~\u002F.claude\u002Fskills\u002Fgstack\u002Fbin\u002Fgstack-config set update_check false\n```\nTell user: \"Update checks disabled. Run `~\u002F.claude\u002Fskills\u002Fgstack\u002Fbin\u002Fgstack-config set update_check true` to re-enable.\"\nContinue with the current skill.\n\n### Step 2: Detect install type\n\n```bash\nif [ -d \"$HOME\u002F.claude\u002Fskills\u002Fgstack\u002F.git\" ]; then\n  INSTALL_TYPE=\"global-git\"\n  INSTALL_DIR=\"$HOME\u002F.claude\u002Fskills\u002Fgstack\"\nelif [ -d \"$HOME\u002F.gstack\u002Frepos\u002Fgstack\u002F.git\" ]; then\n  INSTALL_TYPE=\"global-git\"\n  INSTALL_DIR=\"$HOME\u002F.gstack\u002Frepos\u002Fgstack\"\nelif [ -d \".claude\u002Fskills\u002Fgstack\u002F.git\" ]; then\n  INSTALL_TYPE=\"local-git\"\n  INSTALL_DIR=\".claude\u002Fskills\u002Fgstack\"\nelif [ -d \".agents\u002Fskills\u002Fgstack\u002F.git\" ]; then\n  INSTALL_TYPE=\"local-git\"\n  INSTALL_DIR=\".agents\u002Fskills\u002Fgstack\"\nelif [ -d \".claude\u002Fskills\u002Fgstack\" ]; then\n  INSTALL_TYPE=\"vendored\"\n  INSTALL_DIR=\".claude\u002Fskills\u002Fgstack\"\nelif [ -d \"$HOME\u002F.claude\u002Fskills\u002Fgstack\" ]; then\n  INSTALL_TYPE=\"vendored-global\"\n  INSTALL_DIR=\"$HOME\u002F.claude\u002Fskills\u002Fgstack\"\nelse\n  echo \"ERROR: gstack not found\"\n  exit 1\nfi\necho \"Install type: $INSTALL_TYPE at $INSTALL_DIR\"\n```\n\nThe install type and directory path printed above will be used in all subsequent steps.\n\n### Step 3: Save old version\n\nUse the install directory from Step 2's output below:\n\n```bash\nOLD_VERSION=$(cat \"$INSTALL_DIR\u002FVERSION\" 2>\u002Fdev\u002Fnull || echo \"unknown\")\n```\n\n### Step 4: Upgrade\n\nUse the install type and directory detected in Step 2:\n\n**For git installs** (global-git, local-git):\n```bash\ncd \"$INSTALL_DIR\"\nSTASH_OUTPUT=$(git stash 2>&1)\ngit fetch origin\ngit reset --hard origin\u002Fmain\n.\u002Fsetup\n```\nIf `$STASH_OUTPUT` contains \"Saved working directory\", warn the user: \"Note: local changes were stashed. Run `git stash pop` in the skill directory to restore them.\"\n\n**For vendored installs** (vendored, vendored-global):\n```bash\nPARENT=$(dirname \"$INSTALL_DIR\")\nTMP_DIR=$(mktemp -d)\ngit clone --depth 1 https:\u002F\u002Fgithub.com\u002Fgarrytan\u002Fgstack.git \"$TMP_DIR\u002Fgstack\"\nmv \"$INSTALL_DIR\" \"$INSTALL_DIR.bak\"\nmv \"$TMP_DIR\u002Fgstack\" \"$INSTALL_DIR\"\ncd \"$INSTALL_DIR\" && .\u002Fsetup\nrm -rf \"$INSTALL_DIR.bak\" \"$TMP_DIR\"\n```\n\n### Step 4.5: Handle local vendored copy\n\nUse the install directory from Step 2. Check if there's also a local vendored copy, and whether team mode is active:\n\n```bash\n_ROOT=$(git rev-parse --show-toplevel 2>\u002Fdev\u002Fnull)\nLOCAL_GSTACK=\"\"\nif [ -n \"$_ROOT\" ] && [ -d \"$_ROOT\u002F.claude\u002Fskills\u002Fgstack\" ]; then\n  _RESOLVED_LOCAL=$(cd \"$_ROOT\u002F.claude\u002Fskills\u002Fgstack\" && pwd -P)\n  _RESOLVED_PRIMARY=$(cd \"$INSTALL_DIR\" && pwd -P)\n  if [ \"$_RESOLVED_LOCAL\" != \"$_RESOLVED_PRIMARY\" ]; then\n    LOCAL_GSTACK=\"$_ROOT\u002F.claude\u002Fskills\u002Fgstack\"\n  fi\nfi\n_TEAM_MODE=$(~\u002F.claude\u002Fskills\u002Fgstack\u002Fbin\u002Fgstack-config get team_mode 2>\u002Fdev\u002Fnull || echo \"false\")\necho \"LOCAL_GSTACK=$LOCAL_GSTACK\"\necho \"TEAM_MODE=$_TEAM_MODE\"\n```\n\n**If `LOCAL_GSTACK` is non-empty AND `TEAM_MODE` is `true`:** Remove the vendored copy. Team mode uses the global install as the single source of truth.\n\n```bash\ncd \"$_ROOT\"\ngit rm -r --cached .claude\u002Fskills\u002Fgstack\u002F 2>\u002Fdev\u002Fnull || true\nif ! grep -qF '.claude\u002Fskills\u002Fgstack\u002F' .gitignore 2>\u002Fdev\u002Fnull; then\n  echo '.claude\u002Fskills\u002Fgstack\u002F' >> .gitignore\nfi\nrm -rf \"$LOCAL_GSTACK\"\n```\nTell user: \"Removed vendored copy at `$LOCAL_GSTACK` (team mode active — global install is the source of truth). Commit the `.gitignore` change when ready.\"\n\n**If `LOCAL_GSTACK` is non-empty AND `TEAM_MODE` is NOT `true`:** Update it by copying from the freshly-upgraded primary install (same approach as README vendored install):\n```bash\nmv \"$LOCAL_GSTACK\" \"$LOCAL_GSTACK.bak\"\ncp -Rf \"$INSTALL_DIR\" \"$LOCAL_GSTACK\"\nrm -rf \"$LOCAL_GSTACK\u002F.git\"\ncd \"$LOCAL_GSTACK\" && .\u002Fsetup\nrm -rf \"$LOCAL_GSTACK.bak\"\n```\nTell user: \"Also updated vendored copy at `$LOCAL_GSTACK` — commit `.claude\u002Fskills\u002Fgstack\u002F` when you're ready.\"\n\nIf `.\u002Fsetup` fails, restore from backup and warn the user:\n```bash\nrm -rf \"$LOCAL_GSTACK\"\nmv \"$LOCAL_GSTACK.bak\" \"$LOCAL_GSTACK\"\n```\nTell user: \"Sync failed — restored previous version at `$LOCAL_GSTACK`. Run `\u002Fgstack-upgrade` manually to retry.\"\n\n### Step 4.75: Run version migrations\n\nAfter `.\u002Fsetup` completes, run any migration scripts for versions between the old\nand new version. Migrations handle state fixes that `.\u002Fsetup` alone can't cover\n(stale config, orphaned files, directory structure changes).\n\n```bash\nMIGRATIONS_DIR=\"$INSTALL_DIR\u002Fgstack-upgrade\u002Fmigrations\"\nif [ -d \"$MIGRATIONS_DIR\" ]; then\n  for migration in $(find \"$MIGRATIONS_DIR\" -maxdepth 1 -name 'v*.sh' -type f 2>\u002Fdev\u002Fnull | sort -V); do\n    # Extract version from filename: v0.15.2.0.sh → 0.15.2.0\n    m_ver=\"$(basename \"$migration\" .sh | sed 's\u002F^v\u002F\u002F')\"\n    # Run if this migration version is newer than old version\n    # (simple string compare works for dotted versions with same segment count)\n    if [ \"$OLD_VERSION\" != \"unknown\" ] && [ \"$(printf '%s\\n%s' \"$OLD_VERSION\" \"$m_ver\" | sort -V | head -1)\" = \"$OLD_VERSION\" ] && [ \"$OLD_VERSION\" != \"$m_ver\" ]; then\n      echo \"Running migration $m_ver...\"\n      bash \"$migration\" || echo \"  Warning: migration $m_ver had errors (non-fatal)\"\n    fi\n  done\nfi\n```\n\nMigrations are idempotent bash scripts in `gstack-upgrade\u002Fmigrations\u002F`. Each is named\n`v{VERSION}.sh` and runs only when upgrading from an older version. See CONTRIBUTING.md\nfor how to add new migrations.\n\n### Step 5: Write marker + clear cache\n\n```bash\nmkdir -p ~\u002F.gstack\necho \"$OLD_VERSION\" > ~\u002F.gstack\u002Fjust-upgraded-from\nrm -f ~\u002F.gstack\u002Flast-update-check\nrm -f ~\u002F.gstack\u002Fupdate-snoozed\n```\n\n### Step 6: Show What's New\n\nRead `$INSTALL_DIR\u002FCHANGELOG.md`. Find all version entries between the old version and the new version. Summarize as 5-7 bullets grouped by theme. Don't overwhelm — focus on user-facing changes. Skip internal refactors unless they're significant.\n\nFormat:\n```\ngstack v{new} — upgraded from v{old}!\n\nWhat's new:\n- [bullet 1]\n- [bullet 2]\n- ...\n\nHappy shipping!\n```\n\n### Step 7: Continue\n\nAfter showing What's New, continue with whatever skill the user originally invoked. The upgrade is done — no further action needed.\n\n---\n\n## Standalone usage\n\nWhen invoked directly as `\u002Fgstack-upgrade` (not from a preamble):\n\n1. Force a fresh update check (bypass cache):\n```bash\n~\u002F.claude\u002Fskills\u002Fgstack\u002Fbin\u002Fgstack-update-check --force 2>\u002Fdev\u002Fnull || \\\n.claude\u002Fskills\u002Fgstack\u002Fbin\u002Fgstack-update-check --force 2>\u002Fdev\u002Fnull || true\n```\nUse the output to determine if an upgrade is available.\n\n2. If `UPGRADE_AVAILABLE \u003Cold> \u003Cnew>`: follow Steps 2-6 above.\n\n3. If no output (primary is up to date): check for a stale local vendored copy.\n\nRun the Step 2 bash block above to detect the primary install type and directory (`INSTALL_TYPE` and `INSTALL_DIR`). Then run the Step 4.5 detection bash block above to check for a local vendored copy (`LOCAL_GSTACK`) and team mode status (`TEAM_MODE`).\n\n**If `LOCAL_GSTACK` is empty** (no local vendored copy): tell the user \"You're already on the latest version (v{version}).\"\n\n**If `LOCAL_GSTACK` is non-empty AND `TEAM_MODE` is `true`:** Remove the vendored copy using the Step 4.5 team-mode removal bash block above. Tell user: \"Global v{version} is up to date. Removed stale vendored copy (team mode active). Commit the `.gitignore` change when ready.\"\n\n**If `LOCAL_GSTACK` is non-empty AND `TEAM_MODE` is NOT `true`**, compare versions:\n```bash\nPRIMARY_VER=$(cat \"$INSTALL_DIR\u002FVERSION\" 2>\u002Fdev\u002Fnull || echo \"unknown\")\nLOCAL_VER=$(cat \"$LOCAL_GSTACK\u002FVERSION\" 2>\u002Fdev\u002Fnull || echo \"unknown\")\necho \"PRIMARY=$PRIMARY_VER LOCAL=$LOCAL_VER\"\n```\n\n**If versions differ:** follow the Step 4.5 sync bash block above to update the local copy from the primary. Tell user: \"Global v{PRIMARY_VER} is up to date. Updated local vendored copy from v{LOCAL_VER} → v{PRIMARY_VER}. Commit `.claude\u002Fskills\u002Fgstack\u002F` when you're ready.\"\n\n**If versions match:** tell the user \"You're on the latest version (v{PRIMARY_VER}). Global and local vendored copy are both up to date.\"\n","\u003C!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->\n\u003C!-- Regenerate: bun run gen:skill-docs -->\n\n# \u002Fgstack-upgrade\n\nUpgrade gstack to the latest version and show what's new.\n\n## Inline upgrade flow\n\nThis section is referenced by all skill preambles when they detect `UPGRADE_AVAILABLE`.\n\n### Step 1: Ask the user (or auto-upgrade)\n\nFirst, check if auto-upgrade is enabled:\n```bash\n_AUTO=\"\"\n[ \"${GSTACK_AUTO_UPGRADE:-}\" = \"1\" ] && _AUTO=\"true\"\n[ -z \"$_AUTO\" ] && _AUTO=$(~\u002F.claude\u002Fskills\u002Fgstack\u002Fbin\u002Fgstack-config get auto_upgrade 2>\u002Fdev\u002Fnull || true)\necho \"AUTO_UPGRADE=$_AUTO\"\n```\n\n**If `AUTO_UPGRADE=true` or `AUTO_UPGRADE=1`:** Skip AskUserQuestion. Log \"Auto-upgrading gstack v{old} → v{new}...\" and proceed directly to Step 2. If `.\u002Fsetup` fails during auto-upgrade, restore from backup (`.bak` directory) and warn the user: \"Auto-upgrade failed — restored previous version. Run `\u002Fgstack-upgrade` manually to retry.\"\n\n**Otherwise**, use AskUserQuestion:\n- Question: \"gstack **v{new}** is available (you're on v{old}). Upgrade now?\"\n- Options: [\"Yes, upgrade now\", \"Always keep me up to date\", \"Not now\", \"Never ask again\"]\n\n**If \"Yes, upgrade now\":** Proceed to Step 2.\n\n**If \"Always keep me up to date\":**\n```bash\n~\u002F.claude\u002Fskills\u002Fgstack\u002Fbin\u002Fgstack-config set auto_upgrade true\n```\nTell user: \"Auto-upgrade enabled. Future updates will install automatically.\" Then proceed to Step 2.\n\n**If \"Not now\":** Write snooze state with escalating backoff (first snooze = 24h, second = 48h, third+ = 1 week), then continue with the current skill. Do not mention the upgrade again.\n```bash\n_SNOOZE_FILE=\"$HOME\u002F.gstack\u002Fupdate-snoozed\"\n_REMOTE_VER=\"{new}\"\n_CUR_LEVEL=0\nif [ -f \"$_SNOOZE_FILE\" ]; then\n  _SNOOZED_VER=$(awk '{print $1}' \"$_SNOOZE_FILE\")\n  if [ \"$_SNOOZED_VER\" = \"$_REMOTE_VER\" ]; then\n    _CUR_LEVEL=$(awk '{print $2}' \"$_SNOOZE_FILE\")\n    case \"$_CUR_LEVEL\" in *[!0-9]*) _CUR_LEVEL=0 ;; esac\n  fi\nfi\n_NEW_LEVEL=$((_CUR_LEVEL + 1))\n[ \"$_NEW_LEVEL\" -gt 3 ] && _NEW_LEVEL=3\necho \"$_REMOTE_VER $_NEW_LEVEL $(date +%s)\" > \"$_SNOOZE_FILE\"\n```\nNote: `{new}` is the remote version from the `UPGRADE_AVAILABLE` output — substitute it from the update check result.\n\nTell user the snooze duration: \"Next reminder in 24h\" (or 48h or 1 week, depending on level). Tip: \"Set `auto_upgrade: true` in `~\u002F.gstack\u002Fconfig.yaml` for automatic upgrades.\"\n\n**If \"Never ask again\":**\n```bash\n~\u002F.claude\u002Fskills\u002Fgstack\u002Fbin\u002Fgstack-config set update_check false\n```\nTell user: \"Update checks disabled. Run `~\u002F.claude\u002Fskills\u002Fgstack\u002Fbin\u002Fgstack-config set update_check true` to re-enable.\"\nContinue with the current skill.\n\n### Step 2: Detect install type\n\n```bash\nif [ -d \"$HOME\u002F.claude\u002Fskills\u002Fgstack\u002F.git\" ]; then\n  INSTALL_TYPE=\"global-git\"\n  INSTALL_DIR=\"$HOME\u002F.claude\u002Fskills\u002Fgstack\"\nelif [ -d \"$HOME\u002F.gstack\u002Frepos\u002Fgstack\u002F.git\" ]; then\n  INSTALL_TYPE=\"global-git\"\n  INSTALL_DIR=\"$HOME\u002F.gstack\u002Frepos\u002Fgstack\"\nelif [ -d \".claude\u002Fskills\u002Fgstack\u002F.git\" ]; then\n  INSTALL_TYPE=\"local-git\"\n  INSTALL_DIR=\".claude\u002Fskills\u002Fgstack\"\nelif [ -d \".agents\u002Fskills\u002Fgstack\u002F.git\" ]; then\n  INSTALL_TYPE=\"local-git\"\n  INSTALL_DIR=\".agents\u002Fskills\u002Fgstack\"\nelif [ -d \".claude\u002Fskills\u002Fgstack\" ]; then\n  INSTALL_TYPE=\"vendored\"\n  INSTALL_DIR=\".claude\u002Fskills\u002Fgstack\"\nelif [ -d \"$HOME\u002F.claude\u002Fskills\u002Fgstack\" ]; then\n  INSTALL_TYPE=\"vendored-global\"\n  INSTALL_DIR=\"$HOME\u002F.claude\u002Fskills\u002Fgstack\"\nelse\n  echo \"ERROR: gstack not found\"\n  exit 1\nfi\necho \"Install type: $INSTALL_TYPE at $INSTALL_DIR\"\n```\n\nThe install type and directory path printed above will be used in all subsequent steps.\n\n### Step 3: Save old version\n\nUse the install directory from Step 2's output below:\n\n```bash\nOLD_VERSION=$(cat \"$INSTALL_DIR\u002FVERSION\" 2>\u002Fdev\u002Fnull || echo \"unknown\")\n```\n\n### Step 4: Upgrade\n\nUse the install type and directory detected in Step 2:\n\n**For git installs** (global-git, local-git):\n```bash\ncd \"$INSTALL_DIR\"\nSTASH_OUTPUT=$(git stash 2>&1)\ngit fetch origin\ngit reset --hard origin\u002Fmain\n.\u002Fsetup\n```\nIf `$STASH_OUTPUT` contains \"Saved working directory\", warn the user: \"Note: local changes were stashed. Run `git stash pop` in the skill directory to restore them.\"\n\n**For vendored installs** (vendored, vendored-global):\n```bash\nPARENT=$(dirname \"$INSTALL_DIR\")\nTMP_DIR=$(mktemp -d)\ngit clone --depth 1 https:\u002F\u002Fgithub.com\u002Fgarrytan\u002Fgstack.git \"$TMP_DIR\u002Fgstack\"\nmv \"$INSTALL_DIR\" \"$INSTALL_DIR.bak\"\nmv \"$TMP_DIR\u002Fgstack\" \"$INSTALL_DIR\"\ncd \"$INSTALL_DIR\" && .\u002Fsetup\nrm -rf \"$INSTALL_DIR.bak\" \"$TMP_DIR\"\n```\n\n### Step 4.5: Handle local vendored copy\n\nUse the install directory from Step 2. Check if there's also a local vendored copy, and whether team mode is active:\n\n```bash\n_ROOT=$(git rev-parse --show-toplevel 2>\u002Fdev\u002Fnull)\nLOCAL_GSTACK=\"\"\nif [ -n \"$_ROOT\" ] && [ -d \"$_ROOT\u002F.claude\u002Fskills\u002Fgstack\" ]; then\n  _RESOLVED_LOCAL=$(cd \"$_ROOT\u002F.claude\u002Fskills\u002Fgstack\" && pwd -P)\n  _RESOLVED_PRIMARY=$(cd \"$INSTALL_DIR\" && pwd -P)\n  if [ \"$_RESOLVED_LOCAL\" != \"$_RESOLVED_PRIMARY\" ]; then\n    LOCAL_GSTACK=\"$_ROOT\u002F.claude\u002Fskills\u002Fgstack\"\n  fi\nfi\n_TEAM_MODE=$(~\u002F.claude\u002Fskills\u002Fgstack\u002Fbin\u002Fgstack-config get team_mode 2>\u002Fdev\u002Fnull || echo \"false\")\necho \"LOCAL_GSTACK=$LOCAL_GSTACK\"\necho \"TEAM_MODE=$_TEAM_MODE\"\n```\n\n**If `LOCAL_GSTACK` is non-empty AND `TEAM_MODE` is `true`:** Remove the vendored copy. Team mode uses the global install as the single source of truth.\n\n```bash\ncd \"$_ROOT\"\ngit rm -r --cached .claude\u002Fskills\u002Fgstack\u002F 2>\u002Fdev\u002Fnull || true\nif ! grep -qF '.claude\u002Fskills\u002Fgstack\u002F' .gitignore 2>\u002Fdev\u002Fnull; then\n  echo '.claude\u002Fskills\u002Fgstack\u002F' >> .gitignore\nfi\nrm -rf \"$LOCAL_GSTACK\"\n```\nTell user: \"Removed vendored copy at `$LOCAL_GSTACK` (team mode active — global install is the source of truth). Commit the `.gitignore` change when ready.\"\n\n**If `LOCAL_GSTACK` is non-empty AND `TEAM_MODE` is NOT `true`:** Update it by copying from the freshly-upgraded primary install (same approach as README vendored install):\n```bash\nmv \"$LOCAL_GSTACK\" \"$LOCAL_GSTACK.bak\"\ncp -Rf \"$INSTALL_DIR\" \"$LOCAL_GSTACK\"\nrm -rf \"$LOCAL_GSTACK\u002F.git\"\ncd \"$LOCAL_GSTACK\" && .\u002Fsetup\nrm -rf \"$LOCAL_GSTACK.bak\"\n```\nTell user: \"Also updated vendored copy at `$LOCAL_GSTACK` — commit `.claude\u002Fskills\u002Fgstack\u002F` when you're ready.\"\n\nIf `.\u002Fsetup` fails, restore from backup and warn the user:\n```bash\nrm -rf \"$LOCAL_GSTACK\"\nmv \"$LOCAL_GSTACK.bak\" \"$LOCAL_GSTACK\"\n```\nTell user: \"Sync failed — restored previous version at `$LOCAL_GSTACK`. Run `\u002Fgstack-upgrade` manually to retry.\"\n\n### Step 4.75: Run version migrations\n\nAfter `.\u002Fsetup` completes, run any migration scripts for versions between the old\nand new version. Migrations handle state fixes that `.\u002Fsetup` alone can't cover\n(stale config, orphaned files, directory structure changes).\n\n```bash\nMIGRATIONS_DIR=\"$INSTALL_DIR\u002Fgstack-upgrade\u002Fmigrations\"\nif [ -d \"$MIGRATIONS_DIR\" ]; then\n  for migration in $(find \"$MIGRATIONS_DIR\" -maxdepth 1 -name 'v*.sh' -type f 2>\u002Fdev\u002Fnull | sort -V); do\n    # Extract version from filename: v0.15.2.0.sh → 0.15.2.0\n    m_ver=\"$(basename \"$migration\" .sh | sed 's\u002F^v\u002F\u002F')\"\n    # Run if this migration version is newer than old version\n    # (simple string compare works for dotted versions with same segment count)\n    if [ \"$OLD_VERSION\" != \"unknown\" ] && [ \"$(printf '%s\\n%s' \"$OLD_VERSION\" \"$m_ver\" | sort -V | head -1)\" = \"$OLD_VERSION\" ] && [ \"$OLD_VERSION\" != \"$m_ver\" ]; then\n      echo \"Running migration $m_ver...\"\n      bash \"$migration\" || echo \"  Warning: migration $m_ver had errors (non-fatal)\"\n    fi\n  done\nfi\n```\n\nMigrations are idempotent bash scripts in `gstack-upgrade\u002Fmigrations\u002F`. Each is named\n`v{VERSION}.sh` and runs only when upgrading from an older version. See CONTRIBUTING.md\nfor how to add new migrations.\n\n### Step 5: Write marker + clear cache\n\n```bash\nmkdir -p ~\u002F.gstack\necho \"$OLD_VERSION\" > ~\u002F.gstack\u002Fjust-upgraded-from\nrm -f ~\u002F.gstack\u002Flast-update-check\nrm -f ~\u002F.gstack\u002Fupdate-snoozed\n```\n\n### Step 6: Show What's New\n\nRead `$INSTALL_DIR\u002FCHANGELOG.md`. Find all version entries between the old version and the new version. Summarize as 5-7 bullets grouped by theme. Don't overwhelm — focus on user-facing changes. Skip internal refactors unless they're significant.\n\nFormat:\n```\ngstack v{new} — upgraded from v{old}!\n\nWhat's new:\n- [bullet 1]\n- [bullet 2]\n- ...\n\nHappy shipping!\n```\n\n### Step 7: Continue\n\nAfter showing What's New, continue with whatever skill the user originally invoked. The upgrade is done — no further action needed.\n\n---\n\n## Standalone usage\n\nWhen invoked directly as `\u002Fgstack-upgrade` (not from a preamble):\n\n1. Force a fresh update check (bypass cache):\n```bash\n~\u002F.claude\u002Fskills\u002Fgstack\u002Fbin\u002Fgstack-update-check --force 2>\u002Fdev\u002Fnull || \\\n.claude\u002Fskills\u002Fgstack\u002Fbin\u002Fgstack-update-check --force 2>\u002Fdev\u002Fnull || true\n```\nUse the output to determine if an upgrade is available.\n\n2. If `UPGRADE_AVAILABLE \u003Cold> \u003Cnew>`: follow Steps 2-6 above.\n\n3. If no output (primary is up to date): check for a stale local vendored copy.\n\nRun the Step 2 bash block above to detect the primary install type and directory (`INSTALL_TYPE` and `INSTALL_DIR`). Then run the Step 4.5 detection bash block above to check for a local vendored copy (`LOCAL_GSTACK`) and team mode status (`TEAM_MODE`).\n\n**If `LOCAL_GSTACK` is empty** (no local vendored copy): tell the user \"You're already on the latest version (v{version}).\"\n\n**If `LOCAL_GSTACK` is non-empty AND `TEAM_MODE` is `true`:** Remove the vendored copy using the Step 4.5 team-mode removal bash block above. Tell user: \"Global v{version} is up to date. Removed stale vendored copy (team mode active). Commit the `.gitignore` change when ready.\"\n\n**If `LOCAL_GSTACK` is non-empty AND `TEAM_MODE` is NOT `true`**, compare versions:\n```bash\nPRIMARY_VER=$(cat \"$INSTALL_DIR\u002FVERSION\" 2>\u002Fdev\u002Fnull || echo \"unknown\")\nLOCAL_VER=$(cat \"$LOCAL_GSTACK\u002FVERSION\" 2>\u002Fdev\u002Fnull || echo \"unknown\")\necho \"PRIMARY=$PRIMARY_VER LOCAL=$LOCAL_VER\"\n```\n\n**If versions differ:** follow the Step 4.5 sync bash block above to update the local copy from the primary. Tell user: \"Global v{PRIMARY_VER} is up to date. Updated local vendored copy from v{LOCAL_VER} → v{PRIMARY_VER}. Commit `.claude\u002Fskills\u002Fgstack\u002F` when you're ready.\"\n\n**If versions match:** tell the user \"You're on the latest version (v{PRIMARY_VER}). Global and local vendored copy are both up to date.\"\n",{"name":5,"version":23,"triggers":24,"description":28,"allowed-tools":29},"1.1.0",[25,26,27],"upgrade gstack","update gstack version","get latest gstack","Upgrade gstack to the latest version. Detects global vs vendored install,\nruns the upgrade, and shows what's new. Use when asked to \"upgrade gstack\",\n\"update gstack\", or \"get latest version\".\nVoice triggers (speech-to-text aliases): \"upgrade the tools\", \"update the tools\", \"gee stack upgrade\", \"g stack upgrade\".\n",[30,31,32,33],"Bash","Read","Write","AskUserQuestion","main","f37de8f681f0c0ca0e0ebab6e5fddf764ca7553d","skills\u002Fgstack-upgrade",1,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one","https:\u002F\u002Fagisota.github.io\u002Fold-one\u002F","https:\u002F\u002Fgithub.com\u002Fagisota","pzd.world","2026-07-04 22:32:06",{"source":8,"skillName":5,"commands":44,"prompt":54,"zipAvailable":55},[45,48,51],{"tool":46,"command":47},"npx","npx skills add agisota\u002Fold-one --skill gstack-upgrade",{"tool":49,"command":50},"bunx","bunx skills add agisota\u002Fold-one --skill gstack-upgrade",{"tool":52,"command":53},"pnpm","pnpm dlx skills add agisota\u002Fold-one --skill gstack-upgrade","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fgstack-upgrade\u002FSKILL.md",true,[57,63,67,71,75],{"path":58,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":61,"sourceHtmlUrl":62},"migrations\u002Fv0.15.2.0.sh","SCRIPT","脚本",854,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fgstack-upgrade\u002Fmigrations\u002Fv0.15.2.0.sh",{"path":64,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":65,"sourceHtmlUrl":66},"migrations\u002Fv0.16.2.0.sh",2382,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fgstack-upgrade\u002Fmigrations\u002Fv0.16.2.0.sh",{"path":68,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":69,"sourceHtmlUrl":70},"migrations\u002Fv1.0.0.0.sh",1625,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fgstack-upgrade\u002Fmigrations\u002Fv1.0.0.0.sh",{"path":72,"resourceType":59,"resourceTypeDesc":60,"sizeBytes":73,"sourceHtmlUrl":74},"migrations\u002Fv1.1.3.0.sh",6020,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fgstack-upgrade\u002Fmigrations\u002Fv1.1.3.0.sh",{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"SKILL.md.tmpl","OTHER","其他",10667,"https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fgstack-upgrade\u002FSKILL.md.tmpl",[82,89,96,105,112,119],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":18},"01M75KRGZWQWE9JDBS6RX42NWV","zoom-out","Tell the agent to zoom out and give broader context or a higher-level perspective. Use when you're unfamiliar with a section of code or need to understand how it fits into the bigger picture.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fzoom-out\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":18},"01M75KRCZHKE0ZYAQFFYHS0YNP","zeroize-audit","Detects missing zeroization of sensitive data in source code and identifies zeroization removed by compiler optimizations, with assembly-level analysis, and control-flow verification. Use for auditing C\u002FC++\u002FRust code handling secrets, keys, passwords, or other sensitive data.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fzeroize-audit\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":100,"licenseFileUrl":101,"sourceHtmlUrl":102,"categories":103,"keywords":104,"publishedAt":18},"01M75KR94KYQ30DTE1P9WNDAE0","yeet","Use only when the user explicitly asks to stage, commit, push, and open a GitHub pull request in one flow using the GitHub CLI (`gh`).","Apache-2.0","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fyeet\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fyeet\u002FSKILL.md",[],[],{"skillNo":106,"name":107,"nameZh":6,"description":108,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":109,"categories":110,"keywords":111,"publishedAt":18},"01M75KR3H13YJ9QHMD49818FA1","yara-rule-authoring","Guides authoring of high-quality YARA-X detection rules for malware identification. Use when writing, reviewing, or optimizing YARA rules. Covers naming conventions, string selection, performance optimization, migration from legacy YARA, and false positive reduction. Triggers on: YARA, YARA-X, malware detection, threat hunting, IOC, signature, crx module, dex module.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fyara-rule-authoring\u002FSKILL.md",[],[],{"skillNo":113,"name":114,"nameZh":6,"description":115,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":116,"categories":117,"keywords":118,"publishedAt":18},"01M75KQMPY8A4Y8XTDD2DT0M9T","x-twitter-growth","X\u002FTwitter growth engine for building audience, crafting viral content, and analyzing engagement. Use when the user wants to grow on X\u002FTwitter, write tweets or threads, analyze their X profile, research competitors on X, plan a posting strategy, or optimize engagement. Complements social-content (generic multi-platform) with X-specific depth: algorithm mechanics, thread engineering, reply strategy, profile optimization, and competitive intelligence via web search.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fx-twitter-growth\u002FSKILL.md",[],[],{"skillNo":120,"name":121,"nameZh":6,"description":122,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":18},"01M75KQHNZ0ANZNJGZY6M8MDAK","x-api","X\u002FTwitter API integration for posting tweets, threads, reading timelines, search, and analytics. Covers OAuth auth patterns, rate limits, and platform-native content posting. Use when the user wants to interact with X programmatically.","https:\u002F\u002Fgithub.com\u002Fagisota\u002Fold-one\u002Fblob\u002Fmain\u002Fskills\u002Fx-api\u002FSKILL.md",[],[]]