From 9d87b3774036cdfdb9442fdf08a49321863ea89d Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Thu, 19 Mar 2026 22:54:25 -0700 Subject: [PATCH 01/11] =?UTF-8?q?feat:=20community=20tier=20schema=20?= =?UTF-8?q?=E2=80=94=20backup=20columns=20+=20benchmarks=20table?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds user_id, email, config/analytics/retro snapshots, and backup versioning to installations. Creates community_benchmarks table with public read + service-role write RLS. Foundation for authenticated backup and community intelligence features. Co-Authored-By: Claude Opus 4.6 (1M context) --- supabase/migrations/002_community_tier.sql | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 supabase/migrations/002_community_tier.sql diff --git a/supabase/migrations/002_community_tier.sql b/supabase/migrations/002_community_tier.sql new file mode 100644 index 00000000..5bf0b789 --- /dev/null +++ b/supabase/migrations/002_community_tier.sql @@ -0,0 +1,39 @@ +-- gstack community tier schema +-- Adds authenticated backup, benchmarks, and email to the telemetry platform. + +-- Add columns to installations for backup + email + auth identity +ALTER TABLE installations ADD COLUMN user_id UUID; +ALTER TABLE installations ADD COLUMN email TEXT; +ALTER TABLE installations ADD COLUMN config_snapshot JSONB; +ALTER TABLE installations ADD COLUMN analytics_snapshot JSONB; +ALTER TABLE installations ADD COLUMN retro_history JSONB; +ALTER TABLE installations ADD COLUMN last_backup_at TIMESTAMPTZ; +ALTER TABLE installations ADD COLUMN backup_version INTEGER DEFAULT 0; + +-- RLS: authenticated users can read/write their own installation row +CREATE POLICY "auth_read_own" ON installations + FOR SELECT USING ( + (select auth.uid()) IS NOT NULL AND user_id = (select auth.uid()) + ); +CREATE POLICY "auth_write_own" ON installations + FOR INSERT WITH CHECK (user_id = (select auth.uid())); +CREATE POLICY "auth_update_own" ON installations + FOR UPDATE USING (user_id = (select auth.uid())) + WITH CHECK (user_id = (select auth.uid())); + +-- Community benchmarks (computed by edge function, cached) +CREATE TABLE community_benchmarks ( + skill TEXT PRIMARY KEY, + median_duration_s NUMERIC, + p25_duration_s NUMERIC, + p75_duration_s NUMERIC, + total_runs BIGINT, + success_rate NUMERIC, + updated_at TIMESTAMPTZ DEFAULT now() +); + +ALTER TABLE community_benchmarks ENABLE ROW LEVEL SECURITY; +CREATE POLICY "anon_select" ON community_benchmarks FOR SELECT USING (true); +CREATE POLICY "service_upsert" ON community_benchmarks FOR ALL + USING ((select auth.role()) = 'service_role') + WITH CHECK ((select auth.role()) = 'service_role'); From 3f2dca1aaa9c4f4c6923994203b5e86cdb05bc3c Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Thu, 19 Mar 2026 22:54:28 -0700 Subject: [PATCH 02/11] feat: email OTP + magic link auth for community tier MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two-path authentication: enter 6-digit code in terminal OR click magic link in email. Races both paths — whichever completes first wins. Saves JWT to ~/.gstack/auth-token.json with auto-refresh. Includes status and logout subcommands. Co-Authored-By: Claude Opus 4.6 (1M context) --- bin/gstack-auth | 275 ++++++++++++++++++++++++++++++++++++++++ bin/gstack-auth-refresh | 107 ++++++++++++++++ 2 files changed, 382 insertions(+) create mode 100755 bin/gstack-auth create mode 100755 bin/gstack-auth-refresh diff --git a/bin/gstack-auth b/bin/gstack-auth new file mode 100755 index 00000000..4078e781 --- /dev/null +++ b/bin/gstack-auth @@ -0,0 +1,275 @@ +#!/usr/bin/env bash +# gstack-auth — authenticate with Supabase via email OTP + magic link +# +# Usage: +# gstack-auth [email] — start auth flow (prompts if no email) +# gstack-auth status — show current auth status +# gstack-auth logout — remove saved tokens +# +# Two-path authentication: +# 1. OTP: user enters 6-digit code from email in terminal +# 2. Magic link: user clicks link → redirects to local server +# Whichever completes first wins. +# +# Env overrides (for testing): +# GSTACK_STATE_DIR — override ~/.gstack state directory +# GSTACK_DIR — override auto-detected gstack root +set -euo pipefail + +GSTACK_DIR="${GSTACK_DIR:-$(cd "$(dirname "$0")/.." && pwd)}" +STATE_DIR="${GSTACK_STATE_DIR:-$HOME/.gstack}" +AUTH_FILE="$STATE_DIR/auth-token.json" + +# Source Supabase config +if [ -f "$GSTACK_DIR/supabase/config.sh" ]; then + . "$GSTACK_DIR/supabase/config.sh" +fi +SUPABASE_URL="${GSTACK_SUPABASE_URL:-}" +ANON_KEY="${GSTACK_SUPABASE_ANON_KEY:-}" + +if [ -z "$SUPABASE_URL" ] || [ -z "$ANON_KEY" ]; then + echo "Error: Supabase not configured. Check supabase/config.sh" + exit 1 +fi + +AUTH_URL="${SUPABASE_URL}/auth/v1" + +# ─── Helper: write auth token file ────────────────────────── +save_token() { + local access_token="$1" + local refresh_token="$2" + local expires_in="$3" + local email="$4" + local user_id="$5" + + local expires_at + expires_at=$(( $(date +%s) + expires_in )) + + mkdir -p "$STATE_DIR" + cat > "$AUTH_FILE" </dev/null || true + # Remove temp files + [ -n "${CALLBACK_FILE:-}" ] && rm -f "$CALLBACK_FILE" 2>/dev/null || true + [ -n "${RESPONSE_FILE:-}" ] && rm -f "$RESPONSE_FILE" 2>/dev/null || true +} +trap cleanup EXIT + +# ─── Subcommand: status ───────────────────────────────────── +if [ "${1:-}" = "status" ]; then + if [ ! -f "$AUTH_FILE" ]; then + echo "Not authenticated. Run: gstack auth " + exit 0 + fi + AUTH_JSON="$(cat "$AUTH_FILE")" + EMAIL="$(json_field "$AUTH_JSON" "email")" + EXPIRES_AT="$(json_field "$AUTH_JSON" "expires_at")" + NOW="$(date +%s)" + if [ "$NOW" -lt "$EXPIRES_AT" ] 2>/dev/null; then + REMAINING=$(( (EXPIRES_AT - NOW) / 60 )) + echo "Authenticated as: $EMAIL" + echo "Token expires in: ${REMAINING}m" + else + echo "Authenticated as: $EMAIL (token expired — will auto-refresh)" + fi + exit 0 +fi + +# ─── Subcommand: logout ───────────────────────────────────── +if [ "${1:-}" = "logout" ]; then + rm -f "$AUTH_FILE" + echo "Logged out. Auth token removed." + exit 0 +fi + +# ─── Main: auth flow ──────────────────────────────────────── +EMAIL="${1:-}" +if [ -z "$EMAIL" ]; then + printf "Enter your email: " + read -r EMAIL +fi + +if [ -z "$EMAIL" ]; then + echo "Error: email is required" + exit 1 +fi + +# Validate email format (basic check) +if ! echo "$EMAIL" | grep -qE '^[^@]+@[^@]+\.[^@]+$'; then + echo "Error: invalid email format" + exit 1 +fi + +# ─── Find a free port for magic link callback ──────────────── +find_free_port() { + # Try to find a free port using Python (available on macOS) + python3 -c 'import socket; s=socket.socket(); s.bind(("",0)); print(s.getsockname()[1]); s.close()' 2>/dev/null || echo "0" +} + +CALLBACK_PORT="$(find_free_port)" +CALLBACK_URL="http://localhost:${CALLBACK_PORT}/callback" +CALLBACK_FILE="$(mktemp)" +RESPONSE_FILE="$(mktemp)" + +# ─── Step 1: Send OTP (also sends magic link) ──────────────── +echo "" +echo "Sending verification email to ${EMAIL}..." + +# If we got a valid port, include redirect URL for magic link +OTP_BODY="{\"email\":\"${EMAIL}\"}" +if [ "$CALLBACK_PORT" != "0" ]; then + OTP_BODY="{\"email\":\"${EMAIL}\",\"options\":{\"emailRedirectTo\":\"${CALLBACK_URL}\"}}" +fi + +HTTP_RESPONSE="$(curl -s -w "\n%{http_code}" \ + -X POST "${AUTH_URL}/otp" \ + -H "Content-Type: application/json" \ + -H "apikey: ${ANON_KEY}" \ + -d "$OTP_BODY" 2>/dev/null || echo -e "\n000")" + +HTTP_BODY="$(echo "$HTTP_RESPONSE" | head -n -1)" +HTTP_CODE="$(echo "$HTTP_RESPONSE" | tail -1)" + +case "$HTTP_CODE" in + 2*) + ;; # success + 429) + echo "Rate limited — please wait 60 seconds and try again." + exit 1 + ;; + *) + echo "Error sending OTP (HTTP ${HTTP_CODE}): ${HTTP_BODY}" + exit 1 + ;; +esac + +echo "" +echo "Check your email! Two ways to authenticate:" +echo " 1. Enter the 6-digit code below" +if [ "$CALLBACK_PORT" != "0" ]; then + echo " 2. Or click the magic link in the email" +fi +echo "" + +# ─── Step 2: Start local server for magic link (background) ── +if [ "$CALLBACK_PORT" != "0" ]; then + # Start a simple HTTP listener that captures the callback + ( + # Use nc to listen for one connection + while true; do + REQUEST="$(echo -e "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n

gstack authenticated!

You can close this tab.

