feat(agent-setup): add skill to derive and export GH_CONFIG_DIR from AGENT_HOME

Provides a session dotfile ($AGENT_HOME/.env) that subsequent skills
can source to inherit GH_CONFIG_DIR.
This commit is contained in:
2026-05-03 18:12:37 -04:00
parent 4f32fac49b
commit e3fb22a098
2 changed files with 44 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -euo pipefail
die() { echo "ERROR: $*" >&2; exit 1; }
[[ -z "${AGENT_HOME:-}" ]] && die "AGENT_HOME is not set"
# Derive GH_CONFIG_DIR — gh stores config at ~/.config/gh by default,
# so we mirror that structure under AGENT_HOME
export GH_CONFIG_DIR="$AGENT_HOME/.github"
# Write to a session dotfile so child processes inherit the variables
mkdir -p "$AGENT_HOME"
cat > "$AGENT_HOME/.env" <<EOF
export GH_CONFIG_DIR="$GH_CONFIG_DIR"
EOF
echo "GH_CONFIG_DIR set to $GH_CONFIG_DIR"