Communitygithub.com

GitHub-CLI (gh)

Integration des GitHub CLI (gh) für die Verwaltung von Issues, Pull Requests, Branches, Commits und Code-Reviews direkt aus dem Terminal.

Was ist GitHub-CLI (gh)?

Dieser Skill integriert das GitHub CLI (`gh`) in KI-Agenten wie Claude, Cursor oder Codex und ermöglicht die direkte Interaktion mit GitHub-Repositories aus der Kommandozeile. Er deckt alle wesentlichen Arbeitsabläufe ab: Issue-Management (Erstellen, Anzeigen, Bearbeiten, Kommentieren), Branch- und Commit-Workflows, Pull-Request-Erstellung und -Verwaltung, formelle Code-Reviews (Genehmigen, Änderungen anfordern, Kommentieren) sowie das Management von GitHub Actions Workflows (Start, Logs, Wiederholungen). Der Skill ist besonders nützlich, um schnelle Änderungen vorzunehmen, ohne den Browser öffnen zu müssen, und unterstützt gleichzeitig die Automatisierung wiederkehrender Aufgaben. Voraussetzung ist eine installierte und authentifizierte `gh` CLI.

Funktioniert mit✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/cdcoonce/Portfolio_Website/tree/HEAD/.claude/skills/github-cli

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

GitHub CLI (gh) Skill

Verwenden Sie die gh CLI, um mit GitHub-Repositories, Issues, Pull Requests und GitHub Actions Workflows vom Terminal aus zu interagieren.

Voraussetzungen

Überprüfen Sie, ob gh installiert und authentifiziert ist:

gh --version
gh auth status

Wenn nicht authentifiziert, führen Sie gh auth login aus und folgen Sie den Anweisungen.

Kern-Workflows

Issue-Verwaltung

# Issues auflisten
gh issue list                             # Offene Issues im aktuellen Repo
gh issue list --state all                 # Alle Issues (inkl. geschlossene)
gh issue list --assignee @me              # Ihnen zugewiesene Issues
gh issue list --label "bug"               # Nach Label filtern

# Issue erstellen
gh issue create -t "Titel" -b "Beschreibung"
gh issue create -t "Titel" --label "bug,priority:high" --milestone "milestone-1"
gh issue create                           # Interaktiver Modus

# Issue anzeigen/aktualisieren
gh issue view 123                         # Issue-Details anzeigen
gh issue view 123 --web                   # Im Browser öffnen
gh issue edit 123 --add-label "in-progress"
gh issue close 123
gh issue reopen 123

# Kommentare hinzufügen
gh issue comment 123 -b "Ich arbeite jetzt daran"

Branch- und Commit-Workflow

# Feature/Fix-Branch erstellen
git checkout -b feature/mein-feature
git checkout -b fix/issue-123
git checkout -b draft/wip-experiment

# Änderungen bereitstellen und committen
git add .
git commit -m "feat: neues Feature hinzufügen"
git commit -m "fix: Problem #123 behoben"

# Branch auf Remote pushen
git push -u origin feature/mein-feature

Pull-Request-Verwaltung

# PR erstellen (mehrere Methoden)
gh pr create                              # Interaktiver Modus
gh pr create --fill                       # Automatisch aus Commits befüllen
gh pr create --draft                      # Als Entwurf erstellen
gh pr create --draft --fill               # Entwurf mit automatischer Befüllung
gh pr create -t "Titel" -b "Beschreibung" -B main
gh pr create --label "review-needed" --assignee @me

# PRs auflisten
gh pr list                                # Offene PRs
gh pr list --assignee @me                 # Ihre PRs
gh pr list --search "review-requested:@me"  # PRs mit Review-Anfrage an Sie
gh pr list --draft                        # Nur Entwurfs-PRs

# PR-Details anzeigen
gh pr view 45                             # PR im Terminal anzeigen
gh pr view 45 --web                       # Im Browser öffnen

Code-Review-Workflow

# PR lokal zum Testen auschecken
gh pr checkout 45                         # PR-Branch lokal auschecken

# Änderungen überprüfen
gh pr diff 45                             # PR-Diff anzeigen
gh pr diff                                # Diff für den aktuellen Branch-PR

# Review-Kommentare hinzufügen
gh pr comment 45 -b "LGTM, kleiner Vorschlag in Zeile 42"
gh pr comment -b "Bitte Tests hinzufügen"  # Kommentar zum aktuellen Branch-PR

# Formelles Review einreichen
gh pr review 45 --approve
gh pr review 45 --request-changes -b "Bitte beheben Sie die Fehlerbehandlung"
gh pr review 45 --comment -b "Sieht insgesamt gut aus, ein paar Vorschläge"

