[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7E63P7VV2EPPDWFH6JR4Z0Y":3,"skill-same:01M7E63P7VV2EPPDWFH6JR4Z0Y":122},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":34,"commitSha":35,"skillDirectory":5,"forksCount":14,"repositoryHtmlUrl":36,"repositoryHomepageUrl":6,"ownerHtmlUrl":37,"ownerBlogUrl":38,"ownerDescription":6,"updatedAt":39,"install":40,"resources":53},"01M7E63P7VV2EPPDWFH6JR4Z0Y","gstack-upgrade",null,"Upgrade gstack to the latest version.","mike7418\u002FGstack-Healthcare","mike7418","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F17167114?v=4","01M7E5Y064PTP3PT0M1Z9DTY7W","Mike Parks","01M7E5Y076SG1ZBEATHQ5P4SER",0,"MIT","https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Fgstack-upgrade\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: gstack-upgrade\nversion: 1.1.0\ndescription: Upgrade gstack to the latest version.\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\n## When to invoke this skill\n\nDetects 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\".\n\nVoice triggers (speech-to-text aliases): \"upgrade the tools\", \"update the tools\", \"gee stack upgrade\", \"g stack upgrade\".\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. On setup failure, follow Step 4's install-specific recovery: vendored installs restore their backup; git installs stop with the pre-upgrade commit recorded, without a destructive reset. Never claim restoration unless it actually succeeded.\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\nGSTACK_STATE_ROOT=$(~\u002F.claude\u002Fskills\u002Fgstack\u002Fbin\u002Fgstack-paths --get GSTACK_STATE_ROOT); : \"${GSTACK_STATE_ROOT:?gstack-paths failed; reinstall with .\u002Fsetup or \u002Fgstack-upgrade}\"\n_SNOOZE_FILE=\"$GSTACK_STATE_ROOT\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\"\nelif _SRC=$(~\u002F.claude\u002Fskills\u002Fgstack\u002Fbin\u002Fgstack-paths --get GSTACK_STATE_ROOT 2>\u002Fdev\u002Fnull) && _SRC=$(awk -F '\\t' '$(1) == \"claude\" && $(6) != \"-\" { print $(6); exit }' \"$_SRC\u002Finstalls.tsv\" 2>\u002Fdev\u002Fnull) && [ -d \"$_SRC\u002F.git\" ]; then\n  # The install registry names the checkout setup activated for this host (e.g. a ~\u002Fgstack clone).\n  INSTALL_TYPE=\"global-git\"\n  INSTALL_DIR=\"$_SRC\"\nelse\n  echo \"ERROR: gstack not found\"\n  exit 1\nfi\nINSTALL_DIR=$(cd -- \"$INSTALL_DIR\" && pwd -P) || { echo \"ERROR: cannot enter the gstack install directory\" >&2; exit 1; }\necho \"Install type: $INSTALL_TYPE at $INSTALL_DIR\"\n```\n\nThe install type and the absolute directory printed above are used in all subsequent steps.\nCarry `INSTALL_TYPE`, `INSTALL_DIR`, `OLD_VERSION`, and later `NEW_VERSION` forward explicitly: tool calls may run in fresh shells, so start each later block by assigning them from the captured output (for example `INSTALL_DIR=\u002Fabs\u002Fpath\u002Fprinted\u002Fabove`). Do not rely on a prior call's working directory or shell variables. Every block that changes files first checks `INSTALL_DIR` and stops before any git command when it is unset, empty, missing, unreadable, or not gstack's own checkout.\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:?INSTALL_DIR is not set: re-run Step 2 and substitute the printed path}\u002FVERSION\" 2>\u002Fdev\u002Fnull || echo \"unknown\")\necho \"OLD_VERSION=$OLD_VERSION\"\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\nFast-forward first — the same policy the session-update auto-upgrade\nuses. `--autostash` carries local edits over the pull; render-footprint dirt\nis discarded first because it is regenerable and poisons stashes:\n```bash\ncd -- \"${INSTALL_DIR:?INSTALL_DIR is not set: re-run Step 2 and substitute the printed path}\" || exit 1\n{ [ -f VERSION ] && [ -f setup ] && [ -f bin\u002Fgstack-config ] && [ \"$(git rev-parse --show-toplevel 2>\u002Fdev\u002Fnull)\" = \"$(pwd -P)\" ]; } || { echo \"ERROR: $INSTALL_DIR is not a gstack checkout; nothing was changed. Re-run Step 2.\" >&2; exit 1; }\n# Discard render-footprint dirt: older gbrain-enabled installs rendered\n# generated SKILL.md \u002F sections files IN PLACE. They are regenerable (setup\n# re-renders to ~\u002F.gstack\u002Frender), so discarding is lossless.\ngit checkout -- 'SKILL.md' '*\u002FSKILL.md' '*\u002Fsections\u002F*.md' 2>\u002Fdev\u002Fnull || true\ngit fetch origin\nPRE_UPGRADE_COMMIT=$(git rev-parse HEAD)\necho \"PRE_UPGRADE_COMMIT=$PRE_UPGRADE_COMMIT\"\nif git pull --ff-only --autostash origin main; then\n  if .\u002Fsetup --refresh-registered; then echo \"FF_OK\"; else echo \"SETUP_FAILED: git update succeeded; stop and inspect setup output (previous commit: $PRE_UPGRADE_COMMIT)\" >&2; exit 1; fi\nelse\n  echo \"FF_REFUSED\"\nfi\n```\n\nSetup's `--refresh-registered` refreshes every install this checkout\nregistered (each host, global and this project's), prints the source first,\nand ends with an `Upgrade summary` of one row per install. Relay those rows\nas printed. A `failed` row means that host kept its previous install; give\nits retry command and never say every host was refreshed. A `skipped` row\nbelongs to another checkout or project; pass on its command, do not run it.\n\nIf the output ends with `FF_OK`, the upgrade is done — skip the fallback\nbelow entirely.\nOn `SETUP_FAILED`, STOP; keep user changes and report the recovery commit. There is no `.bak` on the git path. Do not enter the divergence fallback merely because setup failed. Enter it only on `FF_REFUSED`, after inspecting the pull error; network\u002Fauth failures stop for repair, not reset.\n\n**Fallback (ff-only refused — local commits or divergence).** `git reset\n--hard` DESTROYS things: a clean tree with unpushed local commits still loses\nthose commits. Gate it:\n\n1. Run `git status --porcelain` and `git rev-list origin\u002Fmain..HEAD --oneline`\n   in `$INSTALL_DIR`.\n2. If BOTH are empty, the reset is provably safe — run the fallback block\n   below without asking.\n3. Otherwise ask via AskUserQuestion (one-way door — destructive), listing\n   exactly what will be discarded: each dirty file and each unpushed commit\n   by hash + subject. Options: **A)** Discard them and upgrade (reset) —\n   requires the explicit letter; **B)** Abort the upgrade so the user can\n   rescue their work first (recommended when local commits exist). Never\n   proceed on a vague reply.\n\n```bash\ncd -- \"${INSTALL_DIR:?INSTALL_DIR is not set: re-run Step 2 and substitute the printed path}\" || exit 1\n{ [ -f VERSION ] && [ -f setup ] && [ -f bin\u002Fgstack-config ] && [ \"$(git rev-parse --show-toplevel 2>\u002Fdev\u002Fnull)\" = \"$(pwd -P)\" ]; } || { echo \"ERROR: $INSTALL_DIR is not a gstack checkout; nothing was changed. Re-run Step 2.\" >&2; exit 1; }\nSTASH_OUTPUT=$(git stash 2>&1)\ngit reset --hard origin\u002Fmain\n.\u002Fsetup --refresh-registered\n```\nIf `$STASH_OUTPUT` contains \"Saved working directory\", warn the user: \"Note: local changes were stashed (any modified generated SKILL.md\u002Fsections files were discarded first — they regenerate on setup). Run `git stash pop` in the skill directory to restore your own changes.\"\n\n**For vendored installs** (vendored, vendored-global):\n```bash\n(cd -- \"${INSTALL_DIR:?INSTALL_DIR is not set: re-run Step 2 and substitute the printed path}\" && [ -f VERSION ] && [ -f setup ] && [ -f bin\u002Fgstack-config ]) || { echo \"ERROR: INSTALL_DIR=${INSTALL_DIR:-} is not a gstack install; nothing was changed. Re-run Step 2.\" >&2; exit 1; }\n# A stale .bak from a previously crashed upgrade would make the mv below NEST\n# the live install inside it and the failure-restore arm would \"restore\" the\n# stale backup. It may also be the only good copy from that crashed run —\n# abort and let the human inspect, never delete it silently.\n[ -e \"$INSTALL_DIR.bak\" ] && { echo \"ERROR: stale backup exists at $INSTALL_DIR.bak (from a previous failed upgrade?) — inspect it, salvage\u002Fremove it, then re-run.\" >&2; exit 1; }\nTMP_DIR=$(mktemp -d \"${TMPDIR:-\u002Ftmp}\u002Fgstack-upgrade.XXXXXX\") || { echo \"ERROR: mktemp failed — aborting upgrade (install untouched).\" >&2; exit 1; }\ngit clone --depth 1 https:\u002F\u002Fgithub.com\u002Fgarrytan\u002Fgstack.git \"$TMP_DIR\u002Fgstack\" || { echo \"ERROR: clone failed — aborting upgrade (install untouched).\" >&2; rm -rf \"$TMP_DIR\"; exit 1; }\nmv \"$INSTALL_DIR\" \"$INSTALL_DIR.bak\" || { rm -rf \"$TMP_DIR\"; exit 1; }\nif mv \"$TMP_DIR\u002Fgstack\" \"$INSTALL_DIR\"; then\n  if (cd \"$INSTALL_DIR\" && .\u002Fsetup --refresh-registered); then\n    rm -rf \"$INSTALL_DIR.bak\" \"$TMP_DIR\"\n  else\n    rm -rf \"$INSTALL_DIR\"\n    mv \"$INSTALL_DIR.bak\" \"$INSTALL_DIR\" || { echo \"ERROR: restore failed; backup retained.\" >&2; exit 1; }\n    rm -rf \"$TMP_DIR\"\n    echo \"ERROR: setup failed; previous install restored.\" >&2\n    exit 1\n  fi\nelse\n  mv \"$INSTALL_DIR.bak\" \"$INSTALL_DIR\"\n  echo \"ERROR: swap failed — previous install restored; upgrade aborted.\" >&2\n  rm -rf \"$TMP_DIR\"\n  exit 1\nfi\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_RESOLVED_PRIMARY=$(cd -- \"${INSTALL_DIR:?INSTALL_DIR is not set: re-run Step 2 and substitute the printed path}\" && pwd -P) || exit 1\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  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\n(cd -- \"${LOCAL_GSTACK:?LOCAL_GSTACK is not set: re-run the detection block above and substitute the printed path}\" && [ -f VERSION ] && [ -f setup ] && [ -f bin\u002Fgstack-config ]) || { echo \"ERROR: LOCAL_GSTACK=${LOCAL_GSTACK:-} is not a gstack copy; nothing was changed.\" >&2; exit 1; }\n_ROOT=${LOCAL_GSTACK%\u002F.claude\u002Fskills\u002Fgstack}\n{ [ \"$_ROOT\" != \"$LOCAL_GSTACK\" ] && cd -- \"${_ROOT:?}\" && [ \"$(git rev-parse --show-toplevel 2>\u002Fdev\u002Fnull)\" = \"$(pwd -P)\" ]; } || { echo \"ERROR: $LOCAL_GSTACK is not the vendored copy at the root of a git repository; nothing was changed.\" >&2; exit 1; }\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\n(cd -- \"${INSTALL_DIR:?INSTALL_DIR is not set: re-run Step 2 and substitute the printed path}\" && [ -f VERSION ] && [ -f setup ] && [ -f bin\u002Fgstack-config ]) || { echo \"ERROR: INSTALL_DIR=${INSTALL_DIR:-} is not a gstack install; nothing was changed.\" >&2; exit 1; }\n(cd -- \"${LOCAL_GSTACK:?LOCAL_GSTACK is not set: re-run the detection block above and substitute the printed path}\" && [ -f VERSION ] && [ -f setup ] && [ -f bin\u002Fgstack-config ]) || { echo \"ERROR: LOCAL_GSTACK=${LOCAL_GSTACK:-} is not a gstack copy; nothing was changed.\" >&2; exit 1; }\n[ -e \"$LOCAL_GSTACK.bak\" ] && { echo \"ERROR: stale vendored backup; inspect it before retrying.\" >&2; exit 1; }\nmv \"$LOCAL_GSTACK\" \"$LOCAL_GSTACK.bak\" || exit 1\nif cp -Rf \"$INSTALL_DIR\" \"$LOCAL_GSTACK\" && rm -rf \"$LOCAL_GSTACK\u002F.git\" && (cd \"$LOCAL_GSTACK\" && .\u002Fsetup --refresh-registered); then\n  rm -rf \"$LOCAL_GSTACK.bak\"\n  echo \"LOCAL_SYNC_OK\"\nelse\n  rm -rf \"$LOCAL_GSTACK\"\n  mv \"$LOCAL_GSTACK.bak\" \"$LOCAL_GSTACK\" || { echo \"ERROR: restore failed; backup retained.\" >&2; exit 1; }\n  echo \"ERROR: sync failed; previous vendored copy restored.\" >&2\n  exit 1\nfi\n```\nOnly on `LOCAL_SYNC_OK`, tell user: \"Also updated vendored copy at `$LOCAL_GSTACK` — commit `.claude\u002Fskills\u002Fgstack\u002F` when you're ready.\" Otherwise stop and report the recovery outcome; do not continue migrations or announce success.\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:?INSTALL_DIR is not set: re-run Step 2 and substitute the printed path}\u002Fgstack-upgrade\u002Fmigrations\"\n: \"${OLD_VERSION:?OLD_VERSION is not set: substitute the value Step 3 printed}\"\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      # GSTACK_INSTALL_DIR: migrations that clean the INSTALL (not just\n      # ~\u002F.gstack state) default to ~\u002F.claude\u002Fskills\u002Fgstack when unset —\n      # a repo-local install would silently no-op without this.\n      GSTACK_INSTALL_DIR=\"$INSTALL_DIR\" 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 4.8: Stop any stale daemon (unconditional)\n\nA browse daemon started before the upgrade keeps serving the OLD binary's code\nuntil it is stopped — it survives `git reset --hard` and `.\u002Fsetup` because the\nrunning process holds the old executable. Always run this step, using\nthe install directory detected in Step 2.\n\n```bash\nINSTALL_DIR_PLACEHOLDER=\"\u003Cinstall dir from Step 2>\"\nNEW_HASH=$(cat \"$INSTALL_DIR_PLACEHOLDER\u002Fbrowse\u002Fdist\u002F.version\" 2>\u002Fdev\u002Fnull || echo \"\")\n_STATE_FILE=\"${BROWSE_STATE_FILE:-$(git rev-parse --show-toplevel 2>\u002Fdev\u002Fnull || pwd)\u002F.gstack\u002Fbrowse.json}\"\nif [ -z \"$NEW_HASH\" ] || [ ! -f \"$_STATE_FILE\" ]; then\n  echo \"DAEMON_CHECK=none (no state file or no fresh build hash)\"\nelse\n  DAEMON_PID=$(sed -n 's\u002F.*\"pid\"[[:space:]]*:[[:space:]]*\\([0-9][0-9]*\\).*\u002F\\1\u002Fp' \"$_STATE_FILE\" | head -1)\n  DAEMON_PORT=$(sed -n 's\u002F.*\"port\"[[:space:]]*:[[:space:]]*\\([0-9][0-9]*\\).*\u002F\\1\u002Fp' \"$_STATE_FILE\" | head -1)\n  OLD_HASH=$(sed -n 's\u002F.*\"binaryVersion\"[[:space:]]*:[[:space:]]*\"\\([^\"]*\\)\".*\u002F\\1\u002Fp' \"$_STATE_FILE\" | head -1)\n  if [ -z \"$DAEMON_PID\" ] || ! kill -0 \"$DAEMON_PID\" 2>\u002Fdev\u002Fnull; then\n    echo \"DAEMON_CHECK=dead (no live daemon to stop)\"\n  elif [ \"$OLD_HASH\" = \"$NEW_HASH\" ]; then\n    echo \"DAEMON_CHECK=current (daemon already runs the new binary)\"\n  elif curl -fsS --max-time 2 \"http:\u002F\u002F127.0.0.1:$DAEMON_PORT\u002Fhealth\" 2>\u002Fdev\u002Fnull | grep -q '\"status\":\"healthy\"'; then\n    echo \"DAEMON_CHECK=stale-responsive pid=$DAEMON_PID hash=${OLD_HASH:-unknown} -> $NEW_HASH\"\n    \"$INSTALL_DIR_PLACEHOLDER\u002Fbrowse\u002Fdist\u002Fbrowse\" stop && echo \"DAEMON_STOPPED=yes\"\n  else\n    echo \"DAEMON_CHECK=stale-busy pid=$DAEMON_PID hash=${OLD_HASH:-unknown} -> $NEW_HASH\"\n  fi\nfi\n```\n\nReplace `\u003Cinstall dir from Step 2>` with the actual install directory before\nrunning. Interpret the `DAEMON_CHECK` result:\n\n1. **`stale-responsive` + `DAEMON_STOPPED=yes`:** Tell the user \"Stopped the\n   old browse daemon (binary {OLD_HASH} → {NEW_HASH}). The next browse command\n   starts a fresh daemon on the new binary.\"\n2. **`stale-busy`:** The daemon runs the old binary but is mid-work — DEFER to\n   it, never kill a busy daemon during upgrade. Tell the user: \"A browse daemon\n   is still running the pre-upgrade binary ({OLD_HASH} → {NEW_HASH}) but is\n   busy right now. When it finishes, stop it with `browse stop` — or force it\n   immediately with `browse --force-restart stop` (loses that session's\n   tabs\u002Fcookies\u002Flogins).\"\n3. **`none` \u002F `dead` \u002F `current`:** Nothing to do — say nothing.\n\n### Step 5: Write marker + clear cache\n\n```bash\nGSTACK_STATE_ROOT=$(~\u002F.claude\u002Fskills\u002Fgstack\u002Fbin\u002Fgstack-paths --get GSTACK_STATE_ROOT); : \"${GSTACK_STATE_ROOT:?gstack-paths failed; reinstall with .\u002Fsetup or \u002Fgstack-upgrade}\"\nmkdir -p \"$GSTACK_STATE_ROOT\"\necho \"$OLD_VERSION\" > \"$GSTACK_STATE_ROOT\"\u002Fjust-upgraded-from\nrm -f \"$GSTACK_STATE_ROOT\"\u002Flast-update-check\nrm -f \"$GSTACK_STATE_ROOT\"\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\n   If `CHECK_FAILED ...`: the remote version could not be read, so the update\n   status is unknown. Show the line (it names the URL that failed) and tell the\n   user the check failed; never report \"already on the latest version\". Stop.\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:?INSTALL_DIR is not set: re-run Step 2 and substitute the printed path}\u002FVERSION\" 2>\u002Fdev\u002Fnull || echo \"unknown\")\nLOCAL_VER=$(cat \"${LOCAL_GSTACK:?LOCAL_GSTACK is not set: re-run the Step 4.5 detection block}\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\n## When to invoke this skill\n\nDetects 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\".\n\nVoice triggers (speech-to-text aliases): \"upgrade the tools\", \"update the tools\", \"gee stack upgrade\", \"g stack upgrade\".\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. On setup failure, follow Step 4's install-specific recovery: vendored installs restore their backup; git installs stop with the pre-upgrade commit recorded, without a destructive reset. Never claim restoration unless it actually succeeded.\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\nGSTACK_STATE_ROOT=$(~\u002F.claude\u002Fskills\u002Fgstack\u002Fbin\u002Fgstack-paths --get GSTACK_STATE_ROOT); : \"${GSTACK_STATE_ROOT:?gstack-paths failed; reinstall with .\u002Fsetup or \u002Fgstack-upgrade}\"\n_SNOOZE_FILE=\"$GSTACK_STATE_ROOT\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\"\nelif _SRC=$(~\u002F.claude\u002Fskills\u002Fgstack\u002Fbin\u002Fgstack-paths --get GSTACK_STATE_ROOT 2>\u002Fdev\u002Fnull) && _SRC=$(awk -F '\\t' '$(1) == \"claude\" && $(6) != \"-\" { print $(6); exit }' \"$_SRC\u002Finstalls.tsv\" 2>\u002Fdev\u002Fnull) && [ -d \"$_SRC\u002F.git\" ]; then\n  # The install registry names the checkout setup activated for this host (e.g. a ~\u002Fgstack clone).\n  INSTALL_TYPE=\"global-git\"\n  INSTALL_DIR=\"$_SRC\"\nelse\n  echo \"ERROR: gstack not found\"\n  exit 1\nfi\nINSTALL_DIR=$(cd -- \"$INSTALL_DIR\" && pwd -P) || { echo \"ERROR: cannot enter the gstack install directory\" >&2; exit 1; }\necho \"Install type: $INSTALL_TYPE at $INSTALL_DIR\"\n```\n\nThe install type and the absolute directory printed above are used in all subsequent steps.\nCarry `INSTALL_TYPE`, `INSTALL_DIR`, `OLD_VERSION`, and later `NEW_VERSION` forward explicitly: tool calls may run in fresh shells, so start each later block by assigning them from the captured output (for example `INSTALL_DIR=\u002Fabs\u002Fpath\u002Fprinted\u002Fabove`). Do not rely on a prior call's working directory or shell variables. Every block that changes files first checks `INSTALL_DIR` and stops before any git command when it is unset, empty, missing, unreadable, or not gstack's own checkout.\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:?INSTALL_DIR is not set: re-run Step 2 and substitute the printed path}\u002FVERSION\" 2>\u002Fdev\u002Fnull || echo \"unknown\")\necho \"OLD_VERSION=$OLD_VERSION\"\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\nFast-forward first — the same policy the session-update auto-upgrade\nuses. `--autostash` carries local edits over the pull; render-footprint dirt\nis discarded first because it is regenerable and poisons stashes:\n```bash\ncd -- \"${INSTALL_DIR:?INSTALL_DIR is not set: re-run Step 2 and substitute the printed path}\" || exit 1\n{ [ -f VERSION ] && [ -f setup ] && [ -f bin\u002Fgstack-config ] && [ \"$(git rev-parse --show-toplevel 2>\u002Fdev\u002Fnull)\" = \"$(pwd -P)\" ]; } || { echo \"ERROR: $INSTALL_DIR is not a gstack checkout; nothing was changed. Re-run Step 2.\" >&2; exit 1; }\n# Discard render-footprint dirt: older gbrain-enabled installs rendered\n# generated SKILL.md \u002F sections files IN PLACE. They are regenerable (setup\n# re-renders to ~\u002F.gstack\u002Frender), so discarding is lossless.\ngit checkout -- 'SKILL.md' '*\u002FSKILL.md' '*\u002Fsections\u002F*.md' 2>\u002Fdev\u002Fnull || true\ngit fetch origin\nPRE_UPGRADE_COMMIT=$(git rev-parse HEAD)\necho \"PRE_UPGRADE_COMMIT=$PRE_UPGRADE_COMMIT\"\nif git pull --ff-only --autostash origin main; then\n  if .\u002Fsetup --refresh-registered; then echo \"FF_OK\"; else echo \"SETUP_FAILED: git update succeeded; stop and inspect setup output (previous commit: $PRE_UPGRADE_COMMIT)\" >&2; exit 1; fi\nelse\n  echo \"FF_REFUSED\"\nfi\n```\n\nSetup's `--refresh-registered` refreshes every install this checkout\nregistered (each host, global and this project's), prints the source first,\nand ends with an `Upgrade summary` of one row per install. Relay those rows\nas printed. A `failed` row means that host kept its previous install; give\nits retry command and never say every host was refreshed. A `skipped` row\nbelongs to another checkout or project; pass on its command, do not run it.\n\nIf the output ends with `FF_OK`, the upgrade is done — skip the fallback\nbelow entirely.\nOn `SETUP_FAILED`, STOP; keep user changes and report the recovery commit. There is no `.bak` on the git path. Do not enter the divergence fallback merely because setup failed. Enter it only on `FF_REFUSED`, after inspecting the pull error; network\u002Fauth failures stop for repair, not reset.\n\n**Fallback (ff-only refused — local commits or divergence).** `git reset\n--hard` DESTROYS things: a clean tree with unpushed local commits still loses\nthose commits. Gate it:\n\n1. Run `git status --porcelain` and `git rev-list origin\u002Fmain..HEAD --oneline`\n   in `$INSTALL_DIR`.\n2. If BOTH are empty, the reset is provably safe — run the fallback block\n   below without asking.\n3. Otherwise ask via AskUserQuestion (one-way door — destructive), listing\n   exactly what will be discarded: each dirty file and each unpushed commit\n   by hash + subject. Options: **A)** Discard them and upgrade (reset) —\n   requires the explicit letter; **B)** Abort the upgrade so the user can\n   rescue their work first (recommended when local commits exist). Never\n   proceed on a vague reply.\n\n```bash\ncd -- \"${INSTALL_DIR:?INSTALL_DIR is not set: re-run Step 2 and substitute the printed path}\" || exit 1\n{ [ -f VERSION ] && [ -f setup ] && [ -f bin\u002Fgstack-config ] && [ \"$(git rev-parse --show-toplevel 2>\u002Fdev\u002Fnull)\" = \"$(pwd -P)\" ]; } || { echo \"ERROR: $INSTALL_DIR is not a gstack checkout; nothing was changed. Re-run Step 2.\" >&2; exit 1; }\nSTASH_OUTPUT=$(git stash 2>&1)\ngit reset --hard origin\u002Fmain\n.\u002Fsetup --refresh-registered\n```\nIf `$STASH_OUTPUT` contains \"Saved working directory\", warn the user: \"Note: local changes were stashed (any modified generated SKILL.md\u002Fsections files were discarded first — they regenerate on setup). Run `git stash pop` in the skill directory to restore your own changes.\"\n\n**For vendored installs** (vendored, vendored-global):\n```bash\n(cd -- \"${INSTALL_DIR:?INSTALL_DIR is not set: re-run Step 2 and substitute the printed path}\" && [ -f VERSION ] && [ -f setup ] && [ -f bin\u002Fgstack-config ]) || { echo \"ERROR: INSTALL_DIR=${INSTALL_DIR:-} is not a gstack install; nothing was changed. Re-run Step 2.\" >&2; exit 1; }\n# A stale .bak from a previously crashed upgrade would make the mv below NEST\n# the live install inside it and the failure-restore arm would \"restore\" the\n# stale backup. It may also be the only good copy from that crashed run —\n# abort and let the human inspect, never delete it silently.\n[ -e \"$INSTALL_DIR.bak\" ] && { echo \"ERROR: stale backup exists at $INSTALL_DIR.bak (from a previous failed upgrade?) — inspect it, salvage\u002Fremove it, then re-run.\" >&2; exit 1; }\nTMP_DIR=$(mktemp -d \"${TMPDIR:-\u002Ftmp}\u002Fgstack-upgrade.XXXXXX\") || { echo \"ERROR: mktemp failed — aborting upgrade (install untouched).\" >&2; exit 1; }\ngit clone --depth 1 https:\u002F\u002Fgithub.com\u002Fgarrytan\u002Fgstack.git \"$TMP_DIR\u002Fgstack\" || { echo \"ERROR: clone failed — aborting upgrade (install untouched).\" >&2; rm -rf \"$TMP_DIR\"; exit 1; }\nmv \"$INSTALL_DIR\" \"$INSTALL_DIR.bak\" || { rm -rf \"$TMP_DIR\"; exit 1; }\nif mv \"$TMP_DIR\u002Fgstack\" \"$INSTALL_DIR\"; then\n  if (cd \"$INSTALL_DIR\" && .\u002Fsetup --refresh-registered); then\n    rm -rf \"$INSTALL_DIR.bak\" \"$TMP_DIR\"\n  else\n    rm -rf \"$INSTALL_DIR\"\n    mv \"$INSTALL_DIR.bak\" \"$INSTALL_DIR\" || { echo \"ERROR: restore failed; backup retained.\" >&2; exit 1; }\n    rm -rf \"$TMP_DIR\"\n    echo \"ERROR: setup failed; previous install restored.\" >&2\n    exit 1\n  fi\nelse\n  mv \"$INSTALL_DIR.bak\" \"$INSTALL_DIR\"\n  echo \"ERROR: swap failed — previous install restored; upgrade aborted.\" >&2\n  rm -rf \"$TMP_DIR\"\n  exit 1\nfi\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_RESOLVED_PRIMARY=$(cd -- \"${INSTALL_DIR:?INSTALL_DIR is not set: re-run Step 2 and substitute the printed path}\" && pwd -P) || exit 1\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  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\n(cd -- \"${LOCAL_GSTACK:?LOCAL_GSTACK is not set: re-run the detection block above and substitute the printed path}\" && [ -f VERSION ] && [ -f setup ] && [ -f bin\u002Fgstack-config ]) || { echo \"ERROR: LOCAL_GSTACK=${LOCAL_GSTACK:-} is not a gstack copy; nothing was changed.\" >&2; exit 1; }\n_ROOT=${LOCAL_GSTACK%\u002F.claude\u002Fskills\u002Fgstack}\n{ [ \"$_ROOT\" != \"$LOCAL_GSTACK\" ] && cd -- \"${_ROOT:?}\" && [ \"$(git rev-parse --show-toplevel 2>\u002Fdev\u002Fnull)\" = \"$(pwd -P)\" ]; } || { echo \"ERROR: $LOCAL_GSTACK is not the vendored copy at the root of a git repository; nothing was changed.\" >&2; exit 1; }\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\n(cd -- \"${INSTALL_DIR:?INSTALL_DIR is not set: re-run Step 2 and substitute the printed path}\" && [ -f VERSION ] && [ -f setup ] && [ -f bin\u002Fgstack-config ]) || { echo \"ERROR: INSTALL_DIR=${INSTALL_DIR:-} is not a gstack install; nothing was changed.\" >&2; exit 1; }\n(cd -- \"${LOCAL_GSTACK:?LOCAL_GSTACK is not set: re-run the detection block above and substitute the printed path}\" && [ -f VERSION ] && [ -f setup ] && [ -f bin\u002Fgstack-config ]) || { echo \"ERROR: LOCAL_GSTACK=${LOCAL_GSTACK:-} is not a gstack copy; nothing was changed.\" >&2; exit 1; }\n[ -e \"$LOCAL_GSTACK.bak\" ] && { echo \"ERROR: stale vendored backup; inspect it before retrying.\" >&2; exit 1; }\nmv \"$LOCAL_GSTACK\" \"$LOCAL_GSTACK.bak\" || exit 1\nif cp -Rf \"$INSTALL_DIR\" \"$LOCAL_GSTACK\" && rm -rf \"$LOCAL_GSTACK\u002F.git\" && (cd \"$LOCAL_GSTACK\" && .\u002Fsetup --refresh-registered); then\n  rm -rf \"$LOCAL_GSTACK.bak\"\n  echo \"LOCAL_SYNC_OK\"\nelse\n  rm -rf \"$LOCAL_GSTACK\"\n  mv \"$LOCAL_GSTACK.bak\" \"$LOCAL_GSTACK\" || { echo \"ERROR: restore failed; backup retained.\" >&2; exit 1; }\n  echo \"ERROR: sync failed; previous vendored copy restored.\" >&2\n  exit 1\nfi\n```\nOnly on `LOCAL_SYNC_OK`, tell user: \"Also updated vendored copy at `$LOCAL_GSTACK` — commit `.claude\u002Fskills\u002Fgstack\u002F` when you're ready.\" Otherwise stop and report the recovery outcome; do not continue migrations or announce success.\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:?INSTALL_DIR is not set: re-run Step 2 and substitute the printed path}\u002Fgstack-upgrade\u002Fmigrations\"\n: \"${OLD_VERSION:?OLD_VERSION is not set: substitute the value Step 3 printed}\"\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      # GSTACK_INSTALL_DIR: migrations that clean the INSTALL (not just\n      # ~\u002F.gstack state) default to ~\u002F.claude\u002Fskills\u002Fgstack when unset —\n      # a repo-local install would silently no-op without this.\n      GSTACK_INSTALL_DIR=\"$INSTALL_DIR\" 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 4.8: Stop any stale daemon (unconditional)\n\nA browse daemon started before the upgrade keeps serving the OLD binary's code\nuntil it is stopped — it survives `git reset --hard` and `.\u002Fsetup` because the\nrunning process holds the old executable. Always run this step, using\nthe install directory detected in Step 2.\n\n```bash\nINSTALL_DIR_PLACEHOLDER=\"\u003Cinstall dir from Step 2>\"\nNEW_HASH=$(cat \"$INSTALL_DIR_PLACEHOLDER\u002Fbrowse\u002Fdist\u002F.version\" 2>\u002Fdev\u002Fnull || echo \"\")\n_STATE_FILE=\"${BROWSE_STATE_FILE:-$(git rev-parse --show-toplevel 2>\u002Fdev\u002Fnull || pwd)\u002F.gstack\u002Fbrowse.json}\"\nif [ -z \"$NEW_HASH\" ] || [ ! -f \"$_STATE_FILE\" ]; then\n  echo \"DAEMON_CHECK=none (no state file or no fresh build hash)\"\nelse\n  DAEMON_PID=$(sed -n 's\u002F.*\"pid\"[[:space:]]*:[[:space:]]*\\([0-9][0-9]*\\).*\u002F\\1\u002Fp' \"$_STATE_FILE\" | head -1)\n  DAEMON_PORT=$(sed -n 's\u002F.*\"port\"[[:space:]]*:[[:space:]]*\\([0-9][0-9]*\\).*\u002F\\1\u002Fp' \"$_STATE_FILE\" | head -1)\n  OLD_HASH=$(sed -n 's\u002F.*\"binaryVersion\"[[:space:]]*:[[:space:]]*\"\\([^\"]*\\)\".*\u002F\\1\u002Fp' \"$_STATE_FILE\" | head -1)\n  if [ -z \"$DAEMON_PID\" ] || ! kill -0 \"$DAEMON_PID\" 2>\u002Fdev\u002Fnull; then\n    echo \"DAEMON_CHECK=dead (no live daemon to stop)\"\n  elif [ \"$OLD_HASH\" = \"$NEW_HASH\" ]; then\n    echo \"DAEMON_CHECK=current (daemon already runs the new binary)\"\n  elif curl -fsS --max-time 2 \"http:\u002F\u002F127.0.0.1:$DAEMON_PORT\u002Fhealth\" 2>\u002Fdev\u002Fnull | grep -q '\"status\":\"healthy\"'; then\n    echo \"DAEMON_CHECK=stale-responsive pid=$DAEMON_PID hash=${OLD_HASH:-unknown} -> $NEW_HASH\"\n    \"$INSTALL_DIR_PLACEHOLDER\u002Fbrowse\u002Fdist\u002Fbrowse\" stop && echo \"DAEMON_STOPPED=yes\"\n  else\n    echo \"DAEMON_CHECK=stale-busy pid=$DAEMON_PID hash=${OLD_HASH:-unknown} -> $NEW_HASH\"\n  fi\nfi\n```\n\nReplace `\u003Cinstall dir from Step 2>` with the actual install directory before\nrunning. Interpret the `DAEMON_CHECK` result:\n\n1. **`stale-responsive` + `DAEMON_STOPPED=yes`:** Tell the user \"Stopped the\n   old browse daemon (binary {OLD_HASH} → {NEW_HASH}). The next browse command\n   starts a fresh daemon on the new binary.\"\n2. **`stale-busy`:** The daemon runs the old binary but is mid-work — DEFER to\n   it, never kill a busy daemon during upgrade. Tell the user: \"A browse daemon\n   is still running the pre-upgrade binary ({OLD_HASH} → {NEW_HASH}) but is\n   busy right now. When it finishes, stop it with `browse stop` — or force it\n   immediately with `browse --force-restart stop` (loses that session's\n   tabs\u002Fcookies\u002Flogins).\"\n3. **`none` \u002F `dead` \u002F `current`:** Nothing to do — say nothing.\n\n### Step 5: Write marker + clear cache\n\n```bash\nGSTACK_STATE_ROOT=$(~\u002F.claude\u002Fskills\u002Fgstack\u002Fbin\u002Fgstack-paths --get GSTACK_STATE_ROOT); : \"${GSTACK_STATE_ROOT:?gstack-paths failed; reinstall with .\u002Fsetup or \u002Fgstack-upgrade}\"\nmkdir -p \"$GSTACK_STATE_ROOT\"\necho \"$OLD_VERSION\" > \"$GSTACK_STATE_ROOT\"\u002Fjust-upgraded-from\nrm -f \"$GSTACK_STATE_ROOT\"\u002Flast-update-check\nrm -f \"$GSTACK_STATE_ROOT\"\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\n   If `CHECK_FAILED ...`: the remote version could not be read, so the update\n   status is unknown. Show the line (it names the URL that failed) and tell the\n   user the check failed; never report \"already on the latest version\". Stop.\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:?INSTALL_DIR is not set: re-run Step 2 and substitute the printed path}\u002FVERSION\" 2>\u002Fdev\u002Fnull || echo \"unknown\")\nLOCAL_VER=$(cat \"${LOCAL_GSTACK:?LOCAL_GSTACK is not set: re-run the Step 4.5 detection block}\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":24,"triggers":25,"description":7,"allowed-tools":29},"1.1.0",[26,27,28],"upgrade gstack","update gstack version","get latest gstack",[30,31,32,33],"Bash","Read","Write","AskUserQuestion","main","71fdaf2142b5a71850116384ecade47cb5e60009","https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare","https:\u002F\u002Fgithub.com\u002Fmike7418","https:\u002F\u002Fmikeparks.vercel.app\u002F","2026-10-27 01:21:16",{"source":8,"skillName":5,"commands":41,"prompt":51,"zipAvailable":52},[42,45,48],{"tool":43,"command":44},"npx","npx skills add mike7418\u002FGstack-Healthcare --skill gstack-upgrade",{"tool":46,"command":47},"bunx","bunx skills add mike7418\u002FGstack-Healthcare --skill gstack-upgrade",{"tool":49,"command":50},"pnpm","pnpm dlx skills add mike7418\u002FGstack-Healthcare --skill gstack-upgrade","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Fgstack-upgrade\u002FSKILL.md",true,[54,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116],{"path":55,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":58,"sourceHtmlUrl":59},"migrations\u002Fv0.15.2.0.sh","SCRIPT","脚本",854,"https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Fgstack-upgrade\u002Fmigrations\u002Fv0.15.2.0.sh",{"path":61,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":62,"sourceHtmlUrl":63},"migrations\u002Fv0.16.2.0.sh",2773,"https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Fgstack-upgrade\u002Fmigrations\u002Fv0.16.2.0.sh",{"path":65,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":66,"sourceHtmlUrl":67},"migrations\u002Fv1.0.0.0.sh",2016,"https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Fgstack-upgrade\u002Fmigrations\u002Fv1.0.0.0.sh",{"path":69,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":70,"sourceHtmlUrl":71},"migrations\u002Fv1.1.3.0.sh",6020,"https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Fgstack-upgrade\u002Fmigrations\u002Fv1.1.3.0.sh",{"path":73,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":74,"sourceHtmlUrl":75},"migrations\u002Fv1.17.0.0.sh",2544,"https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Fgstack-upgrade\u002Fmigrations\u002Fv1.17.0.0.sh",{"path":77,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":78,"sourceHtmlUrl":79},"migrations\u002Fv1.27.0.0.sh",19199,"https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Fgstack-upgrade\u002Fmigrations\u002Fv1.27.0.0.sh",{"path":81,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":82,"sourceHtmlUrl":83},"migrations\u002Fv1.37.0.0.sh",4703,"https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Fgstack-upgrade\u002Fmigrations\u002Fv1.37.0.0.sh",{"path":85,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":86,"sourceHtmlUrl":87},"migrations\u002Fv1.38.1.0.sh",4082,"https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Fgstack-upgrade\u002Fmigrations\u002Fv1.38.1.0.sh",{"path":89,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":90,"sourceHtmlUrl":91},"migrations\u002Fv1.40.0.0.sh",5900,"https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Fgstack-upgrade\u002Fmigrations\u002Fv1.40.0.0.sh",{"path":93,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":94,"sourceHtmlUrl":95},"migrations\u002Fv1.58.0.0.sh",2857,"https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Fgstack-upgrade\u002Fmigrations\u002Fv1.58.0.0.sh",{"path":97,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":98,"sourceHtmlUrl":99},"migrations\u002Fv1.65.0.0.sh",7822,"https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Fgstack-upgrade\u002Fmigrations\u002Fv1.65.0.0.sh",{"path":101,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":102,"sourceHtmlUrl":103},"migrations\u002Fv1.67.0.0.sh",2865,"https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Fgstack-upgrade\u002Fmigrations\u002Fv1.67.0.0.sh",{"path":105,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":106,"sourceHtmlUrl":107},"migrations\u002Fv1.78.0.0.sh",1531,"https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Fgstack-upgrade\u002Fmigrations\u002Fv1.78.0.0.sh",{"path":109,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":110,"sourceHtmlUrl":111},"migrations\u002Fv1.86.0.0.sh",685,"https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Fgstack-upgrade\u002Fmigrations\u002Fv1.86.0.0.sh",{"path":113,"resourceType":56,"resourceTypeDesc":57,"sizeBytes":114,"sourceHtmlUrl":115},"migrations\u002Fv1.91.19.0.sh",3395,"https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Fgstack-upgrade\u002Fmigrations\u002Fv1.91.19.0.sh",{"path":117,"resourceType":118,"resourceTypeDesc":119,"sizeBytes":120,"sourceHtmlUrl":121},"SKILL.md.tmpl","OTHER","其他",21724,"https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Fgstack-upgrade\u002FSKILL.md.tmpl",[123,130,137,144,151,158],{"skillNo":124,"name":125,"nameZh":6,"description":126,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":127,"categories":128,"keywords":129,"publishedAt":19},"01M7E6DBMA338FWAN7WVGJTCNB","unfreeze","Clear the freeze boundary set by \u002Ffreeze, allowing edits to all directories again. (gstack)","https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Funfreeze\u002FSKILL.md",[],[],{"skillNo":131,"name":132,"nameZh":6,"description":133,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":134,"categories":135,"keywords":136,"publishedAt":19},"01M7E6D7BHG6ZW1ZEX71RCBSME","beta","Clean fixture tool skill with no forced reads and no mode table.","https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fcontext-bill\u002Ftree-a\u002Fbeta\u002FSKILL.md",[],[],{"skillNo":138,"name":139,"nameZh":6,"description":140,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":141,"categories":142,"keywords":143,"publishedAt":19},"01M7E6D52EFYY27Y8X76PH347M","alpha","Fixture dispatcher with a mode table and forced-read references.","https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Ftest\u002Ffixtures\u002Fcontext-bill\u002Ftree-a\u002Falpha\u002FSKILL.md",[],[],{"skillNo":145,"name":146,"nameZh":6,"description":147,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":148,"categories":149,"keywords":150,"publishedAt":19},"01M7E6CY6JC1N74V5KAZCH03S3","test-audit","Find low-value or duplicate tests and the test-only code they keep alive. (gstack)","https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Ftest-audit\u002FSKILL.md",[],[],{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":157,"publishedAt":19},"01M7E6CMVB52J31DKBKH54Z3NT","sync-gbrain","Keep gbrain current with this repo's code and refresh agent search guidance in CLAUDE.md. (gstack)","https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Fsync-gbrain\u002FSKILL.md",[],[],{"skillNo":159,"name":160,"nameZh":6,"description":161,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":162,"categories":163,"keywords":164,"publishedAt":19},"01M7E6C95ZGKEFXKCP0EGKXEN1","spec","Turn vague intent into a precise, executable spec in five phases. (gstack)","https:\u002F\u002Fgithub.com\u002Fmike7418\u002FGstack-Healthcare\u002Fblob\u002Fmain\u002Fspec\u002FSKILL.md",[],[]]