Token导航 LogoToken导航TokenDH.com
前端设计敏感数据github未标认证来源可访问许可证需确认审计提醒

invoking-githubinvoking GitHub 前端

Agent Skill

用于围绕 GitHub 仓库、Issue、Pull Request、分支、提交和代码协作流程提供辅助能力。它适合让 Agent 查询项目状态、整理变更、辅助创建或检查协作事项,并把仓库中的信息转成可执行的下一步。使用时需要区分只读查询和写入操作;涉及创建 PR、修改 Issue、推送分支或访问私有仓库时,应确认 token 权限、目标仓库范围和用户授权。

总安装

682

周安装

29

GitHub Stars

119

下载量

239
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:invoking-github(invoking GitHub 前端)
来源仓库:https://github.com/oaustegard/claude-skills
仓库路径:skills/invoking-github
安装命令:
npx skills add https://github.com/oaustegard/claude-skills --skill invoking-github
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/oaustegard/claude-skills --skill invoking-github

简介

用于围绕 GitHub 仓库、Issue、Pull Request 和代码协作流程提供辅助能力。

  • 适合查询项目状态、整理变更、创建或检查协作事项,并将信息转为可执行步骤。
  • 使用时需区分只读查询与写入操作;涉及修改时需确认 token 权限和仓库范围。
  • 安装命令:npx skills add https://github.com/oaustegard/claude-skills --skill invoking-github。
  • 注意维护状态及是否会触发联网、文件读写或命令执行。

SKILL.md

Invoking GitHub

Programmatically interact with GitHub repositories from Claude.ai chat: read files, commit changes, create PRs, and persist state across sessions.

When to Use This Skill

Primary use cases:

  • Commit code/documentation from Claude.ai chat (mobile/web)
  • Auto-persist DEVLOG.md for iterating skill
  • Manage state across sessions via GitHub branches
  • Read and update repository files programmatically
  • Create pull requests from chat interface

Trigger patterns:

  • "Commit this to the repository"
  • "Update the README on GitHub"
  • "Save this to a feature branch"
  • "Create a PR with these changes"
  • "Persist DEVLOG to GitHub"
  • "Read the config file from my repo"

Not needed for:

  • Claude Code environments (use native git commands)
  • Read-only repository access (use GitHub UI or API directly)

Quick Start

Prerequisites

Create a GitHub Personal Access Token and add to Project Knowledge:

  1. Go to https://github.com/settings/tokens
  2. Create new token (classic or fine-grained)
  3. Required scopes: repo (or public_repo for public repos only)
  4. In Claude.ai, add to Project Knowledge:

- Title: GITHUB_API_KEY - Content: Your token (e.g., ghp_abc123...)

Single File Commit

from invoking_github import commit_file

result = commit_file(
    repo="username/repo-name",
    path="README.md",
    content="# Updated README\n\nNew content here...",
    branch="main",
    message="Update README with new instructions"
)

print(f"Committed: {result['commit_sha']}")

Read File

from invoking_github import read_file

content = read_file(
    repo="username/repo-name",
    path="config.json",
    branch="main"
)

print(content)

Batch Commit (Multiple Files)

from invoking_github import commit_files

files = [
    {"path": "src/main.py", "content": "# Python code..."},
    {"path": "README.md", "content": "# Updated docs..."},
    {"path": "tests/test.py", "content": "# Tests..."}
]

result = commit_files(
    repo="username/repo-name",
    files=files,
    branch="feature-branch",
    message="Add new feature implementation",
    create_branch_from="main"  # Create branch if it doesn't exist
)

print(f"Committed {len(files)} files: {result['commit_sha']}")

Create Pull Request

from invoking_github import create_pull_request

pr = create_pull_request(
    repo="username/repo-name",
    head="feature-branch",
    base="main",
    title="Add new feature",
    body="## Changes\n- Implemented feature X\n- Updated docs\n- Added tests"
)

print(f"PR created: {pr['html_url']}")

Core Functions

read_file()

Read a file from repository:

read_file(
    repo: str,           # "owner/name"
    path: str,           # "path/to/file.py"
    branch: str = "main" # Branch name
) -> str

Returns: File content as string Raises: GitHubAPIError if file not found or access denied

commit_file()

Commit a single file (create or update):

commit_file(
    repo: str,                      # "owner/name"
    path: str,                      # "path/to/file.py"
    content: str,                   # New file content
    branch: str,                    # Target branch
    message: str,                   # Commit message
    create_branch_from: str = None  # Create branch from this if doesn't exist
) -> dict

Returns: Dict with commit_sha, branch, file_path Raises: GitHubAPIError on conflicts or auth failures

commit_files()

Commit multiple files in a single commit:

commit_files(
    repo: str,                      # "owner/name"
    files: list[dict],              # [{"path": "...", "content": "..."}]
    branch: str,                    # Target branch
    message: str,                   # Commit message
    create_branch_from: str = None  # Create branch from this if doesn't exist
) -> dict

Returns: Dict with commit_sha, branch, files_committed Raises: GitHubAPIError on failures

Note: Uses Git Trees API for efficiency - atomic commit of all files.

create_pull_request()

Create a pull request:

create_pull_request(
    repo: str,      # "owner/name"
    head: str,      # Source branch (your changes)
    base: str,      # Target branch (where to merge)
    title: str,     # PR title
    body: str = ""  # PR description (supports markdown)
) -> dict

