From 6c4f72a4262676f9c1774f5caea0b175f6479642 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Sat, 18 Apr 2026 11:38:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20V1=20upgrade=20migration=20=E2=80=94=20?= =?UTF-8?q?writing-style=20opt-out=20prompt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New migration script following existing v0.15.2.0.sh / v0.16.2.0.sh pattern. Writes a .writing-style-prompt-pending flag file on first run post-upgrade. The preamble's migration-prompt block reads the flag and fires a one-time AskUserQuestion offering the user a choice between the new default writing style and restoring V0 prose via \`gstack-config set explain_level terse\`. Idempotent via flag files; if the user has already set explain_level explicitly, counts as answered and skips. Co-Authored-By: Claude Opus 4.7 (1M context) --- gstack-upgrade/migrations/v1.0.0.0.sh | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 gstack-upgrade/migrations/v1.0.0.0.sh diff --git a/gstack-upgrade/migrations/v1.0.0.0.sh b/gstack-upgrade/migrations/v1.0.0.0.sh new file mode 100755 index 00000000..2e62fe06 --- /dev/null +++ b/gstack-upgrade/migrations/v1.0.0.0.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash +# Migration: v1.0.0.0 — V1 writing style prompt +# +# What changed: tier-≥2 skills default to ELI10 writing style (jargon glossed on +# first use, outcome-framed questions, short sentences). Power users who prefer +# the older V0 prose can set `gstack-config set explain_level terse`. +# +# What this does: writes a "pending prompt" flag file. On the first tier-≥2 skill +# invocation after upgrade, the preamble reads the flag and asks the user once +# whether to keep the new default or opt into terse mode. Flag file is deleted +# after the user answers. Idempotent — safe to run multiple times. +# +# Affected: every user on v0.19.x and below who upgrades to v1.x +set -euo pipefail + +GSTACK_HOME="${GSTACK_HOME:-$HOME/.gstack}" +PROMPTED_FLAG="$GSTACK_HOME/.writing-style-prompted" +PENDING_FLAG="$GSTACK_HOME/.writing-style-prompt-pending" + +mkdir -p "$GSTACK_HOME" + +# If the user has already answered the prompt at any point, skip. +if [ -f "$PROMPTED_FLAG" ]; then + exit 0 +fi + +# If the user has already explicitly set explain_level (either way), count that +# as an answer — they've made their choice, don't ask again. +EXPLAIN_LEVEL_SET="$("${HOME}/.claude/skills/gstack/bin/gstack-config" get explain_level 2>/dev/null || true)" +if [ -n "$EXPLAIN_LEVEL_SET" ]; then + touch "$PROMPTED_FLAG" + exit 0 +fi + +# Write the pending flag — preamble will see it on the first tier-≥2 skill invocation. +touch "$PENDING_FLAG" + +echo " [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."