diff --git a/scripts/install-golem15.sh b/scripts/install-golem15.sh new file mode 100755 index 000000000..41ad07f82 --- /dev/null +++ b/scripts/install-golem15.sh @@ -0,0 +1,135 @@ +#!/usr/bin/env bash +set -euo pipefail + +usage() { + cat <<'EOF' +Install the private golem15 GSD build for Claude Code and Codex. +Grok Build consumes the Claude installation through its compatibility layer. + +Usage: + scripts/install-golem15.sh [--update] [--skip-deps] [--profile PROFILE] + +Options: + --update Pull origin/next with --ff-only before installing. + --skip-deps Do not run npm ci. + --profile PROFILE GSD profile: core, standard, or full (default: full). + -h, --help Show this help. +EOF +} + +update=false +install_deps=true +profile="${GSD_PROFILE:-full}" + +while (($#)); do + case "$1" in + --update) update=true ;; + --skip-deps) install_deps=false ;; + --profile) + shift + if (($# == 0)); then + echo "ERROR: --profile requires a value." >&2 + exit 2 + fi + profile="$1" + ;; + -h|--help) + usage + exit 0 + ;; + *) + echo "ERROR: unknown argument: $1" >&2 + usage >&2 + exit 2 + ;; + esac + shift +done + +case "$profile" in + core|standard|full) ;; + *) + echo "ERROR: profile must be core, standard, or full; got: $profile" >&2 + exit 2 + ;; +esac + +script_dir=$(CDPATH='' cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) +repo_root=$(CDPATH='' cd -- "$script_dir/.." && pwd) +cd "$repo_root" + +node_version=$(node --version 2>/dev/null || true) +node_major=${node_version#v} +node_major=${node_major%%.*} +if [[ ! "$node_major" =~ ^[0-9]+$ ]] || ((node_major < 24)); then + cat >&2 < Updating private mirror from origin/next" + git pull --ff-only origin next +fi + +if [[ "$install_deps" == true ]]; then + echo "==> Installing locked dependencies" + npm ci +fi + +echo "==> Installing GSD for Claude Code (profile: $profile)" +node bin/install.js --claude --global "--profile=$profile" + +echo "==> Installing GSD for Codex (profile: $profile)" +node bin/install.js --codex --global "--profile=$profile" + +claude_root=${CLAUDE_CONFIG_DIR:-"$HOME/.claude"} +codex_root=${CODEX_HOME:-"$HOME/.codex"} +recovery_rel=gsd-core/workflows/plan-phase/steps/agent-recovery-and-timing.md + +for install_root in "$claude_root" "$codex_root"; do + if [[ ! -f "$install_root/$recovery_rel" ]]; then + echo "ERROR: patched recovery workflow missing after install: $install_root/$recovery_rel" >&2 + exit 1 + fi +done + +active_codex=$(command -v codex 2>/dev/null || true) +bun_codex="$HOME/.bun/bin/codex" +if [[ -x "$bun_codex" && "$active_codex" != "$bun_codex" ]]; then + active_version=$(${active_codex:-false} --version 2>/dev/null || echo unknown) + bun_version=$($bun_codex --version 2>/dev/null || echo unknown) + cat >&2 </dev/null 2>&1; then + grok_report=$(mktemp) + trap 'rm -f "$grok_report"' EXIT + if grok inspect --json >"$grok_report" 2>/dev/null \ + && grep -Fq "$claude_root/skills/gsd-plan-phase/SKILL.md" "$grok_report"; then + echo "==> Grok verified: Claude-compatible gsd-plan-phase skill discovered" + else + echo "WARNING: Grok did not report the Claude gsd-plan-phase skill; restart Grok and run 'grok inspect'." >&2 + fi +fi + +cat <