agentsclimarketplace

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

Install
npx -y skills add jeet-dhandha/jd-skills --skill surgical-github-extraction

Assembled 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

  1. Raw files, never clone. raw.githubusercontent.com/<o>/<r>/<sha>/<path> or gh api.
  2. Tempdir, not project tree. Unix ${TMPDIR:-/tmp}/sge-<repo>-<sha>/. Win $env:TEMP\sge-<repo>-<sha>\.
  3. Pin SHA, not branch. Future re-read need exact version.
  4. README first. Then 1–3 source files for wiring. README = what, source = how. Stop once enough to adapt.
  5. Minimum unit. Smallest function / prompt / config that solve need.
  6. Adapt, not transplant. Match project conventions. Drop unused branches. Swap imports for stdlib or local utils.
  7. Cite source. // adapted from github.com/<o>/<r>@<sha>:<path>.

Workflow

  1. Clarify. One question max. Concept vs code lift? What's the one thing?
  2. Fetch README via raw URL. Get shape.
  3. Pin SHA once, reuse for all fetches.
  4. List tree only if README don't point at right files.
  5. Fetch 1–3 target files to tempdir — prompts, schemas, wiring.
  6. Read, extract, adapt. Rewrite inline to project style. Drop dead code.
  7. Paste + cite with provenance comment.
  8. 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 clone into project or home dir.
  • pip install git+https://... or npm 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 main not 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.

Keep looking

Skills are one crate of 326,506. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.