name: github-repo-ops
description: >
This skill should be used for any direct read or write operation against a
GitHub repository β when the user asks to "commit this", "push this file",
"create a branch", "open a PR", "read the repo", "what's in this repo",
"update the README", "delete this file", "merge that PR", "create a repo",
"add a collaborator", "check CI status", "list branches", "tag a release", or
names a repository and asks for a change to it. Also triggers on "github-ops",
"repo ops", "full repo access", and any request that would modify files,
branches, issues, or pull requests on GitHub.
metadata:
version: 0.1.0
GitHub Repo Ops
Perform read and write operations against GitHub through the github-ops MCP server, which is authenticated with a Personal Access Token and therefore has write access β unlike the read-only OAuth GitHub connector.
Before the first operation in a session
Confirm which server is answering. Call get_me on the github-ops server. If it fails with a 401, the GITHUB_OPS_PAT environment variable is missing or expired β stop and point the user at SETUP-PAT.md rather than silently falling back to the read-only connector.
If both the read-only GitHub connector and this plugin's server are active, always prefer the github-ops tools for writes. The read-only connector returns 403 Resource not accessible by integration on any mutation.
Resolve the target before acting
Never guess an owner/repo pair. Resolve it in this order:
- An explicit
owner/repoin the user's message. - A repo named in the current session's earlier turns.
search_repositorieswithuser:<login>ororg:<org>β note that a bareMADHATstyle keyword search returns nothing useful; owner-qualified queries do.- Ask, once, if still ambiguous. Do not fan out writes across candidate repos.
Confirm the default branch (default_branch from the repo object) before any commit. Do not assume main β several repos use master.
Write operations: the safe sequence
Writes are irreversible from this session's perspective (there is no branch-delete or force-push tool). Follow this order every time:
- Read before write.
get_file_contentson the target path. A blindcreate_or_update_fileon an existing path without its current SHA fails; with a stale SHA it clobbers. - Branch, never commit to default.
create_branchfrom the default branch. Name it<type>/<short-slug>βfeat/,fix/,chore/,docs/,refactor/. - Commit. Use
push_filesfor multi-file changes in one commit β it is atomic and produces a clean history. Usecreate_or_update_fileonly for genuine single-file edits. - Open a PR with
create_pull_request. Search the repo for.github/pull_request_template.mdor.github/PULL_REQUEST_TEMPLATE/first and fill that structure if present. - Report the URL. Always hand back the PR or commit URL. The user cannot see the API response.
Never merge_pull_request without explicit instruction in the current turn. "Open a PR" is not permission to merge it.
Commit message format
<type>(<scope>): <imperative summary under 72 chars>
<why the change was needed β not what the diff shows>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Types: feat, fix, chore, docs, refactor, test, perf, build, ci. Scope is the package or contract name.
Reading efficiently
Repo reads burn context fast. Discipline:
get_file_contentswithpath: "/"to map structure before pulling files.search_codewithrepo:owner/nameto locate a symbol instead of reading directories.list_commitswithperPage: 10β never the default page size on an active repo.- Set
minimal_output: trueon searches unless a specific field is needed. - For a broad sweep across many files, stage the repo into the session workspace with
git cloneover HTTPS and grep locally. One clone beats fifty API reads.
Workflow files are a separate permission
Any commit touching .github/workflows/* requires the workflow scope on a classic PAT (or Workflows: write on a fine-grained PAT). repo/Contents alone returns 403 with a message about workflow permissions. If that error appears, say so plainly β it is a token scope problem, not a code problem.
Repository creation and settings
create_repository defaults matter. Set private: true unless the user says public. Initialize with a README only when there is no local content to push. For a first push into an empty repo, push_files against the auto-created default branch works; create_branch does not, because there is no ref to branch from yet.
Collaborator and settings changes (Administration permission) are not in this token's default scope. If list_repository_collaborators returns 403 Resource not accessible by integration, the PAT lacks admin read β report it rather than retrying.
Project conventions
For MAD Gambit repositories, load the mad-gambit-context skill before writing anything user-facing. Canonical values that must never be altered in committed content: platform fee 1.88%, community profit share 28.8%, creator revenue share 40%, seed raise $1β2M at $12M pre-money. The platform is "MAD Gambit"; the card game is "MADHAT's Gambit". Never write "MADHATs Gambit" as a platform name.
Solidity work: pair with the solidity-foundry skill. Never commit contract changes without forge build and forge test passing locally in the session workspace first β CI catching it after the PR is open wastes a round trip.
Verification step
After any write, verify rather than assume:
- Commit:
get_commiton the returned SHA, confirm the file list matches intent. - PR:
pull_request_readto confirm it targets the right base branch. - CI:
list_workflow_runsor the Actions toolset to confirm the run started.
Report what was verified, not what was attempted.