| name | github-ops |
| description | Workflow for repository reconnaissance and operations using GitHub CLI (gh). Optimizes token usage by using structured API queries instead of blind file fetching. |
| version | 1.2.0 |
| model | sonnet |
| invoked_by | both |
| user_invocable | true |
| tools | ["Bash","Read"] |
| best_practices | ["List directory contents before fetching specific files","Use --jq to filter JSON output and reduce token noise","Combine multiple checks into single API calls where possible"] |
| error_handling | graceful |
| streaming | supported |
| verified | true |
| lastVerifiedAt | "2026-02-22T00:00:00.000Z" |
| source | builtin |
| trust_score | 100 |
| provenance_sha | 36873c4bd8da3135 |
GitHub Ops Skill
Provides structured guidance for repository reconnaissance using gh api and gh search.
Overview
Repository reconnaissance often fails when agents guess file paths or attempt to fetch large files blindly. This skill enforces a structured Map -> Identify -> Fetch sequence using the GitHub CLI to minimize token waste and improve reliability.
⚡ Essential Reconnaissance Commands
Use these commands to understand a repository structure before fetching content.
1. List Repository Root
gh api repos/{owner}/{repo}/contents --jq '.[].name'
2. List Specific Directory
gh api repos/{owner}/{repo}/contents/{path} --jq '.[].name'
3. Fetch File Content (Base64 Decoded)
gh api repos/{owner}/{repo}/contents/{path} --jq '.content' | base64 -d
4. Search for Pattern in Repository
gh search code "{pattern}" --repo {owner}/{repo}
5. Get Repository Metadata
gh repo view {owner}/{repo} --json description,stargazerCount,updatedAt
🔄 Token-Efficient Workflow
- Map Tree: List the root and core directories (
commands, src, docs).
- Identify Entrypoints: Look for
README.md, gemini-extension.json, package.json, or SKILL.md.
- Targeted Fetch: Download only the entrypoints first.
- Deep Dive: Use
gh search code to find logic patterns rather than reading every file.
🛡️ Platform Safety (Windows)
- When using
base64 -d, ensure the output is redirected to a file using the Write tool if it's large.
- Avoid Linux-style
/dev/stdin patterns in complex pipes.
- Use native paths for any local storage.
Iron Laws
- ALWAYS follow the Map → Identify → Fetch sequence before reading any file — blindly fetching files by guessed path wastes tokens, triggers 404s, and produces hallucinated repo structure.