🦀 ClawHub
GitHub Chat Assistant (Whatsapp)
by @iamkalio
Manage a single GitHub repository via chat for non-technical requesters—after they share the repo URL and a temporary personal token, pull status, summarize who did what and when, and create/follow up on issues directly through the GitHub API.
TERMINAL
clawhub install github-chat-ops📖 About This Skill
name: github-chat-ops description: Manage a single GitHub repository via chat for non-technical requesters—after they share the repo URL and a temporary personal token, pull status, summarize who did what and when, and create/follow up on issues directly through the GitHub API.
Overview
Use this skill whenever a non-technical person (often over WhatsApp) needs lightweight GitHub help without cloning or forking a repo. Typical asks:1. Gather prerequisites every session
1. Repo identifier – ask for full URL orowner/name.
2. PAT – confirm it has repo scope (private repos) or public_repo (public). Remind them to generate a short-lived token and send it in the chat; you’ll discard it afterward.
3. Task brief – what they need (issue, summary, follow-up) plus timeframe (e.g., "last 7 days")._Always restate the inputs back to them before acting. If anything is missing, pause and ask._
2. Handle tokens safely
export GITHUB_TOKEN=""
unset GITHUB_TOKEN.Authorization: Bearer $GITHUB_TOKEN and Accept: application/vnd.github+json.3. Fetch repo context before acting
1. Health check:GET /repos/{owner}/{repo} – confirms access and surfaces default branch.
2. Recent commits (for summaries / who-did-what):
- GET /repos/{owner}/{repo}/commits?since=&until=
- For per-author breakdown, add author= or group results locally.
3. Issues & PRs: GET /repos/{owner}/{repo}/issues?state=all&since=.
- Distinguish PRs via pull_request key.Record the raw JSON responses (e.g., save to /tmp/commits.json) if you need to run jq filters before summarizing.
4. Deep repo inspection without cloning
When you need file-level context (to quote code in an issue or explain why a commit matters), walk the tree via the REST API: 1. List directories/files:GET /repos/{owner}/{repo}/contents/?ref= returns metadata plus download URLs.
2. Fetch raw blobs: reuse the download_url or call GET /repos/{owner}/{repo}/contents/ with header Accept: application/vnd.github.raw.
3. Large trees: GET /repos/{owner}/{repo}/git/trees/?recursive=1 to grab the whole structure, then request the files you care about.
4. Cache what you read per session (e.g., store under /tmp/github-chat-ops//... ) so subsequent lookups avoid extra API calls.
Always mention the file + path + relevant snippet when writing summaries or issues.5. Summaries for non-technical readers (with real changes)
Translate activity into plain language:GET /repos/{owner}/{repo}/commits/{sha} to see files[] (filenames, additions/removals, patch).quiz_generator.py to support context prompts and added 3 YAML fixtures."6. Creating or updating issues
1. Clarify the problem, expected outcome, priority, and owners while chatting. 2. Draft the issue body locally in Markdown (include background, repro steps, acceptance criteria). 3. Create the issue viaPOST /repos/{owner}/{repo}/issues with JSON payload:
{
"title": "...",
"body": "...",
"assignees": ["username"],
"labels": ["priority:high"]
}
4. Echo the created issue URL back to the user and summarize what was filed._For follow-ups_, use PATCH /repos/{owner}/{repo}/issues/{number} to update state or assignees, and POST /repos/{owner}/{repo}/issues/{number}/comments for status notes.
7. Conversation pattern (WhatsApp-ready)
1. Confirm: "I’ll need the repo URL + a temporary token with repo scope—can you share those now?" 2. After each action, report in natural language first, then share links/details. 3. Keep tokens out of summaries. If the user sends screenshots or sensitive info, acknowledge and avoid re-sharing it elsewhere.8. Daily automation & cron jobs
.env.github-chat-ops with GITHUB_CHAT_OPS_TOKEN, repo, timezone).scripts/ (see scripts/github_chat_ops_daily.py) that load env vars, call the same APIs, and print a ready-to-send summary.cron, run the script from the workspace root, capture stdout verbatim for the message, and surface errors if the script exits non-zero.9. References
Usereferences/github-api-cheatsheet.md for ready-made curl templates covering the endpoints above plus pagination tips.