Surgical github extraction
Skill jeet-dhandha/jd-skills/skills/surgical-github-extraction
Use when user references GitHub repo as inspiration, not dependency — phrases like "look at this repo", "borrow from X", "use approach from Y", "implement like Z", or GitHub URL handed in as reference. Prevents clone or install. Fetches raw files to tempdir, lifts minimum useful snippet or concept, adapts to user project style. Output version-independent, dep-free.From its SKILL.md
npx -y skills add jeet-dhandha/jd-skills --skill surgical-github-extractionAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.2 KB, 808 tokens by cl100k_base, as published. Nobody here has run it
Surgical GitHub Extraction
Why
Clone or install = version coupling + transitive deps + scaffolding buries concept. User usually want idea, not framework. Lift small, own it.
Use when
- User pastes GitHub URL + says "look at" / "borrow" / "use approach from" / "implement like".
- User want concept/architecture/technique from repo.
- User want small util lifted from bigger lib.
- Lib unmaintained, niche, or painful to install.
Skip when
- User says "install X" / "add to package.json".
- Lib = runtime engine (Next, React, FastAPI).
- Repo = CLI tool to run, not learn from.
Rules
- Raw files, never clone.
raw.githubusercontent.com/<o>/<r>/<sha>/<path>orgh api. - Tempdir, not project tree. Unix
${TMPDIR:-/tmp}/sge-<repo>-<sha>/. Win$env:TEMP\sge-<repo>-<sha>\. - Pin SHA, not branch. Future re-read need exact version.
- README first. Then 1–3 source files for wiring. README = what, source = how. Stop once enough to adapt.
- Minimum unit. Smallest function / prompt / config that solve need.
- Adapt, not transplant. Match project conventions. Drop unused branches. Swap imports for stdlib or local utils.
- Cite source.
// adapted from github.com/<o>/<r>@<sha>:<path>.
Workflow
- Clarify. One question max. Concept vs code lift? What's the one thing?
- Fetch README via raw URL. Get shape.
- Pin SHA once, reuse for all fetches.
- List tree only if README don't point at right files.
- Fetch 1–3 target files to tempdir — prompts, schemas, wiring.
- Read, extract, adapt. Rewrite inline to project style. Drop dead code.
- Paste + cite with provenance comment.
- Verify. Run project typecheck/lint/test. Tempdir = scratch, never commit.
Two paths
- Concept-only: README + few key files for shape (agent defs, prompts, graph wiring). Propose analogue in user stack. Tempdir inspected, nothing committed.
- Surgical lift: README + target file. Extract minimum unit, adapt, paste with provenance. No
pip install, no submodule.
Anti-patterns
- ❌
git cloneinto project or home dir. - ❌
pip install git+https://...ornpm install <tarball>when user want to learn from repo. - ❌ Fetch all of
/src"just in case". - ❌ Paste verbatim with upstream imports and style intact.
- ❌ Pin
mainnot SHA. - ❌ Commit tempdir paths in scripts.
Quick reference
README → curl -fsSL raw.githubusercontent.com/<o>/<r>/<sha>/README.md
tree → gh api repos/<o>/<r>/git/trees/<sha>?recursive=1
one file → curl -fsSL raw.githubusercontent.com/<o>/<r>/<sha>/<path>
pin SHA → gh api repos/<o>/<r>/commits/<branch> --jq .sha | cut -c1-7
tempdir unix → ${TMPDIR:-/tmp}/sge-<repo>-<sha>/
tempdir win → $env:TEMP\sge-<repo>-<sha>\
provenance → // adapted from github.com/<o>/<r>@<sha>:<path>
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.