ワンクリックで
mcp-github-error-recovery
GitHub MCP error handling and recovery procedures
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
GitHub MCP error handling and recovery procedures
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Prepend session handoff to DaysActivity.md
Initialize session with context briefing
File production feedback about a zgent's behavior. Routes to CSO for diagnosis and artifact tuning. Usage: /zgent-feedback <zgent> <description>
Run A/B tests comparing convention variants to measure compliance improvements
Archive yesterday's DaysActivity and create fresh file for today
DaysActivity.md formatting conventions. Use when writing handoff entries, hourly summaries, or any content destined for DaysActivity.md.
| name | mcp-github-error-recovery |
| description | GitHub MCP error handling and recovery procedures |
| user-invocable | false |
| triggers | {"require-any":["mcp:github"],"priority":80,"ttl":"session"} |
This skill provides error handling and recovery procedures for GitHub MCP tool usage.
Symptoms:
mcp__github__* tools return "Bad credentials"Root Causes:
GITHUB_TOKEN environment variable not setResolution Steps:
Check token existence:
# Verify GITHUB_TOKEN is set (don't echo the value)
[[ -n "$GITHUB_TOKEN" ]] && echo "Token is set" || echo "Token is missing"
Verify token scopes:
repo scoperepo scopeworkflow scopeAlert operator if token is invalid:
Prevention:
.claude/.env (gitignored) or system environmentSymptoms:
mcp__github__* tools return "API rate limit exceeded"Understanding GitHub Rate Limits:
Resolution Steps:
Immediate response:
Check rate limit status (if available):
Use mcp__github__get_rate_limit if the tool exists
Optimize remaining operations:
Backoff schedule:
| Attempt | Wait Time | Action |
|---|---|---|
| 1st limit hit | 60 seconds | Retry with batched operations |
| 2nd limit hit | 120 seconds | Retry only critical operations |
| 3rd limit hit | Alert operator | Do not retry automatically |
Prevention:
Symptoms:
mcp__github__get_file_contents returns "Not Found"Common Causes:
Incorrect file path:
README.md ≠ readme.md)Wrong branch:
master not mainAccess issues:
Resolution Steps:
Verify repository exists:
Try listing repository contents first to confirm access
Check branch name:
Verify file path:
Validate access:
repo scope if repository is privatePrevention:
Symptoms:
Resolution Steps:
Immediate retry:
Exponential backoff:
| Attempt | Wait | Action |
|---|---|---|
| 1st | 5s | Immediate retry |
| 2nd | 15s | Retry with longer timeout |
| 3rd | 45s | Final retry |
| 4th | Alert | Do not retry |
Check GitHub status:
Prevention:
Symptoms:
Resolution Steps:
This is GitHub's problem, not ours:
Retry strategy:
Alert operator:
Prevention:
Always verify preconditions:
Branch exists and has commits:
Use mcp__github__list_commits to verify branch has commits
No existing PR for this branch:
Use mcp__github__list_pull_requests to check for existing PRs from this branch
Branch is ahead of base:
Common errors:
Performance optimization:
Use narrow queries:
language:pythonpath:src/Limit result set:
Set per_page: 10 or less for exploratory searches
Search API has strict rate limits:
Best practices:
Always specify branch:
branch parameterHandle binary files:
Large files:
Recommended: Store in .claude/.env (gitignored):
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Required Token Scopes:
| Operation | Required Scope |
|---|---|
| Read public repos | None (but token must exist) |
| Read private repos | repo |
| Create issues | repo or public_repo |
| Create PRs | repo |
| Modify GitHub Actions | workflow |
| Read organization data | read:org |
When token expires or is revoked:
DO NOT attempt automatic rotation
Operator action required:
.claude/.env with new tokenGitHub MCP tool fails
|
+-- 401/403 auth error?
| |
| +-- Check GITHUB_TOKEN exists
| +-- Alert operator about scopes/expiration
| +-- STOP (don't retry)
|
+-- 403 rate limit?
| |
| +-- Wait 60 seconds
| +-- Optimize remaining operations
| +-- Retry with backoff schedule
|
+-- 404 not found?
| |
| +-- Verify repository exists
| +-- Check branch name
| +-- Validate file path
| +-- Try alternative approach
|
+-- Network error (timeout/refused)?
| |
| +-- Retry once after 5 seconds
| +-- If fails again, exponential backoff
| +-- After 3 attempts, alert operator
|
+-- 500-level server error?
|
+-- Wait 30 seconds
+-- Retry once
+-- If fails, alert operator (GitHub issue)
For each GitHub MCP operation, log:
Immediate alert:
Info alert:
| Error Pattern | First Action | Max Retries |
|---|---|---|
| 401 Auth | Alert operator | 0 (do not retry) |
| 403 Rate limit | Wait 60s | 2 with backoff |
| 404 Not found | Verify path/branch | 1 (after validation) |
| Network timeout | Wait 5s | 3 with exponential backoff |
| 500 Server error | Wait 30s | 1 |
Key Principle: When in doubt, alert the operator rather than retry indefinitely.
This skill is automatically injected when GitHub MCP tools are first used in a session.