Learn-skills.dev github-gist
Create, manage, and organize GitHub Gists using the gh CLI. Use this skill whenever a user wants to create a gist, share code snippets, manage existing gists, add files to a gist, list or search gists, edit gist content or descriptions, clone a gist, or delete a gist. Every gist created or modified must include a README.md documenting its purpose and contents.
install
source · Clone the upstream repo
git clone https://github.com/NeverSight/learn-skills.dev
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/NeverSight/learn-skills.dev "$T" && mkdir -p ~/.claude/skills && cp -r "$T/data/skills-md/abuxton/skills/github-gist" ~/.claude/skills/neversight-learn-skills-dev-github-gist && rm -rf "$T"
manifest:
data/skills-md/abuxton/skills/github-gist/SKILL.mdsource content
GitHub Gist Skill
Expert management of GitHub Gists via the
gh CLI. All gists created through this skill include a README.md that documents the gist's purpose, content, and optional usage instructions.
Core Rule: README.md is Mandatory
Every gist must contain a
file. When creating a new gist, always generate a README.md
README.md alongside any other files. When editing a gist that lacks a README.md, add one.
The README.md must include:
- Description — what the gist does or contains
- Content summary — what files are included and what each does
- Usage (optional, include when the gist contains runnable scripts or commands)
See
references/readme-template.md for the standard template.
Reference Files
| Reference | When to Load |
|---|---|
| Before creating any gist — get the README.md template |
| For multi-step operations: create with multiple files, bulk edit, clone & modify |
| For listing, filtering, viewing, or deleting gists |
Quick Reference: Common Operations
Create a new gist (single file)
# Always create README.md first, then create gist with both files cat > /tmp/README.md << 'EOF' # <gist title> <description> ## Files - `<filename>` — <what it does> ## Usage <usage instructions if applicable> EOF gh gist create --public --desc "<description>" /tmp/README.md <your-file>
Create a gist (multiple files)
gh gist create --public --desc "<description>" README.md file1.sh file2.py
List gists
gh gist list # 10 most recent gh gist list -L 50 # 50 most recent gh gist list --public # only public gh gist list --secret # only secret gh gist list --filter "pattern" # filter by description/filename gh gist list --filter "pattern" --include-content # search file contents
View a gist
gh gist view <id> # rendered view gh gist view <id> --raw # raw content gh gist view <id> --files # list filenames gh gist view <id> --filename README.md gh gist view <id> --web # open in browser
Edit a gist
gh gist edit <id> # interactive (opens editor) gh gist edit <id> --filename <file> # edit specific file gh gist edit <id> --desc "new description" gh gist edit <id> --add newfile.py # add a file gh gist edit <id> --remove oldfile.py # remove a file
Clone a gist locally
gh gist clone <id> [<directory>]
Delete a gist
gh gist delete <id>
Workflow: Creating a Gist
When a user asks to create a gist, follow these steps:
- Gather information — determine the description, files involved, and whether it should be public or secret (default: secret)
- Generate README.md — always write a
using the template inREADME.mdreferences/readme-template.md - Assemble files — write the actual script/content files if they don't already exist
- Create the gist — use
with all files, includinggh gist createREADME.md - Confirm and report — show the user the gist URL
Always load
before writing the README.md.references/readme-template.md
Workflow: Adding Files to an Existing Gist
When adding files to a gist:
- Check if a
exists:README.mdgh gist view <id> --files - If missing, create one with
gh gist edit <id> --add README.md - Add the new file:
gh gist edit <id> --add <filename> - Update the
to document the new fileREADME.md
Determining Visibility
- Secret (default): private to owner, accessible by URL. Use when the content is personal or sensitive.
- Public (
): listed publicly. Use when the intent is sharing with the community.--public
Ask the user if unclear. Default to secret.
File Naming Convention
- Scripts: use the appropriate extension (
,.sh
,.py
,.rb
, etc.).js - Config snippets: use the actual config filename (e.g.,
,.zshrc
)nginx.conf - Documentation: always
(neverREADME.md
orreadme.txt
)README.txt - One-liners or reference cards: use
format for readability.md
Error Handling
| Error | Resolution |
|---|---|
| Run |
| File not found | Verify path; use absolute paths in for temp files |
| Gist ID not found | Run to find the correct ID |
| Rate limited | Wait and retry; use to reduce API calls |
Tip: Use
to open any gist in the browser for easy sharing.gh gist view <id> --web