From 840b9981d9317cb76da4744af3a69ad466aeadb5 Mon Sep 17 00:00:00 2001 From: monokoo Date: Sun, 5 Apr 2026 02:15:56 +0800 Subject: [PATCH] fix: add environment-based runtime detection for /gsd-review (#1463) Replace AI self-identification with env var checks (ANTIGRAVITY_AGENT, CLAUDE_CODE_ENTRYPOINT) to correctly determine which review CLI to skip. Fixes incorrect skip behavior when running non-Claude models inside the Antigravity client. --- get-shit-done/workflows/review.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/get-shit-done/workflows/review.md b/get-shit-done/workflows/review.md index 847be40f3..dd8ef9355 100644 --- a/get-shit-done/workflows/review.md +++ b/get-shit-done/workflows/review.md @@ -43,8 +43,28 @@ Then run /gsd-review again. ``` Exit. -If only one CLI is the current runtime (e.g. running inside Claude), skip it for the review -to ensure independence. At least one DIFFERENT CLI must be available. +Determine which CLI to skip based on the current runtime environment: + +```bash +# Environment-based runtime detection (priority order) +if [ "$ANTIGRAVITY_AGENT" = "1" ]; then + # Antigravity is a separate client — all CLIs are external, skip none + SELF_CLI="none" +elif [ -n "$CLAUDE_CODE_ENTRYPOINT" ]; then + # Running inside Claude Code CLI — skip claude for independence + SELF_CLI="claude" +else + # Other environments (Gemini CLI, Codex CLI, etc.) + # Fall back to AI self-identification to decide which CLI to skip + SELF_CLI="auto" +fi +``` + +Rules: +- If `SELF_CLI="none"` → invoke ALL available CLIs (no skip) +- If `SELF_CLI="claude"` → skip claude, use gemini/codex +- If `SELF_CLI="auto"` → the executing AI identifies itself and skips its own CLI +- At least one DIFFERENT CLI must be available for the review to proceed.