
Github Ops
- 48 installs
- 36 repo stars
- Updated July 14, 2026
- oimiragieo/agent-studio
Helps with ai & agent building tasks.
About
github-ops is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.
- github-ops
- AI & Agent Building
- AI-coding skill
Github Ops by the numbers
- 48 all-time installs (skills.sh)
- Ranked #7,473 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/oimiragieo/agent-studio --skill github-opsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 48 |
|---|---|
| repo stars | ★ 36 |
| Last updated | July 14, 2026 |
| Repository | oimiragieo/agent-studio ↗ |
What it does
Helps with ai & agent building tasks.
Files
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 -d4. 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
1. Map Tree: List the root and core directories (commands, src, docs). 2. Identify Entrypoints: Look for README.md, gemini-extension.json, package.json, or SKILL.md. 3. Targeted Fetch: Download only the entrypoints first. 4. 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 theWritetool if it's large. - Avoid Linux-style
/dev/stdinpatterns in complex pipes. - Use native paths for any local storage.
Iron Laws
1. 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. 2. NEVER fetch a file without first listing its parent directory or confirming it exists via gh api — large files fetched unnecessarily can exhaust the context window. 3. ALWAYS use --jq to filter gh api JSON output to only the fields needed — unfiltered API responses contain hundreds of irrelevant fields that inflate token usage. 4. NEVER use gh search code without a scoping qualifier (repo, org, or path) — unscoped code search returns results from all of GitHub, producing irrelevant noise. 5. ALWAYS prefer gh api structured queries over reading repository files directly when repository metadata is needed — API queries are faster, structured, and don't require authentication context for public repos.
Anti-Patterns
| Anti-Pattern | Why It Fails | Correct Approach |
|---|---|---|
| Guessing file paths and fetching them directly | High 404 rate; wasted tokens on non-existent paths | Map root tree first: gh api repos/{owner}/{repo}/git/trees/HEAD --jq '.tree[].path' |
| Fetching entire files for a single field | Large files exhaust context; slow and imprecise | Use --jq to extract only the required field from API response |
Unscoped gh search code queries | Returns GitHub-wide results; noise overwhelms signal | Always add --repo owner/name or --owner org scope qualifier |
| Reading binary or generated files | Binary content is unreadable; generated files change frequently | Identify file type first; skip binaries; read source files only |
| Sequential API calls for each file | Unnecessary round-trips inflate latency | Batch: use gh api trees or search to identify multiple targets, then fetch in parallel |
GitHub MCP Server Operations
When the official GitHub MCP server (@modelcontextprotocol/server-github) is configured, use these higher-level tools for repository management and automation:
// settings.json configuration
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "${GITHUB_TOKEN}" }
}PR Automation Pattern
# Create PR with auto-generated description
gh pr create \
--title "feat: add feature X" \
--body "$(gh api repos/{owner}/{repo}/compare/{base}...{head} --jq '.commits[].commit.message' | head -5)" \
--base main \
--head feature/x
# Auto-merge after CI passes
gh pr merge --auto --squash --delete-branchIssue Management
# List open issues by label
gh issue list --label "bug" --state open --json number,title,assignees
# Bulk-close resolved issues
gh issue list --label "stale" --json number --jq '.[].number' | \
xargs -I{} gh issue close {} --comment "Closing as stale"
# Create issue from template
gh issue create \
--title "Bug: [description]" \
--body-file .github/ISSUE_TEMPLATE/bug_report.md \
--label "bug,needs-triage"Release Automation
# Create release with auto-generated notes
gh release create v1.2.0 \
--generate-notes \
--title "v1.2.0" \
--target main
# Upload release assets
gh release upload v1.2.0 dist/*.tar.gz dist/*.zipWorkflow Management
# Trigger workflow manually
gh workflow run deploy.yml --field environment=production
# Watch workflow run
gh run watch $(gh run list --workflow=deploy.yml --limit=1 --json databaseId --jq '.[0].databaseId')
# Download workflow artifacts
gh run download --name=build-artifacts --dir=./artifactsAssigned Agents
- artifact-integrator: Lead agent for repository onboarding.
- developer: PR management and exploration.
Memory Protocol (MANDATORY)
Before starting: Read .claude/context/memory/learnings.md
After completing:
- New pattern ->
.claude/context/memory/learnings.md - Issue found ->
.claude/context/memory/issues.md - Decision made ->
.claude/context/memory/decisions.md
ASSUME INTERRUPTION: If it's not in memory, it didn't happen.
Invoke the github-ops skill and follow it exactly as presented to you
'use strict';
module.exports = function postExecute(input, output) {
if (!output.ok && output.error && output.error.includes('Not Found')) {
return {
ok: false,
message: '[github-ops] Resource not found. Verify the owner, repo, and path placeholders.',
};
}
return { ok: true };
};
'use strict';
module.exports = function preExecute(input) {
const { command, args } = input;
// Platform safety: block Linux-specific constructs on Windows
if (process.platform === 'win32') {
const fullCommand = `${command} ${args ? args.join(' ') : ''}`;
if (fullCommand.includes('/dev/stdin') || fullCommand.includes('/tmp/')) {
return {
allow: false,
message: '[github-ops] Linux-specific path constructs detected in Windows environment.',
};
}
}
return { allow: true };
};
# Reference materials for this skill
Research Requirements: github-ops
Research Details
- Date: 2026-02-17
- Query Intent: Identify best practices for repository reconnaissance and structured API usage via GitHub CLI (gh).
- Sources:
- GitHub REST API Documentation (Best Practices)
- GitHub CLI (gh) Manual
- GitHub Community Discussions
Exa Findings
- High-Confidence Keywords: gh api, jq filtering, code search, repository structure, pagination.
- Actionable Design Constraints:
1. Structured Reconnaissance: Use gh api repos/{owner}/{repo}/contents with --jq to list files before fetching content. 2. Token Efficiency: Filter JSON responses to return only necessary fields (e.g., name, type, path). 3. Automated Pagination: Use the --paginate flag for endpoints that return large lists (e.g., issues, PRs).
- Non-Goals:
- Do not implement complex local caching (assume session-level persistence).
- Do not provide exhaustive wrappers for all 100+ API endpoints; focus on reconnaissance.
Actionable Design Constraints
1. Tooling: Always prioritize gh api for reconnaissance over blind Read or WebFetch of raw files. 2. Workflow: Implement a Map -> Identify -> Fetch sequence. 3. Guardrails: Block Linux-specific path constructs (e.g., /dev/stdin) in Windows environments.
Operating Rules: github-ops
1. Reconnaissance-First: Always list directory contents via gh api before attempting to read specific files. 2. Filter Aggressively: Use the --jq flag to select only relevant metadata (name, type, size) to keep the context clean. 3. Placeholders: Use {owner}, {repo}, and {branch} placeholders in API endpoints; the CLI will automatically resolve them if in a git directory. 4. No Linux Paths: Never use /dev/stdin or Linux-style absolute paths in gh commands when on Windows. 5. Output Redirection: For large API responses, redirect output to a temporary file instead of outputting directly to the prompt. 6. Pagination: Always use --paginate for endpoints known to return large collections (e.g., repository contents with 50+ items).
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "github-opsInput",
"description": "Input schema for Workflow for repository reconnaissance and operations using GitHub CLI (gh). Optimizes token usage by using structured API queries instead of blind file fetching.",
"type": "object",
"additionalProperties": true,
"properties": {
"target": {
"type": "string",
"description": "Target file or path for the skill to operate on"
},
"options": {
"type": "object",
"description": "Additional options for skill execution",
"additionalProperties": true
}
}
}
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "github-opsOutput",
"type": "object",
"additionalProperties": true,
"properties": {
"ok": {
"type": "boolean"
},
"summary": {
"type": "string"
}
}
}
'use strict';
const { spawnSync } = require('child_process');
const path = require('path');
function executeGh(args) {
const result = spawnSync('gh', args, {
shell: false,
encoding: 'utf8',
windowsHide: true,
});
if (result.error) {
return { ok: false, error: result.error.message };
}
if (result.status !== 0) {
return { ok: false, error: result.stderr, status: result.status };
}
return { ok: true, output: result.stdout };
}
function main() {
const args = process.argv.slice(2);
if (args.length === 0) {
console.log('GitHub Ops CLI - Structured Reconnaissance');
console.log('Usage: node main.cjs <gh-command> [gh-args]');
return;
}
const result = executeGh(args);
if (result.ok) {
process.stdout.write(result.output);
} else {
process.stderr.write(`Error (${result.status}): ${result.error}\n`);
process.exit(result.status || 1);
}
}
if (require.main === module) {
main();
}
module.exports = { executeGh };
Implementation Template: github-ops
Use this template when implementing repository reconnaissance workflows.
1. Map Root
// Step 1: List root files
Skill({
skill: 'github-ops',
args: ['api', 'repos/{owner}/{repo}/contents', '--jq', '.[].name'],
});2. Locate Core Logic
// Step 2: Search for entrypoints
Skill({
skill: 'github-ops',
args: ['search', 'code', 'pattern', '--repo', '{owner}/{repo}'],
});3. Ingest Entrypoints
// Step 3: Fetch file content
Skill({
skill: 'github-ops',
args: ['api', 'repos/{owner}/{repo}/contents/{path}', '--jq', '.content'],
});