This skill should be used when the user asks to "fetch GitHub issue", "get GitLab issue", "analyze GitHub PR", "search GitHub repo", "check GitLab commits", "use GitHub API", "use GitLab API", or mentions fetching data from GitHub or GitLab for incident investigation. Provides guidance for integrating with GitHub and GitLab APIs for RCA.
This skill inherits all available tools. When active, it can use any tool Claude has access to.
references/api-examples.mdGitHub and GitLab are popular code hosting platforms that also track issues, pull requests, and commits. This skill provides guidance for fetching and analyzing data from these platforms during root cause analysis, particularly when production issues are reported via GitHub/GitLab issues.
Apply this skill when:
Both GitHub and GitLab provide similar capabilities:
Key differences:
#123, GitLab uses !123 for MRsThis skill covers both platforms; adapt examples to your platform of choice.
Create token at: https://github.com/settings/tokens
Required scopes:
repo - Full repository access (includes issues, commits, code)read:org - Read organization data (if using org repos)Usage in API calls:
Authorization: Bearer ghp_yourtoken
Create token at: https://gitlab.com/-/profile/personal_access_tokens
Required scopes:
api - Full API accessread_repository - Read repository dataUsage in API calls:
Authorization: Bearer glpat_yourtoken
Configure in Thufir settings (.claude/thufir.local.md):
github:
token: "ghp_your_token_here"
default_repo: "owner/repository"
gitlab:
token: "glpat_your_token_here"
default_project: "group/project"
GitHub API:
GET /repos/{owner}/{repo}/issues/{issue_number}
GitLab API:
GET /projects/{id}/issues/{issue_iid}
Issues contain:
From issue body, extract:
Example parsing:
Issue body:
"Users are getting 500 errors when trying to log in.
Error: ConnectionPoolExhausted at 2025-12-19 14:32 UTC
Approximately 15,000 users affected."
Extracted:
- Error: ConnectionPoolExhausted
- Time: 2025-12-19 14:32 UTC
- Impact: 15,000 users
- Feature: Login
GitHub - List issues with labels:
GET /repos/{owner}/{repo}/issues?labels=production,incident&state=open
GitLab - List issues with labels:
GET /projects/{id}/issues?labels=production,incident&state=opened
GitHub - List commits:
GET /repos/{owner}/{repo}/commits?since=2025-12-19T00:00:00Z
GitLab - List commits:
GET /projects/{id}/repository/commits?since=2025-12-19T00:00:00Z
Each commit includes:
Filter commits by:
Git blame identifies who last modified each line.
GitHub - Get blame:
GET /repos/{owner}/{repo}/blame/{ref}/{path}
GitLab - Get blame:
GET /projects/{id}/repository/files/{path}/blame?ref=main
Parse blame output to find:
Use for RCA:
GitHub - Search code:
GET /search/code?q=ConnectionPoolExhausted+repo:owner/repo
GitLab - Search in project:
GET /projects/{id}/search?scope=blobs&search=ConnectionPoolExhausted
Search for error strings:
ConnectionPoolExhausted not ConnectionPoolExhausted: timeout=5000ms"Could not acquire connection"Search for code patterns:
Example RCA search workflow:
ConnectionPoolExhaustedGitHub - Get pull request:
GET /repos/{owner}/{repo}/pulls/{pr_number}
GitLab - Get merge request:
GET /projects/{id}/merge_requests/{mr_iid}
Includes:
Link issues to PRs:
Identify problematic merge:
Thufir provides MCP servers for GitHub and GitLab:
get_issue:
list_commits:
get_blame:
search_code:
get_issue:
list_commits:
get_blame:
search_code:
Workflow example:
Use MCP: github_get_issue
Parameters: issue_number=456
Result: Issue describes login failures at 14:32 UTC
Use MCP: github_search_code
Parameters: query="ConnectionPoolExhausted"
Result: Found in src/config/database.js
Use MCP: github_get_blame
Parameters: path="src/config/database.js"
Result: Line 45 changed by Developer X in commit abc123
Use MCP: github_list_commits
Parameters: since="2025-12-19T00:00:00Z", path="src/config/database.js"
Result: Commit abc123 at 10:15 UTC changed pool size
git diff to see what changedThis skill works with:
For detailed API patterns and examples:
references/api-examples.md - Complete API call examples for common scenariosGitHub:
https://api.github.comAuthorization: Bearer ghp_token/repos/{owner}/{repo}/issues/{number}/repos/{owner}/{repo}/commits/repos/{owner}/{repo}/blame/{ref}/{path}/search/code?q=query+repo:owner/repoGitLab:
https://gitlab.com/api/v4Authorization: Bearer glpat_token/projects/{id}/issues/{iid}/projects/{id}/repository/commits/projects/{id}/repository/files/{path}/blame/projects/{id}/search?scope=blobs&search=queryWorkflow: Issue → Error → Search → Blame → Commits → Root Cause
Use GitHub and GitLab APIs to gather comprehensive incident context, correlate issues with code changes, and identify specific commits that introduced problems.