From managing-github
Interact with GitHub via the gh CLI: create issues, pull requests, fetch review threads, post comments, and search. Use when the project's source code hosting or issue tracker is GitHub.
npx claudepluginhub forketyfork/agentic-skills --plugin managing-githubThis skill is limited to using the following tools:
Set a description and topics for discoverability:
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Generates original PNG/PDF visual art via design philosophy manifestos for posters, graphics, and static designs on user request.
Set a description and topics for discoverability:
gh repo edit --description "<description>" \
--add-topic "<topic1>" --add-topic "<topic2>"
Add a homepage link if applicable:
gh repo edit --homepage "<url>"
Rename the default branch to main if it is still named master:
# Rename the branch on GitHub (also updates the default branch)
gh api repos/<org>/<repo>/branches/master/rename \
--method POST --field new_name=main
# Update your local clone to track the renamed branch
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a
Enable via:
https://github.com/<org>/<repo>/settings/security_analysis
Enable CodeQL with default settings via:
https://github.com/<org>/<repo>/settings/security_analysis
In every GitHub Actions workflow file, add a top-level permissions block with
minimum required access:
permissions:
contents: read
On https://github.com/<org>/<repo>/settings/rules, create a ruleset named
"Protect the main" targeting the default branch with these settings:
Create .github/dependabot.yml with ecosystem-appropriate entries. Example for
Maven/Gradle:
version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "daily"
groups:
all-dependencies:
patterns:
- "*"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
all-actions:
patterns:
- "*"
Enable Dependabot features via:
https://github.com/<org>/<repo>/settings/security_analysis
Create an issue:
gh issue create --title "<title>" --label "<labels>" --body "<body>"
For long bodies, write to a temp file and use --body-file:
gh issue create --title "<title>" --label "<labels>" --body-file .tmp/issue-body-$RANDOM.md
Search issues:
gh issue list --search "<query>"
gh issue list --label "bug"
Create a PR:
gh pr create --title "<title>" --body-file .tmp/pr-body-$RANDOM.md
Create a draft PR:
gh pr create --draft --title "<title>" --body-file .tmp/pr-body-$RANDOM.md
Include Fixes #<number> in PR body to auto-close the linked issue on merge.
View PR details:
gh pr view <number>
gh pr view --json number --jq '.number'
gh pr diff <number>
Fetch PR comments (paginated):
gh api repos/<org>/<repo>/pulls/<pr>/comments --paginate
Get root-level comments only:
gh api repos/<org>/<repo>/pulls/<pr>/comments --paginate \
--jq '[.[] | select(.in_reply_to_id == null)]'
Fetch review threads with resolution state:
gh api graphql -f query='
{
repository(owner: "<org>", name: "<repo>") {
pullRequest(number: <pr>) {
reviewThreads(first: 100) {
nodes {
isResolved
comments(first: 1) {
nodes {
databaseId
body
author { login }
path
}
}
}
}
}
}
}'
Reply to a review comment:
gh api repos/<org>/<repo>/pulls/<pr>/comments \
--method POST \
--field in_reply_to=<comment_id> \
--field body="<reply text>"
Post an issue comment:
gh api repos/<org>/<repo>/issues/<number>/comments \
--method POST \
--field body="<comment text>"
Avoid shell expansion issues by using a body file:
gh api repos/<org>/<repo>/pulls/<pr>/comments \
--method POST \
--field in_reply_to=<comment_id> \
--field body=@.tmp/reply.txt