From ml-research
Initialize a new ML research project using the ML Research template with PyTorch Lightning, Hydra, and modern Python tooling. Use when starting a new ML project from scratch.
npx claudepluginhub nishide-dev/claude-code-ml-researchThis skill uses the workspace's default tool permissions.
Initialize a new machine learning research project using the ML Research Copier template with PyTorch Lightning, Hydra configuration, and modern Python tooling (uv).
Verifies tests pass on completed feature branch, presents options to merge locally, create GitHub PR, keep as-is or discard; executes choice and cleans up worktree.
Guides root cause investigation for bugs, test failures, unexpected behavior, performance issues, and build failures before proposing fixes.
Writes implementation plans from specs for multi-step tasks, mapping files and breaking into TDD bite-sized steps before coding.
Share bugs, ideas, or general feedback.
Initialize a new machine learning research project using the ML Research Copier template with PyTorch Lightning, Hydra configuration, and modern Python tooling (uv).
This command uses uvx copier to create projects from templates. The template supports:
Verify that uvx is available:
uvx --version
If not available, install uv:
curl -LsSf https://astral.sh/uv/install.sh | sh
Execute the copier command pointing to the ML research template:
# From GitHub (recommended)
uvx copier copy --trust gh:nishide-dev/ml-research-template <project-directory>
# From local clone (for development)
uvx copier copy --trust /path/to/ml-research-template <project-directory>
Where:
gh:nishide-dev/ml-research-template is the GitHub repository URL<project-directory> is where the new project will be createdNote: The template is maintained in a separate repository (ml-research-template) for independent versioning and broader reusability.
Copier will ask the user to configure:
Project Basics:
Development Tools:
PyTorch/CUDA:
ML Frameworks:
Experiment Tracking:
Template Type:
Dataset:
Copier automatically executes post-generation tasks:
git init -b main - Initialize git repositoryuv venv - Create virtual environmentuv lock - Lock dependenciesuv sync - Install dependenciesruff check . --fix - Lint and auto-fixruff format . - Format codety check - Type check (if enabled)pytest - Run tests (if enabled)The generated project will have:
<project-name>/
├── src/
│ └── <package-name>/
│ ├── __init__.py
│ ├── train.py # Main training script with Hydra
│ ├── models/ # LightningModule definitions
│ ├── data/ # DataModule and datasets
│ └── utils/ # Utility functions
├── tests/
│ └── test_<package_name>.py
├── configs/ # Hydra configuration
│ ├── config.yaml
│ ├── model/
│ ├── data/
│ ├── trainer/
│ ├── logger/
│ └── experiment/
├── pyproject.toml # uv + project config
├── ruff.toml # Ruff linting config
├── .gitignore
├── README.md
└── .venv/ # Virtual environment (created)
After project creation, verify the setup:
cd <project-name>
# Verify CUDA availability
uv run python -c "import torch; print(f'CUDA: {torch.cuda.is_available()}')"
# Run a quick test
uv run pytest tests/ -v
# Check code quality
uv run ruff check .
Guide the user:
# Start training (with Hydra defaults)
uv run python src/<package-name>/train.py
# Override configuration
uv run python src/<package-name>/train.py trainer.max_epochs=20 data.batch_size=64
# Run specific experiment
uv run python src/<package-name>/train.py experiment=baseline
# Start TensorBoard (if using TensorBoard)
tensorboard --logdir logs/
# Login to W&B (if using W&B)
wandb login
If the user wants a specific template variant without interactive prompts, they can use:
# Use defaults with --defaults flag (from GitHub)
uvx copier copy --trust --defaults gh:nishide-dev/ml-research-template <project-directory>
# Use data flags for non-interactive (from GitHub)
uvx copier copy --trust \
--data project_name="my-project" \
--data pytorch_cuda_preset="pytorch-2.8.0-cuda-12.6" \
--data use_lightning=true \
--data logger_choice="wandb" \
gh:nishide-dev/ml-research-template <project-directory>
# From local clone
uvx copier copy --trust --defaults /path/to/ml-research-template <project-directory>
# Install uv first
curl -LsSf https://astral.sh/uv/install.sh | sh
# Then uvx will be available
Check available CUDA on system:
nvidia-smi
Select matching preset or custom CUDA version during copier prompts.
Ensure virtual environment is activated or use uv run:
uv run python src/<package-name>/train.py
Project is ready for ML research!
# From GitHub (recommended)
uvx copier copy --trust gh:nishide-dev/ml-research-template ~/projects/my-cifar10-project
# From local clone (for development)
uvx copier copy --trust /path/to/ml-research-template ~/projects/my-cifar10-project
# Follow interactive prompts, then:
cd ~/projects/my-cifar10-project
uv run python src/my_cifar10_project/train.py