environment-setup

Builds and repairs conda environments for research codebases with pinned lockfiles and verification reports.

Updated Aug 14, 2026
One-click install
npx skills add https://github.com/yyccbb/PaperReproduction-Skills --skill environment-setup-yyccbb
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: environment-setup
Source: https://github.com/yyccbb/PaperReproduction-Skills/tree/main/skills/environment-setup
Command: npx skills add https://github.com/yyccbb/PaperReproduction-Skills --skill environment-setup-yyccbb

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Research codebases rarely ship with complete, working dependency specs, so reproducing a paper often stalls on Python/CUDA/torch version conflicts and broken environments. This Skill turns scattered version evidence (lockfiles, READMEs, the paper itself, code-level API clues) into one working, verified conda environment with every pin recorded. ## Core Features & Use Cases - Tiered version resolution: Ranks evidence from lockfiles and Dockerfiles (tier 1) down through README instructions, the paper's text, and inference from imports, resolving conflicts deterministically and recording which tier decided each fact. - Three operating modes: Fresh setup, repair mode for fixing an existing env given a traceback (with the smallest change that resolves the error), and candidate-env reuse checks that never modify another repo's environment. - Verification and lockfile export: Import-tests every major package and entry-point module, checks torch.cuda.is_available() against host GPU reality, and exports a pip-freeze lockfile plus a structured markdown report. - Use Case: While reproducing a machine learning paper, stage 4 of your pipeline hits "ModuleNotFoundError: No module named 'scipy'". Invoke this Skill in repair mode to install a compatible scipy version, re-verify the import, re-export the lockfile, and append a dated entry to the repair log. ## Quick Start Set up the conda environment for this cloned research repo, pin all package versions into a lockfile, and verify the imports and CUDA setup work on this machine.

Frequently Asked Questions about environment-setup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a conda environment for a research paper codebase?▼

Run the Skill from inside the cloned repo; it inventories version evidence from requirements files, Dockerfiles, READMEs, and the paper, then creates a conda env named pr-<repo-dirname>, installs pinned packages, and verifies imports. It exports a pip-freeze lockfile and a setup report when done.

How to fix a broken Python environment after a ModuleNotFoundError?▼

Invoke the Skill in repair mode with the env name and the traceback. It diagnoses whether the error is environmental, applies the smallest fix such as installing the missing package at a compatible version, re-verifies the import, and re-exports the lockfile.

How do I choose a torch version compatible with my CUDA driver?▼

Check the host driver with nvidia-smi, then pick the torch wheel whose bundled CUDA runtime the driver supports, installing with the matching PyTorch index URL. Pip wheels ship their own CUDA runtime, so no system toolkit is needed; a missing nvidia-smi means install CPU-only torch.

What if a repo has no requirements.txt or environment file?▼

The Skill infers versions from code clues: API usage like torch.cuda.amp implies torch >= 1.6, and syntax features bound the Python version. The repo's last commit date breaks remaining ties, and all pins are verified as a conflict-free set with a resolver dry-run and pip check.

Can this Skill fix bugs in the repo's own code?▼

No. It only builds and repairs environments; if a traceback is diagnosed as a code error (logic exceptions, shape mismatches, missing files), it reports that verdict back instead of editing code. It also never runs experiment commands or downloads datasets.

Why does torch.cuda.is_available() return False after installation?▼

This usually means the installed torch build's CUDA runtime is incompatible with the host driver, or a CPU-only wheel was installed. The Skill treats False on a GPU machine as an unfinished environment and swaps to a driver-compatible CUDA build before declaring success.