Install Experiment Code
Pick your agent. Every command is ready to paste.
npx skills add lingzhi227/agent-research-skills --skill experiment-codeThe open skills CLI detects your agents (Claude Code, Cursor, Codex and 70+ more) and installs to the right folder. Add -g to install globally.
01
Install it
Run the command above, or upload the folder in Claude.
02
Ask naturally
Describe the task. Your agent loads experiment-code when the request matches its description.
03
Name it if needed
If it does not trigger, say “use the experiment-code skill”. In Codex, type $experiment-code.
Experiment Code
Generate and iteratively improve ML experiment code for research papers.
Input
$0— Task:generate,improve,debug,plot$1— Research plan, idea description, or error message
References
- Experiment prompts and patterns:
~/.claude/skills/experiment-code/references/experiment-prompts.md - Code patterns (error handling, repair, hill-climbing):
~/.claude/skills/experiment-code/references/code-patterns.md
Action: generate
Generate initial experiment code following this structure:
- Plan experiments first — List all runs needed (hyperparameter sweeps, ablations, baselines)
- Write self-contained code — All code in project directory, no external imports from reference repos
- Include proper logging — Save results to JSON, print intermediate metrics
- Generate figures — At minimum Figure_1.png and Figure_2.png
Mandatory Structure
project/
├── experiment.py # Main experiment script
├── plot.py # Visualization script
├── notes.txt # Experiment descriptions and results
├── run_1/ # Results from run 1
│ └── final_info.json
├── run_2/
└── ...
Constraints
- No placeholder code (
pass,...,raise NotImplementedError) - Must use actual datasets (not toy data unless explicitly requested)
- PyTorch or scikit-learn preferred (no TensorFlow/Keras)
- Each run uses:
python experiment.py --out_dir=run_i
Action: improve
Improve existing experiment code:
- Read current code and results
- Reflect on what worked and what didn't
- Apply targeted edits (prefer small edits over full rewrites)
- Re-run and compare scores
- Keep the best-performing code variant
Action: debug
Fix experiment code errors:
- Read the error message (truncate to last 1500 chars if very long)
- Identify the root cause
- Apply minimal fix
- Up to 4 retry attempts before changing approach
Action: plot
Generate publication-quality plots from experiment results:
- Read all
run_*/final_info.jsonfiles - Generate comparison plots with proper labels
- Use the figure-generation skill for styling
Rules
- Always plan experiments before writing code
- After each run, document results in notes.txt
- Include print statements explaining what results show
- Method MUST not get 0% accuracy — verify accuracy calculations
- Use seeds for reproducibility
- Before each experiment include a print statement explaining exactly what the results are meant to show
Related Skills
- Upstream: experiment-design, algorithm-design
- Downstream: data-analysis, backward-traceability
- See also: code-debugging, paper-to-code
Tips for Experiment Code
- • Start a fresh session after installing so your agent picks up the new skill.
- • It bundles reference files. The agent reads them only when needed, so they cost no context until then.
- • It is part of a pack with 30 skills. Install only the ones you need with --skill to keep triggers precise.
- • If two skills overlap, mention the one you want by name.
Questions about Experiment Code
What does the Experiment Code skill do?
Write ML experiment code with iterative improvement. Generate training/evaluation pipelines, debug errors, and optimize results through code reflection. Use when implementing experiments for a research paper.
How do I install Experiment Code?
Run "npx skills add lingzhi227/agent-research-skills --skill experiment-code" in your project. The skills CLI installs it for Claude Code, Cursor, Codex and 70+ other agents. In Claude on the web, upload the skill folder as a ZIP under Customize > Skills.
Does Experiment Code work in Cursor and Codex?
Yes. Experiment Code uses the open SKILL.md format, so it works in Claude Code, Claude, Cursor, OpenAI Codex, Gemini CLI, GitHub Copilot and other agents that support agent skills.
Is Experiment Code free?
Experiment Code is open source on GitHub. It is free to install; check the license before commercial use.
Who made Experiment Code?
Experiment Code is published by lingzhi227 in the lingzhi227/agent-research-skills repository, together with 29 other skills.
