@uriva/p2b-github
1.0.3Description
GitHub repository, issue, comment, and pull request tools using safescript. Includes repoInstructions to fetch a repo's agent instruction files (AGENTS.md, CLAUDE.md, etc.)..
tank install -g @uriva/p2b-githubVerified clean
No security issues detected in the latest scan.
GitHub Skill
Use this skill to read and edit GitHub repositories without creating a VM or cloning the repository.
Read the repo's instructions FIRST (mandatory)
Before you read, write, or patch ANY file in a repository — on your first action
against that repo, and again whenever you switch repos or branches — you MUST
call repoInstructions for that owner/repo/ref and follow what it returns.
repoInstructions fetches the project's agent instruction files in one call:
AGENTS.md, CLAUDE.md, GEMINI.md, .github/copilot-instructions.md,
.cursorrules, and .windsurfrules. These hold the repo's conventions,
runbooks, and "how we do X here" knowledge. Skipping this is the most common
cause of wrong or low-quality changes — do not guess what you could have read.
If it returns NO_INSTRUCTION_FILES_FOUND, proceed but infer conventions from
the codebase.
Pass the configured GitHub token secret as githubToken through
secretMapping. Usually this should be:
{ "githubToken": "GITHUB_TOKEN" }
The token must have access to the repository and must allow requests to
api.github.com.
Tools
repoInstructions: fetches the repo's agent instruction files (AGENTS.md,CLAUDE.md,GEMINI.md,.github/copilot-instructions.md,.cursorrules,.windsurfrules) in one call. Call this FIRST for any repo, before reading or editing files (see "Read the repo's instructions FIRST" above).readGithubFile: reads a file from a branch or ref.writeGithubFile: commits a full file replacement using the Git Data API.patchGithubFile: reads a file, performs an exact string replacement, and commits the result using the Git Data API.createGithubIssue: creates a GitHub issue.addGithubIssueComment: adds a comment to an issue or pull request.createGithubPullRequest: creates a pull request.patchTextForTest: pure helper used for testing patch semantics.
Editing Rules
Prefer patchGithubFile for small changes. It follows OpenCode-style safe
editing semantics:
searchTextmust exactly match existing file content.- If
replaceAllisfalse,searchTextmust occur exactly once. - If
searchTextoccurs zero times, the tool returnsSEARCH_TEXT_NOT_FOUND. - If
searchTextoccurs multiple times andreplaceAllisfalse, the tool returnsSEARCH_TEXT_NOT_UNIQUE. - Set
replaceAlltotrueonly when every occurrence should change.
Use writeGithubFile only when creating or replacing a whole file is clearer
than a precise patch.
Use createGithubIssue, addGithubIssueComment, and createGithubPullRequest
for project-management tasks instead of shelling out to curl. This avoids VM
state issues and command-length limits for long issue/comment bodies.
Pass issueNumber as a string, for example "11".