# Merge
gh pr merge 45                            # Interaktiver Merge
gh pr merge 45 --squash                   # Squash-Merge
gh pr merge 45 --rebase                   # Rebase-Merge
gh pr merge 45 --merge                    # Standard-Merge-Commit
gh pr merge 45 --auto                     # Auto-Merge, wenn Checks bestanden

Vorhandenen PR aktualisieren

gh pr edit 45 --title "Neuer Titel"
gh pr edit 45 --body "Aktualisierte Beschreibung"
gh pr edit 45 --base develop
gh pr edit 45 --add-label "ready-for-review"
gh pr ready 45                            # Als bereit markieren (Entwurf entfernen)

GitHub Actions Workflow-Verwaltung

# Workflow-Läufe auflisten
gh run list                               # Aktuelle Workflow-Läufe
gh run list --workflow=ci.yml             # Bestimmter Workflow
gh run list --status=failure              # Nur fehlgeschlagene Läufe

# Workflow-Lauf-Details anzeigen
gh run view                               # Interaktive Laufauswahl
gh run view 12345                         # Bestimmter Lauf
gh run view 12345 --web                   # Im Browser öffnen

# Workflow auslösen
gh workflow run ci.yml                    # Auf Standard-Branch ausführen
gh workflow run ci.yml --ref feature/x    # Auf bestimmtem Branch ausführen
gh workflow run ci.yml -f key=value       # Mit Eingabeparametern

# Fehlgeschlagene Jobs erneut ausführen
gh run rerun 12345                        # Alle Jobs erneut ausführen
gh run rerun 12345 --failed               # Nur fehlgeschlagene Jobs erneut ausführen

# Job-Logs anzeigen
gh run view 12345 --log                   # Vollständige Log-Ausgabe
gh run view 12345 --log-failed            # Nur Logs fehlgeschlagener Jobs

# Lauf in Echtzeit verfolgen
gh run watch                              # Aktuellen Lauf verfolgen
gh run watch 12345                        # Bestimmten Lauf verfolgen

Allgemeine Flag-Referenz

FlagBeschreibung
-R, --repo OWNER/REPOZiel-Repository ändern
-B, --baseBasis-Branch für den PR
-H, --headKopf-Branch für den PR
-t, --titleTitel für Issue/PR
-b, --bodyBeschreibung für Issue/PR
-l, --labelLabels (kommasepariert)
-a, --assigneeZugewiesener Benutzer
-m, --milestoneMeilenstein-Name
--draftAls Entwurfs-PR erstellen
--fillAutomatisch aus Commit-Nachrichten befüllen
--webIm Browser öffnen
-y, --yesBestätigungsaufforderungen überspringen

Umgebungsvariablen

export GH_TOKEN="ghp_xxxx"               # Personal Access Token
export GH_HOST="github.example.com"      # GitHub Enterprise-Instanz
export GH_REPO="owner/repo"              # Standard-Repository

Tipps und Fallstricke

Mehrzeilige Beschreibungen mit Markdown

Wenn Sie Issues oder PRs mit langen Beschreibungen erstellen, die Markdown enthalten (Codeblöcke, Backticks), vermeiden Sie Heredocs, die aufgrund der Shell-Interpretation fehlschlagen können. Stattdessen:

# Schritt 1: Beschreibung in eine temporäre Datei schreiben (außerhalb von bash)
# Schritt 2: Aus der temporären Datei erstellen
gh issue create -t "Titel" -b "$(cat temp_description.txt)"
# Schritt 3: Aufräumen
rm temp_description.txt

Dies vermeidet Probleme mit:

  • Backticks in Codeblöcken, die mit der Befehlsersetzung kollidieren
  • Sonderzeichen, die von der Shell interpretiert werden
  • Heredoc-Delimiter-Konflikten

Beschreibung aus vorhandenen Dateien einlesen

Um ein Issue oder einen PR aus einer Markdown-Plan-Datei zu erstellen:

# Verwenden Sie den body-file-Flag für saubere dateibasierte Beschreibungen
gh issue create -t "Titel" --body-file docs/plans/mein-plan.md
gh pr create -t "Titel" --body-file docs/plans/mein-plan.md

Detaillierte Referenz

Eine umfassende Übersicht über Befehlsoptionen und Beispiele finden Sie unter references/commands.md.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

cdcoonce/Portfolio_Website

Git commit workflow with enforced conventional commit style. Use when Claude needs to stage and commit changes, craft commit messages, or the user asks to commit, make a commit, or save their work. Ensures consistent commit message format, proper scoping, and atomic commits across the project.

cdcoonce/Portfolio_Website

AI-powered code quality analysis for Python, Markdown, and Mermaid diagrams. Use this skill when: (1) reviewing code for quality issues, (2) checking Python files for PEP8 violations, unused code, missing type hints, docstring problems, complexity issues, or potential runtime errors, (3) validating Markdown documentation for broken links, heading structure, or formatting issues, (4) validating Mermaid diagram syntax, (5) the user asks for a "code review" or "quality check", (6) analyzing code snippets pasted in conversation, or (7) suggesting and applying fixes for code quality issues.

