GitHub Integration Skill
Complete integration with GitHub for repository management, issue tracking, pull requests, releases, and automation via GitHub API and CLI.
Overview
The GitHub Integration Skill provides:
- Repository Management: Create, update, configure repositories
- Topics & Metadata: Add/update topics, description, website
- Issue Tracking: Create, update, query, label issues
- Pull Requests: Create, review, merge PRs
- Releases: Create releases, upload assets, manage tags
- Actions & Workflows: Trigger workflows, check runs
- User/Org Management: Teams, permissions, collaborators
- GitHub CLI: Direct
ghcommand integration
When to Use This Skill
Activate this skill when the user needs to:
- Update repository topics/tags/description
- Create or manage GitHub repositories
- Work with issues and pull requests
- Create releases and tags
- Manage repository settings
- Trigger GitHub Actions workflows
- Manage collaborators and permissions
- Query GitHub data via API
Capabilities
Repository Management
- Create Repository: Initialize new repos (public/private)
- Update Settings: Description, website, topics, visibility
- Topics/Tags: Add, remove, replace repository topics
- Branch Protection: Configure branch rules
- Webhooks: Configure repository webhooks
- Secrets: Manage repository secrets (Actions)
- Collaborators: Add, remove, manage permissions
- Transfer: Transfer ownership
- Archive/Delete: Archive or delete repositories
Topics & Metadata Management
- Add Topics: Add tags to repository for discoverability
- Remove Topics: Remove outdated or incorrect tags
- Update Description: Set repository description
- Set Homepage: Configure repository website URL
- Update README: Generate or update README.md
- Social Preview: Update social media preview image
Issue Management
- Create Issues: Create with templates, labels, assignees
- Update Issues: Edit title, body, labels, assignees
- Query Issues: Search with filters and queries
- Labels: Create, update, delete labels
- Milestones: Create and manage milestones
- Comments: Add, edit, delete comments
- Close/Reopen: Change issue state
- Lock/Unlock: Lock conversations
Pull Request Operations
- Create PR: From branch or fork
- Review PR: Add review comments, approve/reject
- Merge PR: Merge, squash, or rebase
- Request Reviews: Assign reviewers
- Check Status: CI/CD status, conflicts
- Draft PRs: Create draft pull requests
- Auto-merge: Enable auto-merge when checks pass
Release Management
- Create Release: Tag and create release
- Upload Assets: Attach binaries, archives
- Pre-release: Mark as pre-release or draft
- Release Notes: Auto-generate from commits
- Edit Release: Update release info
- Delete Release: Remove releases
GitHub Actions
- Trigger Workflows: Manually trigger workflows
- Check Runs: View workflow run status
- Download Artifacts: Get workflow artifacts
- Secrets Management: Add/update Actions secrets
- View Logs: Check workflow logs
GitHub CLI Integration
This skill uses gh (GitHub CLI) for most operations:
Repository Commands
gh repo create- Create repositorygh repo edit- Update repository settingsgh repo view- View repository detailsgh repo clone- Clone repositorygh repo fork- Fork repository
Issue Commands
gh issue create- Create issuegh issue list- List issuesgh issue view- View issue detailsgh issue edit- Update issuegh issue close- Close issue
PR Commands
gh pr create- Create pull requestgh pr list- List pull requestsgh pr view- View PR detailsgh pr review- Review PRgh pr merge- Merge PRgh pr checks- Check PR status
Release Commands
gh release create- Create releasegh release list- List releasesgh release view- View releasegh release upload- Upload assetsgh release delete- Delete release
Usage Examples
Example 1: Update Repository Topics
User: "Add topics claude-code, cursor, ai-assistant to my repo"
Workflow:
1. Identify current repository (from git remote or ask)
2. Get current topics: gh repo view --json repositoryTopics
3. Add new topics: gh repo edit --add-topic claude-code --add-topic cursor --add-topic ai-assistant
4. Verify topics added
5. Return success with updated topics list
Example 2: Update Repository Description & Homepage
User: "Update repo description and add homepage URL"
Workflow:
1. Get repository info
2. Ask user for new description
3. Ask user for homepage URL
4. Update: gh repo edit --description "New description" --homepage "https://example.com"
5. Verify changes
6. Return success
Example 3: Create GitHub Issue
User: "Create bug issue for login failure"
Workflow:
1. Use issue template if available
2. Gather details:
- Title: "Login fails on mobile"
- Body: User description
- Labels: bug, high-priority
- Assignee: Optional
3. Create: gh issue create --title "..." --body "..." --label bug
4. Return issue URL
Example 4: Create Pull Request
User: "Create PR from feature/login to main"
Workflow:
1. Verify current branch or checkout branch
2. Push branch to remote if needed
3. Generate PR description from commits
4. Create: gh pr create --base main --head feature/login --title "Add login feature" --body "..."
5. Assign reviewers if specified
6. Return PR URL
Example 5: Create Release
User: "Create v1.0.0 release with changelog"
Workflow:
1. Verify tag doesn't exist
2. Generate release notes from commits
3. Create: gh release create v1.0.0 --title "Version 1.0.0" --notes "Changelog..."
4. Upload assets if provided
5. Return release URL
Example 6: Set Multiple Repository Topics
User: "Tag this repo with Claude Code, Cursor, AI tools"
Workflow:
1. Parse desired topics (normalize: claude-code, cursor, ai-tools)
2. Get current topics
3. Merge with new topics (avoid duplicates)
4. Set all topics: gh repo edit --add-topic claude-code,cursor,ai-tools
5. Return complete topic list
Example 7: Check PR Status
User: "What's the status of PR #42?"
Workflow:
1. Get PR details: gh pr view 42
2. Check CI/CD status: gh pr checks 42
3. Check reviews
4. Check merge conflicts
5. Format and return status report
Example 8: Trigger GitHub Actions Workflow
User: "Run the deploy workflow"
Workflow:
1. List workflows: gh workflow list
2. Find deploy workflow
3. Trigger: gh workflow run deploy.yml
4. Get run ID
5. Monitor progress
6. Return run status and URL
Configuration
Automatic GitHub CLI Setup
IMPORTANT: This skill requires GitHub CLI (gh). The skill will automatically:
- Check if
ghis installed - If not installed, provide platform-specific installation instructions
- Guide user through authentication if needed
GitHub CLI Installation
Automatic Check:
Before any GitHub operation, the skill will verify gh is installed:
gh --version
If not installed, provide instructions based on platform:
Windows:
winget install GitHub.cli
macOS:
brew install gh
Linux (Debian/Ubuntu):
sudo apt install gh
Linux (Fedora/RHEL):
sudo dnf install gh
Linux (Arch):
sudo pacman -S github-cli
Authentication Setup
After installation, authenticate with GitHub:
gh auth login
# Set default repository (optional)
gh repo set-default owner/repo
Environment Variables
# GitHub token (optional, gh auth is preferred)
GITHUB_TOKEN=ghp_your_token_here
# Default repository
GITHUB_REPO=owner/repo
Git Configuration
# Ensure git is configured
git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"
Repository Topics Guidelines
Best Practices for Topics
Topic Format:
- Lowercase letters, numbers, hyphens
- Max 50 characters per topic
- Max 20 topics per repository
- Use hyphens not spaces:
claude-codenotclaude code
Recommended Topics for AI/IDE Projects:
# Primary
claude-code, cursor, anthropic, ai-assistant
# Project Type
project-template, boilerplate, starter-kit
# Technologies
mcp, mcp-server, python, nodejs
# Features
task-management, automation, web-scraping
# Integrations
jira, confluence, github, atlassian
Topic Categories:
- Platform/IDE: claude-code, cursor, vscode, windsurf
- AI/ML: anthropic, openai, llm, ai-tools
- Language: python, javascript, typescript
- Framework: react, nodejs, playwright
- Purpose: automation, integration, productivity
- Domain: devtools, enterprise, productivity
Best Practices
Repository Management
- Clear Description: Write descriptive, searchable descriptions
- Relevant Topics: Add 5-15 relevant topics
- Homepage URL: Link to documentation or project site
- README: Keep README.md updated
- License: Always include LICENSE file
- Contributing: Add CONTRIBUTING.md for contributors
Issue Management
- Templates: Use issue templates for consistency
- Labels: Create clear, consistent labels
- Assignees: Assign issues to responsible parties
- Milestones: Group issues by milestone
- Projects: Use GitHub Projects for planning
Pull Requests
- Descriptive Titles: Clear, concise PR titles
- Detailed Descriptions: Explain what and why
- Link Issues: Reference related issues
- Request Reviews: Assign appropriate reviewers
- CI/CD: Ensure checks pass before merging
Releases
- Semantic Versioning: Use semver (v1.2.3)
- Changelog: Include detailed changelog
- Assets: Attach relevant binaries/archives
- Pre-releases: Mark beta/alpha as pre-release
- Release Notes: Auto-generate from commits
Troubleshooting
Authentication Issues
Problem: gh not authenticated
gh auth status
# If not authenticated:
gh auth login
Problem: Insufficient permissions
- Check token scopes (repo, workflow, etc.)
- Regenerate token with required scopes
- Re-authenticate: gh auth login
Repository Issues
Problem: Can't find repository
- Check repository name/owner
- Verify access permissions
- Use full name: owner/repo
Problem: Topics not updating
- Check topic format (lowercase, hyphens)
- Verify max 20 topics limit
- Check repository permissions
PR/Issue Issues
Problem: Can't create PR
- Ensure branch is pushed to remote
- Check base and head branches exist
- Verify no existing PR for branch
Problem: CI checks failing
- View logs: gh pr checks
- Check GitHub Actions tab
- Fix issues and push new commits
Security Considerations
Token Management
- ✅ Use
gh authinstead of tokens when possible - ✅ Store tokens in environment variables
- ✅ Use minimum required scopes
- ✅ Rotate tokens regularly
- ❌ Never commit tokens to repository
Repository Secrets
- ✅ Use for sensitive data in Actions
- ✅ Never expose in logs
- ✅ Rotate regularly
- ✅ Use environment secrets for sensitive workflows
Permissions
- ✅ Grant minimum required access
- ✅ Use teams for group permissions
- ✅ Review collaborators periodically
- ✅ Enable branch protection for important branches
Advanced Features
Batch Operations
# Add multiple topics at once
gh repo edit --add-topic topic1,topic2,topic3
# Close multiple issues
gh issue list --state open | xargs -I {} gh issue close {}
# Bulk label issues
gh issue list --label needs-triage | xargs -I {} gh issue edit {} --add-label triaged
Automation with GitHub Actions
# Example: Auto-update topics on push
name: Update Topics
on:
push:
paths:
- '.github/topics.txt'
jobs:
update-topics:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update Topics
run: |
topics=$(cat .github/topics.txt | tr '\n' ',')
gh repo edit --add-topic $topics
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
API Integration
# Example: Update repository via API
import requests
def update_repo_topics(owner, repo, topics):
url = f"https://api.github.com/repos/{owner}/{repo}/topics"
headers = {
"Authorization": f"token {token}",
"Accept": "application/vnd.github.mercy-preview+json"
}
data = {"names": topics}
response = requests.put(url, headers=headers, json=data)
return response.json()
Reference Materials
For detailed implementation information, see:
- reference/github_cli_guide.md - GitHub CLI commands
- reference/github_api_guide.md - GitHub API usage
- reference/topics_guide.md - Repository topics best practices
- examples/repo_workflows.md - Common workflows
Related Skills
- atlassian-integration: Similar workflow for Jira/Confluence
- web-tools: For scraping GitHub pages
- fstrent-task-management: Sync GitHub issues with local tasks
Note: Ensure you have proper permissions before performing repository operations. Always follow your organization's policies for repository management.