mcpField
G
github-issues

github-issues

github.com/nousresearch開発260.2k307 回インストール今日更新
リポジトリ

github-issues について

github-issuesは、GitHub Issueを管理するためのスキルです。リポジトリのメンテナーやトリアージ担当者向けに、ghまたはcurlによる閲覧、検索、作成、ラベル付け、一括操作を扱います。

主な機能

  1. 01Issueの一覧表示、閲覧、検索
  2. 02報告内容を含むIssueの作成
  3. 03ラベルの追加・削除と担当者の割り当て
  4. 04Issueへのコメント、クローズ、再オープン
  5. 05ラベルによるIssueの一括処理

活用シーン

  1. 01未トリアージまたは指定ラベルのIssueを探す
  2. 02形式に沿ったバグや機能要望を登録する
  3. 03Issueの担当者を割り当て、トリアージ記録を残す
  4. 04対応予定なしのIssueをまとめてクローズする

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/nousresearch/hermes-agent --skill github-issues

インストール後、Claude Code で/github-issuesを入力して読み込まれたか確認します。

同梱ファイルtemplates/bug-report.mdtemplates/feature-request.md

詳細

GitHub Issues の管理

GitHub Issues の作成、検索、トリアージ、管理を行います。各セクションでは、まず gh を示し、次に curl の代替方法を示します。

前提条件

  • GitHub に認証済みであること(github-auth スキルを参照)
  • GitHub のリモートが設定された git リポジトリ内にいること、またはリポジトリを明示的に指定すること
セットアップ
if command -v gh &>/dev/null && gh auth status &>/dev/null; then
  AUTH="gh"
else
  AUTH="git"
  if [ -z "$GITHUB_TOKEN" ]; then
    if _hermes_env="${HERMES_HOME:-$HOME/.hermes}/.env"; [ -f "$_hermes_env" ] && grep -q "^GITHUB_TOKEN=" "$_hermes_env"; then
      GITHUB_TOKEN=$(grep "^GITHUB_TOKEN=" "$_hermes_env" | head -1 | cut -d= -f2 | tr -d '\n\r')
    elif grep -q "github.com" ~/.git-credentials 2>/dev/null; then
      GITHUB_TOKEN=$(uv run python "${HERMES_HOME:-$HOME/.hermes}/skills/github/github-auth/scripts/git-credential-token.py")
    fi
  fi
fi

REMOTE_URL=$(git remote get-url origin)
OWNER_REPO=$(echo "$REMOTE_URL" | sed -E 's|.*github\.com[:/]||; s|\.git$||')
OWNER=$(echo "$OWNER_REPO" | cut -d/ -f1)
REPO=$(echo "$OWNER_REPO" | cut -d/ -f2)

1. Issues の表示

gh を使用する場合:

gh issue list
gh issue list --state open --label "bug"
gh issue list --assignee @me
gh issue list --search "authentication error" --state all
gh issue view 42

curl を使用する場合:

# List open issues
curl -s \
  -H "Authorization: token $GITHUB_TOKEN" \
  "https://api.github.com/repos/$OWNER/$REPO/issues?state=open&per_page=20" \
  | python -c "
