Fetch raw file content from GitHub URLs. Trigger when user shares a GitHub file link (https://github.com/user/repo/blob/main/file.go) and wants to view the source code. Avoids HTML/JS clutter from WebFetch.
Fetches raw source code from GitHub file URLs using the GitHub CLI, avoiding HTML/JS clutter. Trigger when users share GitHub blob/tree links and want to view clean source code.
/plugin marketplace add robbyt/claude-skills/plugin install gemini@robbyt-claude-skillsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
scripts/view_github_file.pyFetch raw file content from GitHub URLs without HTML/JS clutter.
GitHub CLI must be installed and authenticated:
gh auth status
When a user shares a GitHub file URL like:
https://github.com/user/repo/blob/main/src/file.gohttps://github.com/user/repo/tree/v1.0/docs/README.mdUse this skill instead of WebFetch to get clean source code.
python3 scripts/view_github_file.py https://github.com/user/repo/blob/main/path/to/file.go
The script:
gh api to fetch file contenthttps://github.com/{owner}/{repo}/blob/{ref}/{path}
https://github.com/{owner}/{repo}/tree/{ref}/{path}
Where {ref} can be a branch name, tag, or commit SHA.
Parse the URL manually and use gh api:
# From URL: https://github.com/golang/go/blob/master/README.md
# Extract: owner=golang, repo=go, ref=master, path=README.md
gh api repos/golang/go/contents/README.md?ref=master --jq '.content' | base64 --decode
Or use raw.githubusercontent.com:
curl https://raw.githubusercontent.com/golang/go/master/README.md