GitHub Agent
Drop this in ~/.claude/skills/github/SKILL.md and Claude Code becomes your GitHub assistant.
Bootstrap (ALWAYS Run First)
#!/bin/bash
set -e
# 1. Check if atris CLI is installed
if ! command -v atris &> /dev/null; then
echo "Installing atris CLI..."
npm install -g atris
fi
# 2. Check if logged in to AtrisOS
if [ ! -f ~/.atris/credentials.json ]; then
echo "Not logged in. Run: atris login"
exit 1
fi
# 3. Extract token
if command -v node &> /dev/null; then
TOKEN=$(node -e "console.log(require('$HOME/.atris/credentials.json').token)")
elif command -v python3 &> /dev/null; then
TOKEN=$(python3 -c "import json,os; print(json.load(open(os.path.expanduser('~/.atris/credentials.json')))['token'])")
else
TOKEN=$(jq -r '.token' ~/.atris/credentials.json)
fi
# 4. Check GitHub connection
STATUS=$(curl -s "https://api.atris.ai/api/integrations/github/status" \
-H "Authorization: Bearer $TOKEN")
CONNECTED=$(echo "$STATUS" | python3 -c "import sys,json; print(json.load(sys.stdin).get('connected', False))" 2>/dev/null || echo "false")
if [ "$CONNECTED" != "true" ] && [ "$CONNECTED" != "True" ]; then
echo "GitHub not connected. Getting authorization URL..."
AUTH=$(curl -s -X POST "https://api.atris.ai/api/integrations/github/start" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"return_url":"https://atris.ai/settings/integrations"}')
URL=$(echo "$AUTH" | python3 -c "import sys,json; print(json.load(sys.stdin).get('auth_url', ''))")
echo ""
echo "Open this URL to connect GitHub:"
echo "$URL"
echo ""
echo "After authorizing, run your command again."
exit 0
fi
echo "Ready. GitHub is connected."
export ATRIS_TOKEN="$TOKEN"
Tool Actions
The GitHub tool is available to agents as github. All actions accept optional owner and repo params (defaults to configured repo).
Repos
| Action |
Params |
Description |
list_repos |
per_page |
List your accessible repos |
get_repo |
owner, repo |
Get repo details |
Pull Requests
| Action |
Params |
Description |
list_prs |
state (open/closed/all), per_page |
List PRs |
get_pr |
pr_number |
Get PR details + merge status |
create_pr |
title, head, base, body |
Open a PR |
list_pr_files |
pr_number |
Files changed in PR |
list_pr_reviews |
pr_number |
Reviews on PR |
create_pr_review |
pr_number, body, event |
Add review (APPROVE/REQUEST_CHANGES/COMMENT) |
create_pr_comment |
pr_number, body |
Comment on PR |
merge_pr |
pr_number, merge_method |
Merge PR (squash/merge/rebase) |
Issues
| Action |
Params |
Description |
list_issues |
state, labels, per_page |
List issues |
get_issue |
issue_number |
Get issue details |
create_issue |
title, body, labels |
Open issue |
update_issue |
issue_number, title/body/state/labels |
Update issue |
list_issue_comments |
issue_number |
Get issue comments |
create_issue_comment |
issue_number, body |
Comment on issue |
add_labels |
issue_number/pr_number, labels |
Add labels |
Branches
| Action |
Params |
Description |
list_branches |
per_page |
List branches |
create_branch |
branch, from_ref |
Create branch from ref |
delete_branch |
branch |
Delete branch |
Commits
| Action |
Params |
Description |
list_commits |
sha/branch, per_page |
Recent commits |
get_commit |
ref |
Commit details |
compare_commits |
base, head |
Diff between refs |
CI / Checks
| Action |
Params |
Description |
get_combined_status |
ref/branch |
CI status for ref |
list_check_runs |
ref/branch |
Check runs (Actions) |
Search
| Action |
Params |
Description |
search_issues |
query |
Search issues/PRs across repos |
search_code |
query |
Search code across repos |
Files
| Action |
Params |
Description |
list_contents |
path |
List directory |
get_file |
path, ref |
Read file (returns decoded_content) |
put_file |
path, message, content, sha, branch |
Create/update file |
Workflows
"Check open PRs"
- Bootstrap
list_prs with state=open
- For each PR:
get_combined_status with the PR's head ref
- Display: title, author, CI status, review count, age
"Review a PR"
get_pr with pr_number
list_pr_files to see what changed
get_file on key changed files to read content
create_pr_review with body and event (APPROVE/REQUEST_CHANGES/COMMENT)
"Triage new issues"
list_issues with state=open
- For each: inspect title/body for keywords
add_labels based on content (bug, feature, docs)
create_issue_comment acknowledging triage
"Clean merged branches"
list_branches to see all branches
list_prs with state=closed to find merged PRs
- For branches with merged PRs (not main/master/develop):
delete_branch
"Get CI status"
get_combined_status with ref=main for overall status
list_check_runs for individual check details
"Weekly repo report"
list_prs with state=all + filter by date
list_issues with state=all + filter by date
list_commits for recent activity
- Summarize: PRs merged, issues opened/closed, top contributors
Error Handling
| Error |
Meaning |
Solution |
GitHub not connected |
No OAuth token |
Run bootstrap |
GitHub API error (401) |
Token expired |
Reconnect GitHub in settings |
GitHub API error (403) |
Rate limited or no permission |
Wait or check repo access |
GitHub API error (404) |
Repo/resource not found |
Check owner/repo/number |
GitHub API error (422) |
Invalid request |
Check required params |
No repo specified |
No default repo configured |
Set default in Settings > Integrations > GitHub |
Quick Reference
TOKEN=$(node -e "console.log(require('$HOME/.atris/credentials.json').token)")
# Check connection
curl -s "https://api.atris.ai/api/integrations/github/status" -H "Authorization: Bearer $TOKEN"
# List repos
curl -s "https://api.atris.ai/api/integrations/github/repos" -H "Authorization: Bearer $TOKEN"
# Configure default repo
curl -s -X PUT "https://api.atris.ai/api/integrations/github/config" \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"owner":"atrislabs","repo":"atrisos-backend","default_branch":"master"}'
# Disconnect
curl -s -X DELETE "https://api.atris.ai/api/integrations/github" -H "Authorization: Bearer $TOKEN"
1---2name: github3description: GitHub integration via AtrisOS API. Manage PRs, issues, branches, CI status, code review, search. Use when user asks about repos, pull requests, issues, branches, or code changes.4---56# GitHub Agent78> Drop this in `~/.claude/skills/github/SKILL.md` and Claude Code becomes your GitHub assistant.910## Bootstrap (ALWAYS Run First)1112```bash13#!/bin/bash14set -e1516# 1. Check if atris CLI is installed17if ! command -v atris &> /dev/null; then18 echo "Installing atris CLI..."19 npm install -g atris20fi2122# 2. Check if logged in to AtrisOS23if [ ! -f ~/.atris/credentials.json ]; then24 echo "Not logged in. Run: atris login"25 exit 126fi2728# 3. Extract token29if command -v node &> /dev/null; then30 TOKEN=$(node -e "console.log(require('$HOME/.atris/credentials.json').token)")31elif command -v python3 &> /dev/null; then32 TOKEN=$(python3 -c "import json,os; print(json.load(open(os.path.expanduser('~/.atris/credentials.json')))['token'])")33else34 TOKEN=$(jq -r '.token' ~/.atris/credentials.json)35fi3637# 4. Check GitHub connection38STATUS=$(curl -s "https://api.atris.ai/api/integrations/github/status" \39 -H "Authorization: Bearer $TOKEN")4041CONNECTED=$(echo "$STATUS" | python3 -c "import sys,json; print(json.load(sys.stdin).get('connected', False))" 2>/dev/null || echo "false")4243if [ "$CONNECTED" != "true" ] && [ "$CONNECTED" != "True" ]; then44 echo "GitHub not connected. Getting authorization URL..."45 AUTH=$(curl -s -X POST "https://api.atris.ai/api/integrations/github/start" \46 -H "Authorization: Bearer $TOKEN" \47 -H "Content-Type: application/json" \48 -d '{"return_url":"https://atris.ai/settings/integrations"}')4950 URL=$(echo "$AUTH" | python3 -c "import sys,json; print(json.load(sys.stdin).get('auth_url', ''))")5152 echo ""53 echo "Open this URL to connect GitHub:"54 echo "$URL"55 echo ""56 echo "After authorizing, run your command again."57 exit 058fi5960echo "Ready. GitHub is connected."61export ATRIS_TOKEN="$TOKEN"62```6364---6566## Tool Actions6768The GitHub tool is available to agents as `github`. All actions accept optional `owner` and `repo` params (defaults to configured repo).6970### Repos71| Action | Params | Description |72|--------|--------|-------------|73| `list_repos` | `per_page` | List your accessible repos |74| `get_repo` | `owner`, `repo` | Get repo details |7576### Pull Requests77| Action | Params | Description |78|--------|--------|-------------|79| `list_prs` | `state` (open/closed/all), `per_page` | List PRs |80| `get_pr` | `pr_number` | Get PR details + merge status |81| `create_pr` | `title`, `head`, `base`, `body` | Open a PR |82| `list_pr_files` | `pr_number` | Files changed in PR |83| `list_pr_reviews` | `pr_number` | Reviews on PR |84| `create_pr_review` | `pr_number`, `body`, `event` | Add review (APPROVE/REQUEST_CHANGES/COMMENT) |85| `create_pr_comment` | `pr_number`, `body` | Comment on PR |86| `merge_pr` | `pr_number`, `merge_method` | Merge PR (squash/merge/rebase) |8788### Issues89| Action | Params | Description |90|--------|--------|-------------|91| `list_issues` | `state`, `labels`, `per_page` | List issues |92| `get_issue` | `issue_number` | Get issue details |93| `create_issue` | `title`, `body`, `labels` | Open issue |94| `update_issue` | `issue_number`, `title`/`body`/`state`/`labels` | Update issue |95| `list_issue_comments` | `issue_number` | Get issue comments |96| `create_issue_comment` | `issue_number`, `body` | Comment on issue |97| `add_labels` | `issue_number`/`pr_number`, `labels` | Add labels |9899### Branches100| Action | Params | Description |101|--------|--------|-------------|102| `list_branches` | `per_page` | List branches |103| `create_branch` | `branch`, `from_ref` | Create branch from ref |104| `delete_branch` | `branch` | Delete branch |105106### Commits107| Action | Params | Description |108|--------|--------|-------------|109| `list_commits` | `sha`/`branch`, `per_page` | Recent commits |110| `get_commit` | `ref` | Commit details |111| `compare_commits` | `base`, `head` | Diff between refs |112113### CI / Checks114| Action | Params | Description |115|--------|--------|-------------|116| `get_combined_status` | `ref`/`branch` | CI status for ref |117| `list_check_runs` | `ref`/`branch` | Check runs (Actions) |118119### Search120| Action | Params | Description |121|--------|--------|-------------|122| `search_issues` | `query` | Search issues/PRs across repos |123| `search_code` | `query` | Search code across repos |124125### Files126| Action | Params | Description |127|--------|--------|-------------|128| `list_contents` | `path` | List directory |129| `get_file` | `path`, `ref` | Read file (returns decoded_content) |130| `put_file` | `path`, `message`, `content`, `sha`, `branch` | Create/update file |131132---133134## Workflows135136### "Check open PRs"1371. Bootstrap1382. `list_prs` with `state=open`1393. For each PR: `get_combined_status` with the PR's head ref1404. Display: title, author, CI status, review count, age141142### "Review a PR"1431. `get_pr` with `pr_number`1442. `list_pr_files` to see what changed1453. `get_file` on key changed files to read content1464. `create_pr_review` with body and event (APPROVE/REQUEST_CHANGES/COMMENT)147148### "Triage new issues"1491. `list_issues` with `state=open`1502. For each: inspect title/body for keywords1513. `add_labels` based on content (bug, feature, docs)1524. `create_issue_comment` acknowledging triage153154### "Clean merged branches"1551. `list_branches` to see all branches1562. `list_prs` with `state=closed` to find merged PRs1573. For branches with merged PRs (not main/master/develop): `delete_branch`158159### "Get CI status"1601. `get_combined_status` with `ref=main` for overall status1612. `list_check_runs` for individual check details162163### "Weekly repo report"1641. `list_prs` with `state=all` + filter by date1652. `list_issues` with `state=all` + filter by date1663. `list_commits` for recent activity1674. Summarize: PRs merged, issues opened/closed, top contributors168169---170171## Error Handling172173| Error | Meaning | Solution |174|-------|---------|----------|175| `GitHub not connected` | No OAuth token | Run bootstrap |176| `GitHub API error (401)` | Token expired | Reconnect GitHub in settings |177| `GitHub API error (403)` | Rate limited or no permission | Wait or check repo access |178| `GitHub API error (404)` | Repo/resource not found | Check owner/repo/number |179| `GitHub API error (422)` | Invalid request | Check required params |180| `No repo specified` | No default repo configured | Set default in Settings > Integrations > GitHub |181182---183184## Quick Reference185186```bash187TOKEN=$(node -e "console.log(require('$HOME/.atris/credentials.json').token)")188189# Check connection190curl -s "https://api.atris.ai/api/integrations/github/status" -H "Authorization: Bearer $TOKEN"191192# List repos193curl -s "https://api.atris.ai/api/integrations/github/repos" -H "Authorization: Bearer $TOKEN"194195# Configure default repo196curl -s -X PUT "https://api.atris.ai/api/integrations/github/config" \197 -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \198 -d '{"owner":"atrislabs","repo":"atrisos-backend","default_branch":"master"}'199200# Disconnect201curl -s -X DELETE "https://api.atris.ai/api/integrations/github" -H "Authorization: Bearer $TOKEN"202```