Returns: Dict with number, html_url, state Raises: GitHubAPIError if branches invalid or PR exists

Credential Configuration

This skill requires a GitHub Personal Access Token. Two configuration methods:

Method 1: Project Knowledge (Recommended)

Best for Claude.ai chat users (mobile/web):

  1. Create token at https://github.com/settings/tokens
  2. In Claude.ai Project settings → Add to Project Knowledge
  3. Create document titled GITHUB_API_KEY
  4. Paste your token as content

Permissions required:

  • Classic token: repo scope
  • Fine-grained token: Repository permissions → Contents (read/write) and Pull requests (read/write)

Method 2: API Credentials Skill (Fallback)

Alternatively, use combined credentials file:

  1. Create API_CREDENTIALS.json in project knowledge
  2. Add: {"github_api_key": "ghp_your-token-here"}

Integration with Iterating Skill

Auto-persist DEVLOG.md to GitHub for cross-session continuity:

# In your DEVLOG update function
from invoking_github import commit_file
from pathlib import Path

def update_devlog_with_sync(data, repo="user/project", branch="devlog"):
    """Update DEVLOG.md locally and sync to GitHub"""

    # Update local DEVLOG
    update_devlog(data)  # Your existing function

    # Auto-sync to GitHub
    try:
        devlog_content = Path("DEVLOG.md").read_text()

        result = commit_file(
            repo=repo,
            path="DEVLOG.md",
            content=devlog_content,
            branch=branch,
            message=f"DEVLOG: {data['title']}",
            create_branch_from="main"
        )

        print(f"✓ DEVLOG synced to GitHub ({repo}:{branch})")
        return result

    except Exception as e:
        print(f"⚠ DEVLOG sync failed: {e}")
        # Continue anyway - local DEVLOG.md still updated
        return None

Benefits:

  • Automatic backup of session progress
  • Cross-device access to development logs
  • Git history of decisions and progress
  • No manual copy/paste to Project Knowledge

See references/iterating-integration.md for complete patterns.

Error Handling

All functions raise GitHubAPIError with descriptive messages:

from invoking_github import commit_file, GitHubAPIError

try:
    result = commit_file(
        repo="user/repo",
        path="file.py",
        content="...",
        branch="main",
        message="Update"
    )
except GitHubAPIError as e:
    if e.status_code == 404:
        print("Repository or branch not found")
    elif e.status_code == 401:
        print("Authentication failed - check your token")
    elif e.status_code == 403:
        print("Access denied - check token permissions")
    elif e.status_code == 409:
        print("Conflict - file was modified since last read")
    else:
        print(f"GitHub API error: {e}")

Common errors:

  • 404: Repository, branch, or file not found
  • 401/403: Invalid token or insufficient permissions
  • 409: Merge conflict (file changed concurrently)
  • 422: Validation error (invalid branch name, etc.)
  • Rate limit: Too many requests (wait before retrying)

Best Practices

  1. Use descriptive commit messages

- Bad: "Update files" - Good: "Add authentication middleware and update user routes"

  1. Batch commits when possible

- Use commit_files() for related changes - Single atomic commit = cleaner git history

  1. Create feature branches

- Don't commit directly to main - Use create_branch_from="main" parameter - Create PR for review

  1. Handle errors gracefully

- Always wrap in try-except - Provide fallback behavior - Don't fail silently

  1. Secure token management

- Use fine-grained tokens with minimal scopes - Set expiration dates - Rotate regularly - Never commit tokens to repositories

Advanced Usage

Conditional Commits

Only commit if file content changed:

from invoking_github import read_file, commit_file, GitHubAPIError

try:
    current_content = read_file(repo, path, branch)
    if current_content != new_content:
        commit_file(repo, path, new_content, branch, "Update file")
    else:
        print("No changes detected, skipping commit")
except GitHubAPIError as e:
    if e.status_code == 404:
        # File doesn't exist, create it
        commit_file(repo, path, new_content, branch, "Create file")
    else:
        raise

Session-Specific Branches

Avoid conflicts with unique branch names:

import datetime

session_id = datetime.datetime.now().strftime("%Y%m%d-%H%M%S")
branch_name = f"devlog-{session_id}"

commit_file(
    repo="user/project",
    path="DEVLOG.md",
    content=devlog_content,
    branch=branch_name,
    message="Session progress",
    create_branch_from="main"
)

Multi-Repository Workflows

Work across multiple repos:

repos = ["user/frontend", "user/backend", "user/docs"]

for repo in repos:
    commit_file(
        repo=repo,
        path="VERSION",
        content="2.0.0\n",
        branch="release-2.0",
        message="Bump version to 2.0.0"
    )

Limitations

  • Target environment: Claude.ai chat only (not Claude Code)
  • No OAuth: Must use Personal Access Tokens manually
  • No git operations: Pure REST API (no clone, pull, rebase, etc.)
  • File size: GitHub API limits ~100MB per file
  • Rate limits: 5000 requests/hour for authenticated users
  • Network required: All operations require internet access

See Also

Token Efficiency

This skill uses ~800 tokens when loaded but provides essential GitHub operations for claude.ai chat environments where native git access isn't available. Enables persistent state management and cross-session workflows.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

37.39%
按下载量换算89

Claude

31.86%
按下载量换算76

Cursor

19.38%
按下载量换算46

Gemini CLI

8.94%
按下载量换算21

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills