本文へ移動
cccskills
無料GitHub で公開

gh

Install and configure the GitHub CLI (gh) for AI agent environments where gh may not be pre-installed and git remotes use local proxies instead of github.com. Use when gh command not found, shutil.which returns None, need GitHub API access for issues or PRs or releases or workflow runs, or repository operations fail with 'failed to determine base repo' error. Provides auto-install script with SHA256 verification, GITHUB_TOKEN auth with anonymous fallback, and the required -R flag pattern for proxy environments. Covers project management via GitHub Projects V2, milestones via REST API, issue lifecycle templates, and label taxonomy management.

インストール方法を見る

含まれるファイル(14)

  • SKILL.md4.9 KB
  • gh-examples.md.template3.1 KB
  • references/issue-stories.md5.4 KB
  • references/labels.md5.0 KB
  • references/milestones.md4.1 KB
  • references/projects-v2.md4.4 KB
  • scripts/experiment_cleanup.py6.1 KB
  • scripts/github_project_setup.py34.2 KB
  • scripts/setup_gh.py40.9 KB
  • scripts/test_setup_gh.py2.7 KB
  • SKILL-GOALS.md1.2 KB
  • tests/__init__.py0 B
  • tests/test_github_project_setup.py34.1 KB
  • tests/test_setup_gh.py16.3 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

GitHub CLI (gh) — Setup and Usage

Purpose

Ensures the GitHub CLI (gh) is available and provides correct usage patterns for AI agents operating in environments where gh may not be pre-installed and where git remotes point to local proxies instead of github.com.

When to Use

  • gh command not found or shutil.which("gh") returns None
  • Need to interact with GitHub API (issues, PRs, releases, workflows)
  • Repository remote does not point to github.com (proxy environments)
  • Need authenticated GitHub operations with GITHUB_TOKEN
  • Managing GitHub Issues, Projects V2, Milestones, or Labels

Installation

If gh is not installed, run the setup script:

uv run .claude/skills/gh/scripts/setup_gh.py

The script:

  1. Checks if gh is already installed via shutil.which
  2. Detects platform (Linux, macOS, Windows) and architecture
  3. Fetches the latest release from https://github.com/cli/cli/releases/latest
  4. Downloads the correct archive with SHA256 verification from checksums file
  5. Extracts and installs the binary to a writable PATH directory
  6. Uses GITHUB_TOKEN for authenticated requests; falls back to anonymous if auth fails (401/403)

CLI options:

--force          Reinstall even if already at latest version
--dry-run        Show what would happen without installing
--bin-dir        Override install directory (default: auto-detect from PATH)
--detect-only    Detect owner/repo, refresh .dh/config.yaml and gh-examples.md, print examples to stdout. No network calls.

Authentication

GITHUB_TOKEN environment variable provides automatic authentication. No manual gh auth login needed.

# Verify authentication
gh auth status

If GITHUB_TOKEN is set, gh authenticates automatically for all API calls.


Repository Detection

<repo_detection>

Git remote points to a local proxy (127.0.0.1), NOT github.com. Every gh command fails without explicit repo specification:

failed to determine base repo: none of the git remotes configured for this
repository point to a known GitHub host.

RULE: Pass -R (or --repo) on EVERY gh command:

gh <command> -R <owner/repo>

This applies to ALL gh subcommands: pr, issue, run, api, release, project, etc.

</repo_detection>


Common Commands

!uv run --script .claude/skills/gh/scripts/setup_gh.py --detect-only 2>/dev/null


Automation — Python Script

For multi-step operations (label setup, milestone creation, project init, issue import), use:

# Full project setup
uv run .claude/skills/gh/scripts/github_project_setup.py setup

# Labels only
uv run .claude/skills/gh/scripts/github_project_setup.py labels

# Milestone management
uv run .claude/skills/gh/scripts/github_project_setup.py milestone list
uv run .claude/skills/gh/scripts/github_project_setup.py milestone create --title "v1.0" --due 2026-03-31

# Issue management
uv run .claude/skills/gh/scripts/github_project_setup.py issue list --priority p1
uv run .claude/skills/gh/scripts/github_project_setup.py issue create --title "feat: X" --priority-label priority:p1

The script delegates all GitHub operations to the authenticated gh CLI — no separate API tokens or Python HTTP clients needed.


Reference Files

  • labels.md — Label taxonomy (priority, type, status), color codes, bulk setup
  • milestones.md — Milestone CRUD via REST API, naming conventions
  • projects-v2.md — GitHub Projects V2 commands, custom fields, GraphQL queries
  • issue-stories.md — Issue as story format, body template, lifecycle, backlog item field mapping

Sources

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Add automated documentation updater to any Claude skill. Creates a Python sync script that downloads upstream docs, processes markdown for AI consumption, and maintains local cache with configurable refresh. Collects template variables, then delegates implementation through 5-phase workflow. Use when adding auto-updating reference documentation to plugins or skills.

日本語の概要は準備中です。原文の説明を表示しています。

Jamie-BitFlight/claude_skills672026年10月12日 更新

SAM-style feature initiation workflow — discovery through codebase analysis, architecture spec, task decomposition, validation, and context manifest. Use when a user asks to add a feature, plan a feature, or convert an idea into an executable SAM plan.

日本語の概要は準備中です。原文の説明を表示しています。

Jamie-BitFlight/claude_skills672026年10月12日 更新

Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.

日本語の概要は準備中です。原文の説明を表示しています。

Jamie-BitFlight/claude_skills672026年10月12日 更新

Browser automation for AI agents using the agent-browser CLI and Playwright. Use when navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, logging into sites, or automating any browser task. Triggers on "open a website", "fill out a form", "click a button", "scrape data", "test this web app", "automate browser actions", or any programmatic web interaction request.

日本語の概要は準備中です。原文の説明を表示しています。

Jamie-BitFlight/claude_skills672026年10月12日 更新

Runs the description-drift experiment — spawns all Claude Code agents simultaneously to collect self-reported capabilities, then compares them against static frontmatter descriptions to reveal how reliable orchestrator routing based on descriptions actually is. Use when measuring description drift across the agent fleet, re-running the capability collection experiment, analyzing a specific agent's self-reported capabilities, or auditing whether frontmatter descriptions accurately reflect agent behavior.

日本語の概要は準備中です。原文の説明を表示しています。

Jamie-BitFlight/claude_skills672026年10月12日 更新

Create or adapt Claude Code agent definitions. Use when creating an agent, changing subagent configuration, selecting agent scope, or designing a specialized delegation role.

日本語の概要は準備中です。原文の説明を表示しています。

Jamie-BitFlight/claude_skills672026年10月12日 更新

Jamie-BitFlight のスキルをすべて見る

このスキルの問題を報告する