diff --git a/agent-setup/SKILL.md b/agent-setup/SKILL.md new file mode 100644 index 0000000..faeffbd --- /dev/null +++ b/agent-setup/SKILL.md @@ -0,0 +1,26 @@ +--- +name: agent-setup +description: Validate AGENT_HOME, derive GH_CONFIG_DIR, and export both to a session dotfile for use by other skills. +--- + +# Agent Setup Skill + +Validates the `AGENT_HOME` environment variable, derives `GH_CONFIG_DIR` as `$AGENT_HOME/.github`, and exports both to a session dotfile so that child bash sessions and skills invoked in the same session inherit them. + +## Required Environment Variables + +| Variable | Description | +|---|---| +| `AGENT_HOME` | The agent's home directory. Must be an absolute path. | + +## Usage + +```bash +bash agent-setup/scripts/setup.sh +source ~/.env +``` + +## Output + +- `GH_CONFIG_DIR` is set to `$AGENT_HOME/.github` and exported +- A dotfile (`~/.env` inside `AGENT_HOME`) is written with `export GH_CONFIG_DIR=...` for session inheritance diff --git a/agent-setup/scripts/setup.sh b/agent-setup/scripts/setup.sh new file mode 100755 index 0000000..05eca78 --- /dev/null +++ b/agent-setup/scripts/setup.sh @@ -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" <