trnt-ai/trent-agent-skills/github-tools

Claude Code and agent skill by trnt-ai/trent-agent-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Mint GitHub App installation tokens and call GitHub REST API

Install

npx vskill@latest install trnt-ai/trent-agent-skills/github-tools

SKILL.md

The same SKILL.md was published earlier as trnt-ai/trent-agent-skills/github-tools.

GitHub Tools Skill

Provides authenticated access to the GitHub REST API using a GitHub App installation token. Use this skill for ALL GitHub API calls. Never hardcode tokens.


Token Minting

Mint a fresh installation token at the start of each agent run. Tokens expire after 1 hour.

Step 1 — Create a JWT
iat = now - 60 seconds (clock skew buffer)
exp = now + 10 minutes
iss = GITHUB_APP_ID
algorithm = RS256
key = contents of GITHUB_APP_PRIVATE_KEY_FILE (PEM file path from env)
Step 2 — Exchange JWT for installation token
POST https://api.github.com/app/installations/{GITHUB_INSTALLATION_ID}/access_tokens
Headers:
Authorization: Bearer {jwt}
Accept: application/vnd.github+json
X-GitHub-Api-Version: 2022-11-28

Save the returned token field. Use it as Bearer {installation_token} for all subsequent calls.

Script Helper

A Python helper script is available at scripts/mint-token.py in this skill directory. Run it with: python3 <skill_dir>/scripts/mint-token.py It reads env vars, signs the JWT via openssl (subprocess, PEM path passed — contents stay on disk), exchanges it for an installation token via urllib.request with a 10-second timeout, and prints the token to stdout. Errors go to stderr, non-zero exit on any failure (including a null token in the response body).

Stdlib only — no pip install step. Replaces a previous Node helper that hung indefinitely on https.request() on AL2023 ARM64 hosts; Python's urllib works fine on the same host class.


API Conventions

Always include these headers:

Authorization: Bearer {installation_token}
Accept: application/vnd.github+json
X-GitHub-Api-Version: 2022-11-28
Rate Limits
  • On 429: read Retry-After header, wait that many seconds, retry
  • On 403 with X-RateLimit-Remaining: 0: wait until X-RateLimit-Reset (unix timestamp)
  • Max 3 retries per request, exponential backoff: 1s, 2s, 4s

Common Operations

List merged PRs since a timestamp
GET /repos/{owner}/{repo}/pulls?state=closed&sort=updated&direction=desc&per_page=100
Filter client-side: merged_at >= {since}
Get PR diff/files
GET /repos/{owner}/{repo}/pulls/{pull_number}/files
Returns: array of {filename, status, additions, deletions, patch}
Get PR details
GET /repos/{owner}/{repo}/pulls/{pull_number}
Returns: title, body, merged_at, merge_commit_sha, user, labels
List directory contents
GET /repos/{owner}/{repo}/contents/{path}?ref={branch}
Returns: array of {name, path, type, sha, download_url}
Get file contents
GET /repos/{owner}/{repo}/contents/{path}?ref={branch}
Returns: {content} as base64. Decode before use.
Create a branch
First get the SHA of the base branch HEAD:
GET /repos/{owner}/{repo}/git/ref/heads/{base_branch}
→ object.sha
Then create the branch:
POST /repos/{owner}/{repo}/git/refs
Body: {"ref": "refs/heads/{new_branch}", "sha": "{base_sha}"}
Commit a file
First get the file's current SHA (if it exists):
GET /repos/{owner}/{repo}/contents/{path}?ref={branch}
→ sha
Then create/update:
PUT /repos/{owner}/{repo}/contents/{path}
Body: {
"message": "{commit message}",
"content": "{base64 encoded content}",
"branch": "{branch_name}",
"sha": "{existing_file_sha}" ← omit if creating new file
}
Create a PR
POST /repos/{owner}/{repo}/pulls
Body: {
"title": "{title}",
"body": "{markdown body}",
"head": "{branch_name}",
"base": "main",
"draft": false
}

Repos Reference

RepoOwnerAccess
HumberAgenttrnt-aiRead (PRs, files)
threat-dashboardtrnt-aiRead (PRs, files)
sdkstrnt-aiRead + Write (docs/ only)

Never write to HumberAgent or threat-dashboard. Never write outside docs/ in sdks.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/trnt-ai/trent-agent-skills/github-tools/badge)](https://verified-skill.com/skills/trnt-ai/trent-agent-skills/github-tools)

Something wrong with this skill or its page? Tell us.