mcpbeat Sign in

Github Auth Agent Skill

GitHub auth setup: HTTPS tokens, SSH keys, gh CLI.

968 tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
117
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/HezaoHezao/poirot --skill github-auth

The instruction itself

9 sections, as written by the author

GitHub Authentication Setup

Sets up authentication so the agent can work with GitHub repositories, PRs,

issues, and CI.

Detection Flow

When a user asks to work with GitHub, run this check first:

git --version
gh --version 2>/dev/null || echo "gh not installed"
gh auth status 2>/dev/null || echo "gh not authenticated"
git config --global credential.helper 2>/dev/null || echo "no git credential helper"

Decision tree:

  • If gh auth status shows authenticated → use gh for everything
  • If gh installed but not authenticated → use "gh auth" method
  • If gh not installed → use "git-only" method

Method 1: Git-Only (No gh)

Step 1: Create a token at https://github.com/settings/tokens (classic)

or https://github.com/settings/personal-access-tokens (fine-grained). Scope:

repo, workflow, read:org.

Step 2: Configure git credential helper:

# Store credentials (plaintext, dev machine only)
git config --global credential.helper store

# Or use a credential cache (timed, more secure)
git config --global credential.helper 'cache --timeout=3600'

Step 3: First push triggers prompt:

# Username: your GitHub username
# Password: paste your token (not your GitHub password)
git push origin main

Step 4 (optional): Set token as env var for API calls:

export GITHUB_TOKEN="ghp_xxxxxxxxxxxx"
# Add to .env for persistence

SSH Keys

# Generate key (if no existing key)
ssh-keygen -t ed25519 -C "[email protected]" -f ~/.ssh/id_ed25519_github

# Start ssh-agent
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519_github

# Copy public key
cat ~/.ssh/id_ed25519_github.pub
# Paste at https://github.com/settings/keys

# Test
ssh -T [email protected]

# Set remote to SSH
git remote set-url origin [email protected]:owner/repo.git

Method 2: gh CLI

# Install gh (if not present)
# macOS: brew install gh
# Linux: see https://github.com/cli/cli#installation
# Windows: winget install GitHub.cli

# Authenticate
gh auth login
# Follow prompts: choose HTTPS or SSH, authenticate via browser or token

# Verify
gh auth status

# Use gh for everything
gh repo clone owner/repo
gh pr create
gh issue list

Verification

# Test git auth
git ls-remote origin

# Test gh auth
gh api user --jq '.login'

# Test API token
curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/user | python3 -c "import sys,json; print(json.load(sys.stdin)['login'])"

Common Auth Setup Block

Many skills need owner/repo. Use this reusable block:

# Determine auth method
if command -v gh &>/dev/null && gh auth status &>/dev/null; then
  AUTH="gh"
else
  AUTH="git"
fi

# Extract owner/repo from remote
REMOTE_URL=$(git remote get-url origin)
OWNER_REPO=$(echo "$REMOTE_URL" | sed -E 's|.*github\.com[:/]||; s|\.git$||')
OWNER=$(echo "$OWNER_REPO" | cut -d/ -f1)
REPO=$(echo "$OWNER_REPO" | cut -d/ -f2)

Pitfalls

  • 2FA: HTTPS with password no longer works (GitHub requires token). Use

personal access token, not password.

  • Token expiry: fine-grained tokens expire. Check gh auth status or

curl -s -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/user.

  • SSH on Windows: use ssh-keygen in Git Bash or PowerShell (OpenSSH

client built into Windows 10+).

  • Credential helper on Windows: `git config --global credential.helper

manager` uses Windows Credential Manager.

  • Rate limits: unauthenticated API calls limited to 60/hour. Use token for

5000/hour.

Other skills for the same job

different authors, same section of the catalogue
MCP Builder
by anthropics
vendor ×13

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

30k tokens scripts
Changelog Generator
by frostant
×9

Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.

774 tokens
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
MCP Builder
by JayZeeDesign
×7

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

37k tokens scripts
Vercel React Native Skills
by vercel-labs
vendor ×6

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

39k tokens
Vercel React Best Practices
by ratacat
×5

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

34k tokens
Next Best Practices
by vercel-labs
vendor ×4

Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling

20k tokens
Using Git Worktrees
by ZhanlinCui
×4

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification

1k tokens

How to use it

Copy the folder

Take hezaohezao/github-auth from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.

Install what it needs

The instructions reference brew. Without those the skill loads but fails at the first command.