Skills › gstack › gstack-upgrade › v1.0.0.0.sh
v1.0.0.0.sh
40 lines · gstack-upgrade/migrations/v1.0.0.0.sh at 3f79d81
1#!/usr/bin/env bash
2# Migration: v1.0.0.0 — V1 writing style prompt
3#
4# What changed: tier-≥2 skills default to ELI10 writing style (jargon glossed on
5# first use, outcome-framed questions, short sentences). Power users who prefer
6# the older V0 prose can set `gstack-config set explain_level terse`.
7#
8# What this does: writes a "pending prompt" flag file. On the first tier-≥2 skill
9# invocation after upgrade, the preamble reads the flag and asks the user once
10# whether to keep the new default or opt into terse mode. Flag file is deleted
11# after the user answers. Idempotent — safe to run multiple times.
12#
13# Affected: every user on v0.19.x and below who upgrades to v1.x
14set -euo pipefail
16_gstack_migration_dir="${BASH_SOURCE[0]//\\//}"; _gstack_migration_dir="${_gstack_migration_dir%/*}"
17. "${_gstack_migration_dir}/../../bin/gstack-state-root.sh" 2>/dev/null || { echo "$0: cannot resolve the gstack state root: ${_gstack_migration_dir}/../../bin/gstack-state-root.sh is missing. fix: reinstall with ./setup or /gstack-upgrade (docs/state-root.md)" >&2; exit 1; }
18gstack_state_root_select; GSTACK_HOME="$_gstack_sr_root"
19PROMPTED_FLAG="$GSTACK_HOME/.writing-style-prompted"
20PENDING_FLAG="$GSTACK_HOME/.writing-style-prompt-pending"
22mkdir -p "$GSTACK_HOME"
24# If the user has already answered the prompt at any point, skip.
25if [ -f "$PROMPTED_FLAG" ]; then
26 exit 0
27fi
29# If the user has already explicitly set explain_level (either way), count that
30# as an answer — they've made their choice, don't ask again.
31EXPLAIN_LEVEL_SET="$("${HOME}/.claude/skills/gstack/bin/gstack-config" get explain_level 2>/dev/null || true)"
32if [ -n "$EXPLAIN_LEVEL_SET" ]; then
33 touch "$PROMPTED_FLAG"
34 exit 0
35fi
37# Write the pending flag — preamble will see it on the first tier-≥2 skill invocation.
38touch "$PENDING_FLAG"
40echo " [v1.0.0.0] V1 writing style: you'll see a one-time prompt on your next skill run asking if you want the new default (glossed jargon, outcome framing) or the older terse prose."