From 15b134b901023aceed844dce3bc0e7be93c95c73 Mon Sep 17 00:00:00 2001 From: lightforgelabsdev Date: Thu, 5 Feb 2026 22:57:12 +0000 Subject: [PATCH] Docs: make GH_CONFIG_DIR the canonical identity model --- docs/agents/IMPLEMENTATION_START.md | 7 ++++--- docs/agents/PR_REVIEW_START.md | 29 +++++++++++++++-------------- skills/implement/SKILL.md | 1 - skills/pr-review/SKILL.md | 7 ++++--- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/docs/agents/IMPLEMENTATION_START.md b/docs/agents/IMPLEMENTATION_START.md index db09f69..5ae3a1f 100644 --- a/docs/agents/IMPLEMENTATION_START.md +++ b/docs/agents/IMPLEMENTATION_START.md @@ -12,15 +12,16 @@ Implementation work (creating branches/PRs, pushing commits, merging) must be pe **Before starting:** ```bash -## Preferred: isolated auth store for the implementer role +## Canonical: separate auth store + separate window for /implement +# - Prefer running implementation in a dedicated terminal/VS Code window where GH_CONFIG_DIR is already set. # PowerShell example: # $env:GH_CONFIG_DIR="$env:USERPROFILE\.config\gh-implement" # Bash example: # export GH_CONFIG_DIR="$HOME/.config/gh-implement" -# Optional project hook (recommended if present): -# powershell -ExecutionPolicy Bypass -File tools/gh/as-implementer.ps1 +gh api user --jq .login +# If the active login is not the implementer login: gh auth switch -u gh api user --jq .login ``` diff --git a/docs/agents/PR_REVIEW_START.md b/docs/agents/PR_REVIEW_START.md index 1e61237..0777e55 100644 --- a/docs/agents/PR_REVIEW_START.md +++ b/docs/agents/PR_REVIEW_START.md @@ -12,16 +12,16 @@ PR reviews must be performed using a dedicated **reviewer** GitHub identity (not **Before starting:** ```bash -## Preferred: isolated auth store for the reviewer role -# (pick a location that matches your OS conventions) +## Canonical: separate auth store + separate window for /pr-review +# - Prefer running reviews in a dedicated terminal/VS Code window where GH_CONFIG_DIR is already set. # PowerShell example: # $env:GH_CONFIG_DIR="$env:USERPROFILE\.config\gh-review" # Bash example: # export GH_CONFIG_DIR="$HOME/.config/gh-review" -# Optional project hook (recommended if present): -# powershell -ExecutionPolicy Bypass -File tools/gh/as-reviewer.ps1 +gh api user --jq .login +# If the active login is not the reviewer login: gh auth switch -u gh api user --jq .login ``` @@ -201,18 +201,19 @@ gh api repos/:owner/:repo/pulls//comments ### Recommended: Separate reviewer identity (to enable approvals) -If you want the `/pr-review` role to submit real approvals, use a separate GitHub identity for reviews. +If you want `/pr-review` to submit real approvals, use a separate GitHub identity for reviews and keep it isolated from implementation work. -**Minimal setup:** +**Canonical setup (recommended):** - Create a reviewer account (human or bot) and grant it **Write** access to the repo. -- Authenticate both accounts with GitHub CLI: - - `gh auth login` (implementer) - - `gh auth login` (reviewer) -- Switch active identity by role: - - Implement: `gh auth switch -u ` - - Review: `gh auth switch -u ` - -**Note:** You still cannot “independently approve” with the same identity that authored the PR. Separation here means “different GitHub identity”, not “different agent session”. +- Use separate `gh` auth stores: + - Implementer store: set `GH_CONFIG_DIR` to a path like `.../gh-implement`, then run `gh auth login`. + - Reviewer store: set `GH_CONFIG_DIR` to a path like `.../gh-review`, then run `gh auth login`. +- Run `/implement` and `/pr-review` in separate windows (each with its own `GH_CONFIG_DIR`). + +**Fallback (works but easier to misuse):** +- Use a single store and manually switch identities via `gh auth switch`. + +**Note:** You still cannot approve your own PR. Separation here means “different GitHub identity”, not “different agent session”. ## Review Output Format **Summary review structure:** diff --git a/skills/implement/SKILL.md b/skills/implement/SKILL.md index e3e72b0..dc4f846 100644 --- a/skills/implement/SKILL.md +++ b/skills/implement/SKILL.md @@ -24,7 +24,6 @@ If there is no spec yet, switch to `/design` (exploration) before implementing. - Use the implementer GitHub identity for all implementation actions (branch/PR/push/merge). - Prefer an isolated `gh` auth store for the implementer role via `GH_CONFIG_DIR` (see `.aide/docs/agents/IMPLEMENTATION_START.md`). -- Preferred: `powershell -ExecutionPolicy Bypass -File tools/gh/as-implementer.ps1` (if present). - If the active GitHub identity is the reviewer identity, stop and request switching identities before proceeding. ## Workflow diff --git a/skills/pr-review/SKILL.md b/skills/pr-review/SKILL.md index e9d1f81..f9a58ac 100644 --- a/skills/pr-review/SKILL.md +++ b/skills/pr-review/SKILL.md @@ -39,9 +39,10 @@ Review a PR against the linked issue spec and project constraints. Do not push f - Findings grouped by severity (Critical/Major/Minor) with `path:line` references. - Clear decision: approve / request changes / non-blocking. - Prefer submitting as a formal GitHub Review via `gh pr review` (not only as a PR comment). - - Switch to the reviewer identity before reviewing: - - Preferred: `powershell -ExecutionPolicy Bypass -File tools/gh/as-reviewer.ps1` (if present) - - Fallback: `gh auth switch -u ` (see `.aide/docs/agents/PR_REVIEW_START.md`) + - Run reviews from a dedicated reviewer context: + - Prefer a separate window/terminal with `GH_CONFIG_DIR` set to the reviewer auth store. + - Verify identity with `gh api user --jq .login` before submitting a review. + - If needed, use `gh auth switch -u ` (see `.aide/docs/agents/PR_REVIEW_START.md`). - If the reviewer identity == PR author, stop and request switching identities (do not review as the author). ## Reference