code-reproducer
Skill41 starsChanged 8 months agoMITView on GitHub
Automate paper reproduction on remote GPU servers via mcp-ssh, using code-analyzer's reports.
- Installs packages
In this repository8 other files it gives its agents.
- code-analyzerSkill
- code-writerSkill
- formula2codeSkill
- paper-downloaderSkill
- paper-finderSkill
- paper-parserSkill
- paper-presenterSkill
- result-analyzerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 9 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈9
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
code-analyzer: must have been run first (produces code_analysis.json)
- Distinctive: line 23
mcp-ssh: must be installed and configured in the MCP client
- Distinctive: line 29
After paper-downloader has cloned source code
- Distinctive: line 37
Run the code-analyzer skill first:
- Distinctive: line 53
Create SSH connection: ask mcp-ssh to connect to the server
- Very specific: line 54
Test connection: run echo "Connected" and nvidia-smi
- Very specific: line 55
Create a tmux session for persistence: tmux new-session -d -s repro
- Very specific: line 59
Create remote workspace: mkdir -p ~/reproduce/<project>
- Distinctive: line 99
Start training in the tmux session:
- Distinctive: line 135
Import errors → missing dependency, install it
- Distinctive: line 137
Error recovery: If training fails:
- Distinctive: line 138
Read the error message
- Distinctive: line 145
Check what was generated:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Code Reproducer Skill
Purpose
Automate the full reproduction of a research paper's experiments on remote GPU servers. This skill reads the analysis report from code-analyzer and executes the reproduction plan via mcp-ssh.
Architecture
code-analyzer (analysis) → code-reproducer (this skill) → mcp-ssh (SSH)
└── code_analysis.json └── Reads analysis report └── SSH connection
├── Framework ├── Environment setup ├── Command execution
├── Training scripts ├── Training execution ├── File upload/download
├── Configs ├── Progress monitoring ├── tmux sessions
└── Reproduction plan └── Result downloading └── Persistent sessionsPrerequisites
- code-analyzer must have been run first (produces
code_analysis.json) - mcp-ssh must be installed and configured in the MCP client
- Install:
git clone https://github.com/shuakami/mcp-ssh.git && cd mcp-ssh && npm install && npm run build - Config: Add to your MCP config (Cursor/Claude Desktop
mcp.json) - Docs: https://github.com/shuakami/mcp-ssh
- Install:
When to Use
- After paper-downloader has cloned source code
- User asks to "reproduce", "train", "run experiments", or "replicate results"
- User wants to execute code on a remote GPU server
Workflow
Phase 1: Analyze Repository (LOCAL) — via code-analyzer
Run the code-analyzer skill first:
python code-analyzer/analyze.py workspace/<paper>/code/<repo>/ -o workspace/<paper>/code_analysis.jsonThis produces a comprehensive JSON report containing framework detection, AST call graph, training loop analysis, reproducibility score, and a step-by-step reproduction plan. See code-analyzer/SKILL.md for full details.
Phase 2: Setup Server (via mcp-ssh)
First-time setup — ask the user these questions:
- "What is your GPU server's SSH address and port?"
- "What is your username?"
- "Do you use SSH key or password authentication?"
- "Does your server need a jump/bastion host?"
Then use mcp-ssh to:
- Create SSH connection: ask mcp-ssh to connect to the server
- Test connection: run
echo "Connected"andnvidia-smi - Create a tmux session for persistence:
tmux new-session -d -s repro
Phase 3: Upload Code (via mcp-ssh)
- Create remote workspace:
mkdir -p ~/reproduce/<project> - Upload code via mcp-ssh file upload tool
- Verify:
ls -la ~/reproduce/<project>/
Phase 4: Setup Environment (via mcp-ssh)
Based on code_analysis.json, execute the appropriate commands IN the tmux session:
For conda + requirements.txt:
tmux send-keys -t repro "conda create -n repro_<project> python=3.10 -y" Enter
# Wait for completion, then:
tmux send-keys -t repro "conda activate repro_<project>" Enter
tmux send-keys -t repro "cd ~/reproduce/<project> && pip install -r requirements.txt" EnterFor environment.yml:
tmux send-keys -t repro "conda env create -f ~/reproduce/<project>/environment.yml -n repro_<project>" EnterFor Docker:
tmux send-keys -t repro "cd ~/reproduce/<project> && docker build -t repro ." EnterAfter setup, verify:
# For PyTorch
python -c "import torch; print(f'CUDA: {torch.cuda.is_available()}, GPUs: {torch.cuda.device_count()}')"
# For TensorFlow
python -c "import tensorflow as tf; print(tf.config.list_physical_devices('GPU'))"Phase 5: Run Training (via mcp-ssh + tmux)
[!IMPORTANT] Always use tmux for training. This ensures the training continues even if the SSH session drops.
- Start training in the tmux session:
tmux send-keys -t repro "cd ~/reproduce/<project>" Enter
tmux send-keys -t repro "python <training_script> <args> 2>&1 | tee training.log" Enter- The training command comes from
code_analysis.json→reproduction_plan:- First priority: README training commands
- Second: detected training scripts (with confidence scores)
- Third: ask the user
Phase 6: Monitor Training (periodic)
[!TIP] For long training runs: After starting training, wait/sleep for a reasonable interval (e.g., 10-30 minutes for quick tests, 1-2 hours for full training), then check progress.
Check progress via mcp-ssh:
# Get latest log lines
tmux capture-pane -t repro -p | tail -20
# Or check the log file
tail -20 ~/reproduce/<project>/training.log
# Check if process is still running
ps aux | grep python | grep train
# Check GPU usage
nvidia-smiWhat to look for:
- Loss decreasing → training is working
- OOM errors → reduce batch size
- CUDA errors → check CUDA version compatibility
- NaN loss → check learning rate, data preprocessing
- Import errors → missing dependency, install it
Error recovery: If training fails:
- Read the error message
- Diagnose and fix (install missing package, adjust hyperparameters)
- Restart in the same tmux session
Phase 7: Download Results (via mcp-ssh)
After training completes:
- Check what was generated:
find ~/reproduce/<project> -name "*.pt" -o -name "*.pth" -o -name "*.ckpt" -o -name "*.png" -o -name "*.csv" -o -name "*.log" | head -30- Download result files via mcp-ssh to local:
- Model checkpoints
- Training logs
- Generated images/figures
- Evaluation metrics
- Save to
workspace/<paper>/results/
Phase 8: Report to User
Tell the user:
- ✅ Training completed (or ❌ failed with reason)
- Duration
- Final metrics (loss, accuracy, FID, etc.)
- Files downloaded
- Next steps (run result-analyzer for comparison with paper)
Dependencies
- code-analyzer skill (for repository analysis)
- mcp-ssh for SSH operations (https://github.com/shuakami/mcp-ssh)
Common Pitfalls and Solutions
| Problem | Solution |
| CUDA version mismatch | Check nvcc --version and install matching PyTorch |
| OOM (Out of Memory) | Reduce batch size, enable gradient checkpointing |
| Missing data | Check README for dataset download instructions |
| Deprecated API calls | Check the paper's publication year, install matching lib versions |
| Training too slow | Verify GPU is being used: nvidia-smi during training |
| tmux session lost | tmux ls to list sessions, tmux attach -t repro to reattach |
| Permission denied | chmod +x <script> or check directory permissions |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