cdcoonce/Portfolio_Website

Deploy the portfolio chat agent Lambda function to AWS. Use when the user asks to deploy, redeploy, push to Lambda, update the chat agent, or after updating context files or lambda_function.py. Rebuilds the knowledge base, packages dependencies, and deploys to AWS Lambda.

cdcoonce/Portfolio_Website

Generate multiple radically different interface designs for a module using parallel sub-agents. Use when user wants to design an API, explore interface options, compare module shapes, or mentions "design it twice".

cdcoonce/Portfolio_Website

Orchestrate the full GitHub-issues-driven development lifecycle. 7-phase pipeline from brainstorm through PR with state tracking and cross-conversation resume. Use when user says "dev cycle", "development workflow", "full development pipeline", or invokes /dev-cycle.

cdcoonce/Portfolio_Website

Production Python coding standards with automatic version detection (3.10-3.13). Use when writing, reviewing, or refactoring Python to ensure adherence to modern type syntax, LBYL exception handling, pathlib operations, ABC-based interfaces, and production-tested patterns. Not Dagster-specific - applies to any Python project.

cdcoonce/Portfolio_Website

Set up Claude Code hooks to block dangerous git commands (push, reset --hard, clean, branch -D, etc.) before they execute. Use when user wants to prevent destructive git operations, add git safety hooks, or block git push/reset in Claude Code.

cdcoonce/Portfolio_Website

Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".

cdcoonce/Portfolio_Website

Explore a codebase to find opportunities for architectural improvement, focusing on making the codebase more testable by deepening shallow modules. Use when user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more AI-navigable.

cdcoonce/Portfolio_Website

CEO/founder-mode plan review. Rethink the problem, find the 10-star product, challenge premises, expand scope when it creates a better product. Three modes: SCOPE EXPANSION (dream big), HOLD SCOPE (maximum rigor), SCOPE REDUCTION (strip to essentials). Use when the user asks for a plan review, CEO review, mega review, or wants a plan challenged/stress-tested before implementation.

cdcoonce/Portfolio_Website

Break a PRD into independently-grabbable GitHub issues using tracer-bullet vertical slices. Use when user wants to convert a PRD to issues, create implementation tickets, or break down a PRD into work items.

cdcoonce/Portfolio_Website

Turn a PRD into a multi-phase implementation plan using tracer-bullet vertical slices, saved as a local Markdown file in docs/plans/. Use when user wants to break down a PRD, create an implementation plan, plan phases from a PRD, or mentions "tracer bullets".

cdcoonce/Portfolio_Website

Generate or update the `.claude/docs/project.md` file that gives Claude project-specific context. Use this skill when the user asks to create, update, regenerate, or refresh project context, or says things like "update project.md", "generate project context", "this repo needs a project.md", or "Claude doesn't know about this project". Also trigger when onboarding Claude to a new repository for the first time.

cdcoonce/Portfolio_Website

Generate comprehensive, high-quality README.md files for code repositories. Use this skill whenever the user asks to create, write, generate, update, or improve a README for any project or repository. Also trigger when the user says things like "document this project", "write docs for this repo", "this repo needs a README", "help me onboard developers to this codebase", or asks for project documentation in markdown. Even if the user just says "README" or "readme" in the context of a codebase, use this skill.

cdcoonce/Portfolio_Website

Create a detailed refactor plan with tiny commits via user interview, then file it as a GitHub issue. Use when user wants to plan a refactor, create a refactoring RFC, or break a refactor into safe incremental steps.

cdcoonce/Portfolio_Website

Set up pre-commit hooks for the current repo. Use when user wants to add pre-commit hooks, configure commit-time linting, formatting, type checking, or testing. Triggers on "pre-commit", "git hooks", "linting hooks", or /setup-pre-commit.

cdcoonce/Portfolio_Website

Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.

cdcoonce/Portfolio_Website

Triage a bug or issue by exploring the codebase to find root cause, then create a GitHub issue with a TDD-based fix plan. Use when user reports a bug, wants to file an issue, mentions "triage", or wants to investigate and plan a fix for a problem.

cdcoonce/Portfolio_Website

Rewrites the prose sections of wiki pages in-place. Reads source files to understand current context, then updates only the content inside <!-- claude:prose --> ... <!-- claude:prose:end --> markers. Never touches <!-- generated:start --> ... <!-- generated:end --> blocks. Supports targeting a single page with /update-wiki {PageName}.

cdcoonce/Portfolio_Website

Create a PRD through user interview, codebase exploration, and module design, then submit as a GitHub issue. Use when user wants to write a PRD, create a product requirements document, or plan a new feature.

Verwandte Skills