
Experiment Design
- 1 installs
- 255 repo stars
- Updated February 27, 2026
- lingzhi227/claude-research-skills
This is a copy of experiment-design by lingzhi227 - installs and ranking accrue to the original listing.
Helps with design & ui/ux tasks.
About
experiment-design is a Claude Code skill for design & ui/ux. It helps solo builders move faster with AI-assisted development.
- experiment-design
- Design & UI/UX
- AI-coding skill
Experiment Design by the numbers
- 1 all-time installs (skills.sh)
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/lingzhi227/claude-research-skills --skill experiment-designAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 1 |
|---|---|
| repo stars | ★ 255 |
| Last updated | February 27, 2026 |
| Repository | lingzhi227/claude-research-skills ↗ |
What it does
Helps with design & ui/ux tasks.
Files
Experiment Design
Design structured, progressive experiment plans for research papers.
Input
$0— Research idea, plan, or method description
References
- 4-stage progressive experiment prompts:
~/.claude/skills/experiment-design/references/stage-prompts.md
Scripts
Generate experiment design
python ~/.claude/skills/experiment-design/scripts/design_experiments.py --plan research_plan.json --output experiment_design.json
python ~/.claude/skills/experiment-design/scripts/design_experiments.py --method "contrastive learning" --task classification --format markdownGenerates baselines, ablation matrix, hyperparameter grid, metric selection. Stdlib-only.
4-Stage Progressive Framework (from AI-Scientist-v2)
Stage 1: Initial Implementation
- Focus on getting a basic working implementation
- Use a simple dataset
- Aim for basic functional correctness
- Completion: at least one working (non-buggy) implementation
Stage 2: Baseline Tuning
- Tune hyperparameters (learning rate, epochs, batch size)
- Do NOT change model architecture
- Test on at least TWO datasets
- Completion: stable training curves, improvement over Stage 1
Stage 3: Creative Research
- Explore novel improvements and insights
- Be creative and think outside the box
- Test on at least THREE datasets
- Completion: demonstrated novel improvement
Stage 4: Ablation Studies
- Systematic component analysis
- Each ablation tests a different aspect
- Use same datasets as Stage 3
- Completion: all planned ablations done
Output Format
{
"stages": [
{
"name": "initial_implementation",
"goals": ["Basic working baseline", "Simple dataset"],
"max_iterations": 5,
"completion_criteria": "Working implementation with non-zero accuracy"
}
],
"baselines": ["Method A", "Method B"],
"datasets": ["Dataset1", "Dataset2", "Dataset3"],
"metrics": ["accuracy", "F1", "inference_time"],
"ablation_components": ["component_A", "component_B"],
"hyperparameter_grid": {
"lr": [1e-4, 1e-3, 1e-2],
"batch_size": [32, 64, 128]
},
"num_seeds": 3
}Rules
- Always start simple (Stage 1) before complex experiments
- Each stage builds on the best result from the previous stage
- Multi-seed evaluation for statistical significance
- Document every experiment run in notes.txt
- Generate figures for training curves and comparisons
Related Skills
- Upstream: research-planning, idea-generation
- Downstream: experiment-code, data-analysis
- See also: paper-assembly
Experiment Design Stage Prompts
Extracted from AI-Scientist-v2 (agent_manager.py) and AI-Researcher (exp_analyser.py).
4-Stage Progressive Experiment Framework (AI-Scientist-v2)
Stage 1: Initial Implementation
Goal: Get a working baseline on a simple dataset.
Stage 1 - Initial Implementation:
- Implement the core method on the simplest dataset
- Ensure training converges (check training curves)
- Establish baseline metrics
- Verify code runs without errors
Completion criteria:
- Training loss decreases
- Validation metrics are reasonable (not random)
- Code executes end-to-end without errorsStage 2: Baseline Tuning
Goal: Optimize hyperparameters and test on multiple datasets.
Stage 2 - Baseline Tuning:
- Tune learning rate, batch size, and key hyperparameters
- Test on at least 2 datasets
- Compare against published baselines
- Run 3 seeds for statistical significance
Completion criteria:
- Results competitive with or better than baselines
- Consistent across multiple seeds
- Training curves show stable convergenceStage 3: Creative Research
Goal: Novel improvements and comprehensive evaluation.
Stage 3 - Creative Research:
- Implement novel improvements to the method
- Test on 3+ datasets
- Compare against 3+ baselines
- Ablation of key design choices
- Generate publication-quality figures
Completion criteria:
- Clear improvement over baselines on most datasets
- Ablation supports contribution claims
- Figures are informative and well-designedStage 4: Ablation Studies
Goal: Systematic component analysis.
Stage 4 - Ablation Studies:
- Remove/modify each key component one at a time
- Measure impact on performance
- Sensitivity analysis for key hyperparameters
- Report statistical significance (mean ± std over 3+ seeds)
Completion criteria:
- Every claimed contribution verified by ablation
- Hyperparameter sensitivity is reasonable
- Results table is complete with all comparisonsVLM-Based Stage Completion Check (AI-Scientist-v2)
Examine the training curves and results:
1. Is the training loss decreasing?
2. Is validation performance improving?
3. Has the model converged or does it need more epochs?
4. Are there signs of overfitting?
5. Is the performance competitive with baselines?
Based on this analysis, determine if the current stage is complete
or if more experiments are needed.Best-Node Selection (AI-Scientist-v2)
Given the following experiment results and their training curves,
holistically select the best experiment considering:
1. Final test performance (primary metric)
2. Training stability (smooth loss curves)
3. Consistency across seeds
4. Generalization (train-test gap)
Experiment results:
{results_json}
Select the best experiment and justify your choice.Ablation Study Design (AI-Researcher)
Given the experimental results:
{results}
Design an ablation study to verify each component's contribution:
1. List all key components of the method
2. For each component, propose a variant where it is removed/replaced
3. Predict expected impact of each removal
4. Prioritize: test the most impactful ablations firstSensitivity Analysis (AI-Researcher)
Design a sensitivity analysis for these hyperparameters:
{hyperparameters}
For each hyperparameter:
1. Define a reasonable range to test
2. Specify the number of values to try
3. Identify which metrics to track
4. Note any interactions between hyperparameters#!/usr/bin/env python3
"""Generate experiment design from a research plan.
Takes a research plan (JSON or text description) and generates
a structured experiment design with baselines, ablation matrix,
hyperparameter grid, and evaluation metrics.
Self-contained: uses only stdlib.
Usage:
python design_experiments.py --plan research_plan.json --output experiment_design.json
python design_experiments.py --method "contrastive learning" --task "image classification" --output design.json
python design_experiments.py --plan plan.json --format markdown
"""
import argparse
import json
import os
import sys
DEFAULT_HYPERPARAMS = {
"learning_rate": [1e-4, 3e-4, 1e-3],
"batch_size": [16, 32, 64],
"epochs": [50, 100],
"weight_decay": [0, 1e-4, 1e-2],
"dropout": [0.0, 0.1, 0.3],
}
DEFAULT_METRICS = {
"classification": ["accuracy", "f1_macro", "precision", "recall", "auroc"],
"regression": ["mse", "mae", "r2", "rmse"],
"generation": ["bleu", "rouge_l", "meteor", "perplexity"],
"detection": ["map", "map50", "precision", "recall", "f1"],
"segmentation": ["iou", "dice", "pixel_accuracy"],
"retrieval": ["mrr", "ndcg", "recall_at_k", "precision_at_k"],
"general": ["accuracy", "f1", "loss"],
}
STAGE_TEMPLATES = [
{
"name": "initial_implementation",
"description": "Get a basic working implementation",
"goals": [
"Implement core method",
"Run on simplest dataset",
"Verify training loop works",
],
"max_iterations": 5,
"completion_criteria": "Working implementation with non-trivial performance",
},
{
"name": "baseline_tuning",
"description": "Tune hyperparameters and establish baselines",
"goals": [
"Tune learning rate and batch size",
"Compare against at least 2 baselines",
"Test on at least 2 datasets",
],
"max_iterations": 10,
"completion_criteria": "Stable training, improvement over baselines",
},
{
"name": "creative_research",
"description": "Explore novel improvements",
"goals": [
"Try architectural modifications",
"Explore loss function variants",
"Test on at least 3 datasets",
],
"max_iterations": 15,
"completion_criteria": "Demonstrated novel improvement",
},
{
"name": "ablation_studies",
"description": "Systematic component analysis",
"goals": [
"Ablate each proposed component",
"Test sensitivity to hyperparameters",
"Run with multiple random seeds",
],
"max_iterations": 10,
"completion_criteria": "All planned ablations completed",
},
]
def generate_ablation_matrix(components: list[str]) -> list[dict]:
"""Generate ablation study matrix from component list."""
ablations = [{"name": "Full Model", "components": {c: True for c in components}}]
for comp in components:
ablation = {
"name": f"w/o {comp}",
"components": {c: (c != comp) for c in components},
}
ablations.append(ablation)
return ablations
def generate_design(plan: dict) -> dict:
"""Generate a full experiment design from a research plan."""
method = plan.get("method", "proposed method")
task_type = plan.get("task_type", "general")
components = plan.get("components", ["component_A", "component_B", "component_C"])
baselines = plan.get("baselines", [])
datasets = plan.get("datasets", [])
custom_metrics = plan.get("metrics", [])
num_seeds = plan.get("num_seeds", 3)
# Select metrics
metrics = custom_metrics or DEFAULT_METRICS.get(task_type, DEFAULT_METRICS["general"])
# Generate hyperparameter grid
hp_grid = plan.get("hyperparameter_grid", {})
if not hp_grid:
hp_grid = {
"learning_rate": DEFAULT_HYPERPARAMS["learning_rate"],
"batch_size": DEFAULT_HYPERPARAMS["batch_size"],
}
# Generate ablation matrix
ablations = generate_ablation_matrix(components)
# Compute total experiments estimate
n_hp_configs = 1
for vals in hp_grid.values():
n_hp_configs *= len(vals)
n_datasets = max(len(datasets), 1)
n_ablations = len(ablations)
n_baselines = max(len(baselines), 1)
total_runs = (n_hp_configs + n_ablations + n_baselines) * n_datasets * num_seeds
design = {
"method": method,
"task_type": task_type,
"stages": STAGE_TEMPLATES,
"baselines": baselines,
"datasets": datasets,
"metrics": metrics,
"primary_metric": metrics[0] if metrics else "accuracy",
"components": components,
"ablation_matrix": ablations,
"hyperparameter_grid": hp_grid,
"num_seeds": num_seeds,
"estimated_total_runs": total_runs,
"evaluation_protocol": {
"report_mean_std": True,
"statistical_test": "paired_ttest" if num_seeds >= 3 else "none",
"significance_level": 0.05,
},
}
return design
def format_markdown(design: dict) -> str:
"""Format experiment design as markdown."""
lines = [f"# Experiment Design: {design['method']}\n"]
lines.append(f"## Task Type: {design['task_type']}\n")
lines.append("## Stages\n")
for i, stage in enumerate(design["stages"], 1):
lines.append(f"### Stage {i}: {stage['name']}")
lines.append(f"{stage['description']}\n")
for goal in stage["goals"]:
lines.append(f"- {goal}")
lines.append(f"- Completion: {stage['completion_criteria']}\n")
if design["baselines"]:
lines.append("## Baselines\n")
for b in design["baselines"]:
lines.append(f"- {b}")
lines.append("")
if design["datasets"]:
lines.append("## Datasets\n")
for d in design["datasets"]:
lines.append(f"- {d}")
lines.append("")
lines.append("## Metrics\n")
lines.append(f"Primary: **{design['primary_metric']}**\n")
for m in design["metrics"]:
lines.append(f"- {m}")
lines.append("")
lines.append("## Ablation Matrix\n")
comps = design["components"]
header = "| Variant | " + " | ".join(comps) + " |"
sep = "|" + "|".join(["---"] * (len(comps) + 1)) + "|"
lines.append(header)
lines.append(sep)
for ab in design["ablation_matrix"]:
row = f"| {ab['name']} | "
row += " | ".join("Y" if ab["components"][c] else "N" for c in comps)
row += " |"
lines.append(row)
lines.append("")
lines.append("## Hyperparameter Grid\n")
for param, vals in design["hyperparameter_grid"].items():
lines.append(f"- {param}: {vals}")
lines.append("")
lines.append(f"## Summary\n")
lines.append(f"- Seeds: {design['num_seeds']}")
lines.append(f"- Estimated total runs: {design['estimated_total_runs']}")
lines.append(f"- Statistical test: {design['evaluation_protocol']['statistical_test']}")
return "\n".join(lines) + "\n"
def main():
parser = argparse.ArgumentParser(description="Generate experiment design from research plan")
parser.add_argument("--plan", help="Research plan JSON file")
parser.add_argument("--method", help="Method name (if no plan file)")
parser.add_argument("--task", help="Task type: classification, regression, generation, etc.")
parser.add_argument("--format", choices=["json", "markdown"], default="json",
help="Output format (default: json)")
parser.add_argument("--output", "-o", help="Output file")
args = parser.parse_args()
if args.plan and os.path.exists(args.plan):
with open(args.plan, encoding="utf-8") as f:
plan = json.load(f)
elif args.method:
plan = {
"method": args.method,
"task_type": args.task or "general",
}
else:
print("Error: specify --plan or --method", file=sys.stderr)
sys.exit(1)
design = generate_design(plan)
if args.format == "markdown":
output = format_markdown(design)
else:
output = json.dumps(design, indent=2, ensure_ascii=False)
if args.output:
with open(args.output, "w", encoding="utf-8") as f:
f.write(output)
print(f"Design written to {args.output}", file=sys.stderr)
else:
print(output)
if __name__ == "__main__":
main()