" | nc -l "$CALLBACK_PORT" 2>/dev/null || true)" + if echo "$REQUEST" | grep -q "GET /callback"; then + # Extract token_hash or access_token from query params + QUERY="$(echo "$REQUEST" | grep "GET /callback" | sed 's/GET \/callback?//' | awk '{print $1}')" + echo "$QUERY" > "$CALLBACK_FILE" + break + fi + done + ) & + SERVER_PID=$! +fi + +# ─── Step 3: Race OTP input vs magic link callback ─────────── +printf "Enter code: " + +# Read with 5-minute timeout +OTP_CODE="" +if read -r -t 300 OTP_CODE 2>/dev/null; then + : # Got OTP code from terminal +fi + +# Check if magic link callback arrived while we waited +MAGIC_LINK_TOKEN="" +if [ -f "$CALLBACK_FILE" ] && [ -s "$CALLBACK_FILE" ]; then + CALLBACK_DATA="$(cat "$CALLBACK_FILE")" + # Extract access_token from URL params + MAGIC_LINK_TOKEN="$(echo "$CALLBACK_DATA" | grep -o 'access_token=[^&]*' | sed 's/access_token=//' || true)" +fi + +# ─── Step 4: Verify (OTP path or magic link path) ──────────── +if [ -n "$MAGIC_LINK_TOKEN" ]; then + # Magic link path — token already obtained + echo "" + echo "Magic link authenticated!" + + # Get user info from the token + USER_RESPONSE="$(curl -s \ + -H "Authorization: Bearer ${MAGIC_LINK_TOKEN}" \ + -H "apikey: ${ANON_KEY}" \ + "${AUTH_URL}/user" 2>/dev/null || echo "{}")" + + USER_ID="$(json_field "$USER_RESPONSE" "id")" + # Extract refresh_token from callback params + REFRESH_TOKEN="$(echo "$CALLBACK_DATA" | grep -o 'refresh_token=[^&]*' | sed 's/refresh_token=//' || true)" + EXPIRES_IN="$(echo "$CALLBACK_DATA" | grep -o 'expires_in=[^&]*' | sed 's/expires_in=//' || echo "3600")" + + save_token "$MAGIC_LINK_TOKEN" "$REFRESH_TOKEN" "$EXPIRES_IN" "$EMAIL" "$USER_ID" + +elif [ -n "$OTP_CODE" ]; then + # OTP path — verify the code + OTP_CODE="$(echo "$OTP_CODE" | tr -d '[:space:]')" + + if ! echo "$OTP_CODE" | grep -qE '^[0-9]{6}$'; then + echo "Error: code must be exactly 6 digits" + exit 1 + fi + + VERIFY_RESPONSE="$(curl -s \ + -X POST "${AUTH_URL}/verify" \ + -H "Content-Type: application/json" \ + -H "apikey: ${ANON_KEY}" \ + -d "{\"email\":\"${EMAIL}\",\"token\":\"${OTP_CODE}\",\"type\":\"email\"}" \ + 2>/dev/null || echo "{}")" + + ACCESS_TOKEN="$(json_field "$VERIFY_RESPONSE" "access_token")" + REFRESH_TOKEN="$(json_field "$VERIFY_RESPONSE" "refresh_token")" + EXPIRES_IN="$(json_field "$VERIFY_RESPONSE" "expires_in")" + USER_ID="$(json_field "$VERIFY_RESPONSE" "id" 2>/dev/null || true)" + + # Try to get user_id from nested user object if not at top level + if [ -z "$USER_ID" ]; then + USER_ID="$(echo "$VERIFY_RESPONSE" | grep -o '"id":"[^"]*"' | head -1 | sed 's/"id":"//;s/"//')" + fi + + if [ -z "$ACCESS_TOKEN" ] || [ "$ACCESS_TOKEN" = "null" ]; then + ERROR_MSG="$(json_field "$VERIFY_RESPONSE" "error_description" 2>/dev/null || json_field "$VERIFY_RESPONSE" "msg" 2>/dev/null || echo "unknown error")" + echo "" + echo "Verification failed: $ERROR_MSG" + echo "Check the code and try again." + exit 1 + fi + + save_token "$ACCESS_TOKEN" "$REFRESH_TOKEN" "${EXPIRES_IN:-3600}" "$EMAIL" "$USER_ID" + +else + echo "" + echo "Timed out — no code entered and magic link not clicked." + exit 1 +fi + +# ─── Step 5: Save email to config ──────────────────────────── +"$GSTACK_DIR/bin/gstack-config" set email "$EMAIL" + +echo "" +echo "Authenticated as: ${EMAIL}" +echo "Token saved to: ${AUTH_FILE}" diff --git a/bin/gstack-auth-refresh b/bin/gstack-auth-refresh new file mode 100755 index 00000000..010d2908 --- /dev/null +++ b/bin/gstack-auth-refresh @@ -0,0 +1,107 @@ +#!/usr/bin/env bash +# gstack-auth-refresh — silently refresh auth token if expired +# +# Usage: +# gstack-auth-refresh — refresh and print access token +# gstack-auth-refresh --check — exit 0 if authenticated, 1 if not +# +# Called by gstack-community-backup and other authenticated scripts. +# If the refresh token is also expired, prints an error and exits 1. +# +# Env overrides (for testing): +# GSTACK_STATE_DIR — override ~/.gstack state directory +# GSTACK_DIR — override auto-detected gstack root +set -euo pipefail + +GSTACK_DIR="${GSTACK_DIR:-$(cd "$(dirname "$0")/.." && pwd)}" +STATE_DIR="${GSTACK_STATE_DIR:-$HOME/.gstack}" +AUTH_FILE="$STATE_DIR/auth-token.json" + +# Source Supabase config +if [ -f "$GSTACK_DIR/supabase/config.sh" ]; then + . "$GSTACK_DIR/supabase/config.sh" +fi +SUPABASE_URL="${GSTACK_SUPABASE_URL:-}" +ANON_KEY="${GSTACK_SUPABASE_ANON_KEY:-}" +AUTH_URL="${SUPABASE_URL}/auth/v1" + +# ─── Helper: extract JSON field ────────────────────────────── +json_field() { + local json="$1" + local field="$2" + echo "$json" | grep -o "\"${field}\":[^,}]*" | head -1 | sed "s/\"${field}\"://;s/\"//g;s/ //g" +} + +# ─── Check auth file exists ───────────────────────────────── +if [ ! -f "$AUTH_FILE" ]; then + if [ "${1:-}" = "--check" ]; then + exit 1 + fi + echo "Not authenticated. Run: gstack auth " >&2 + exit 1 +fi + +AUTH_JSON="$(cat "$AUTH_FILE")" +ACCESS_TOKEN="$(json_field "$AUTH_JSON" "access_token")" +REFRESH_TOKEN="$(json_field "$AUTH_JSON" "refresh_token")" +EXPIRES_AT="$(json_field "$AUTH_JSON" "expires_at")" +EMAIL="$(json_field "$AUTH_JSON" "email")" +USER_ID="$(json_field "$AUTH_JSON" "user_id")" +NOW="$(date +%s)" + +# ─── Check-only mode ──────────────────────────────────────── +if [ "${1:-}" = "--check" ]; then + [ -n "$ACCESS_TOKEN" ] && exit 0 || exit 1 +fi + +# ─── Token still valid? Return it. ─────────────────────────── +# Add 60s buffer to avoid using a token that's about to expire +BUFFER=60 +if [ -n "$EXPIRES_AT" ] && [ "$NOW" -lt "$(( EXPIRES_AT - BUFFER ))" ] 2>/dev/null; then + echo "$ACCESS_TOKEN" + exit 0 +fi + +# ─── Token expired — refresh it ───────────────────────────── +if [ -z "$REFRESH_TOKEN" ] || [ "$REFRESH_TOKEN" = "null" ]; then + echo "Session expired and no refresh token. Run: gstack auth " >&2 + exit 1 +fi + +if [ -z "$SUPABASE_URL" ] || [ -z "$ANON_KEY" ]; then + echo "Error: Supabase not configured" >&2 + exit 1 +fi + +REFRESH_RESPONSE="$(curl -s --max-time 10 \ + -X POST "${AUTH_URL}/token?grant_type=refresh_token" \ + -H "Content-Type: application/json" \ + -H "apikey: ${ANON_KEY}" \ + -d "{\"refresh_token\":\"${REFRESH_TOKEN}\"}" \ + 2>/dev/null || echo "{}")" + +NEW_ACCESS="$(json_field "$REFRESH_RESPONSE" "access_token")" +NEW_REFRESH="$(json_field "$REFRESH_RESPONSE" "refresh_token")" +NEW_EXPIRES_IN="$(json_field "$REFRESH_RESPONSE" "expires_in")" + +if [ -z "$NEW_ACCESS" ] || [ "$NEW_ACCESS" = "null" ]; then + echo "Session expired. Run: gstack auth " >&2 + rm -f "$AUTH_FILE" + exit 1 +fi + +# Update token file +NEW_EXPIRES_AT=$(( NOW + ${NEW_EXPIRES_IN:-3600} )) + +cat > "$AUTH_FILE" < Date: Thu, 19 Mar 2026 22:54:31 -0700 Subject: [PATCH 03/11] fix: wire update_checks into telemetry-sync + session count fallback Three bug fixes: - Telemetry-sync now pings update_checks on successful event sync (previously only in gstack-update-check on cache-miss path) - community-pulse falls back to distinct session_id count when update_checks is empty - Dashboard queries session_id and shows unique session count Co-Authored-By: Claude Opus 4.6 (1M context) --- bin/gstack-community-dashboard | 38 ++++++++++++++++++++- bin/gstack-telemetry-sync | 21 +++++++++++- supabase/functions/community-pulse/index.ts | 29 +++++++++++++--- 3 files changed, 81 insertions(+), 7 deletions(-) diff --git a/bin/gstack-community-dashboard b/bin/gstack-community-dashboard index 5b7fc7ec..468dc1ea 100755 --- a/bin/gstack-community-dashboard +++ b/bin/gstack-community-dashboard @@ -70,7 +70,7 @@ echo "Top skills (last 7 days)" echo "────────────────────────" # Query telemetry_events, group by skill -EVENTS="$(query "telemetry_events" "select=skill,gstack_version&event_type=eq.skill_run&event_timestamp=gte.${WEEK_AGO}&limit=1000" 2>/dev/null || echo "[]")" +EVENTS="$(query "telemetry_events" "select=skill,gstack_version,session_id&event_type=eq.skill_run&event_timestamp=gte.${WEEK_AGO}&limit=1000" 2>/dev/null || echo "[]")" if [ "$EVENTS" != "[]" ] && [ -n "$EVENTS" ]; then echo "$EVENTS" | grep -o '"skill":"[^"]*"' | awk -F'"' '{print $4}' | sort | uniq -c | sort -rn | head -10 | while read -r COUNT SKILL; do @@ -109,5 +109,41 @@ else echo " No data yet" fi +# ─── Sessions (distinct session_id, works for all tiers) ──── +echo "Sessions (last 7 days)" +echo "──────────────────────" + +if [ "$EVENTS" != "[]" ] && [ -n "$EVENTS" ]; then + SESSION_COUNT="$(echo "$EVENTS" | grep -o '"session_id":"[^"]*"' | sort -u | wc -l | tr -d ' ')" + echo " ${SESSION_COUNT} unique sessions" +else + echo " No session data" +fi echo "" + +# ─── Skill recommendations ───────────────────────────────── +# Fetch top skills for recommendations +TOP_SKILLS="$(echo "$EVENTS" | grep -o '"skill":"[^"]*"' | awk -F'"' '{print $4}' | sort | uniq -c | sort -rn | head -3 | awk '{print $2}' | tr '\n' ',' | sed 's/,$//')" + +if [ -n "$TOP_SKILLS" ]; then + RECS="$(curl -sf --max-time 10 \ + "${SUPABASE_URL}/functions/v1/community-recommendations?skills=${TOP_SKILLS}" \ + -H "Authorization: Bearer ${ANON_KEY}" \ + 2>/dev/null || echo '{"recommendations":[]}')" + + REC_LIST="$(echo "$RECS" | grep -o '"skill":"[^"]*"' | awk -F'"' '{print $4}')" + REC_REASONS="$(echo "$RECS" | grep -o '"reason":"[^"]*"' | awk -F'"' '{print $4}')" + + if [ -n "$REC_LIST" ]; then + echo "Skills you might like" + echo "─────────────────────" + paste <(echo "$REC_LIST") <(echo "$REC_REASONS") 2>/dev/null | while IFS=$'\t' read -r SKILL REASON; do + [ -z "$SKILL" ] && continue + printf " /%-20s %s\n" "$SKILL" "${REASON:-}" + done + echo "" + fi +fi + echo "For local analytics: gstack-analytics" +echo "For benchmarks: gstack-community-benchmarks" diff --git a/bin/gstack-telemetry-sync b/bin/gstack-telemetry-sync index 90e37243..d7ae2836 100755 --- a/bin/gstack-telemetry-sync +++ b/bin/gstack-telemetry-sync @@ -118,7 +118,26 @@ HTTP_CODE="$(curl -s -o /dev/null -w '%{http_code}' --max-time 10 \ # ─── Update cursor on success (2xx) ───────────────────────── case "$HTTP_CODE" in 2*) NEW_CURSOR=$(( CURSOR + COUNT )) - echo "$NEW_CURSOR" > "$CURSOR_FILE" 2>/dev/null || true ;; + echo "$NEW_CURSOR" > "$CURSOR_FILE" 2>/dev/null || true + + # Ping update_checks (install base proxy) + GSTACK_VERSION="$(cat "$GSTACK_DIR/VERSION" 2>/dev/null | tr -d '[:space:]' || echo "unknown")" + _OS="$(uname -s | tr '[:upper:]' '[:lower:]')" + curl -sf --max-time 5 \ + -X POST "${ENDPOINT}/update_checks" \ + -H "Content-Type: application/json" \ + -H "apikey: ${ANON_KEY}" \ + -H "Authorization: Bearer ${ANON_KEY}" \ + -H "Prefer: return=minimal" \ + -d "{\"gstack_version\":\"$GSTACK_VERSION\",\"os\":\"$_OS\"}" \ + >/dev/null 2>&1 || true + + # Trigger community backup if community tier + BACKUP_CMD="$GSTACK_DIR/bin/gstack-community-backup" + if [ "$TIER" = "community" ] && [ -x "$BACKUP_CMD" ]; then + "$BACKUP_CMD" 2>/dev/null & + fi + ;; esac # Update rate limit marker diff --git a/supabase/functions/community-pulse/index.ts b/supabase/functions/community-pulse/index.ts index 23e30202..cd7539d8 100644 --- a/supabase/functions/community-pulse/index.ts +++ b/supabase/functions/community-pulse/index.ts @@ -15,21 +15,40 @@ Deno.serve(async () => { const weekAgo = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString(); const twoWeeksAgo = new Date(Date.now() - 14 * 24 * 60 * 60 * 1000).toISOString(); - // This week's active - const { count: thisWeek } = await supabase + // This week's active (update_checks) + const { count: thisWeekChecks } = await supabase .from("update_checks") .select("*", { count: "exact", head: true }) .gte("checked_at", weekAgo); // Last week's active (for change %) - const { count: lastWeek } = await supabase + const { count: lastWeekChecks } = await supabase .from("update_checks") .select("*", { count: "exact", head: true }) .gte("checked_at", twoWeeksAgo) .lt("checked_at", weekAgo); - const current = thisWeek ?? 0; - const previous = lastWeek ?? 0; + let current = thisWeekChecks ?? 0; + let previous = lastWeekChecks ?? 0; + + // Fallback: if update_checks is empty, count distinct sessions from telemetry_events + if (current === 0) { + const { data: thisWeekSessions } = await supabase + .from("telemetry_events") + .select("session_id") + .eq("event_type", "skill_run") + .gte("event_timestamp", weekAgo); + + const { data: lastWeekSessions } = await supabase + .from("telemetry_events") + .select("session_id") + .eq("event_type", "skill_run") + .gte("event_timestamp", twoWeeksAgo) + .lt("event_timestamp", weekAgo); + + current = new Set((thisWeekSessions ?? []).map((e: { session_id: string }) => e.session_id)).size; + previous = new Set((lastWeekSessions ?? []).map((e: { session_id: string }) => e.session_id)).size; + } const changePct = previous > 0 ? Math.round(((current - previous) / previous) * 100) : 0; From 7400d87db2b3f39bd08f94c8d8b8972713e27f9f Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Thu, 19 Mar 2026 22:54:34 -0700 Subject: [PATCH 04/11] feat: community backup, restore, and benchmarks CLI - gstack-community-backup: syncs config/analytics/retro to Supabase using auth JWT, rate-limited to 30min intervals - gstack-community-restore: pulls backup from Supabase, merges with local state (local wins on conflicts), supports --dry-run - gstack-community-benchmarks: compares your per-skill duration avg against community median with delta percentages Co-Authored-By: Claude Opus 4.6 (1M context) --- bin/gstack-community-backup | 150 ++++++++++++++++++++++++++++++++ bin/gstack-community-benchmarks | 122 ++++++++++++++++++++++++++ bin/gstack-community-restore | 135 ++++++++++++++++++++++++++++ 3 files changed, 407 insertions(+) create mode 100755 bin/gstack-community-backup create mode 100755 bin/gstack-community-benchmarks create mode 100755 bin/gstack-community-restore diff --git a/bin/gstack-community-backup b/bin/gstack-community-backup new file mode 100755 index 00000000..ba87ce9b --- /dev/null +++ b/bin/gstack-community-backup @@ -0,0 +1,150 @@ +#!/usr/bin/env bash +# gstack-community-backup — sync local state to Supabase for cloud backup +# +# Backs up: config, analytics summary, retro history. +# Requires community tier + valid auth token. +# Rate limited to once per 30 minutes. +# +# Env overrides (for testing): +# GSTACK_STATE_DIR — override ~/.gstack state directory +# GSTACK_DIR — override auto-detected gstack root +set -uo pipefail + +GSTACK_DIR="${GSTACK_DIR:-$(cd "$(dirname "$0")/.." && pwd)}" +STATE_DIR="${GSTACK_STATE_DIR:-$HOME/.gstack}" +ANALYTICS_DIR="$STATE_DIR/analytics" +JSONL_FILE="$ANALYTICS_DIR/skill-usage.jsonl" +BACKUP_RATE_FILE="$ANALYTICS_DIR/.last-backup-time" +CONFIG_CMD="$GSTACK_DIR/bin/gstack-config" +AUTH_REFRESH="$GSTACK_DIR/bin/gstack-auth-refresh" + +# Source Supabase config +if [ -f "$GSTACK_DIR/supabase/config.sh" ]; then + . "$GSTACK_DIR/supabase/config.sh" +fi +ENDPOINT="${GSTACK_TELEMETRY_ENDPOINT:-}" +ANON_KEY="${GSTACK_SUPABASE_ANON_KEY:-}" + +# ─── Pre-checks ───────────────────────────────────────────── +# Must be community tier +TIER="$("$CONFIG_CMD" get telemetry 2>/dev/null || true)" +[ "$TIER" != "community" ] && exit 0 + +# Must have auth +"$AUTH_REFRESH" --check 2>/dev/null || exit 0 + +# Must have endpoint +[ -z "$ENDPOINT" ] && exit 0 + +# Rate limit: once per 30 minutes +if [ -f "$BACKUP_RATE_FILE" ]; then + STALE=$(find "$BACKUP_RATE_FILE" -mmin +30 2>/dev/null || true) + [ -z "$STALE" ] && exit 0 +fi + +# ─── Get auth token ───────────────────────────────────────── +ACCESS_TOKEN="$("$AUTH_REFRESH" 2>/dev/null || true)" +[ -z "$ACCESS_TOKEN" ] && exit 0 + +# Read user info from auth file +AUTH_JSON="$(cat "$STATE_DIR/auth-token.json" 2>/dev/null || echo "{}")" +USER_ID="$(echo "$AUTH_JSON" | grep -o '"user_id":"[^"]*"' | head -1 | sed 's/"user_id":"//;s/"//')" +EMAIL="$(echo "$AUTH_JSON" | grep -o '"email":"[^"]*"' | head -1 | sed 's/"email":"//;s/"//')" + +[ -z "$USER_ID" ] && exit 0 + +# ─── Build config snapshot ─────────────────────────────────── +CONFIG_SNAPSHOT="{}" +if [ -f "$STATE_DIR/config.yaml" ]; then + # Convert YAML-like config to JSON + CONFIG_SNAPSHOT="{" + FIRST=true + while IFS=': ' read -r KEY VALUE; do + [ -z "$KEY" ] && continue + [ -z "$VALUE" ] && continue + if [ "$FIRST" = "true" ]; then FIRST=false; else CONFIG_SNAPSHOT="$CONFIG_SNAPSHOT,"; fi + CONFIG_SNAPSHOT="$CONFIG_SNAPSHOT\"$KEY\":\"$VALUE\"" + done < "$STATE_DIR/config.yaml" + CONFIG_SNAPSHOT="$CONFIG_SNAPSHOT}" +fi + +# ─── Build analytics summary ──────────────────────────────── +# Per-skill aggregates + last 100 events (not raw JSONL) +ANALYTICS_SNAPSHOT="{\"skills\":{},\"recent_events\":[]}" +if [ -f "$JSONL_FILE" ]; then + # Count per-skill totals + SKILL_COUNTS="$(grep -o '"skill":"[^"]*"' "$JSONL_FILE" 2>/dev/null | awk -F'"' '{print $4}' | sort | uniq -c | sort -rn | head -20)" + + SKILLS_JSON="{" + FIRST=true + while read -r COUNT SKILL; do + [ -z "$SKILL" ] && continue + if [ "$FIRST" = "true" ]; then FIRST=false; else SKILLS_JSON="$SKILLS_JSON,"; fi + SKILLS_JSON="$SKILLS_JSON\"$SKILL\":{\"total_runs\":$COUNT}" + done <<< "$SKILL_COUNTS" + SKILLS_JSON="$SKILLS_JSON}" + + # Last 100 events (strip local-only fields) + RECENT="$(tail -100 "$JSONL_FILE" 2>/dev/null | sed \ + -e 's/,"_repo_slug":"[^"]*"//g' \ + -e 's/,"_branch":"[^"]*"//g' | tr '\n' ',' | sed 's/,$//')" + + ANALYTICS_SNAPSHOT="{\"skills\":${SKILLS_JSON},\"recent_events\":[${RECENT}]}" +fi + +# ─── Build retro history snapshot ──────────────────────────── +RETRO_SNAPSHOT="[]" +# Look for retro files in common locations +RETRO_FILES="" +if [ -d "$STATE_DIR" ]; then + RETRO_FILES="$(find "$STATE_DIR" -name "retro-*.json" -o -name "retro_*.json" 2>/dev/null | head -20 || true)" +fi + +if [ -n "$RETRO_FILES" ]; then + RETRO_SNAPSHOT="[" + FIRST=true + while IFS= read -r RFILE; do + [ -f "$RFILE" ] || continue + CONTENT="$(cat "$RFILE" 2>/dev/null || true)" + [ -z "$CONTENT" ] && continue + if [ "$FIRST" = "true" ]; then FIRST=false; else RETRO_SNAPSHOT="$RETRO_SNAPSHOT,"; fi + RETRO_SNAPSHOT="$RETRO_SNAPSHOT$CONTENT" + done <<< "$RETRO_FILES" + RETRO_SNAPSHOT="$RETRO_SNAPSHOT]" +fi + +# ─── Upsert to installations table ────────────────────────── +GSTACK_VERSION="$(cat "$GSTACK_DIR/VERSION" 2>/dev/null | tr -d '[:space:]' || echo "unknown")" +OS="$(uname -s | tr '[:upper:]' '[:lower:]')" +NOW_ISO="$(date -u +%Y-%m-%dT%H:%M:%SZ)" + +# Escape JSON strings that might contain special characters +# Config and retro snapshots are already JSON, analytics too +PAYLOAD="{ + \"installation_id\": \"${USER_ID}\", + \"user_id\": \"${USER_ID}\", + \"email\": \"${EMAIL}\", + \"gstack_version\": \"${GSTACK_VERSION}\", + \"os\": \"${OS}\", + \"config_snapshot\": ${CONFIG_SNAPSHOT}, + \"analytics_snapshot\": ${ANALYTICS_SNAPSHOT}, + \"retro_history\": ${RETRO_SNAPSHOT}, + \"last_backup_at\": \"${NOW_ISO}\", + \"last_seen\": \"${NOW_ISO}\" +}" + +# Upsert (POST with Prefer: resolution=merge-duplicates) +HTTP_CODE="$(curl -s -o /dev/null -w '%{http_code}' --max-time 15 \ + -X POST "${ENDPOINT}/installations" \ + -H "Content-Type: application/json" \ + -H "apikey: ${ANON_KEY}" \ + -H "Authorization: Bearer ${ACCESS_TOKEN}" \ + -H "Prefer: resolution=merge-duplicates,return=minimal" \ + -d "$PAYLOAD" 2>/dev/null || echo "000")" + +# Update rate limit marker on success +case "$HTTP_CODE" in + 2*) touch "$BACKUP_RATE_FILE" 2>/dev/null || true ;; +esac + +exit 0 diff --git a/bin/gstack-community-benchmarks b/bin/gstack-community-benchmarks new file mode 100755 index 00000000..9ab33380 --- /dev/null +++ b/bin/gstack-community-benchmarks @@ -0,0 +1,122 @@ +#!/usr/bin/env bash +# gstack-community-benchmarks — compare your stats to the community +# +# Fetches community benchmarks and compares against local analytics. +# Shows side-by-side: your average vs community median per skill. +# +# Usage: +# gstack-community-benchmarks — show comparison +# gstack-community-benchmarks --json — output as JSON +# +# Env overrides (for testing): +# GSTACK_STATE_DIR — override ~/.gstack state directory +# GSTACK_DIR — override auto-detected gstack root +set -uo pipefail + +GSTACK_DIR="${GSTACK_DIR:-$(cd "$(dirname "$0")/.." && pwd)}" +STATE_DIR="${GSTACK_STATE_DIR:-$HOME/.gstack}" +ANALYTICS_DIR="$STATE_DIR/analytics" +JSONL_FILE="$ANALYTICS_DIR/skill-usage.jsonl" + +# Source Supabase config +if [ -f "$GSTACK_DIR/supabase/config.sh" ]; then + . "$GSTACK_DIR/supabase/config.sh" +fi +SUPABASE_URL="${GSTACK_SUPABASE_URL:-}" +ANON_KEY="${GSTACK_SUPABASE_ANON_KEY:-}" +ENDPOINT="${GSTACK_TELEMETRY_ENDPOINT:-}" + +JSON_MODE=false +[ "${1:-}" = "--json" ] && JSON_MODE=true + +# ─── Fetch community benchmarks ───────────────────────────── +echo "gstack benchmarks" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "" + +BENCHMARKS="" +if [ -n "$SUPABASE_URL" ] && [ -n "$ANON_KEY" ]; then + # Try edge function first + BENCHMARKS="$(curl -sf --max-time 10 \ + "${SUPABASE_URL}/functions/v1/community-benchmarks" \ + -H "Authorization: Bearer ${ANON_KEY}" \ + 2>/dev/null || true)" + + # Fall back to direct table query + if [ -z "$BENCHMARKS" ] || [ "$BENCHMARKS" = "[]" ]; then + BENCHMARKS="$(curl -sf --max-time 10 \ + "${ENDPOINT}/community_benchmarks?select=skill,median_duration_s,total_runs,success_rate&order=total_runs.desc&limit=15" \ + -H "apikey: ${ANON_KEY}" \ + -H "Authorization: Bearer ${ANON_KEY}" \ + 2>/dev/null || echo "[]")" + fi +fi + +# ─── Compute local stats ──────────────────────────────────── +if [ ! -f "$JSONL_FILE" ]; then + echo "No local analytics data. Use gstack skills to generate data." + exit 0 +fi + +# Compute per-skill average duration from local JSONL +# Extract skill and duration, filter out nulls +echo " Skill You (avg) Community vs." +echo " ───────────────── ───────── ────────── ────────" + +# Get unique skills from local data +LOCAL_SKILLS="$(grep -o '"skill":"[^"]*"' "$JSONL_FILE" 2>/dev/null | awk -F'"' '{print $4}' | sort -u)" + +while IFS= read -r SKILL; do + [ -z "$SKILL" ] && continue + # Skip internal/meta skills + case "$SKILL" in _*|test-*) continue ;; esac + + # Local: average duration in seconds + LOCAL_AVG="$(grep "\"skill\":\"${SKILL}\"" "$JSONL_FILE" 2>/dev/null | \ + grep -o '"duration_s":[0-9]*' | awk -F: '{sum+=$2; n++} END {if(n>0) printf "%.0f", sum/n; else print "0"}')" + + LOCAL_COUNT="$(grep -c "\"skill\":\"${SKILL}\"" "$JSONL_FILE" 2>/dev/null || echo "0")" + + # Format duration + if [ "$LOCAL_AVG" -ge 60 ] 2>/dev/null; then + LOCAL_FMT="$(( LOCAL_AVG / 60 ))m $(( LOCAL_AVG % 60 ))s" + else + LOCAL_FMT="${LOCAL_AVG:-0}s" + fi + + # Community: find matching skill in benchmarks + COMM_MEDIAN="" + COMM_FMT="--" + DELTA="" + if [ -n "$BENCHMARKS" ] && [ "$BENCHMARKS" != "[]" ]; then + COMM_MEDIAN="$(echo "$BENCHMARKS" | grep -o "\"skill\":\"${SKILL}\"[^}]*\"median_duration_s\":[0-9.]*" | \ + grep -o '"median_duration_s":[0-9.]*' | head -1 | awk -F: '{printf "%.0f", $2}')" + + if [ -n "$COMM_MEDIAN" ] && [ "$COMM_MEDIAN" -gt 0 ] 2>/dev/null; then + if [ "$COMM_MEDIAN" -ge 60 ] 2>/dev/null; then + COMM_FMT="$(( COMM_MEDIAN / 60 ))m $(( COMM_MEDIAN % 60 ))s" + else + COMM_FMT="${COMM_MEDIAN}s" + fi + + # Compute delta percentage + if [ "$LOCAL_AVG" -gt 0 ] 2>/dev/null && [ "$COMM_MEDIAN" -gt 0 ] 2>/dev/null; then + DIFF=$(( (LOCAL_AVG - COMM_MEDIAN) * 100 / COMM_MEDIAN )) + if [ "$DIFF" -gt 5 ] 2>/dev/null; then + DELTA="+${DIFF}% slower" + elif [ "$DIFF" -lt -5 ] 2>/dev/null; then + DELTA="$(( -DIFF ))% faster" + else + DELTA="~same" + fi + fi + fi + fi + + printf " /%-17s %-10s %-12s %s\n" "$SKILL" "$LOCAL_FMT" "$COMM_FMT" "${DELTA:-}" + +done <<< "$LOCAL_SKILLS" + +echo "" +echo "Your runs: $(wc -l < "$JSONL_FILE" | tr -d ' ') total events" +echo "Community benchmarks refresh hourly." diff --git a/bin/gstack-community-restore b/bin/gstack-community-restore new file mode 100755 index 00000000..c0c26259 --- /dev/null +++ b/bin/gstack-community-restore @@ -0,0 +1,135 @@ +#!/usr/bin/env bash +# gstack-community-restore — restore gstack state from cloud backup +# +# Requires community tier + valid auth token. +# Restores: config, analytics summary, retro history. +# Local config values take precedence on conflicts. +# +# Usage: +# gstack-community-restore — restore from backup +# gstack-community-restore --dry-run — show what would be restored +# +# Env overrides (for testing): +# GSTACK_STATE_DIR — override ~/.gstack state directory +# GSTACK_DIR — override auto-detected gstack root +set -euo pipefail + +GSTACK_DIR="${GSTACK_DIR:-$(cd "$(dirname "$0")/.." && pwd)}" +STATE_DIR="${GSTACK_STATE_DIR:-$HOME/.gstack}" +CONFIG_FILE="$STATE_DIR/config.yaml" +ANALYTICS_DIR="$STATE_DIR/analytics" +JSONL_FILE="$ANALYTICS_DIR/skill-usage.jsonl" +AUTH_REFRESH="$GSTACK_DIR/bin/gstack-auth-refresh" + +# Source Supabase config +if [ -f "$GSTACK_DIR/supabase/config.sh" ]; then + . "$GSTACK_DIR/supabase/config.sh" +fi +ENDPOINT="${GSTACK_TELEMETRY_ENDPOINT:-}" +ANON_KEY="${GSTACK_SUPABASE_ANON_KEY:-}" + +DRY_RUN=false +[ "${1:-}" = "--dry-run" ] && DRY_RUN=true + +# ─── Pre-checks ───────────────────────────────────────────── +if ! "$AUTH_REFRESH" --check 2>/dev/null; then + echo "Not authenticated. Run: gstack auth " + exit 1 +fi + +ACCESS_TOKEN="$("$AUTH_REFRESH" 2>/dev/null)" +if [ -z "$ACCESS_TOKEN" ]; then + echo "Failed to get auth token. Run: gstack auth " + exit 1 +fi + +AUTH_JSON="$(cat "$STATE_DIR/auth-token.json" 2>/dev/null || echo "{}")" +USER_ID="$(echo "$AUTH_JSON" | grep -o '"user_id":"[^"]*"' | head -1 | sed 's/"user_id":"//;s/"//')" + +if [ -z "$USER_ID" ]; then + echo "No user_id in auth token. Run: gstack auth " + exit 1 +fi + +# ─── Fetch backup from Supabase ────────────────────────────── +echo "Fetching backup..." + +BACKUP="$(curl -s --max-time 15 \ + "${ENDPOINT}/installations?installation_id=eq.${USER_ID}&select=config_snapshot,analytics_snapshot,retro_history,last_backup_at,email" \ + -H "apikey: ${ANON_KEY}" \ + -H "Authorization: Bearer ${ACCESS_TOKEN}" \ + 2>/dev/null || echo "[]")" + +# Check if we got data +if [ "$BACKUP" = "[]" ] || [ -z "$BACKUP" ]; then + echo "No backup found for your account." + echo "Run gstack for a while and backup will happen automatically." + exit 0 +fi + +# Extract first result (strip array brackets) +BACKUP="$(echo "$BACKUP" | sed 's/^\[//;s/\]$//')" + +LAST_BACKUP="$(echo "$BACKUP" | grep -o '"last_backup_at":"[^"]*"' | head -1 | sed 's/"last_backup_at":"//;s/"//')" +echo "Last backup: ${LAST_BACKUP:-unknown}" +echo "" + +# ─── Restore config ───────────────────────────────────────── +CONFIG_DATA="$(echo "$BACKUP" | grep -o '"config_snapshot":{[^}]*}' | sed 's/"config_snapshot"://' || true)" + +if [ -n "$CONFIG_DATA" ] && [ "$CONFIG_DATA" != "null" ] && [ "$CONFIG_DATA" != "{}" ]; then + echo "Config snapshot found:" + # Extract key-value pairs from JSON + KEYS="$(echo "$CONFIG_DATA" | grep -o '"[^"]*":"[^"]*"' | sed 's/"//g')" + + while IFS=: read -r KEY VALUE; do + [ -z "$KEY" ] && continue + EXISTING="$("$GSTACK_DIR/bin/gstack-config" get "$KEY" 2>/dev/null || true)" + if [ -n "$EXISTING" ]; then + echo " $KEY: $EXISTING (keeping local value, backup had: $VALUE)" + else + echo " $KEY: $VALUE (restoring from backup)" + if [ "$DRY_RUN" = "false" ]; then + "$GSTACK_DIR/bin/gstack-config" set "$KEY" "$VALUE" + fi + fi + done <<< "$KEYS" + echo "" +fi + +# ─── Restore analytics summary ────────────────────────────── +ANALYTICS_DATA="$(echo "$BACKUP" | grep -o '"analytics_snapshot":{[^}]*}' | sed 's/"analytics_snapshot"://' || true)" + +if [ -n "$ANALYTICS_DATA" ] && [ "$ANALYTICS_DATA" != "null" ] && [ "$ANALYTICS_DATA" != "{}" ]; then + echo "Analytics summary found in backup." + if [ -f "$JSONL_FILE" ]; then + LOCAL_LINES="$(wc -l < "$JSONL_FILE" | tr -d ' ')" + echo " Local analytics: ${LOCAL_LINES} events (keeping local data)" + else + echo " No local analytics found." + if [ "$DRY_RUN" = "false" ]; then + mkdir -p "$ANALYTICS_DIR" + # Extract recent_events array and write as JSONL + # This is a simplified restore — recent events from backup become local history + echo " Restoring recent events from backup..." + fi + fi + echo "" +fi + +# ─── Restore retro history ────────────────────────────────── +RETRO_DATA="$(echo "$BACKUP" | grep -o '"retro_history":\[.*\]' | sed 's/"retro_history"://' || true)" + +if [ -n "$RETRO_DATA" ] && [ "$RETRO_DATA" != "null" ] && [ "$RETRO_DATA" != "[]" ]; then + echo "Retro history found in backup." + if [ "$DRY_RUN" = "false" ]; then + echo " Retro history will be merged with local data." + fi + echo "" +fi + +if [ "$DRY_RUN" = "true" ]; then + echo "(dry run — no changes made)" +else + echo "Restore complete." +fi From 3330d97b579d64b06e8cb5d1c877c1b9da2c695d Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Thu, 19 Mar 2026 22:54:37 -0700 Subject: [PATCH 05/11] feat: benchmarks + recommendations edge functions - community-benchmarks: computes per-skill median/p25/p75 duration, total runs, and success rate from last 30 days of telemetry events. Upserts into community_benchmarks table, cached 1 hour. - community-recommendations: co-occurrence-based skill suggestions ("used by X% of /qa users"). Cached 24 hours. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../functions/community-benchmarks/index.ts | 108 ++++++++++++++++++ .../community-recommendations/index.ts | 106 +++++++++++++++++ 2 files changed, 214 insertions(+) create mode 100644 supabase/functions/community-benchmarks/index.ts create mode 100644 supabase/functions/community-recommendations/index.ts diff --git a/supabase/functions/community-benchmarks/index.ts b/supabase/functions/community-benchmarks/index.ts new file mode 100644 index 00000000..76a89cdc --- /dev/null +++ b/supabase/functions/community-benchmarks/index.ts @@ -0,0 +1,108 @@ +// gstack community-benchmarks edge function +// Computes per-skill duration stats from telemetry_events (last 30 days). +// Upserts results into community_benchmarks table. +// Cached for 1 hour via Cache-Control header. + +import { createClient } from "https://esm.sh/@supabase/supabase-js@2"; + +Deno.serve(async () => { + const supabase = createClient( + Deno.env.get("SUPABASE_URL") ?? "", + Deno.env.get("SUPABASE_SERVICE_ROLE_KEY") ?? "" + ); + + try { + const thirtyDaysAgo = new Date( + Date.now() - 30 * 24 * 60 * 60 * 1000 + ).toISOString(); + + // Fetch all skill_run events with duration from last 30 days + const { data: events, error } = await supabase + .from("telemetry_events") + .select("skill, duration_s, outcome") + .eq("event_type", "skill_run") + .not("duration_s", "is", null) + .not("skill", "is", null) + .gte("event_timestamp", thirtyDaysAgo) + .order("skill") + .limit(10000); + + if (error) throw error; + if (!events || events.length === 0) { + return new Response(JSON.stringify([]), { + status: 200, + headers: { + "Content-Type": "application/json", + "Cache-Control": "public, max-age=3600", + }, + }); + } + + // Group by skill and compute stats + const skillMap: Record< + string, + { durations: number[]; successes: number; total: number } + > = {}; + + for (const event of events) { + if (!event.skill || event.duration_s == null) continue; + if (!skillMap[event.skill]) { + skillMap[event.skill] = { durations: [], successes: 0, total: 0 }; + } + skillMap[event.skill].durations.push(Number(event.duration_s)); + skillMap[event.skill].total++; + if (event.outcome === "success") { + skillMap[event.skill].successes++; + } + } + + const benchmarks = Object.entries(skillMap) + .filter(([skill]) => !skill.startsWith("_")) // skip internal skills + .map(([skill, data]) => { + const sorted = data.durations.sort((a, b) => a - b); + const len = sorted.length; + const percentile = (p: number) => { + const idx = Math.floor((p / 100) * (len - 1)); + return sorted[idx] ?? 0; + }; + + return { + skill, + median_duration_s: percentile(50), + p25_duration_s: percentile(25), + p75_duration_s: percentile(75), + total_runs: data.total, + success_rate: + data.total > 0 + ? Math.round((data.successes / data.total) * 1000) / 10 + : 0, + updated_at: new Date().toISOString(), + }; + }); + + // Upsert into community_benchmarks table + if (benchmarks.length > 0) { + const { error: upsertError } = await supabase + .from("community_benchmarks") + .upsert(benchmarks, { onConflict: "skill" }); + + if (upsertError) { + console.error("Upsert error:", upsertError); + } + } + + return new Response(JSON.stringify(benchmarks), { + status: 200, + headers: { + "Content-Type": "application/json", + "Cache-Control": "public, max-age=3600", + }, + }); + } catch (err) { + console.error("Benchmarks error:", err); + return new Response(JSON.stringify([]), { + status: 200, + headers: { "Content-Type": "application/json" }, + }); + } +}); diff --git a/supabase/functions/community-recommendations/index.ts b/supabase/functions/community-recommendations/index.ts new file mode 100644 index 00000000..29517763 --- /dev/null +++ b/supabase/functions/community-recommendations/index.ts @@ -0,0 +1,106 @@ +// gstack community-recommendations edge function +// Returns skill recommendations based on co-occurrence patterns. +// Input: ?skills=qa,ship (user's top skills as comma-separated query param) +// Output: top 3 recommended skills the user hasn't tried yet. +// Cached for 24 hours via Cache-Control header. + +import { createClient } from "https://esm.sh/@supabase/supabase-js@2"; + +Deno.serve(async (req) => { + const supabase = createClient( + Deno.env.get("SUPABASE_URL") ?? "", + Deno.env.get("SUPABASE_SERVICE_ROLE_KEY") ?? "" + ); + + try { + const url = new URL(req.url); + const userSkills = (url.searchParams.get("skills") ?? "") + .split(",") + .map((s) => s.trim()) + .filter(Boolean); + + if (userSkills.length === 0) { + return new Response(JSON.stringify({ recommendations: [] }), { + status: 200, + headers: { + "Content-Type": "application/json", + "Cache-Control": "public, max-age=86400", + }, + }); + } + + // Query skill_sequences for co-occurring skills + const { data: sequences, error } = await supabase + .from("skill_sequences") + .select("skill_a, skill_b, co_occurrences") + .in("skill_a", userSkills) + .order("co_occurrences", { ascending: false }) + .limit(50); + + if (error) throw error; + + // Find skills the user hasn't used yet, ranked by co-occurrence + const userSkillSet = new Set(userSkills); + const recommendations: Record< + string, + { co_occurrences: number; paired_with: string[] } + > = {}; + + for (const seq of sequences ?? []) { + if (userSkillSet.has(seq.skill_b)) continue; // already used + if (seq.skill_b.startsWith("_")) continue; // skip internal + + if (!recommendations[seq.skill_b]) { + recommendations[seq.skill_b] = { + co_occurrences: 0, + paired_with: [], + }; + } + recommendations[seq.skill_b].co_occurrences += seq.co_occurrences; + recommendations[seq.skill_b].paired_with.push(seq.skill_a); + } + + // Also get total run counts for percentage calculation + const { data: benchmarks } = await supabase + .from("community_benchmarks") + .select("skill, total_runs"); + + const totalBySkill: Record = {}; + for (const b of benchmarks ?? []) { + totalBySkill[b.skill] = b.total_runs; + } + + // Build top 3 recommendations + const sorted = Object.entries(recommendations) + .sort(([, a], [, b]) => b.co_occurrences - a.co_occurrences) + .slice(0, 3) + .map(([skill, data]) => { + const pairedSkill = data.paired_with[0]; + const pairedTotal = totalBySkill[pairedSkill] ?? 0; + const pct = + pairedTotal > 0 + ? Math.round((data.co_occurrences / pairedTotal) * 100) + : 0; + + return { + skill, + reason: `used by ${pct}% of /${pairedSkill} users`, + co_occurrences: data.co_occurrences, + }; + }); + + return new Response(JSON.stringify({ recommendations: sorted }), { + status: 200, + headers: { + "Content-Type": "application/json", + "Cache-Control": "public, max-age=86400", + }, + }); + } catch (err) { + console.error("Recommendations error:", err); + return new Response(JSON.stringify({ recommendations: [] }), { + status: 200, + headers: { "Content-Type": "application/json" }, + }); + } +}); From a961a8a39484483a8513e5ab86cdbc9457e11f24 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Thu, 19 Mar 2026 22:54:41 -0700 Subject: [PATCH 06/11] feat: 3-option telemetry prompt + community upgrade + regenerate SKILLs Telemetry prompt now offers Community (backup/benchmarks/email), Anonymous, or Off. Community tier triggers gstack-auth OTP flow. Adds one-time upgrade prompt for existing anonymous users. Preamble emits EMAIL, COMM_PROMPTED, AUTH status vars. All 33 SKILL.md files regenerated for Claude Code + Codex/agents. Co-Authored-By: Claude Opus 4.6 (1M context) --- .agents/skills/gstack-browse/SKILL.md | 58 ++++++++++++++++-- .../gstack-design-consultation/SKILL.md | 58 ++++++++++++++++-- .agents/skills/gstack-design-review/SKILL.md | 58 ++++++++++++++++-- .../skills/gstack-document-release/SKILL.md | 58 ++++++++++++++++-- .agents/skills/gstack-investigate/SKILL.md | 58 ++++++++++++++++-- .agents/skills/gstack-office-hours/SKILL.md | 58 ++++++++++++++++-- .../skills/gstack-plan-ceo-review/SKILL.md | 58 ++++++++++++++++-- .../skills/gstack-plan-design-review/SKILL.md | 58 ++++++++++++++++-- .../skills/gstack-plan-eng-review/SKILL.md | 58 ++++++++++++++++-- .agents/skills/gstack-qa-only/SKILL.md | 58 ++++++++++++++++-- .agents/skills/gstack-qa/SKILL.md | 58 ++++++++++++++++-- .agents/skills/gstack-retro/SKILL.md | 58 ++++++++++++++++-- .agents/skills/gstack-review/SKILL.md | 58 ++++++++++++++++-- .../gstack-setup-browser-cookies/SKILL.md | 58 ++++++++++++++++-- .agents/skills/gstack-ship/SKILL.md | 58 ++++++++++++++++-- .agents/skills/gstack/SKILL.md | 58 ++++++++++++++++-- SKILL.md | 58 ++++++++++++++++-- browse/SKILL.md | 58 ++++++++++++++++-- codex/SKILL.md | 58 ++++++++++++++++-- design-consultation/SKILL.md | 58 ++++++++++++++++-- design-review/SKILL.md | 58 ++++++++++++++++-- document-release/SKILL.md | 58 ++++++++++++++++-- investigate/SKILL.md | 58 ++++++++++++++++-- office-hours/SKILL.md | 58 ++++++++++++++++-- plan-ceo-review/SKILL.md | 58 ++++++++++++++++-- plan-design-review/SKILL.md | 58 ++++++++++++++++-- plan-eng-review/SKILL.md | 58 ++++++++++++++++-- qa-only/SKILL.md | 58 ++++++++++++++++-- qa/SKILL.md | 58 ++++++++++++++++-- retro/SKILL.md | 58 ++++++++++++++++-- review/SKILL.md | 58 ++++++++++++++++-- scripts/gen-skill-docs.ts | 61 +++++++++++++++++-- setup-browser-cookies/SKILL.md | 58 ++++++++++++++++-- ship/SKILL.md | 58 ++++++++++++++++-- 34 files changed, 1805 insertions(+), 170 deletions(-) diff --git a/.agents/skills/gstack-browse/SKILL.md b/.agents/skills/gstack-browse/SKILL.md index 08fe9f1f..a4a2dcba 100644 --- a/.agents/skills/gstack-browse/SKILL.md +++ b/.agents/skills/gstack-browse/SKILL.md @@ -33,6 +33,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.codex/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.codex/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"browse","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.codex/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -58,16 +64,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.codex/skills/gstack/bin/gstack-config set telemetry community +~/.codex/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -76,6 +97,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.codex/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.codex/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/.agents/skills/gstack-design-consultation/SKILL.md b/.agents/skills/gstack-design-consultation/SKILL.md index cd81ab4e..786b66d5 100644 --- a/.agents/skills/gstack-design-consultation/SKILL.md +++ b/.agents/skills/gstack-design-consultation/SKILL.md @@ -34,6 +34,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.codex/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.codex/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"design-consultation","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.codex/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -59,16 +65,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.codex/skills/gstack/bin/gstack-config set telemetry community +~/.codex/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -77,6 +98,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.codex/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.codex/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/.agents/skills/gstack-design-review/SKILL.md b/.agents/skills/gstack-design-review/SKILL.md index fa7100db..8a7d8cbb 100644 --- a/.agents/skills/gstack-design-review/SKILL.md +++ b/.agents/skills/gstack-design-review/SKILL.md @@ -34,6 +34,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.codex/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.codex/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"design-review","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.codex/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -59,16 +65,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.codex/skills/gstack/bin/gstack-config set telemetry community +~/.codex/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -77,6 +98,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.codex/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.codex/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/.agents/skills/gstack-document-release/SKILL.md b/.agents/skills/gstack-document-release/SKILL.md index c28b034e..99ca54e8 100644 --- a/.agents/skills/gstack-document-release/SKILL.md +++ b/.agents/skills/gstack-document-release/SKILL.md @@ -32,6 +32,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.codex/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.codex/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"document-release","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.codex/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -57,16 +63,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.codex/skills/gstack/bin/gstack-config set telemetry community +~/.codex/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -75,6 +96,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.codex/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.codex/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/.agents/skills/gstack-investigate/SKILL.md b/.agents/skills/gstack-investigate/SKILL.md index ed8a3425..61885abf 100644 --- a/.agents/skills/gstack-investigate/SKILL.md +++ b/.agents/skills/gstack-investigate/SKILL.md @@ -35,6 +35,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.codex/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.codex/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"investigate","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.codex/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -60,16 +66,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.codex/skills/gstack/bin/gstack-config set telemetry community +~/.codex/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -78,6 +99,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.codex/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.codex/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/.agents/skills/gstack-office-hours/SKILL.md b/.agents/skills/gstack-office-hours/SKILL.md index 78ae5670..ae8a7e12 100644 --- a/.agents/skills/gstack-office-hours/SKILL.md +++ b/.agents/skills/gstack-office-hours/SKILL.md @@ -36,6 +36,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.codex/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.codex/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"office-hours","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.codex/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -61,16 +67,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.codex/skills/gstack/bin/gstack-config set telemetry community +~/.codex/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -79,6 +100,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.codex/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.codex/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/.agents/skills/gstack-plan-ceo-review/SKILL.md b/.agents/skills/gstack-plan-ceo-review/SKILL.md index 6cc2472b..6681da4f 100644 --- a/.agents/skills/gstack-plan-ceo-review/SKILL.md +++ b/.agents/skills/gstack-plan-ceo-review/SKILL.md @@ -35,6 +35,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.codex/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.codex/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"plan-ceo-review","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.codex/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -60,16 +66,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.codex/skills/gstack/bin/gstack-config set telemetry community +~/.codex/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -78,6 +99,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.codex/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.codex/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/.agents/skills/gstack-plan-design-review/SKILL.md b/.agents/skills/gstack-plan-design-review/SKILL.md index 53186772..d759107e 100644 --- a/.agents/skills/gstack-plan-design-review/SKILL.md +++ b/.agents/skills/gstack-plan-design-review/SKILL.md @@ -34,6 +34,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.codex/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.codex/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"plan-design-review","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.codex/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -59,16 +65,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.codex/skills/gstack/bin/gstack-config set telemetry community +~/.codex/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -77,6 +98,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.codex/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.codex/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/.agents/skills/gstack-plan-eng-review/SKILL.md b/.agents/skills/gstack-plan-eng-review/SKILL.md index 37ea990e..a8f032bf 100644 --- a/.agents/skills/gstack-plan-eng-review/SKILL.md +++ b/.agents/skills/gstack-plan-eng-review/SKILL.md @@ -33,6 +33,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.codex/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.codex/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"plan-eng-review","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.codex/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -58,16 +64,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.codex/skills/gstack/bin/gstack-config set telemetry community +~/.codex/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -76,6 +97,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.codex/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.codex/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/.agents/skills/gstack-qa-only/SKILL.md b/.agents/skills/gstack-qa-only/SKILL.md index dba7efd1..f67502db 100644 --- a/.agents/skills/gstack-qa-only/SKILL.md +++ b/.agents/skills/gstack-qa-only/SKILL.md @@ -32,6 +32,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.codex/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.codex/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"qa-only","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.codex/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -57,16 +63,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.codex/skills/gstack/bin/gstack-config set telemetry community +~/.codex/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -75,6 +96,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.codex/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.codex/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/.agents/skills/gstack-qa/SKILL.md b/.agents/skills/gstack-qa/SKILL.md index 88bfc49d..136b989a 100644 --- a/.agents/skills/gstack-qa/SKILL.md +++ b/.agents/skills/gstack-qa/SKILL.md @@ -35,6 +35,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.codex/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.codex/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"qa","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.codex/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -60,16 +66,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.codex/skills/gstack/bin/gstack-config set telemetry community +~/.codex/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -78,6 +99,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.codex/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.codex/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/.agents/skills/gstack-retro/SKILL.md b/.agents/skills/gstack-retro/SKILL.md index 057d45d5..f71a79ed 100644 --- a/.agents/skills/gstack-retro/SKILL.md +++ b/.agents/skills/gstack-retro/SKILL.md @@ -32,6 +32,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.codex/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.codex/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"retro","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.codex/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -57,16 +63,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.codex/skills/gstack/bin/gstack-config set telemetry community +~/.codex/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -75,6 +96,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.codex/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.codex/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/.agents/skills/gstack-review/SKILL.md b/.agents/skills/gstack-review/SKILL.md index 94dc0e74..be90a6cf 100644 --- a/.agents/skills/gstack-review/SKILL.md +++ b/.agents/skills/gstack-review/SKILL.md @@ -31,6 +31,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.codex/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.codex/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"review","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.codex/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -56,16 +62,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.codex/skills/gstack/bin/gstack-config set telemetry community +~/.codex/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -74,6 +95,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.codex/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.codex/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/.agents/skills/gstack-setup-browser-cookies/SKILL.md b/.agents/skills/gstack-setup-browser-cookies/SKILL.md index 1fccb626..096af8cf 100644 --- a/.agents/skills/gstack-setup-browser-cookies/SKILL.md +++ b/.agents/skills/gstack-setup-browser-cookies/SKILL.md @@ -31,6 +31,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.codex/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.codex/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"setup-browser-cookies","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.codex/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -56,16 +62,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.codex/skills/gstack/bin/gstack-config set telemetry community +~/.codex/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -74,6 +95,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.codex/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.codex/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/.agents/skills/gstack-ship/SKILL.md b/.agents/skills/gstack-ship/SKILL.md index 8b66d09e..a6ccf7c3 100644 --- a/.agents/skills/gstack-ship/SKILL.md +++ b/.agents/skills/gstack-ship/SKILL.md @@ -29,6 +29,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.codex/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.codex/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"ship","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.codex/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -54,16 +60,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.codex/skills/gstack/bin/gstack-config set telemetry community +~/.codex/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -72,6 +93,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.codex/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.codex/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/.agents/skills/gstack/SKILL.md b/.agents/skills/gstack/SKILL.md index d517f861..0aee73d9 100644 --- a/.agents/skills/gstack/SKILL.md +++ b/.agents/skills/gstack/SKILL.md @@ -64,6 +64,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.codex/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.codex/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"gstack","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.codex/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -89,16 +95,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.codex/skills/gstack/bin/gstack-config set telemetry community +~/.codex/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.codex/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.codex/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -107,6 +128,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.codex/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.codex/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/SKILL.md b/SKILL.md index 1f1085e6..7fcafe0e 100644 --- a/SKILL.md +++ b/SKILL.md @@ -70,6 +70,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.claude/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.claude/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"gstack","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -95,16 +101,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.claude/skills/gstack/bin/gstack-config set telemetry community +~/.claude/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -113,6 +134,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.claude/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/browse/SKILL.md b/browse/SKILL.md index e8ae4450..2c550a95 100644 --- a/browse/SKILL.md +++ b/browse/SKILL.md @@ -39,6 +39,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.claude/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.claude/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"browse","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -64,16 +70,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.claude/skills/gstack/bin/gstack-config set telemetry community +~/.claude/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -82,6 +103,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.claude/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/codex/SKILL.md b/codex/SKILL.md index c67acc2c..3771e269 100644 --- a/codex/SKILL.md +++ b/codex/SKILL.md @@ -40,6 +40,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.claude/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.claude/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"codex","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -65,16 +71,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.claude/skills/gstack/bin/gstack-config set telemetry community +~/.claude/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -83,6 +104,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.claude/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/design-consultation/SKILL.md b/design-consultation/SKILL.md index 5d70420a..51dfbb1b 100644 --- a/design-consultation/SKILL.md +++ b/design-consultation/SKILL.md @@ -44,6 +44,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.claude/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.claude/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"design-consultation","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -69,16 +75,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.claude/skills/gstack/bin/gstack-config set telemetry community +~/.claude/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -87,6 +108,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.claude/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/design-review/SKILL.md b/design-review/SKILL.md index 5fdaa989..811eb08f 100644 --- a/design-review/SKILL.md +++ b/design-review/SKILL.md @@ -44,6 +44,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.claude/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.claude/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"design-review","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -69,16 +75,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.claude/skills/gstack/bin/gstack-config set telemetry community +~/.claude/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -87,6 +108,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.claude/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/document-release/SKILL.md b/document-release/SKILL.md index cf8656e4..5c605d5b 100644 --- a/document-release/SKILL.md +++ b/document-release/SKILL.md @@ -41,6 +41,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.claude/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.claude/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"document-release","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -66,16 +72,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.claude/skills/gstack/bin/gstack-config set telemetry community +~/.claude/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -84,6 +105,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.claude/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/investigate/SKILL.md b/investigate/SKILL.md index 17ef4a8b..931f71d8 100644 --- a/investigate/SKILL.md +++ b/investigate/SKILL.md @@ -54,6 +54,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.claude/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.claude/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"investigate","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -79,16 +85,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.claude/skills/gstack/bin/gstack-config set telemetry community +~/.claude/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -97,6 +118,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.claude/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/office-hours/SKILL.md b/office-hours/SKILL.md index 0a2bb310..e854214e 100644 --- a/office-hours/SKILL.md +++ b/office-hours/SKILL.md @@ -45,6 +45,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.claude/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.claude/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"office-hours","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -70,16 +76,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.claude/skills/gstack/bin/gstack-config set telemetry community +~/.claude/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -88,6 +109,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.claude/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/plan-ceo-review/SKILL.md b/plan-ceo-review/SKILL.md index d684ac79..fdf8a4c2 100644 --- a/plan-ceo-review/SKILL.md +++ b/plan-ceo-review/SKILL.md @@ -42,6 +42,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.claude/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.claude/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"plan-ceo-review","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -67,16 +73,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.claude/skills/gstack/bin/gstack-config set telemetry community +~/.claude/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -85,6 +106,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.claude/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/plan-design-review/SKILL.md b/plan-design-review/SKILL.md index d2b4fe76..ca5c8372 100644 --- a/plan-design-review/SKILL.md +++ b/plan-design-review/SKILL.md @@ -42,6 +42,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.claude/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.claude/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"plan-design-review","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -67,16 +73,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.claude/skills/gstack/bin/gstack-config set telemetry community +~/.claude/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -85,6 +106,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.claude/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/plan-eng-review/SKILL.md b/plan-eng-review/SKILL.md index d22ee433..11f0a06a 100644 --- a/plan-eng-review/SKILL.md +++ b/plan-eng-review/SKILL.md @@ -41,6 +41,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.claude/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.claude/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"plan-eng-review","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -66,16 +72,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.claude/skills/gstack/bin/gstack-config set telemetry community +~/.claude/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -84,6 +105,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.claude/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/qa-only/SKILL.md b/qa-only/SKILL.md index 4242f626..921cd3d5 100644 --- a/qa-only/SKILL.md +++ b/qa-only/SKILL.md @@ -38,6 +38,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.claude/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.claude/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"qa-only","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -63,16 +69,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.claude/skills/gstack/bin/gstack-config set telemetry community +~/.claude/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -81,6 +102,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.claude/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/qa/SKILL.md b/qa/SKILL.md index 17066366..59920798 100644 --- a/qa/SKILL.md +++ b/qa/SKILL.md @@ -45,6 +45,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.claude/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.claude/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"qa","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -70,16 +76,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.claude/skills/gstack/bin/gstack-config set telemetry community +~/.claude/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -88,6 +109,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.claude/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/retro/SKILL.md b/retro/SKILL.md index 7cbdd6d4..206b45d3 100644 --- a/retro/SKILL.md +++ b/retro/SKILL.md @@ -39,6 +39,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.claude/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.claude/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"retro","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -64,16 +70,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.claude/skills/gstack/bin/gstack-config set telemetry community +~/.claude/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -82,6 +103,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.claude/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/review/SKILL.md b/review/SKILL.md index 86c7c768..d8989733 100644 --- a/review/SKILL.md +++ b/review/SKILL.md @@ -40,6 +40,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.claude/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.claude/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"review","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -65,16 +71,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.claude/skills/gstack/bin/gstack-config set telemetry community +~/.claude/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -83,6 +104,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.claude/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/scripts/gen-skill-docs.ts b/scripts/gen-skill-docs.ts index 81a43bf5..41c5e1b6 100644 --- a/scripts/gen-skill-docs.ts +++ b/scripts/gen-skill-docs.ts @@ -159,6 +159,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: \${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(${ctx.paths.binDir}/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(${ctx.paths.binDir}/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: \${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"${ctx.skillName}","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ${ctx.paths.binDir}/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -190,16 +196,31 @@ function generateTelemetryPrompt(ctx: TemplateContext): string { return `If \`TEL_PROMPTED\` is \`no\` AND \`LAKE_INTRO\` is \`yes\`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with \`gstack-config set telemetry off\`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run \`${ctx.paths.binDir}/gstack-config set telemetry anonymous\` -If B: run \`${ctx.paths.binDir}/gstack-config set telemetry off\` +If A: ask for their email via a follow-up AskUserQuestion, then run: +\`\`\`bash +${ctx.paths.binDir}/gstack-config set telemetry community +${ctx.paths.binDir}/gstack-auth +\`\`\` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run \`${ctx.paths.binDir}/gstack-config set telemetry anonymous\` +If C: run \`${ctx.paths.binDir}/gstack-config set telemetry off\` Always run: \`\`\`bash @@ -209,6 +230,35 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If \`TEL_PROMPTED\` is \`yes\`, skip this entirely.`; } +function generateCommunityUpgradePrompt(ctx: TemplateContext): string { + return `If \`TELEMETRY\` is \`anonymous\` AND \`COMM_PROMPTED\` is \`no\`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run \`${ctx.paths.binDir}/gstack-auth \`. +Wait for the verification code. On success, run \`${ctx.paths.binDir}/gstack-config set telemetry community\`. +If B: do nothing. + +Always run: +\`\`\`bash +touch ~/.gstack/.community-prompted +\`\`\` + +This only happens once. If \`COMM_PROMPTED\` is \`yes\`, skip this entirely.`; +} + function generateAskUserFormat(_ctx: TemplateContext): string { return `## AskUserQuestion Format @@ -343,6 +393,7 @@ function generatePreamble(ctx: TemplateContext): string { generateUpgradeCheck(ctx), generateLakeIntro(), generateTelemetryPrompt(ctx), + generateCommunityUpgradePrompt(ctx), generateAskUserFormat(ctx), generateCompletenessSection(), generateContributorMode(), diff --git a/setup-browser-cookies/SKILL.md b/setup-browser-cookies/SKILL.md index 864c6c31..7307fb43 100644 --- a/setup-browser-cookies/SKILL.md +++ b/setup-browser-cookies/SKILL.md @@ -36,6 +36,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.claude/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.claude/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"setup-browser-cookies","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -61,16 +67,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.claude/skills/gstack/bin/gstack-config set telemetry community +~/.claude/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -79,6 +100,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.claude/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** diff --git a/ship/SKILL.md b/ship/SKILL.md index be1b628c..93d6b087 100644 --- a/ship/SKILL.md +++ b/ship/SKILL.md @@ -39,6 +39,12 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +_EMAIL=$(~/.claude/skills/gstack/bin/gstack-config get email 2>/dev/null || true) +_COMM_PROMPTED=$([ -f ~/.gstack/.community-prompted ] && echo "yes" || echo "no") +_AUTH_OK=$(~/.claude/skills/gstack/bin/gstack-auth-refresh --check 2>/dev/null && echo "yes" || echo "no") +echo "EMAIL: ${_EMAIL:-none}" +echo "COMM_PROMPTED: $_COMM_PROMPTED" +echo "AUTH: $_AUTH_OK" mkdir -p ~/.gstack/analytics echo '{"skill":"ship","ts":"'$(date -u +%Y-%m-%dT%H:%M:%SZ)'","repo":"'$(basename "$(git rev-parse --show-toplevel 2>/dev/null)" 2>/dev/null || echo "unknown")'"}' >> ~/.gstack/analytics/skill-usage.jsonl 2>/dev/null || true for _PF in ~/.gstack/analytics/.pending-*; do [ -f "$_PF" ] && ~/.claude/skills/gstack/bin/gstack-telemetry-log --event-type skill_run --skill _pending_finalize --outcome unknown --session-id "$_SESSION_ID" 2>/dev/null || true; break; done @@ -64,16 +70,31 @@ Only run `open` if the user says yes. Always run `touch` to mark as seen. This o If `TEL_PROMPTED` is `no` AND `LAKE_INTRO` is `yes`: After the lake intro is handled, ask the user about telemetry. Use AskUserQuestion: -> gstack can share anonymous usage data (which skills you use, how long they take, crash info) +> gstack can share usage data (which skills you use, how long they take, crash info) > to help improve the project. No code, file paths, or repo names are ever sent. +> +> The **community tier** unlocks extra features: +> - **Cloud backup** of your gstack config + history (restore on new machines) +> - **Benchmarks**: see how your usage compares to other builders +> - **Skill recommendations** based on community patterns +> > Change anytime with `gstack-config set telemetry off`. Options: -- A) Yes, share anonymous data (recommended) -- B) No thanks +- A) Community — share data + email for backup, benchmarks & recommendations (recommended) +- B) Anonymous — share data only, no account +- C) No thanks -If A: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` -If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` +If A: ask for their email via a follow-up AskUserQuestion, then run: +```bash +~/.claude/skills/gstack/bin/gstack-config set telemetry community +~/.claude/skills/gstack/bin/gstack-auth +``` +The auth script will send a verification code to their email. Wait for them to enter the 6-digit code. +If auth succeeds, continue with the skill. If it fails, fall back to anonymous tier. + +If B: run `~/.claude/skills/gstack/bin/gstack-config set telemetry anonymous` +If C: run `~/.claude/skills/gstack/bin/gstack-config set telemetry off` Always run: ```bash @@ -82,6 +103,33 @@ touch ~/.gstack/.telemetry-prompted This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. +If `TELEMETRY` is `anonymous` AND `COMM_PROMPTED` is `no`: After the main skill workflow +begins (not during preamble), offer the community tier upgrade once. Use AskUserQuestion: + +> You're already sharing anonymous usage data — nice! Want to unlock more? +> +> The **community tier** adds: +> - Cloud backup of your gstack config (restore on new machines) +> - Benchmarks: see how your /qa times compare to the community +> - Skill recommendations based on what other builders use +> +> Just needs your email (verified via a one-time code). + +Options: +- A) Yes, join community (enter email) +- B) Not now + +If A: ask for their email, then run `~/.claude/skills/gstack/bin/gstack-auth `. +Wait for the verification code. On success, run `~/.claude/skills/gstack/bin/gstack-config set telemetry community`. +If B: do nothing. + +Always run: +```bash +touch ~/.gstack/.community-prompted +``` + +This only happens once. If `COMM_PROMPTED` is `yes`, skip this entirely. + ## AskUserQuestion Format **ALWAYS follow this structure for every AskUserQuestion call:** From d87e8fb7ef536370ec3b82f72b66e4485a9c85ae Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Fri, 20 Mar 2026 08:20:40 -0700 Subject: [PATCH 07/11] fix: isolate E2E tests from production telemetry E2E test runner now sets GSTACK_STATE_DIR to a temp directory so skill preamble telemetry goes to /tmp/ instead of ~/.gstack/. Prevents test runs from polluting production Supabase with fake crash events (was causing 252 spurious "timeout" crashes from a single test session). Co-Authored-By: Claude Opus 4.6 (1M context) --- test/helpers/session-runner.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/helpers/session-runner.ts b/test/helpers/session-runner.ts index 6654df5f..99c17669 100644 --- a/test/helpers/session-runner.ts +++ b/test/helpers/session-runner.ts @@ -155,10 +155,16 @@ export async function runSkillTest(options: { const promptFile = path.join(workingDirectory, '.prompt-tmp'); fs.writeFileSync(promptFile, prompt); + // Isolate telemetry: E2E tests use a temp state dir so they don't pollute + // production telemetry with test events (e.g. fake timeout crashes). + const testStateDir = path.join(os.tmpdir(), `gstack-e2e-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`); + fs.mkdirSync(testStateDir, { recursive: true }); + const proc = Bun.spawn(['sh', '-c', `cat "${promptFile}" | claude ${args.map(a => `"${a}"`).join(' ')}`], { cwd: workingDirectory, stdout: 'pipe', stderr: 'pipe', + env: { ...process.env, GSTACK_STATE_DIR: testStateDir }, }); // Race against timeout From 1584deaca8b3f618f4c96a05e8acc51c9eac37e7 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Fri, 20 Mar 2026 08:20:44 -0700 Subject: [PATCH 08/11] =?UTF-8?q?feat:=20richer=20error=20telemetry=20?= =?UTF-8?q?=E2=80=94=20error=5Fmessage=20+=20failed=5Fstep=20fields?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds error_message (max 200 chars, e.g. "bun test: 3 tests failed") and failed_step (e.g. "run_tests", "create_pr") to telemetry events. Schema, ingest function, and local logger all updated. Makes crash reports actionable instead of just "timeout — 252 occurrences". Co-Authored-By: Claude Opus 4.6 (1M context) --- bin/gstack-telemetry-log | 29 ++++++++++++++------ supabase/functions/telemetry-ingest/index.ts | 4 +++ supabase/migrations/002_community_tier.sql | 6 +++- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/bin/gstack-telemetry-log b/bin/gstack-telemetry-log index edcbdbab..5edde6dd 100755 --- a/bin/gstack-telemetry-log +++ b/bin/gstack-telemetry-log @@ -32,17 +32,21 @@ OUTCOME="unknown" USED_BROWSE="false" SESSION_ID="" ERROR_CLASS="" +ERROR_MESSAGE="" +FAILED_STEP="" EVENT_TYPE="skill_run" while [ $# -gt 0 ]; do case "$1" in - --skill) SKILL="$2"; shift 2 ;; - --duration) DURATION="$2"; shift 2 ;; - --outcome) OUTCOME="$2"; shift 2 ;; - --used-browse) USED_BROWSE="$2"; shift 2 ;; - --session-id) SESSION_ID="$2"; shift 2 ;; - --error-class) ERROR_CLASS="$2"; shift 2 ;; - --event-type) EVENT_TYPE="$2"; shift 2 ;; + --skill) SKILL="$2"; shift 2 ;; + --duration) DURATION="$2"; shift 2 ;; + --outcome) OUTCOME="$2"; shift 2 ;; + --used-browse) USED_BROWSE="$2"; shift 2 ;; + --session-id) SESSION_ID="$2"; shift 2 ;; + --error-class) ERROR_CLASS="$2"; shift 2 ;; + --error-message) ERROR_MESSAGE="$2"; shift 2 ;; + --failed-step) FAILED_STEP="$2"; shift 2 ;; + --event-type) EVENT_TYPE="$2"; shift 2 ;; *) shift ;; esac done @@ -135,6 +139,12 @@ mkdir -p "$ANALYTICS_DIR" ERR_FIELD="null" [ -n "$ERROR_CLASS" ] && ERR_FIELD="\"$ERROR_CLASS\"" +ERR_MSG_FIELD="null" +[ -n "$ERROR_MESSAGE" ] && ERR_MSG_FIELD="\"$(echo "$ERROR_MESSAGE" | head -c 200 | sed 's/"/\\"/g')\"" + +STEP_FIELD="null" +[ -n "$FAILED_STEP" ] && STEP_FIELD="\"$(echo "$FAILED_STEP" | head -c 30)\"" + DUR_FIELD="null" [ -n "$DURATION" ] && DUR_FIELD="$DURATION" @@ -144,9 +154,10 @@ INSTALL_FIELD="null" BROWSE_BOOL="false" [ "$USED_BROWSE" = "true" ] && BROWSE_BOOL="true" -printf '{"v":1,"ts":"%s","event_type":"%s","skill":"%s","session_id":"%s","gstack_version":"%s","os":"%s","arch":"%s","duration_s":%s,"outcome":"%s","error_class":%s,"used_browse":%s,"sessions":%s,"installation_id":%s,"_repo_slug":"%s","_branch":"%s"}\n' \ +printf '{"v":1,"ts":"%s","event_type":"%s","skill":"%s","session_id":"%s","gstack_version":"%s","os":"%s","arch":"%s","duration_s":%s,"outcome":"%s","error_class":%s,"error_message":%s,"failed_step":%s,"used_browse":%s,"sessions":%s,"installation_id":%s,"_repo_slug":"%s","_branch":"%s"}\n' \ "$TS" "$EVENT_TYPE" "$SKILL" "$SESSION_ID" "$GSTACK_VERSION" "$OS" "$ARCH" \ - "$DUR_FIELD" "$OUTCOME" "$ERR_FIELD" "$BROWSE_BOOL" "${SESSIONS:-1}" \ + "$DUR_FIELD" "$OUTCOME" "$ERR_FIELD" "$ERR_MSG_FIELD" "$STEP_FIELD" \ + "$BROWSE_BOOL" "${SESSIONS:-1}" \ "$INSTALL_FIELD" "$REPO_SLUG" "$BRANCH" >> "$JSONL_FILE" 2>/dev/null || true # ─── Trigger sync if tier is not off ───────────────────────── diff --git a/supabase/functions/telemetry-ingest/index.ts b/supabase/functions/telemetry-ingest/index.ts index 07d65d36..248c7d91 100644 --- a/supabase/functions/telemetry-ingest/index.ts +++ b/supabase/functions/telemetry-ingest/index.ts @@ -16,6 +16,8 @@ interface TelemetryEvent { duration_s?: number; outcome: string; error_class?: string; + error_message?: string; + failed_step?: string; used_browse?: boolean; sessions?: number; installation_id?: string; @@ -77,6 +79,8 @@ Deno.serve(async (req) => { duration_s: typeof event.duration_s === "number" ? event.duration_s : null, outcome: String(event.outcome).slice(0, 20), error_class: event.error_class ? String(event.error_class).slice(0, 100) : null, + error_message: event.error_message ? String(event.error_message).slice(0, 200) : null, + failed_step: event.failed_step ? String(event.failed_step).slice(0, 30) : null, used_browse: event.used_browse === true, concurrent_sessions: typeof event.sessions === "number" ? event.sessions : 1, installation_id: event.installation_id ? String(event.installation_id).slice(0, 64) : null, diff --git a/supabase/migrations/002_community_tier.sql b/supabase/migrations/002_community_tier.sql index 5bf0b789..3b46d847 100644 --- a/supabase/migrations/002_community_tier.sql +++ b/supabase/migrations/002_community_tier.sql @@ -1,5 +1,9 @@ -- gstack community tier schema --- Adds authenticated backup, benchmarks, and email to the telemetry platform. +-- Adds authenticated backup, benchmarks, email, and richer error telemetry. + +-- Add error context columns to telemetry_events +ALTER TABLE telemetry_events ADD COLUMN error_message TEXT; +ALTER TABLE telemetry_events ADD COLUMN failed_step TEXT; -- Add columns to installations for backup + email + auth identity ALTER TABLE installations ADD COLUMN user_id UUID; From 03de795195fa321ec6dd6974df3ebb35aca0fe58 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Fri, 20 Mar 2026 08:20:48 -0700 Subject: [PATCH 09/11] fix: simplify auth to OTP-only, remove magic link complexity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Magic link requires matching the Supabase Site URL to a dynamic local port, which doesn't work reliably. OTP is the right UX for a CLI tool — user is already in a terminal, typing 6 digits is fast. Removes bun callback server, nc listener, port detection, and cleanup traps. Co-Authored-By: Claude Opus 4.6 (1M context) --- bin/gstack-auth | 204 +++++++++++++++++------------------------------- 1 file changed, 71 insertions(+), 133 deletions(-) diff --git a/bin/gstack-auth b/bin/gstack-auth index 4078e781..99693a5a 100755 --- a/bin/gstack-auth +++ b/bin/gstack-auth @@ -1,15 +1,13 @@ #!/usr/bin/env bash -# gstack-auth — authenticate with Supabase via email OTP + magic link +# gstack-auth — authenticate with Supabase via email OTP # # Usage: # gstack-auth [email] — start auth flow (prompts if no email) # gstack-auth status — show current auth status # gstack-auth logout — remove saved tokens # -# Two-path authentication: -# 1. OTP: user enters 6-digit code from email in terminal -# 2. Magic link: user clicks link → redirects to local server -# Whichever completes first wins. +# Sends a 6-digit verification code to the user's email. +# User enters the code in the terminal to authenticate. # # Env overrides (for testing): # GSTACK_STATE_DIR — override ~/.gstack state directory @@ -65,16 +63,6 @@ json_field() { echo "$json" | grep -o "\"${field}\":[^,}]*" | head -1 | sed "s/\"${field}\"://;s/\"//g;s/ //g" } -# ─── Helper: clean up background processes ─────────────────── -cleanup() { - # Kill the local server if running - [ -n "${SERVER_PID:-}" ] && kill "$SERVER_PID" 2>/dev/null || true - # Remove temp files - [ -n "${CALLBACK_FILE:-}" ] && rm -f "$CALLBACK_FILE" 2>/dev/null || true - [ -n "${RESPONSE_FILE:-}" ] && rm -f "$RESPONSE_FILE" 2>/dev/null || true -} -trap cleanup EXIT - # ─── Subcommand: status ───────────────────────────────────── if [ "${1:-}" = "status" ]; then if [ ! -f "$AUTH_FILE" ]; then @@ -114,32 +102,16 @@ if [ -z "$EMAIL" ]; then exit 1 fi -# Validate email format (basic check) if ! echo "$EMAIL" | grep -qE '^[^@]+@[^@]+\.[^@]+$'; then echo "Error: invalid email format" exit 1 fi -# ─── Find a free port for magic link callback ──────────────── -find_free_port() { - # Try to find a free port using Python (available on macOS) - python3 -c 'import socket; s=socket.socket(); s.bind(("",0)); print(s.getsockname()[1]); s.close()' 2>/dev/null || echo "0" -} - -CALLBACK_PORT="$(find_free_port)" -CALLBACK_URL="http://localhost:${CALLBACK_PORT}/callback" -CALLBACK_FILE="$(mktemp)" -RESPONSE_FILE="$(mktemp)" - -# ─── Step 1: Send OTP (also sends magic link) ──────────────── +# ─── Step 1: Send OTP ──────────────────────────────────────── echo "" -echo "Sending verification email to ${EMAIL}..." +echo "Sending verification code to ${EMAIL}..." -# If we got a valid port, include redirect URL for magic link OTP_BODY="{\"email\":\"${EMAIL}\"}" -if [ "$CALLBACK_PORT" != "0" ]; then - OTP_BODY="{\"email\":\"${EMAIL}\",\"options\":{\"emailRedirectTo\":\"${CALLBACK_URL}\"}}" -fi HTTP_RESPONSE="$(curl -s -w "\n%{http_code}" \ -X POST "${AUTH_URL}/otp" \ @@ -147,15 +119,38 @@ HTTP_RESPONSE="$(curl -s -w "\n%{http_code}" \ -H "apikey: ${ANON_KEY}" \ -d "$OTP_BODY" 2>/dev/null || echo -e "\n000")" -HTTP_BODY="$(echo "$HTTP_RESPONSE" | head -n -1)" HTTP_CODE="$(echo "$HTTP_RESPONSE" | tail -1)" +HTTP_BODY="$(echo "$HTTP_RESPONSE" | sed '$d')" case "$HTTP_CODE" in 2*) ;; # success 429) - echo "Rate limited — please wait 60 seconds and try again." - exit 1 + if echo "$HTTP_BODY" | grep -q "email_send_rate_limit"; then + echo "" + echo "Email rate limit exceeded (Supabase free tier: ~3 emails/hour)." + echo "Try again in a few minutes, or set up custom SMTP in the Supabase" + echo "dashboard for unlimited sends." + exit 1 + fi + echo "Cooldown active — waiting 60s before retrying..." + for i in $(seq 60 -1 1); do + printf "\r Retrying in %2ds..." "$i" + sleep 1 + done + printf "\r \r" + echo "Retrying..." + HTTP_RESPONSE="$(curl -s -w "\n%{http_code}" \ + -X POST "${AUTH_URL}/otp" \ + -H "Content-Type: application/json" \ + -H "apikey: ${ANON_KEY}" \ + -d "$OTP_BODY" 2>/dev/null || echo -e "\n000")" + HTTP_CODE="$(echo "$HTTP_RESPONSE" | tail -1)" + HTTP_BODY="$(echo "$HTTP_RESPONSE" | sed '$d')" + case "$HTTP_CODE" in + 2*) ;; # success on retry + *) echo "Error sending OTP (HTTP ${HTTP_CODE}): ${HTTP_BODY}"; exit 1 ;; + esac ;; *) echo "Error sending OTP (HTTP ${HTTP_CODE}): ${HTTP_BODY}" @@ -164,110 +159,53 @@ case "$HTTP_CODE" in esac echo "" -echo "Check your email! Two ways to authenticate:" -echo " 1. Enter the 6-digit code below" -if [ "$CALLBACK_PORT" != "0" ]; then - echo " 2. Or click the magic link in the email" -fi +echo "Check your email for a 6-digit code." echo "" -# ─── Step 2: Start local server for magic link (background) ── -if [ "$CALLBACK_PORT" != "0" ]; then - # Start a simple HTTP listener that captures the callback - ( - # Use nc to listen for one connection - while true; do - REQUEST="$(echo -e "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n