import sys, json
for i in json.load(sys.stdin):
    if 'pull_request' not in i:  # GitHub API returns PRs in /issues too
        labels = ', '.join(l['name'] for l in i['labels'])
        print(f\"#{i['number']:5}  {i['state']:6}  {labels:30}  {i['title']}\")"

# Filter by label
curl -s \
  -H "Authorization: token $GITHUB_TOKEN" \
  "https://api.github.com/repos/$OWNER/$REPO/issues?state=open&labels=bug&per_page=20" \
  | python -c "
import sys, json
for i in json.load(sys.stdin):
    if 'pull_request' not in i:
        print(f\"#{i['number']}  {i['title']}\")"

# View a specific issue
curl -s \
  -H "Authorization: token $GITHUB_TOKEN" \
  https://api.github.com/repos/$OWNER/$REPO/issues/42 \
  | python -c "
import sys, json
i = json.load(sys.stdin)
labels = ', '.join(l['name'] for l in i['labels'])
assignees = ', '.join(a['login'] for a in i['assignees'])
print(f\"#{i['number']}: {i['title']}\")
print(f\"State: {i['state']}  Labels: {labels}  Assignees: {assignees}\")
print(f\"Author: {i['user']['login']}  Created: {i['created_at']}\")
print(f\"\n{i['body']}\")"

# Search issues
curl -s \
  -H "Authorization: token $GITHUB_TOKEN" \
  "https://api.github.com/search/issues?q=authentication+error+repo:$OWNER/$REPO" \
  | python -c "
import sys, json
for i in json.load(sys.stdin)['items']:
    print(f\"#{i['number']}  {i['state']:6}  {i['title']}\")"

2. Issues の作成

gh を使用する場合:

gh issue create \
  --title "Login redirect ignores ?next= parameter" \
  --body "## Description
After logging in, users always land on /dashboard.

## Steps to Reproduce
1. Navigate to /settings while logged out
2. Get redirected to /login?next=/settings
3. Log in
4. Actual: redirected to /dashboard (should go to /settings)

## Expected Behavior
Respect the ?next= query parameter." \
  --label "bug,backend" \
  --assignee "username"

curl を使用する場合:

curl -s -X POST \
  -H "Authorization: token $GITHUB_TOKEN" \
  https://api.github.com/repos/$OWNER/$REPO/issues \
  -d '{
    "title": "Login redirect ignores ?next= parameter",
    "body": "## Description\nAfter logging in, users always land on /dashboard.\n\n## Steps to Reproduce\n1. Navigate to /settings while logged out\n2. Get redirected to /login?next=/settings\n3. Log in\n4. Actual: redirected to /dashboard\n\n## Expected Behavior\nRespect the ?next= query parameter.",
    "labels": ["bug", "backend"],
    "assignees": ["username"]
  }'
バグ報告テンプレート
## Bug Description
<What's happening>

## Steps to Reproduce
1. <step>
2. <step>

## Expected Behavior
<What should happen>

## Actual Behavior
<What actually happens>

## Environment
- OS: <os>
- Version: <version>
機能リクエストテンプレート
## Feature Description
<What you want>

## Motivation
<Why this would be useful>

## Proposed Solution
<How it could work>

## Alternatives Considered
<Other approaches>

3. Issues の管理

ラベルの追加/削除

gh を使用する場合:

gh issue edit 42 --add-label "priority:high,bug"
gh issue edit 42 --remove-label "needs-triage"

curl を使用する場合:

# Add labels
curl -s -X POST \
  -H "Authorization: token $GITHUB_TOKEN" \
  https://api.github.com/repos/$OWNER/$REPO/issues/42/labels \
  -d '{"labels": ["priority:high", "bug"]}'

# Remove a label
curl -s -X DELETE \
  -H "Authorization: token $GITHUB_TOKEN" \
  https://api.github.com/repos/$OWNER/$REPO/issues/42/labels/needs-triage

# List available labels in the repo
curl -s \
  -H "Authorization: token $GITHUB_TOKEN" \
  https://api.github.com/repos/$OWNER/$REPO/labels \
  | python -c "
import sys, json
for l in json.load(sys.stdin):
    print(f\"  {l['name']:30}  {l.get('description', '')}\")"
担当者の割り当て

gh を使用する場合:

gh issue edit 42 --add-assignee username
gh issue edit 42 --add-assignee @me

curl を使用する場合:

curl -s -X POST \
  -H "Authorization: token $GITHUB_TOKEN" \
  https://api.github.com/repos/$OWNER/$REPO/issues/42/assignees \
  -d '{"assignees": ["username"]}'
コメントの追加

gh を使用する場合:

gh issue comment 42 --body "Investigated — root cause is in auth middleware. Working on a fix."

curl を使用する場合:

curl -s -X POST \
  -H "Authorization: token $GITHUB_TOKEN" \
  https://api.github.com/repos/$OWNER/$REPO/issues/42/comments \
  -d '{"body": "Investigated — root cause is in auth middleware. Working on a fix."}'
クローズと再オープン

gh を使用する場合:

gh issue close 42
gh issue close 42 --reason "not planned"
gh issue reopen 42

curl を使用する場合:

# Close
curl -s -X PATCH \
  -H "Authorization: token $GITHUB_TOKEN" \
  https://api.github.com/repos/$OWNER/$REPO/issues/42 \
  -d '{"state": "closed", "state_reason": "completed"}'

# Reopen
curl -s -X PATCH \
  -H "Authorization: token $GITHUB_TOKEN" \
  https://api.github.com/repos/$OWNER/$REPO/issues/42 \
  -d '{"state": "open"}'
Issues と PR のリンク

PR の本文に適切なキーワードが含まれている状態でマージされると、Issue は自動的にクローズされます。

Closes #42
Fixes #42
Resolves #42

Issue からブランチを作成するには:

gh を使用する場合:

gh issue develop 42 --checkout

git を使用する場合(手動での同等の操作):

git checkout main && git pull origin main
git checkout -b fix/issue-42-login-redirect

4. Issue のトリアージワークフロー

Issue のトリアージを依頼された場合:

  1. 未トリアージの Issue を一覧表示します:
# With gh
gh issue list --label "needs-triage" --state open

# With curl
curl -s \
  -H "Authorization: token $GITHUB_TOKEN" \
  "https://api.github.com/repos/$OWNER/$REPO/issues?labels=needs-triage&state=open" \
  | python -c "
import sys, json
for i in json.load(sys.stdin):
    if 'pull_request' not in i:
        print(f\"#{i['number']}  {i['title']}\")"
  1. 各 Issue を読み、分類します(詳細を表示し、バグ/機能を把握します)

  2. ラベルと優先度を設定します(上記の「Issues の管理」を参照)

  3. 担当者が明確な場合は割り当てます

  4. 必要に応じて、トリアージメモをコメントします

5. 一括操作

一括操作では、API 呼び出しとシェルスクリプトを組み合わせます。

gh を使用する場合:

# Close all issues with a specific label
gh issue list --label "wontfix" --json number --jq '.[].number' | \
  xargs -I {} gh issue close {} --reason "not planned"

curl を使用する場合:

# List issue numbers with a label, then close each
curl -s \
  -H "Authorization: token $GITHUB_TOKEN" \
  "https://api.github.com/repos/$OWNER/$REPO/issues?labels=wontfix&state=open" \
  | python -c "import sys,json; [print(i['number']) for i in json.load(sys.stdin)]" \
  | while read num; do
    curl -s -X PATCH \
      -H "Authorization: token $GITHUB_TOKEN" \
      https://api.github.com/repos/$OWNER/$REPO/issues/$num \
      -d '{"state": "closed", "state_reason": "not_planned"}'
    echo "Closed #$num"
  done

クイックリファレンステーブル

操作ghcurl エンドポイント
Issues の一覧表示gh issue listGET /repos/{o}/{r}/issues
Issue の表示gh issue view NGET /repos/{o}/{r}/issues/N
Issue の作成gh issue create ...POST /repos/{o}/{r}/issues
ラベルの追加gh issue edit N --add-label ...POST /repos/{o}/{r}/issues/N/labels
担当者の割り当てgh issue edit N --add-assignee ...POST /repos/{o}/{r}/issues/N/assignees
コメントの追加gh issue comment N --body ...POST /repos/{o}/{r}/issues/N/comments
クローズgh issue close NPATCH /repos/{o}/{r}/issues/N
検索gh issue list --search "..."GET /search/issues?q=...

コメント