From a5c8bd15ed40ea46ab0a7d1d267a756120684fae Mon Sep 17 00:00:00 2001 From: manoj30075 Date: Tue, 24 Mar 2026 17:56:44 -0400 Subject: [PATCH] fix: gracefully degrade AskUserQuestion in remote control mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When Claude Code is used via the Anthropic app's remote control feature, AskUserQuestion renders an interactive terminal UI that the user cannot interact with. This adds remote control detection to the preamble and instructs Claude to fall back to plain text numbered questions. Detection is conversation-based: Claude checks for "Remote Control connecting…" without a subsequent disconnect in the conversation history. Also supports explicit opt-in via gstack-config or env var as fallback. Zero config for users — fully self-contained in the preamble template, auto-propagates to all 23+ skills. Co-Authored-By: Claude Opus 4.6 (1M context) --- SKILL.md | 9 +++++++++ autoplan/SKILL.md | 27 +++++++++++++++++++++++++++ benchmark/SKILL.md | 9 +++++++++ browse/SKILL.md | 9 +++++++++ canary/SKILL.md | 27 +++++++++++++++++++++++++++ codex/SKILL.md | 27 +++++++++++++++++++++++++++ cso/SKILL.md | 27 +++++++++++++++++++++++++++ design-consultation/SKILL.md | 27 +++++++++++++++++++++++++++ design-review/SKILL.md | 27 +++++++++++++++++++++++++++ document-release/SKILL.md | 27 +++++++++++++++++++++++++++ investigate/SKILL.md | 27 +++++++++++++++++++++++++++ land-and-deploy/SKILL.md | 27 +++++++++++++++++++++++++++ office-hours/SKILL.md | 27 +++++++++++++++++++++++++++ plan-ceo-review/SKILL.md | 27 +++++++++++++++++++++++++++ plan-design-review/SKILL.md | 27 +++++++++++++++++++++++++++ plan-eng-review/SKILL.md | 27 +++++++++++++++++++++++++++ qa-only/SKILL.md | 27 +++++++++++++++++++++++++++ qa/SKILL.md | 27 +++++++++++++++++++++++++++ retro/SKILL.md | 27 +++++++++++++++++++++++++++ review/SKILL.md | 27 +++++++++++++++++++++++++++ scripts/resolvers/preamble.ts | 27 +++++++++++++++++++++++++++ setup-browser-cookies/SKILL.md | 9 +++++++++ setup-deploy/SKILL.md | 27 +++++++++++++++++++++++++++ ship/SKILL.md | 27 +++++++++++++++++++++++++++ 24 files changed, 576 insertions(+) diff --git a/SKILL.md b/SKILL.md index bee0571d9..4f2550b2f 100644 --- a/SKILL.md +++ b/SKILL.md @@ -50,6 +50,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" 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 # zsh-compatible: use find instead of glob to avoid NOMATCH error diff --git a/autoplan/SKILL.md b/autoplan/SKILL.md index 036240987..fbaaa27c7 100644 --- a/autoplan/SKILL.md +++ b/autoplan/SKILL.md @@ -51,6 +51,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" mkdir -p ~/.gstack/analytics echo '{"skill":"autoplan","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 # zsh-compatible: use find instead of glob to avoid NOMATCH error @@ -109,6 +118,24 @@ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. ## AskUserQuestion Format +**REMOTE CONTROL DETECTION:** Check if remote control is active by looking at BOTH: +1. The `REMOTE_CONTROL` value from the preamble output above +2. The conversation history — if you can see `Remote Control connecting…` WITHOUT a + subsequent `Remote Control disconnected.`, remote control is currently active + +If EITHER indicates remote control is active, do NOT use the AskUserQuestion tool. +Instead: +- Present the question and options as plain text in your response +- Format options as a numbered list (1, 2, 3...) so the user can reply with a number +- Include your recommendation inline: "I'd recommend option X because..." +- Wait for the user to reply with their choice before proceeding +- For yes/no questions, just ask directly in plain text + +This applies to ALL AskUserQuestion calls throughout the entire skill workflow, +including telemetry prompts, lake intro, upgrade checks, and skill-specific questions. + +**When remote control is NOT active (normal terminal mode), use AskUserQuestion as usual:** + **ALWAYS follow this structure for every AskUserQuestion call:** 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences) 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called. diff --git a/benchmark/SKILL.md b/benchmark/SKILL.md index c6d2f72c4..f52a7c69b 100644 --- a/benchmark/SKILL.md +++ b/benchmark/SKILL.md @@ -44,6 +44,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" mkdir -p ~/.gstack/analytics echo '{"skill":"benchmark","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 # zsh-compatible: use find instead of glob to avoid NOMATCH error diff --git a/browse/SKILL.md b/browse/SKILL.md index af3274c32..9724dfa47 100644 --- a/browse/SKILL.md +++ b/browse/SKILL.md @@ -44,6 +44,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" 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 # zsh-compatible: use find instead of glob to avoid NOMATCH error diff --git a/canary/SKILL.md b/canary/SKILL.md index 26868d55c..c29da83e0 100644 --- a/canary/SKILL.md +++ b/canary/SKILL.md @@ -44,6 +44,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" mkdir -p ~/.gstack/analytics echo '{"skill":"canary","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 # zsh-compatible: use find instead of glob to avoid NOMATCH error @@ -102,6 +111,24 @@ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. ## AskUserQuestion Format +**REMOTE CONTROL DETECTION:** Check if remote control is active by looking at BOTH: +1. The `REMOTE_CONTROL` value from the preamble output above +2. The conversation history — if you can see `Remote Control connecting…` WITHOUT a + subsequent `Remote Control disconnected.`, remote control is currently active + +If EITHER indicates remote control is active, do NOT use the AskUserQuestion tool. +Instead: +- Present the question and options as plain text in your response +- Format options as a numbered list (1, 2, 3...) so the user can reply with a number +- Include your recommendation inline: "I'd recommend option X because..." +- Wait for the user to reply with their choice before proceeding +- For yes/no questions, just ask directly in plain text + +This applies to ALL AskUserQuestion calls throughout the entire skill workflow, +including telemetry prompts, lake intro, upgrade checks, and skill-specific questions. + +**When remote control is NOT active (normal terminal mode), use AskUserQuestion as usual:** + **ALWAYS follow this structure for every AskUserQuestion call:** 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences) 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called. diff --git a/codex/SKILL.md b/codex/SKILL.md index 6b3d45c6f..a0444b6a3 100644 --- a/codex/SKILL.md +++ b/codex/SKILL.md @@ -45,6 +45,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" 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 # zsh-compatible: use find instead of glob to avoid NOMATCH error @@ -103,6 +112,24 @@ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. ## AskUserQuestion Format +**REMOTE CONTROL DETECTION:** Check if remote control is active by looking at BOTH: +1. The `REMOTE_CONTROL` value from the preamble output above +2. The conversation history — if you can see `Remote Control connecting…` WITHOUT a + subsequent `Remote Control disconnected.`, remote control is currently active + +If EITHER indicates remote control is active, do NOT use the AskUserQuestion tool. +Instead: +- Present the question and options as plain text in your response +- Format options as a numbered list (1, 2, 3...) so the user can reply with a number +- Include your recommendation inline: "I'd recommend option X because..." +- Wait for the user to reply with their choice before proceeding +- For yes/no questions, just ask directly in plain text + +This applies to ALL AskUserQuestion calls throughout the entire skill workflow, +including telemetry prompts, lake intro, upgrade checks, and skill-specific questions. + +**When remote control is NOT active (normal terminal mode), use AskUserQuestion as usual:** + **ALWAYS follow this structure for every AskUserQuestion call:** 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences) 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called. diff --git a/cso/SKILL.md b/cso/SKILL.md index 47a7a0432..8110fd1bb 100644 --- a/cso/SKILL.md +++ b/cso/SKILL.md @@ -48,6 +48,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" mkdir -p ~/.gstack/analytics echo '{"skill":"cso","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 # zsh-compatible: use find instead of glob to avoid NOMATCH error @@ -106,6 +115,24 @@ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. ## AskUserQuestion Format +**REMOTE CONTROL DETECTION:** Check if remote control is active by looking at BOTH: +1. The `REMOTE_CONTROL` value from the preamble output above +2. The conversation history — if you can see `Remote Control connecting…` WITHOUT a + subsequent `Remote Control disconnected.`, remote control is currently active + +If EITHER indicates remote control is active, do NOT use the AskUserQuestion tool. +Instead: +- Present the question and options as plain text in your response +- Format options as a numbered list (1, 2, 3...) so the user can reply with a number +- Include your recommendation inline: "I'd recommend option X because..." +- Wait for the user to reply with their choice before proceeding +- For yes/no questions, just ask directly in plain text + +This applies to ALL AskUserQuestion calls throughout the entire skill workflow, +including telemetry prompts, lake intro, upgrade checks, and skill-specific questions. + +**When remote control is NOT active (normal terminal mode), use AskUserQuestion as usual:** + **ALWAYS follow this structure for every AskUserQuestion call:** 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences) 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called. diff --git a/design-consultation/SKILL.md b/design-consultation/SKILL.md index 826f3097b..1b682a2a1 100644 --- a/design-consultation/SKILL.md +++ b/design-consultation/SKILL.md @@ -49,6 +49,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" 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 # zsh-compatible: use find instead of glob to avoid NOMATCH error @@ -107,6 +116,24 @@ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. ## AskUserQuestion Format +**REMOTE CONTROL DETECTION:** Check if remote control is active by looking at BOTH: +1. The `REMOTE_CONTROL` value from the preamble output above +2. The conversation history — if you can see `Remote Control connecting…` WITHOUT a + subsequent `Remote Control disconnected.`, remote control is currently active + +If EITHER indicates remote control is active, do NOT use the AskUserQuestion tool. +Instead: +- Present the question and options as plain text in your response +- Format options as a numbered list (1, 2, 3...) so the user can reply with a number +- Include your recommendation inline: "I'd recommend option X because..." +- Wait for the user to reply with their choice before proceeding +- For yes/no questions, just ask directly in plain text + +This applies to ALL AskUserQuestion calls throughout the entire skill workflow, +including telemetry prompts, lake intro, upgrade checks, and skill-specific questions. + +**When remote control is NOT active (normal terminal mode), use AskUserQuestion as usual:** + **ALWAYS follow this structure for every AskUserQuestion call:** 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences) 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called. diff --git a/design-review/SKILL.md b/design-review/SKILL.md index 953d9d1a6..4342a9f06 100644 --- a/design-review/SKILL.md +++ b/design-review/SKILL.md @@ -49,6 +49,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" 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 # zsh-compatible: use find instead of glob to avoid NOMATCH error @@ -107,6 +116,24 @@ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. ## AskUserQuestion Format +**REMOTE CONTROL DETECTION:** Check if remote control is active by looking at BOTH: +1. The `REMOTE_CONTROL` value from the preamble output above +2. The conversation history — if you can see `Remote Control connecting…` WITHOUT a + subsequent `Remote Control disconnected.`, remote control is currently active + +If EITHER indicates remote control is active, do NOT use the AskUserQuestion tool. +Instead: +- Present the question and options as plain text in your response +- Format options as a numbered list (1, 2, 3...) so the user can reply with a number +- Include your recommendation inline: "I'd recommend option X because..." +- Wait for the user to reply with their choice before proceeding +- For yes/no questions, just ask directly in plain text + +This applies to ALL AskUserQuestion calls throughout the entire skill workflow, +including telemetry prompts, lake intro, upgrade checks, and skill-specific questions. + +**When remote control is NOT active (normal terminal mode), use AskUserQuestion as usual:** + **ALWAYS follow this structure for every AskUserQuestion call:** 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences) 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called. diff --git a/document-release/SKILL.md b/document-release/SKILL.md index 9748b2d60..a5a4e2b85 100644 --- a/document-release/SKILL.md +++ b/document-release/SKILL.md @@ -46,6 +46,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" 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 # zsh-compatible: use find instead of glob to avoid NOMATCH error @@ -104,6 +113,24 @@ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. ## AskUserQuestion Format +**REMOTE CONTROL DETECTION:** Check if remote control is active by looking at BOTH: +1. The `REMOTE_CONTROL` value from the preamble output above +2. The conversation history — if you can see `Remote Control connecting…` WITHOUT a + subsequent `Remote Control disconnected.`, remote control is currently active + +If EITHER indicates remote control is active, do NOT use the AskUserQuestion tool. +Instead: +- Present the question and options as plain text in your response +- Format options as a numbered list (1, 2, 3...) so the user can reply with a number +- Include your recommendation inline: "I'd recommend option X because..." +- Wait for the user to reply with their choice before proceeding +- For yes/no questions, just ask directly in plain text + +This applies to ALL AskUserQuestion calls throughout the entire skill workflow, +including telemetry prompts, lake intro, upgrade checks, and skill-specific questions. + +**When remote control is NOT active (normal terminal mode), use AskUserQuestion as usual:** + **ALWAYS follow this structure for every AskUserQuestion call:** 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences) 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called. diff --git a/investigate/SKILL.md b/investigate/SKILL.md index 270c08290..1cb469fca 100644 --- a/investigate/SKILL.md +++ b/investigate/SKILL.md @@ -60,6 +60,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" 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 # zsh-compatible: use find instead of glob to avoid NOMATCH error @@ -118,6 +127,24 @@ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. ## AskUserQuestion Format +**REMOTE CONTROL DETECTION:** Check if remote control is active by looking at BOTH: +1. The `REMOTE_CONTROL` value from the preamble output above +2. The conversation history — if you can see `Remote Control connecting…` WITHOUT a + subsequent `Remote Control disconnected.`, remote control is currently active + +If EITHER indicates remote control is active, do NOT use the AskUserQuestion tool. +Instead: +- Present the question and options as plain text in your response +- Format options as a numbered list (1, 2, 3...) so the user can reply with a number +- Include your recommendation inline: "I'd recommend option X because..." +- Wait for the user to reply with their choice before proceeding +- For yes/no questions, just ask directly in plain text + +This applies to ALL AskUserQuestion calls throughout the entire skill workflow, +including telemetry prompts, lake intro, upgrade checks, and skill-specific questions. + +**When remote control is NOT active (normal terminal mode), use AskUserQuestion as usual:** + **ALWAYS follow this structure for every AskUserQuestion call:** 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences) 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called. diff --git a/land-and-deploy/SKILL.md b/land-and-deploy/SKILL.md index 455658fa0..be8e06407 100644 --- a/land-and-deploy/SKILL.md +++ b/land-and-deploy/SKILL.md @@ -43,6 +43,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" mkdir -p ~/.gstack/analytics echo '{"skill":"land-and-deploy","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 # zsh-compatible: use find instead of glob to avoid NOMATCH error @@ -101,6 +110,24 @@ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. ## AskUserQuestion Format +**REMOTE CONTROL DETECTION:** Check if remote control is active by looking at BOTH: +1. The `REMOTE_CONTROL` value from the preamble output above +2. The conversation history — if you can see `Remote Control connecting…` WITHOUT a + subsequent `Remote Control disconnected.`, remote control is currently active + +If EITHER indicates remote control is active, do NOT use the AskUserQuestion tool. +Instead: +- Present the question and options as plain text in your response +- Format options as a numbered list (1, 2, 3...) so the user can reply with a number +- Include your recommendation inline: "I'd recommend option X because..." +- Wait for the user to reply with their choice before proceeding +- For yes/no questions, just ask directly in plain text + +This applies to ALL AskUserQuestion calls throughout the entire skill workflow, +including telemetry prompts, lake intro, upgrade checks, and skill-specific questions. + +**When remote control is NOT active (normal terminal mode), use AskUserQuestion as usual:** + **ALWAYS follow this structure for every AskUserQuestion call:** 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences) 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called. diff --git a/office-hours/SKILL.md b/office-hours/SKILL.md index 84a973aa8..08414f830 100644 --- a/office-hours/SKILL.md +++ b/office-hours/SKILL.md @@ -51,6 +51,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" 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 # zsh-compatible: use find instead of glob to avoid NOMATCH error @@ -109,6 +118,24 @@ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. ## AskUserQuestion Format +**REMOTE CONTROL DETECTION:** Check if remote control is active by looking at BOTH: +1. The `REMOTE_CONTROL` value from the preamble output above +2. The conversation history — if you can see `Remote Control connecting…` WITHOUT a + subsequent `Remote Control disconnected.`, remote control is currently active + +If EITHER indicates remote control is active, do NOT use the AskUserQuestion tool. +Instead: +- Present the question and options as plain text in your response +- Format options as a numbered list (1, 2, 3...) so the user can reply with a number +- Include your recommendation inline: "I'd recommend option X because..." +- Wait for the user to reply with their choice before proceeding +- For yes/no questions, just ask directly in plain text + +This applies to ALL AskUserQuestion calls throughout the entire skill workflow, +including telemetry prompts, lake intro, upgrade checks, and skill-specific questions. + +**When remote control is NOT active (normal terminal mode), use AskUserQuestion as usual:** + **ALWAYS follow this structure for every AskUserQuestion call:** 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences) 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called. diff --git a/plan-ceo-review/SKILL.md b/plan-ceo-review/SKILL.md index a274efc08..e3c0966f9 100644 --- a/plan-ceo-review/SKILL.md +++ b/plan-ceo-review/SKILL.md @@ -49,6 +49,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" 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 # zsh-compatible: use find instead of glob to avoid NOMATCH error @@ -107,6 +116,24 @@ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. ## AskUserQuestion Format +**REMOTE CONTROL DETECTION:** Check if remote control is active by looking at BOTH: +1. The `REMOTE_CONTROL` value from the preamble output above +2. The conversation history — if you can see `Remote Control connecting…` WITHOUT a + subsequent `Remote Control disconnected.`, remote control is currently active + +If EITHER indicates remote control is active, do NOT use the AskUserQuestion tool. +Instead: +- Present the question and options as plain text in your response +- Format options as a numbered list (1, 2, 3...) so the user can reply with a number +- Include your recommendation inline: "I'd recommend option X because..." +- Wait for the user to reply with their choice before proceeding +- For yes/no questions, just ask directly in plain text + +This applies to ALL AskUserQuestion calls throughout the entire skill workflow, +including telemetry prompts, lake intro, upgrade checks, and skill-specific questions. + +**When remote control is NOT active (normal terminal mode), use AskUserQuestion as usual:** + **ALWAYS follow this structure for every AskUserQuestion call:** 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences) 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called. diff --git a/plan-design-review/SKILL.md b/plan-design-review/SKILL.md index ce5f9e756..107ff52b0 100644 --- a/plan-design-review/SKILL.md +++ b/plan-design-review/SKILL.md @@ -47,6 +47,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" 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 # zsh-compatible: use find instead of glob to avoid NOMATCH error @@ -105,6 +114,24 @@ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. ## AskUserQuestion Format +**REMOTE CONTROL DETECTION:** Check if remote control is active by looking at BOTH: +1. The `REMOTE_CONTROL` value from the preamble output above +2. The conversation history — if you can see `Remote Control connecting…` WITHOUT a + subsequent `Remote Control disconnected.`, remote control is currently active + +If EITHER indicates remote control is active, do NOT use the AskUserQuestion tool. +Instead: +- Present the question and options as plain text in your response +- Format options as a numbered list (1, 2, 3...) so the user can reply with a number +- Include your recommendation inline: "I'd recommend option X because..." +- Wait for the user to reply with their choice before proceeding +- For yes/no questions, just ask directly in plain text + +This applies to ALL AskUserQuestion calls throughout the entire skill workflow, +including telemetry prompts, lake intro, upgrade checks, and skill-specific questions. + +**When remote control is NOT active (normal terminal mode), use AskUserQuestion as usual:** + **ALWAYS follow this structure for every AskUserQuestion call:** 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences) 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called. diff --git a/plan-eng-review/SKILL.md b/plan-eng-review/SKILL.md index ecf0ae309..cc8d67377 100644 --- a/plan-eng-review/SKILL.md +++ b/plan-eng-review/SKILL.md @@ -48,6 +48,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" 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 # zsh-compatible: use find instead of glob to avoid NOMATCH error @@ -106,6 +115,24 @@ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. ## AskUserQuestion Format +**REMOTE CONTROL DETECTION:** Check if remote control is active by looking at BOTH: +1. The `REMOTE_CONTROL` value from the preamble output above +2. The conversation history — if you can see `Remote Control connecting…` WITHOUT a + subsequent `Remote Control disconnected.`, remote control is currently active + +If EITHER indicates remote control is active, do NOT use the AskUserQuestion tool. +Instead: +- Present the question and options as plain text in your response +- Format options as a numbered list (1, 2, 3...) so the user can reply with a number +- Include your recommendation inline: "I'd recommend option X because..." +- Wait for the user to reply with their choice before proceeding +- For yes/no questions, just ask directly in plain text + +This applies to ALL AskUserQuestion calls throughout the entire skill workflow, +including telemetry prompts, lake intro, upgrade checks, and skill-specific questions. + +**When remote control is NOT active (normal terminal mode), use AskUserQuestion as usual:** + **ALWAYS follow this structure for every AskUserQuestion call:** 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences) 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called. diff --git a/qa-only/SKILL.md b/qa-only/SKILL.md index d1dd3ad33..eb4d76d5b 100644 --- a/qa-only/SKILL.md +++ b/qa-only/SKILL.md @@ -44,6 +44,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" 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 # zsh-compatible: use find instead of glob to avoid NOMATCH error @@ -102,6 +111,24 @@ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. ## AskUserQuestion Format +**REMOTE CONTROL DETECTION:** Check if remote control is active by looking at BOTH: +1. The `REMOTE_CONTROL` value from the preamble output above +2. The conversation history — if you can see `Remote Control connecting…` WITHOUT a + subsequent `Remote Control disconnected.`, remote control is currently active + +If EITHER indicates remote control is active, do NOT use the AskUserQuestion tool. +Instead: +- Present the question and options as plain text in your response +- Format options as a numbered list (1, 2, 3...) so the user can reply with a number +- Include your recommendation inline: "I'd recommend option X because..." +- Wait for the user to reply with their choice before proceeding +- For yes/no questions, just ask directly in plain text + +This applies to ALL AskUserQuestion calls throughout the entire skill workflow, +including telemetry prompts, lake intro, upgrade checks, and skill-specific questions. + +**When remote control is NOT active (normal terminal mode), use AskUserQuestion as usual:** + **ALWAYS follow this structure for every AskUserQuestion call:** 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences) 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called. diff --git a/qa/SKILL.md b/qa/SKILL.md index b63d6fbd0..0e0a2d102 100644 --- a/qa/SKILL.md +++ b/qa/SKILL.md @@ -50,6 +50,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" 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 # zsh-compatible: use find instead of glob to avoid NOMATCH error @@ -108,6 +117,24 @@ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. ## AskUserQuestion Format +**REMOTE CONTROL DETECTION:** Check if remote control is active by looking at BOTH: +1. The `REMOTE_CONTROL` value from the preamble output above +2. The conversation history — if you can see `Remote Control connecting…` WITHOUT a + subsequent `Remote Control disconnected.`, remote control is currently active + +If EITHER indicates remote control is active, do NOT use the AskUserQuestion tool. +Instead: +- Present the question and options as plain text in your response +- Format options as a numbered list (1, 2, 3...) so the user can reply with a number +- Include your recommendation inline: "I'd recommend option X because..." +- Wait for the user to reply with their choice before proceeding +- For yes/no questions, just ask directly in plain text + +This applies to ALL AskUserQuestion calls throughout the entire skill workflow, +including telemetry prompts, lake intro, upgrade checks, and skill-specific questions. + +**When remote control is NOT active (normal terminal mode), use AskUserQuestion as usual:** + **ALWAYS follow this structure for every AskUserQuestion call:** 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences) 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called. diff --git a/retro/SKILL.md b/retro/SKILL.md index 141605541..27f67bb43 100644 --- a/retro/SKILL.md +++ b/retro/SKILL.md @@ -44,6 +44,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" 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 # zsh-compatible: use find instead of glob to avoid NOMATCH error @@ -102,6 +111,24 @@ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. ## AskUserQuestion Format +**REMOTE CONTROL DETECTION:** Check if remote control is active by looking at BOTH: +1. The `REMOTE_CONTROL` value from the preamble output above +2. The conversation history — if you can see `Remote Control connecting…` WITHOUT a + subsequent `Remote Control disconnected.`, remote control is currently active + +If EITHER indicates remote control is active, do NOT use the AskUserQuestion tool. +Instead: +- Present the question and options as plain text in your response +- Format options as a numbered list (1, 2, 3...) so the user can reply with a number +- Include your recommendation inline: "I'd recommend option X because..." +- Wait for the user to reply with their choice before proceeding +- For yes/no questions, just ask directly in plain text + +This applies to ALL AskUserQuestion calls throughout the entire skill workflow, +including telemetry prompts, lake intro, upgrade checks, and skill-specific questions. + +**When remote control is NOT active (normal terminal mode), use AskUserQuestion as usual:** + **ALWAYS follow this structure for every AskUserQuestion call:** 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences) 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called. diff --git a/review/SKILL.md b/review/SKILL.md index 912e1f3ec..411dd146d 100644 --- a/review/SKILL.md +++ b/review/SKILL.md @@ -47,6 +47,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" 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 # zsh-compatible: use find instead of glob to avoid NOMATCH error @@ -105,6 +114,24 @@ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. ## AskUserQuestion Format +**REMOTE CONTROL DETECTION:** Check if remote control is active by looking at BOTH: +1. The `REMOTE_CONTROL` value from the preamble output above +2. The conversation history — if you can see `Remote Control connecting…` WITHOUT a + subsequent `Remote Control disconnected.`, remote control is currently active + +If EITHER indicates remote control is active, do NOT use the AskUserQuestion tool. +Instead: +- Present the question and options as plain text in your response +- Format options as a numbered list (1, 2, 3...) so the user can reply with a number +- Include your recommendation inline: "I'd recommend option X because..." +- Wait for the user to reply with their choice before proceeding +- For yes/no questions, just ask directly in plain text + +This applies to ALL AskUserQuestion calls throughout the entire skill workflow, +including telemetry prompts, lake intro, upgrade checks, and skill-specific questions. + +**When remote control is NOT active (normal terminal mode), use AskUserQuestion as usual:** + **ALWAYS follow this structure for every AskUserQuestion call:** 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences) 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called. diff --git a/scripts/resolvers/preamble.ts b/scripts/resolvers/preamble.ts index 1fdfed1d8..34a1366ef 100644 --- a/scripts/resolvers/preamble.ts +++ b/scripts/resolvers/preamble.ts @@ -35,6 +35,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: \${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="\${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(${ctx.paths.binDir}/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" 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 # zsh-compatible: use find instead of glob to avoid NOMATCH error @@ -101,6 +110,24 @@ This only happens once. If \`TEL_PROMPTED\` is \`yes\`, skip this entirely.`; function generateAskUserFormat(_ctx: TemplateContext): string { return `## AskUserQuestion Format +**REMOTE CONTROL DETECTION:** Check if remote control is active by looking at BOTH: +1. The \`REMOTE_CONTROL\` value from the preamble output above +2. The conversation history — if you can see \`Remote Control connecting…\` WITHOUT a + subsequent \`Remote Control disconnected.\`, remote control is currently active + +If EITHER indicates remote control is active, do NOT use the AskUserQuestion tool. +Instead: +- Present the question and options as plain text in your response +- Format options as a numbered list (1, 2, 3...) so the user can reply with a number +- Include your recommendation inline: "I'd recommend option X because..." +- Wait for the user to reply with their choice before proceeding +- For yes/no questions, just ask directly in plain text + +This applies to ALL AskUserQuestion calls throughout the entire skill workflow, +including telemetry prompts, lake intro, upgrade checks, and skill-specific questions. + +**When remote control is NOT active (normal terminal mode), use AskUserQuestion as usual:** + **ALWAYS follow this structure for every AskUserQuestion call:** 1. **Re-ground:** State the project, the current branch (use the \`_BRANCH\` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences) 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called. diff --git a/setup-browser-cookies/SKILL.md b/setup-browser-cookies/SKILL.md index 37c944a0d..dfa884c08 100644 --- a/setup-browser-cookies/SKILL.md +++ b/setup-browser-cookies/SKILL.md @@ -41,6 +41,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" 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 # zsh-compatible: use find instead of glob to avoid NOMATCH error diff --git a/setup-deploy/SKILL.md b/setup-deploy/SKILL.md index 6d1a35bb7..3a363d82c 100644 --- a/setup-deploy/SKILL.md +++ b/setup-deploy/SKILL.md @@ -47,6 +47,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" mkdir -p ~/.gstack/analytics echo '{"skill":"setup-deploy","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 # zsh-compatible: use find instead of glob to avoid NOMATCH error @@ -105,6 +114,24 @@ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. ## AskUserQuestion Format +**REMOTE CONTROL DETECTION:** Check if remote control is active by looking at BOTH: +1. The `REMOTE_CONTROL` value from the preamble output above +2. The conversation history — if you can see `Remote Control connecting…` WITHOUT a + subsequent `Remote Control disconnected.`, remote control is currently active + +If EITHER indicates remote control is active, do NOT use the AskUserQuestion tool. +Instead: +- Present the question and options as plain text in your response +- Format options as a numbered list (1, 2, 3...) so the user can reply with a number +- Include your recommendation inline: "I'd recommend option X because..." +- Wait for the user to reply with their choice before proceeding +- For yes/no questions, just ask directly in plain text + +This applies to ALL AskUserQuestion calls throughout the entire skill workflow, +including telemetry prompts, lake intro, upgrade checks, and skill-specific questions. + +**When remote control is NOT active (normal terminal mode), use AskUserQuestion as usual:** + **ALWAYS follow this structure for every AskUserQuestion call:** 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences) 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called. diff --git a/ship/SKILL.md b/ship/SKILL.md index 16d0e4b37..8fe90eabc 100644 --- a/ship/SKILL.md +++ b/ship/SKILL.md @@ -45,6 +45,15 @@ _TEL_START=$(date +%s) _SESSION_ID="$$-$(date +%s)" echo "TELEMETRY: ${_TEL:-off}" echo "TEL_PROMPTED: $_TEL_PROMPTED" +# Detect remote control mode (Anthropic app remote control) +# TTY detection is unreliable (Claude Code's Bash tool never has a real TTY). +# Use explicit env var or check if gstack-config has it enabled. +_REMOTE_CONTROL="${GSTACK_REMOTE_CONTROL:-}" +if [ -z "$_REMOTE_CONTROL" ]; then + _REMOTE_CONTROL=$(~/.claude/skills/gstack/bin/gstack-config get remote_control 2>/dev/null || echo "") +fi +[ -z "$_REMOTE_CONTROL" ] && _REMOTE_CONTROL=0 +echo "REMOTE_CONTROL: $_REMOTE_CONTROL" 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 # zsh-compatible: use find instead of glob to avoid NOMATCH error @@ -103,6 +112,24 @@ This only happens once. If `TEL_PROMPTED` is `yes`, skip this entirely. ## AskUserQuestion Format +**REMOTE CONTROL DETECTION:** Check if remote control is active by looking at BOTH: +1. The `REMOTE_CONTROL` value from the preamble output above +2. The conversation history — if you can see `Remote Control connecting…` WITHOUT a + subsequent `Remote Control disconnected.`, remote control is currently active + +If EITHER indicates remote control is active, do NOT use the AskUserQuestion tool. +Instead: +- Present the question and options as plain text in your response +- Format options as a numbered list (1, 2, 3...) so the user can reply with a number +- Include your recommendation inline: "I'd recommend option X because..." +- Wait for the user to reply with their choice before proceeding +- For yes/no questions, just ask directly in plain text + +This applies to ALL AskUserQuestion calls throughout the entire skill workflow, +including telemetry prompts, lake intro, upgrade checks, and skill-specific questions. + +**When remote control is NOT active (normal terminal mode), use AskUserQuestion as usual:** + **ALWAYS follow this structure for every AskUserQuestion call:** 1. **Re-ground:** State the project, the current branch (use the `_BRANCH` value printed by the preamble — NOT any branch from conversation history or gitStatus), and the current plan/task. (1-2 sentences) 2. **Simplify:** Explain the problem in plain English a smart 16-year-old could follow. No raw function names, no internal jargon, no implementation details. Use concrete examples and analogies. Say what it DOES, not what it's called.