en un clic
github-code
// GitHub code search, file reading, PR review, branch/file management, and commit operations. Use when you need to search code patterns, read repository files, review pull requests, create branches, commit files, or open PRs.
// GitHub code search, file reading, PR review, branch/file management, and commit operations. Use when you need to search code patterns, read repository files, review pull requests, create branches, commit files, or open PRs.
AWS service troubleshooting patterns. Use for EC2, ECS, Lambda, CloudWatch, RDS issues.
Search and read Confluence documentation. Use when looking for internal docs, knowledge base articles, runbooks, or team documentation stored in Confluence.
PostgreSQL database inspection and queries. Use when investigating table schemas, running queries, checking locks, replication status, or long-running queries.
Correlate incidents with recent deployments and code changes. Use when investigating if a deployment caused an issue, finding what changed, or identifying the commit that introduced a bug.
Kubernetes debugging methodology and scripts. Use for pod crashes, CrashLoopBackOff, OOMKilled, deployment issues, resource problems, or container failures.
Jira issue tracking and project management. Use for creating, searching, updating, and commenting on Jira issues. Supports JQL queries for advanced searching.
| name | github-code |
| description | GitHub code search, file reading, PR review, branch/file management, and commit operations. Use when you need to search code patterns, read repository files, review pull requests, create branches, commit files, or open PRs. |
| allowed-tools | Bash(python *) |
Set the GITHUB_TOKEN environment variable with a GitHub personal access token or fine-grained token.
All scripts are in .claude/skills/github-code/scripts/
python .claude/skills/github-code/scripts/search_code.py --query "SEARCH_TERM" [--repo OWNER/REPO]
# Examples:
python .claude/skills/github-code/scripts/search_code.py --query "authentication" --repo acme/webapp
python .claude/skills/github-code/scripts/search_code.py --query "def handle_webhook"
python .claude/skills/github-code/scripts/search_code.py --query "TODO" --repo acme/webapp --limit 50
python .claude/skills/github-code/scripts/read_file.py --repo OWNER/REPO --path FILE_PATH [--ref BRANCH]
# Examples:
python .claude/skills/github-code/scripts/read_file.py --repo acme/webapp --path src/main.py
python .claude/skills/github-code/scripts/read_file.py --repo acme/webapp --path package.json --ref develop
python .claude/skills/github-code/scripts/get_pr_files.py --repo OWNER/REPO --pr NUMBER [--show-patch]
# Examples:
python .claude/skills/github-code/scripts/get_pr_files.py --repo acme/webapp --pr 42
python .claude/skills/github-code/scripts/get_pr_files.py --repo acme/webapp --pr 42 --show-patch
python .claude/skills/github-code/scripts/get_review_context.py --repo OWNER/REPO --pr NUMBER [--bot-marker "Review"]
# Shows prior reviews, inline comments, and whether new commits exist since last review.
# Use before creating a review to avoid duplicating feedback.
python .claude/skills/github-code/scripts/create_review.py --repo OWNER/REPO --pr NUMBER --body "Summary" --comments-file /tmp/comments.json
python .claude/skills/github-code/scripts/create_review.py --repo OWNER/REPO --pr NUMBER --body "LGTM" --event APPROVE
# --comments-file is a JSON array: [{"path": "src/app.py", "line": 42, "body": "Fix this"}]
# --event: COMMENT (default), APPROVE, REQUEST_CHANGES
python .claude/skills/github-code/scripts/create_branch.py --repo OWNER/REPO --branch BRANCH_NAME
python .claude/skills/github-code/scripts/create_branch.py --repo OWNER/REPO --branch BRANCH_NAME --from-branch develop
python .claude/skills/github-code/scripts/create_or_update_file.py --repo OWNER/REPO --path FILE_PATH --branch BRANCH --message "commit msg" --file /tmp/content.txt
echo "content" | python .claude/skills/github-code/scripts/create_or_update_file.py --repo OWNER/REPO --path FILE_PATH --branch BRANCH --message "commit msg"
# For updates, pass --sha with the current file SHA (get it from read_file_with_sha in github_client)
python .claude/skills/github-code/scripts/create_pull_request.py --repo OWNER/REPO --title "PR title" --head BRANCH_NAME
python .claude/skills/github-code/scripts/create_pull_request.py --repo OWNER/REPO --title "PR title" --head BRANCH_NAME --base main --body "Description"
python .claude/skills/github-code/scripts/create_pull_request.py --repo OWNER/REPO --title "PR title" --head BRANCH_NAME --body-file /tmp/pr_body.md
python .claude/skills/github-code/scripts/create_commit_status.py --repo OWNER/REPO --sha COMMIT_SHA --state success --description "All checks passed"
python .claude/skills/github-code/scripts/create_commit_status.py --repo OWNER/REPO --sha COMMIT_SHA --state failure --description "Issues found" --context "ci/review"
# --state: error, failure, pending, success
The github_client.py module provides these functions for programmatic use:
| Function | Purpose |
|---|---|
search_code(query, repo, per_page) | Search code across repos |
read_file(owner, repo, path, ref) | Read a file's content |
read_file_with_sha(owner, repo, path, ref) | Read file content + SHA (needed for updates) |
get_pr(owner, repo, pr_number) | Get PR details |
get_pr_files(owner, repo, pr_number) | Get files changed in a PR |
list_reviews(owner, repo, pr_number) | List reviews on a PR |
list_review_comments(owner, repo, pr_number) | List inline review comments |
list_pr_comments(owner, repo, pr_number) | List general PR comments |
compare_commits(owner, repo, base, head) | Diff between commits |
| Function | Purpose |
|---|---|
create_review(owner, repo, pr_number, body, comments, event) | Submit a PR review |
add_pr_comment(owner, repo, pr_number, body) | Add a general PR comment |
create_branch(owner, repo, branch, from_branch) | Create a new branch |
create_or_update_file(owner, repo, path, content, message, branch, sha) | Commit a file |
create_pull_request(owner, repo, title, head, body, base) | Open a PR |
create_commit_status(owner, repo, sha, state, description, context) | Set commit status |
| Function | Purpose |
|---|---|
format_pr_summary(pr) | Format PR details for display |
format_file_changes(files) | Format changed files list |
# Check for prior reviews
python get_review_context.py --repo acme/webapp --pr 42
# Get the diff
python get_pr_files.py --repo acme/webapp --pr 42 --show-patch
# Read specific files for full context
python read_file.py --repo acme/webapp --path src/auth/handler.py --ref feature-branch
# Submit review with inline comments
python create_review.py --repo acme/webapp --pr 42 --body "Review summary" --comments-file /tmp/comments.json
# Create a branch
python create_branch.py --repo acme/webapp --branch fix/auth-bug
# Commit the fix
python create_or_update_file.py --repo acme/webapp --path src/auth.py --branch fix/auth-bug --message "Fix auth token validation" --file /tmp/auth.py
# Open a PR
python create_pull_request.py --repo acme/webapp --title "Fix auth token validation" --head fix/auth-bug --body "Fixes #123"
# Search for how authentication is implemented
python search_code.py --query "authenticate" --repo acme/webapp
# Read the file for context
python read_file.py --repo acme/webapp --path src/auth/handler.py
| Qualifier | Example | Purpose |
|---|---|---|
repo: | repo:acme/webapp | Limit to repo |
path: | path:src/ | Filter by path |
extension: | extension:py | Filter by file type |
language: | language:python | Filter by language |
filename: | filename:config | Filter by filename |
Combine qualifiers: "def handle" language:python repo:acme/webapp