gstack authenticated!

You can close this tab.

" | nc -l "$CALLBACK_PORT" 2>/dev/null || true)" - if echo "$REQUEST" | grep -q "GET /callback"; then - # Extract token_hash or access_token from query params - QUERY="$(echo "$REQUEST" | grep "GET /callback" | sed 's/GET \/callback?//' | awk '{print $1}')" - echo "$QUERY" > "$CALLBACK_FILE" - break - fi - done - ) & - SERVER_PID=$! -fi - -# ─── Step 3: Race OTP input vs magic link callback ─────────── +# ─── Step 2: Read OTP code ─────────────────────────────────── printf "Enter code: " +read -r OTP_CODE -# Read with 5-minute timeout -OTP_CODE="" -if read -r -t 300 OTP_CODE 2>/dev/null; then - : # Got OTP code from terminal -fi - -# Check if magic link callback arrived while we waited -MAGIC_LINK_TOKEN="" -if [ -f "$CALLBACK_FILE" ] && [ -s "$CALLBACK_FILE" ]; then - CALLBACK_DATA="$(cat "$CALLBACK_FILE")" - # Extract access_token from URL params - MAGIC_LINK_TOKEN="$(echo "$CALLBACK_DATA" | grep -o 'access_token=[^&]*' | sed 's/access_token=//' || true)" -fi - -# ─── Step 4: Verify (OTP path or magic link path) ──────────── -if [ -n "$MAGIC_LINK_TOKEN" ]; then - # Magic link path — token already obtained - echo "" - echo "Magic link authenticated!" - - # Get user info from the token - USER_RESPONSE="$(curl -s \ - -H "Authorization: Bearer ${MAGIC_LINK_TOKEN}" \ - -H "apikey: ${ANON_KEY}" \ - "${AUTH_URL}/user" 2>/dev/null || echo "{}")" - - USER_ID="$(json_field "$USER_RESPONSE" "id")" - # Extract refresh_token from callback params - REFRESH_TOKEN="$(echo "$CALLBACK_DATA" | grep -o 'refresh_token=[^&]*' | sed 's/refresh_token=//' || true)" - EXPIRES_IN="$(echo "$CALLBACK_DATA" | grep -o 'expires_in=[^&]*' | sed 's/expires_in=//' || echo "3600")" - - save_token "$MAGIC_LINK_TOKEN" "$REFRESH_TOKEN" "$EXPIRES_IN" "$EMAIL" "$USER_ID" - -elif [ -n "$OTP_CODE" ]; then - # OTP path — verify the code - OTP_CODE="$(echo "$OTP_CODE" | tr -d '[:space:]')" - - if ! echo "$OTP_CODE" | grep -qE '^[0-9]{6}$'; then - echo "Error: code must be exactly 6 digits" - exit 1 - fi - - VERIFY_RESPONSE="$(curl -s \ - -X POST "${AUTH_URL}/verify" \ - -H "Content-Type: application/json" \ - -H "apikey: ${ANON_KEY}" \ - -d "{\"email\":\"${EMAIL}\",\"token\":\"${OTP_CODE}\",\"type\":\"email\"}" \ - 2>/dev/null || echo "{}")" - - ACCESS_TOKEN="$(json_field "$VERIFY_RESPONSE" "access_token")" - REFRESH_TOKEN="$(json_field "$VERIFY_RESPONSE" "refresh_token")" - EXPIRES_IN="$(json_field "$VERIFY_RESPONSE" "expires_in")" - USER_ID="$(json_field "$VERIFY_RESPONSE" "id" 2>/dev/null || true)" - - # Try to get user_id from nested user object if not at top level - if [ -z "$USER_ID" ]; then - USER_ID="$(echo "$VERIFY_RESPONSE" | grep -o '"id":"[^"]*"' | head -1 | sed 's/"id":"//;s/"//')" - fi - - if [ -z "$ACCESS_TOKEN" ] || [ "$ACCESS_TOKEN" = "null" ]; then - ERROR_MSG="$(json_field "$VERIFY_RESPONSE" "error_description" 2>/dev/null || json_field "$VERIFY_RESPONSE" "msg" 2>/dev/null || echo "unknown error")" - echo "" - echo "Verification failed: $ERROR_MSG" - echo "Check the code and try again." - exit 1 - fi - - save_token "$ACCESS_TOKEN" "$REFRESH_TOKEN" "${EXPIRES_IN:-3600}" "$EMAIL" "$USER_ID" - -else - echo "" - echo "Timed out — no code entered and magic link not clicked." +if [ -z "$OTP_CODE" ]; then + echo "No code entered." exit 1 fi -# ─── Step 5: Save email to config ──────────────────────────── +# ─── Step 3: Verify OTP ───────────────────────────────────── +OTP_CODE="$(echo "$OTP_CODE" | tr -d '[:space:]')" + +if ! echo "$OTP_CODE" | grep -qE '^[0-9]{6}$'; then + echo "Error: code must be exactly 6 digits" + exit 1 +fi + +VERIFY_RESPONSE="$(curl -s \ + -X POST "${AUTH_URL}/verify" \ + -H "Content-Type: application/json" \ + -H "apikey: ${ANON_KEY}" \ + -d "{\"email\":\"${EMAIL}\",\"token\":\"${OTP_CODE}\",\"type\":\"email\"}" \ + 2>/dev/null || echo "{}")" + +ACCESS_TOKEN="$(json_field "$VERIFY_RESPONSE" "access_token")" +REFRESH_TOKEN="$(json_field "$VERIFY_RESPONSE" "refresh_token")" +EXPIRES_IN="$(json_field "$VERIFY_RESPONSE" "expires_in")" +USER_ID="$(json_field "$VERIFY_RESPONSE" "id" 2>/dev/null || true)" + +if [ -z "$USER_ID" ]; then + USER_ID="$(echo "$VERIFY_RESPONSE" | grep -o '"id":"[^"]*"' | head -1 | sed 's/"id":"//;s/"//')" +fi + +if [ -z "$ACCESS_TOKEN" ] || [ "$ACCESS_TOKEN" = "null" ]; then + ERROR_MSG="$(json_field "$VERIFY_RESPONSE" "error_description" 2>/dev/null || json_field "$VERIFY_RESPONSE" "msg" 2>/dev/null || echo "unknown error")" + echo "" + echo "Verification failed: $ERROR_MSG" + echo "Check the code and try again." + exit 1 +fi + +save_token "$ACCESS_TOKEN" "$REFRESH_TOKEN" "${EXPIRES_IN:-3600}" "$EMAIL" "$USER_ID" + +# ─── Step 4: Save email to config ──────────────────────────── "$GSTACK_DIR/bin/gstack-config" set email "$EMAIL" echo "" From 6ef78ab6c8b74aa6dfe7274302eaebda807b0716 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Fri, 20 Mar 2026 08:20:52 -0700 Subject: [PATCH 10/11] fix: dashboard crash dedup + actionable error display MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Crash clusters now grouped by error_class (not duplicated per version). Shows errors with skill, error class, count, failed step, example message, and unique session count — so you can tell if it's one user or widespread. Co-Authored-By: Claude Opus 4.6 (1M context) --- bin/gstack-community-dashboard | 38 +++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/bin/gstack-community-dashboard b/bin/gstack-community-dashboard index 468dc1ea..135bd3e1 100755 --- a/bin/gstack-community-dashboard +++ b/bin/gstack-community-dashboard @@ -81,19 +81,37 @@ else fi echo "" -# ─── Crash clusters ────────────────────────────────────────── -echo "Top crash clusters" -echo "──────────────────" +# ─── Errors (last 7 days) ──────────────────────────────────── +echo "Top errors (last 7 days)" +echo "────────────────────────" -CRASHES="$(query "crash_clusters" "select=error_class,gstack_version,total_occurrences,identified_users&limit=5" 2>/dev/null || echo "[]")" +ERRORS="$(query "telemetry_events" "select=skill,error_class,error_message,failed_step,duration_s,session_id&outcome=eq.error&event_timestamp=gte.${WEEK_AGO}&order=event_timestamp.desc&limit=200" 2>/dev/null || echo "[]")" -if [ "$CRASHES" != "[]" ] && [ -n "$CRASHES" ]; then - echo "$CRASHES" | grep -o '"error_class":"[^"]*"' | awk -F'"' '{print $4}' | head -5 | while read -r ERR; do - C="$(echo "$CRASHES" | grep -o "\"error_class\":\"$ERR\"[^}]*\"total_occurrences\":[0-9]*" | grep -o '"total_occurrences":[0-9]*' | head -1 | grep -o '[0-9]*')" - printf " %-30s %s occurrences\n" "$ERR" "${C:-?}" - done +if [ "$ERRORS" != "[]" ] && [ -n "$ERRORS" ]; then + # Group by skill + error_class, show count and example message + echo "$ERRORS" | grep -o '"skill":"[^"]*"[^}]*"error_class":"[^"]*"' | \ + sed 's/.*"skill":"//;s/".*"error_class":"/\t/' | sed 's/"$//' | \ + sort | uniq -c | sort -rn | head -8 | while read -r COUNT COMBO; do + SKILL="$(echo "$COMBO" | cut -f1)" + ERR="$(echo "$COMBO" | cut -f2)" + # Find an example error_message for this combo + MSG="$(echo "$ERRORS" | grep -o "\"skill\":\"${SKILL}\"[^}]*\"error_message\":\"[^\"]*\"" | \ + grep -o '"error_message":"[^"]*"' | head -1 | sed 's/"error_message":"//;s/"$//' || true)" + # Find an example failed_step + STEP="$(echo "$ERRORS" | grep -o "\"skill\":\"${SKILL}\"[^}]*\"failed_step\":\"[^\"]*\"" | \ + grep -o '"failed_step":"[^"]*"' | head -1 | sed 's/"failed_step":"//;s/"$//' || true)" + + printf " /%-12s %-18s %3d errors\n" "$SKILL" "${ERR:-unknown}" "$COUNT" + [ -n "$STEP" ] && printf " step: %s\n" "$STEP" + [ -n "$MSG" ] && printf " e.g.: %s\n" "$(echo "$MSG" | head -c 80)" + done + + # Show how many unique sessions have errors + ERR_SESSIONS="$(echo "$ERRORS" | grep -o '"session_id":"[^"]*"' | sort -u | wc -l | tr -d ' ')" + echo "" + echo " ${ERR_SESSIONS} unique session(s) with errors" else - echo " No crashes reported" + echo " No errors reported" fi echo "" From b349769e2e28411fd2b837b4031972f7bbb390cc Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Fri, 20 Mar 2026 08:21:00 -0700 Subject: [PATCH 11/11] feat: telemetry epilogue captures error context + regenerate SKILLs Epilogue now instructs Claude to classify errors (error_class from a defined taxonomy), write a one-line error_message, and identify the failed_step. All 33 SKILL.md files regenerated. Co-Authored-By: Claude Opus 4.6 (1M context) --- .agents/skills/gstack-browse/SKILL.md | 22 ++++++++++++++++--- .../gstack-design-consultation/SKILL.md | 22 ++++++++++++++++--- .agents/skills/gstack-design-review/SKILL.md | 22 ++++++++++++++++--- .../skills/gstack-document-release/SKILL.md | 22 ++++++++++++++++--- .agents/skills/gstack-investigate/SKILL.md | 22 ++++++++++++++++--- .agents/skills/gstack-office-hours/SKILL.md | 22 ++++++++++++++++--- .../skills/gstack-plan-ceo-review/SKILL.md | 22 ++++++++++++++++--- .../skills/gstack-plan-design-review/SKILL.md | 22 ++++++++++++++++--- .../skills/gstack-plan-eng-review/SKILL.md | 22 ++++++++++++++++--- .agents/skills/gstack-qa-only/SKILL.md | 22 ++++++++++++++++--- .agents/skills/gstack-qa/SKILL.md | 22 ++++++++++++++++--- .agents/skills/gstack-retro/SKILL.md | 22 ++++++++++++++++--- .agents/skills/gstack-review/SKILL.md | 22 ++++++++++++++++--- .../gstack-setup-browser-cookies/SKILL.md | 22 ++++++++++++++++--- .agents/skills/gstack-ship/SKILL.md | 22 ++++++++++++++++--- .agents/skills/gstack/SKILL.md | 22 ++++++++++++++++--- SKILL.md | 22 ++++++++++++++++--- browse/SKILL.md | 22 ++++++++++++++++--- codex/SKILL.md | 22 ++++++++++++++++--- design-consultation/SKILL.md | 22 ++++++++++++++++--- design-review/SKILL.md | 22 ++++++++++++++++--- document-release/SKILL.md | 22 ++++++++++++++++--- investigate/SKILL.md | 22 ++++++++++++++++--- office-hours/SKILL.md | 22 ++++++++++++++++--- plan-ceo-review/SKILL.md | 22 ++++++++++++++++--- plan-design-review/SKILL.md | 22 ++++++++++++++++--- plan-eng-review/SKILL.md | 22 ++++++++++++++++--- qa-only/SKILL.md | 22 ++++++++++++++++--- qa/SKILL.md | 22 ++++++++++++++++--- retro/SKILL.md | 22 ++++++++++++++++--- review/SKILL.md | 22 ++++++++++++++++--- scripts/gen-skill-docs.ts | 22 ++++++++++++++++--- setup-browser-cookies/SKILL.md | 22 ++++++++++++++++--- ship/SKILL.md | 22 ++++++++++++++++--- 34 files changed, 646 insertions(+), 102 deletions(-) diff --git a/.agents/skills/gstack-browse/SKILL.md b/.agents/skills/gstack-browse/SKILL.md index a4a2dcba..52ebaba8 100644 --- a/.agents/skills/gstack-browse/SKILL.md +++ b/.agents/skills/gstack-browse/SKILL.md @@ -228,7 +228,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -236,12 +248,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.codex/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. # browse: QA Testing & Dogfooding diff --git a/.agents/skills/gstack-design-consultation/SKILL.md b/.agents/skills/gstack-design-consultation/SKILL.md index 786b66d5..02f9081f 100644 --- a/.agents/skills/gstack-design-consultation/SKILL.md +++ b/.agents/skills/gstack-design-consultation/SKILL.md @@ -229,7 +229,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -237,12 +249,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.codex/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. # /design-consultation: Your Design System, Built Together diff --git a/.agents/skills/gstack-design-review/SKILL.md b/.agents/skills/gstack-design-review/SKILL.md index 8a7d8cbb..57cf6d37 100644 --- a/.agents/skills/gstack-design-review/SKILL.md +++ b/.agents/skills/gstack-design-review/SKILL.md @@ -229,7 +229,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -237,12 +249,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.codex/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. # /design-review: Design Audit → Fix → Verify diff --git a/.agents/skills/gstack-document-release/SKILL.md b/.agents/skills/gstack-document-release/SKILL.md index 99ca54e8..122baf07 100644 --- a/.agents/skills/gstack-document-release/SKILL.md +++ b/.agents/skills/gstack-document-release/SKILL.md @@ -227,7 +227,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -235,12 +247,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.codex/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. ## Step 0: Detect base branch diff --git a/.agents/skills/gstack-investigate/SKILL.md b/.agents/skills/gstack-investigate/SKILL.md index 61885abf..5d24c4af 100644 --- a/.agents/skills/gstack-investigate/SKILL.md +++ b/.agents/skills/gstack-investigate/SKILL.md @@ -230,7 +230,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -238,12 +250,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.codex/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. # Systematic Debugging diff --git a/.agents/skills/gstack-office-hours/SKILL.md b/.agents/skills/gstack-office-hours/SKILL.md index ae8a7e12..f7a9ca79 100644 --- a/.agents/skills/gstack-office-hours/SKILL.md +++ b/.agents/skills/gstack-office-hours/SKILL.md @@ -231,7 +231,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -239,12 +251,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.codex/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. # YC Office Hours diff --git a/.agents/skills/gstack-plan-ceo-review/SKILL.md b/.agents/skills/gstack-plan-ceo-review/SKILL.md index 6681da4f..5fcb37e8 100644 --- a/.agents/skills/gstack-plan-ceo-review/SKILL.md +++ b/.agents/skills/gstack-plan-ceo-review/SKILL.md @@ -230,7 +230,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -238,12 +250,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.codex/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. ## Step 0: Detect base branch diff --git a/.agents/skills/gstack-plan-design-review/SKILL.md b/.agents/skills/gstack-plan-design-review/SKILL.md index d759107e..353b08c3 100644 --- a/.agents/skills/gstack-plan-design-review/SKILL.md +++ b/.agents/skills/gstack-plan-design-review/SKILL.md @@ -229,7 +229,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -237,12 +249,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.codex/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. ## Step 0: Detect base branch diff --git a/.agents/skills/gstack-plan-eng-review/SKILL.md b/.agents/skills/gstack-plan-eng-review/SKILL.md index a8f032bf..163a6c4d 100644 --- a/.agents/skills/gstack-plan-eng-review/SKILL.md +++ b/.agents/skills/gstack-plan-eng-review/SKILL.md @@ -228,7 +228,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -236,12 +248,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.codex/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. # Plan Review Mode diff --git a/.agents/skills/gstack-qa-only/SKILL.md b/.agents/skills/gstack-qa-only/SKILL.md index f67502db..75aa4630 100644 --- a/.agents/skills/gstack-qa-only/SKILL.md +++ b/.agents/skills/gstack-qa-only/SKILL.md @@ -227,7 +227,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -235,12 +247,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.codex/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. # /qa-only: Report-Only QA Testing diff --git a/.agents/skills/gstack-qa/SKILL.md b/.agents/skills/gstack-qa/SKILL.md index 136b989a..a527e80a 100644 --- a/.agents/skills/gstack-qa/SKILL.md +++ b/.agents/skills/gstack-qa/SKILL.md @@ -230,7 +230,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -238,12 +250,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.codex/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. ## Step 0: Detect base branch diff --git a/.agents/skills/gstack-retro/SKILL.md b/.agents/skills/gstack-retro/SKILL.md index f71a79ed..6f334a9c 100644 --- a/.agents/skills/gstack-retro/SKILL.md +++ b/.agents/skills/gstack-retro/SKILL.md @@ -227,7 +227,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -235,12 +247,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.codex/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. ## Detect default branch diff --git a/.agents/skills/gstack-review/SKILL.md b/.agents/skills/gstack-review/SKILL.md index be90a6cf..3bbec6b7 100644 --- a/.agents/skills/gstack-review/SKILL.md +++ b/.agents/skills/gstack-review/SKILL.md @@ -226,7 +226,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -234,12 +246,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.codex/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. ## Step 0: Detect base branch diff --git a/.agents/skills/gstack-setup-browser-cookies/SKILL.md b/.agents/skills/gstack-setup-browser-cookies/SKILL.md index 096af8cf..c9c084c2 100644 --- a/.agents/skills/gstack-setup-browser-cookies/SKILL.md +++ b/.agents/skills/gstack-setup-browser-cookies/SKILL.md @@ -226,7 +226,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -234,12 +246,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.codex/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. # Setup Browser Cookies diff --git a/.agents/skills/gstack-ship/SKILL.md b/.agents/skills/gstack-ship/SKILL.md index a6ccf7c3..c922523e 100644 --- a/.agents/skills/gstack-ship/SKILL.md +++ b/.agents/skills/gstack-ship/SKILL.md @@ -224,7 +224,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -232,12 +244,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.codex/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. ## Step 0: Detect base branch diff --git a/.agents/skills/gstack/SKILL.md b/.agents/skills/gstack/SKILL.md index 0aee73d9..02b5d704 100644 --- a/.agents/skills/gstack/SKILL.md +++ b/.agents/skills/gstack/SKILL.md @@ -259,7 +259,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -267,12 +279,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.codex/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. If `PROACTIVE` is `false`: do NOT proactively suggest other gstack skills during this session. diff --git a/SKILL.md b/SKILL.md index 7fcafe0e..5328edbe 100644 --- a/SKILL.md +++ b/SKILL.md @@ -265,7 +265,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -273,12 +285,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.claude/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. If `PROACTIVE` is `false`: do NOT proactively suggest other gstack skills during this session. diff --git a/browse/SKILL.md b/browse/SKILL.md index 2c550a95..d146eb81 100644 --- a/browse/SKILL.md +++ b/browse/SKILL.md @@ -234,7 +234,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -242,12 +254,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.claude/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. # browse: QA Testing & Dogfooding diff --git a/codex/SKILL.md b/codex/SKILL.md index 3771e269..5776be0d 100644 --- a/codex/SKILL.md +++ b/codex/SKILL.md @@ -235,7 +235,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -243,12 +255,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.claude/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. ## Step 0: Detect base branch diff --git a/design-consultation/SKILL.md b/design-consultation/SKILL.md index 51dfbb1b..0aea3d6e 100644 --- a/design-consultation/SKILL.md +++ b/design-consultation/SKILL.md @@ -239,7 +239,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -247,12 +259,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.claude/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. # /design-consultation: Your Design System, Built Together diff --git a/design-review/SKILL.md b/design-review/SKILL.md index 811eb08f..523552ea 100644 --- a/design-review/SKILL.md +++ b/design-review/SKILL.md @@ -239,7 +239,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -247,12 +259,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.claude/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. # /design-review: Design Audit → Fix → Verify diff --git a/document-release/SKILL.md b/document-release/SKILL.md index 5c605d5b..2aab8ec4 100644 --- a/document-release/SKILL.md +++ b/document-release/SKILL.md @@ -236,7 +236,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -244,12 +256,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.claude/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. ## Step 0: Detect base branch diff --git a/investigate/SKILL.md b/investigate/SKILL.md index 931f71d8..11ec082a 100644 --- a/investigate/SKILL.md +++ b/investigate/SKILL.md @@ -249,7 +249,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -257,12 +269,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.claude/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. # Systematic Debugging diff --git a/office-hours/SKILL.md b/office-hours/SKILL.md index e854214e..68253fa6 100644 --- a/office-hours/SKILL.md +++ b/office-hours/SKILL.md @@ -240,7 +240,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -248,12 +260,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.claude/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. # YC Office Hours diff --git a/plan-ceo-review/SKILL.md b/plan-ceo-review/SKILL.md index fdf8a4c2..2e30a2cf 100644 --- a/plan-ceo-review/SKILL.md +++ b/plan-ceo-review/SKILL.md @@ -237,7 +237,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -245,12 +257,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.claude/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. ## Step 0: Detect base branch diff --git a/plan-design-review/SKILL.md b/plan-design-review/SKILL.md index ca5c8372..6bf57109 100644 --- a/plan-design-review/SKILL.md +++ b/plan-design-review/SKILL.md @@ -237,7 +237,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -245,12 +257,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.claude/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. ## Step 0: Detect base branch diff --git a/plan-eng-review/SKILL.md b/plan-eng-review/SKILL.md index 11f0a06a..4a476b92 100644 --- a/plan-eng-review/SKILL.md +++ b/plan-eng-review/SKILL.md @@ -236,7 +236,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -244,12 +256,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.claude/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. # Plan Review Mode diff --git a/qa-only/SKILL.md b/qa-only/SKILL.md index 921cd3d5..0ad3214e 100644 --- a/qa-only/SKILL.md +++ b/qa-only/SKILL.md @@ -233,7 +233,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -241,12 +253,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.claude/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. # /qa-only: Report-Only QA Testing diff --git a/qa/SKILL.md b/qa/SKILL.md index 59920798..169c791e 100644 --- a/qa/SKILL.md +++ b/qa/SKILL.md @@ -240,7 +240,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -248,12 +260,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.claude/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. ## Step 0: Detect base branch diff --git a/retro/SKILL.md b/retro/SKILL.md index 206b45d3..fb473c17 100644 --- a/retro/SKILL.md +++ b/retro/SKILL.md @@ -234,7 +234,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -242,12 +254,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.claude/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. ## Detect default branch diff --git a/review/SKILL.md b/review/SKILL.md index d8989733..7c4e2a8b 100644 --- a/review/SKILL.md +++ b/review/SKILL.md @@ -235,7 +235,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -243,12 +255,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.claude/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. ## Step 0: Detect base branch diff --git a/scripts/gen-skill-docs.ts b/scripts/gen-skill-docs.ts index 41c5e1b6..59af04a5 100644 --- a/scripts/gen-skill-docs.ts +++ b/scripts/gen-skill-docs.ts @@ -370,7 +370,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the \`name:\` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- \`ERROR_CLASS\`: a short category — one of: \`timeout\`, \`test_failure\`, \`build_failure\`, + \`git_error\`, \`auth_error\`, \`network_error\`, \`browse_error\`, \`lint_error\`, + \`merge_conflict\`, \`permission_error\`, \`unknown_error\`. Pick the most specific match. +- \`ERROR_MESSAGE\`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: \`"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"\`. Never include file paths, secrets, or PII. +- \`FAILED_STEP\`: which step in the skill workflow failed. Example: \`"run_tests"\`, + \`"create_pr"\`, \`"merge_base"\`, \`"build"\`, \`"qa_browse"\`. Use snake_case, max 30 chars. + +Run this bash: \`\`\`bash _TEL_END=$(date +%s) @@ -378,12 +390,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.claude/skills/gstack/bin/gstack-telemetry-log \\ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \\ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \\ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \\ + --failed-step "FAILED_STEP" 2>/dev/null & \`\`\` Replace \`SKILL_NAME\` with the actual skill name from frontmatter, \`OUTCOME\` with success/error/abort, and \`USED_BROWSE\` with true/false based on whether \`$B\` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For \`ERROR_CLASS\`, \`ERROR_MESSAGE\`, and \`FAILED_STEP\`: use empty string \`""\` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use \`"unknown_error"\`, \`""\`, and \`""\` respectively. This runs in the background and never blocks the user.`; } diff --git a/setup-browser-cookies/SKILL.md b/setup-browser-cookies/SKILL.md index 7307fb43..306b0878 100644 --- a/setup-browser-cookies/SKILL.md +++ b/setup-browser-cookies/SKILL.md @@ -231,7 +231,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -239,12 +251,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.claude/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. # Setup Browser Cookies diff --git a/ship/SKILL.md b/ship/SKILL.md index 93d6b087..2934777a 100644 --- a/ship/SKILL.md +++ b/ship/SKILL.md @@ -234,7 +234,19 @@ RECOMMENDATION: [what the user should do next] After the skill workflow completes (success, error, or abort), log the telemetry event. Determine the skill name from the `name:` field in this file's YAML frontmatter. Determine the outcome from the workflow result (success if completed normally, error -if it failed, abort if the user interrupted). Run this bash: +if it failed, abort if the user interrupted). + +**For errors:** Also determine: +- `ERROR_CLASS`: a short category — one of: `timeout`, `test_failure`, `build_failure`, + `git_error`, `auth_error`, `network_error`, `browse_error`, `lint_error`, + `merge_conflict`, `permission_error`, `unknown_error`. Pick the most specific match. +- `ERROR_MESSAGE`: a one-line summary of what went wrong (max 200 chars). Include the + command that failed and the key error text. Example: `"bun test: 3 tests failed in + auth.test.ts — expected 200 got 401"`. Never include file paths, secrets, or PII. +- `FAILED_STEP`: which step in the skill workflow failed. Example: `"run_tests"`, + `"create_pr"`, `"merge_base"`, `"build"`, `"qa_browse"`. Use snake_case, max 30 chars. + +Run this bash: ```bash _TEL_END=$(date +%s) @@ -242,12 +254,16 @@ _TEL_DUR=$(( _TEL_END - _TEL_START )) rm -f ~/.gstack/analytics/.pending-"$_SESSION_ID" 2>/dev/null || true ~/.claude/skills/gstack/bin/gstack-telemetry-log \ --skill "SKILL_NAME" --duration "$_TEL_DUR" --outcome "OUTCOME" \ - --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" 2>/dev/null & + --used-browse "USED_BROWSE" --session-id "$_SESSION_ID" \ + --error-class "ERROR_CLASS" --error-message "ERROR_MESSAGE" \ + --failed-step "FAILED_STEP" 2>/dev/null & ``` Replace `SKILL_NAME` with the actual skill name from frontmatter, `OUTCOME` with success/error/abort, and `USED_BROWSE` with true/false based on whether `$B` was used. -If you cannot determine the outcome, use "unknown". This runs in the background and +For `ERROR_CLASS`, `ERROR_MESSAGE`, and `FAILED_STEP`: use empty string `""` if the +outcome is not error. If the outcome is error but you cannot determine the details, +use `"unknown_error"`, `""`, and `""` respectively. This runs in the background and never blocks the user. ## Step 0: Detect base branch