Skip to content
Back to skills

Gh Fetch

ASecurity

GitHub fetch — gh CLI for GitHub URLs; checkout when multiple file accesses are foreseen. Use when the user shares a GitHub link or wants remote repo source.

  • 3 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 19, 2026
ai-agentsgitapi

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 19, 2026

npx -y skills add lucavb/skills --skill gh-fetch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Gh Fetch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Gh Fetch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/lucavb-gh-fetch/badge)](https://www.skillsdirectory.com/skills/lucavb-gh-fetch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: gh-fetch
description: >-
  GitHub fetch — gh CLI for GitHub URLs; checkout when multiple file accesses
  are foreseen. Use when the user shares a GitHub link or wants remote repo source.
---

# GitHub fetch

A **fetch** run is the same **process** every GitHub task: parse → **foresee** → **fetch** or **checkout**.

## Steps

### 1. Parse

Parse `owner/repo` (+ issue/PR number if present) from URL or user text.

**Completion criterion:** `owner/repo` identified (or user asked to clarify).

### 2. Foresee

Before **checkout**, decide: will this task need more than one file read or a repo-wide search (Grep/Glob)?

- **No** → **fetch** branch (Step 3).
- **Yes** → **checkout** branch (Step 4).
- Task expands mid-run → re-**foresee** before the second access; switch branches if needed.

**Completion criterion:** branch chosen and recorded (fetch vs checkout).

### 3. Fetch branch

Follow [GH-COMMANDS.md](GH-COMMANDS.md) for the URL type. Single file: `gh api repos/owner/repo/contents/path?ref=branch`.

**Completion criterion:** requested content returned via `gh`; no **checkout** started.

### 4. Checkout branch

Follow [CHECKOUT.md](CHECKOUT.md) — ask for local path, verify remote, clone only with approval.

**Completion criterion:** verified local path in use, or approved shallow clone at a known absolute path; Read/Grep/Glob target that tree.

## Reach

Reach GitHub through **`gh`** (**fetch** branch) or a verified **checkout** path. If `gh` is missing or unauthenticated, WebFetch is the fallback.

**Done when:** every access went through **fetch** or **checkout** per the **foresee** gate; WebFetch used only on genuine `gh` failure.

Files in this skill

  • CHECKOUT.md1.1 KB
  • GH-COMMANDS.md1.3 KB
  • README.md1 KB
  • SKILL.md1.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.