Skip to content

flitzrrr/agent-skills / skills/tob-gh-cli

Intercepts GitHub URL fetches and redirects to the authenticated `gh` CLI. Use when Claude tries to access GitHub via WebFetch or curl/wget, when you see 404 errors on private repos, when hitting GitHub API rate limits, or when GitHub API responses are incomplete. Provides hooks that automatically suggest the correct `gh` CLI command for any GitHub URL access pattern.

GitHub CLI Integration

A plugin that intercepts GitHub URL fetches and redirects Claude to use the authenticated gh CLI instead.

Problem

Claude Code's WebFetch tool and Bash curl/wget commands don't use the user's GitHub authentication. This means:

  • Private repos: Fetches fail with 404 errors
  • Rate limits: Unauthenticated requests are limited to 60/hour (vs 5,000/hour authenticated)
  • Missing data: Some API responses are incomplete without authentication

Solution

This plugin provides PreToolUse hooks that intercept GitHub URL access via WebFetch or curl/wget, and suggest the correct gh CLI command.

What Gets Intercepted

ToolPatternSuggestion
WebFetchgithub.com/{owner}/{repo}gh repo view owner/repo
WebFetchgithub.com/.../blob/...gh repo clone + Read
WebFetchgithub.com/.../tree/...gh repo clone + Read/Glob/Grep
WebFetchapi.github.com/repos/.../pullsgh pr list / gh pr view
WebFetchapi.github.com/repos/.../issuesgh issue list / gh issue view
WebFetchapi.github.com/...gh api <endpoint>
WebFetchraw.githubusercontent.com/...gh repo clone + Read
Bashcurl https://api.github.com/...gh api <endpoint>
Bashcurl https://raw.githubusercontent.com/...gh repo clone + Read
Bashwget https://github.com/...gh release download

What Passes Through

  • Non-GitHub URLs
  • GitHub Pages sites (*.github.io)
  • Commands already using gh (except anti-patterns)
  • Git commands (git clone, git push, etc.)
  • Search commands that mention GitHub URLs (grep, rg, etc.)

Prerequisites

  • GitHub CLI (gh) must be installed and authenticated (gh auth login)
  • If gh is not installed, the hooks pass through without disruption

Usage

This skill operates automatically via hooks. No manual invocation required. When you attempt to access GitHub URLs, the hooks will intercept and suggest the authenticated alternative.

Common gh CLI Commands

# View repo info
gh repo view owner/repo

# List PRs
gh pr list --repo owner/repo

# View a specific PR
gh pr view 123 --repo owner/repo

# API access
gh api repos/owner/repo/pulls

# Clone a repo
gh repo clone owner/repo
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 319kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 319kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 319kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 319kUpdated Claude CodeCodexVerifiedInstall