Manage GitHub repositories - create, fork, branch, and file operations using gh CLI
Uses GitHub CLI to create repositories, fork projects, manage branches, and manipulate files. Triggered when you need to set up new repos, copy existing ones, or modify repository contents.
/plugin marketplace add Nice-Wolf-Studio/agent-github-skills/plugin install nice-wolf-studio-github-skills@Nice-Wolf-Studio/agent-github-skillsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
This skill provides comprehensive repository management operations including creating repositories, managing branches, and working with files.
Create a new GitHub repository in your account or organization.
Fork an existing repository to your account or specified organization.
Create a new branch in a repository from an existing branch.
Search for GitHub repositories using GitHub's search syntax.
Retrieve the contents of a file or directory from a repository.
Create a new file or update an existing file in a repository.
Push multiple files to a repository in a single commit.
Public repository:
gh repo create my-awesome-project --public --description "My awesome project" --clone
Private repository:
gh repo create my-private-repo --private --description "Private project" --clone
With README initialization:
gh repo create my-project --public --add-readme
Fork to your personal account:
gh repo fork owner/repo-name --clone
Fork to an organization:
gh repo fork owner/repo-name --org my-org --clone
Fork without cloning:
gh repo fork owner/repo-name
Create from default branch:
gh api repos/owner/repo-name/git/refs -f ref=refs/heads/new-feature -f sha=$(gh api repos/owner/repo-name/git/refs/heads/main --jq '.object.sha')
Using Git directly (if repo is cloned):
cd repo-name
git checkout -b new-feature
git push -u origin new-feature
Search by keyword:
gh search repos "machine learning" --limit 20
Search with filters:
gh search repos "web framework" --language python --stars ">1000" --limit 10
Search in organization:
gh search repos "org:myorg" --limit 50
Search by topic:
gh search repos "topic:docker" --stars ">100"
View file contents:
gh api repos/owner/repo-name/contents/path/to/file.txt --jq '.content' | base64 -d
List directory contents:
gh api repos/owner/repo-name/contents/path/to/directory
Get file from specific branch:
gh api repos/owner/repo-name/contents/README.md?ref=develop --jq '.content' | base64 -d
Create a new file:
echo "file content" | gh api repos/owner/repo-name/contents/path/to/newfile.txt \
-X PUT \
-f message="Add new file" \
-f content=$(echo "file content" | base64) \
-f branch=main
Update an existing file (requires SHA):
# First, get the file SHA
SHA=$(gh api repos/owner/repo-name/contents/path/to/file.txt --jq '.sha')
# Then update
echo "updated content" | gh api repos/owner/repo-name/contents/path/to/file.txt \
-X PUT \
-f message="Update file" \
-f content=$(echo "updated content" | base64) \
-f sha="$SHA" \
-f branch=main
For pushing multiple files, it's recommended to clone the repository and use Git:
# Clone the repository
gh repo clone owner/repo-name
cd repo-name
# Create/modify multiple files
echo "content1" > file1.txt
echo "content2" > file2.txt
mkdir -p src
echo "code" > src/main.py
# Commit and push
git add .
git commit -m "Add multiple files"
git push
Alternative: Using GitHub API for multiple files (requires tree/commit API):
# This is more complex and typically requires a script
# Recommended to use Git directly for multiple files
# Create repository
gh repo create my-project --public --clone
cd my-project
# Add initial files
echo "# My Project" > README.md
echo "print('Hello')" > main.py
# Commit and push
git add .
git commit -m "Initial commit"
git push -u origin main
# Fork the repository
gh repo fork upstream/repo-name --clone
cd repo-name
# Create feature branch
git checkout -b my-feature
# Make changes
echo "new feature" > feature.txt
git add feature.txt
git commit -m "Add new feature"
# Push branch
git push -u origin my-feature
# Create PR (using pull-request-management skill)
gh pr create --title "Add new feature" --body "Description of changes"
# Ensure you're authenticated
gh auth status
# Clone
gh repo clone owner/private-repo
# Check if repo exists first
gh repo view owner/repo-name 2>/dev/null && echo "Exists" || echo "Does not exist"
# Verify authentication and permissions
gh auth status
# Try refreshing credentials
gh auth refresh
# Verify the file path exists
gh api repos/owner/repo-name/contents/path/to/file.txt 2>&1 | grep -q "Not Found" && echo "File does not exist"
owner/repo-name not just repo-namegh auth status before operationsissue-management - Create and manage issuespull-request-management - Work with pull requestscommit-operations - View commit historyCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.