Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .claude/skills/resolve/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ fi

# Detect repo slug dynamically so the skill works in any fork or renamed org
REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner 2>/dev/null \
|| git remote get-url origin | sed -E 's|.*github\.com[:/](.+)(\.git)?$|\1|')
|| git remote get-url origin 2>/dev/null \
| sed -nE 's#^(git@github\.com:|https://github\.com/|ssh://git@github\.com/)([^/]+/[^/]+)/?$#\2#p' \
| sed -E 's/\.git$//')

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 GitHub SSH URLs are rejected

When gh repo view fails and origin uses a valid URL such as ssh://git@github.com/owner/repo, the new anchored expression emits an empty slug, causing /resolve to terminate even though the previous fallback resolved that remote.

Fix in Claude Code

if [ -z "$REPO" ]; then
echo "ERROR: could not detect GitHub repo slug — ensure 'gh' is authenticated or 'origin' points to GitHub"
exit 1
Expand All @@ -78,7 +80,9 @@ Persist PR metadata for use in later phases (shell variables don't survive acros
```bash
PR_NUMBER=$(echo "${ARGUMENTS:-}" | tr -d '[:space:]#')
REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner 2>/dev/null \
|| git remote get-url origin | sed -E 's|.*github\.com[:/](.+)(\.git)?$|\1|')
|| git remote get-url origin 2>/dev/null \
| sed -nE 's#^(git@github\.com:|https://github\.com/|ssh://git@github\.com/)([^/]+/[^/]+)/?$#\2#p' \
| sed -E 's/\.git$//')
mkdir -p .codegraph/resolve
# Trap ensures .codegraph/resolve/ is always cleaned up on non-zero exit, even after a crash.
# This prevents stale state from corrupting a future re-run (Phase 1 reads head-branch / base-branch
Expand Down
Loading