Initialize Project
Set up a new ML project from the template. User provides project name and description.
Input
$ARGUMENTS
If project name or description not provided, ask the user.
Workflow
Phase 1: Gather Info
- Get project details from user:
- Project name (used for WandB project, directory context)
- Short description (one sentence)
- WandB entity (team or username)
- WandB launch queue name
- Python version preference (default: current system python3)
- Environment variables / secrets needed (e.g., Kaggle token, HuggingFace token, custom API keys)
Phase 2: Python Environment
Create and activate virtual environment
python3 -m venv .venv source .venv/bin/activateInstall dependencies
pip install -r requirements.txtVerify imports work
python -c "import wandb; import torch; print('All imports OK')"
Phase 3: WandB Setup
Check WandB login
wandb status- If not logged in, prompt user to run
wandb login - Verify the entity is accessible
- If not logged in, prompt user to run
Verify WandB Launch queue
wandb launch-agent --help- Ask user to confirm:
- Queue name exists and is created in WandB UI
- At least one agent is running or will be started on GPU environment
- Test connectivity:
python -c "import wandb; api = wandb.Api(); print('WandB API OK')"
- Ask user to confirm:
Phase 4: Environment Variables
- Write
.claude/settings.local.jsonwith project secrets and env vars:Ask user for any API keys / tokens they need (e.g.,
KAGGLE_USERNAME,KAGGLE_KEY,HF_TOKEN)Write secrets only to
.claude/settings.local.json(gitignored, local only):{ "env": { "WANDB_API_KEY": "<value>", "KAGGLE_USERNAME": "<value>", "KAGGLE_KEY": "<value>", "HF_TOKEN": "<value>" } }Only include keys the user actually needs — omit unused ones
Verify
.claude/settings.local.jsonis in.gitignore:git check-ignore .claude/settings.local.jsonNon-secret project defaults go in
.claude/settings.json(committed, shared):{ "env": { "WANDB_ENTITY": "<entity>", "WANDB_PROJECT": "<project-name>", "WANDB_QUEUE": "<queue-name>" } }
Phase 5: CLAUDE.md — Project-Specific Notes
Write CLAUDE.md with project-specific content:
# CLAUDE.md ## Project: <project-name> <description> ## Key Features - **Git controlled**: Version-controlled experiment workflow - **WandB based**: Experiment tracking, launch, and evaluation - **Python programmed**: pip + requirements.txt - **Claude Code managed**: Human provides ideas, Claude Code runs the loop See `.claude/rules/` for detailed workflow rules. ## WandB Config - **Entity**: <entity> - **Project**: <project-name> - **Queue**: <queue-name> ## Current Baseline Initial baseline. No experiments run yet. ## Project-Specific Notes <!-- Add notes as the project evolves -->
Phase 6: Baseline Documentation
Create initial baseline doc at
docs/baseline-history.md:# Baseline History ## Baseline 0 — Initial - **Date**: <today> - **Description**: Initial project setup from template - **Merged branches**: None (starting point) - **Discarded branches**: None - **Key metrics**: N/A (no training run yet) ---
Phase 7: Git Cleanup
- Ensure clean git state
- Verify on
mainbranch:git branch --show-current - Delete any stale local branches (except
main): list withgit branch, confirm with user before deleting - Delete any stale remote branches:
git branch -rand confirm - Stage and commit all initialization files:
CLAUDE.mddocs/baseline-history.md.venvshould be in.gitignore(create/update if needed)
- Push to remote
git push origin main
Phase 8: Verify
Run verification checklist and print results:
- Python venv active and dependencies installed
- WandB logged in and API accessible
- WandB entity and project confirmed
- WandB launch queue name recorded
- CLAUDE.md has project-specific config
- docs/baseline-history.md exists
- Git is on
main, clean, no stale branches -
.gitignoreincludes.venv/and.claude/settings.local.json -
.claude/settings.jsonhas non-secret project defaults -
.claude/settings.local.jsonhas secrets (not committed) - All changes committed and pushed
- Next: run
/setup-automationto set up GitHub labels, secrets, and automatic CI pipeline
Print next steps:
- "Project initialized. Next:"
- "1. Run
/setup-automationto enable automatic result analysis (WandB → GitHub Actions → Claude Code)" - "2. Ensure a WandB Launch agent is running on your GPU environment"
- "3. Use
/new-experiment [idea]to create your first experiment"
Rules
- Always ask for confirmation before deleting any git branches
- Never commit
.venv/or.claude/settings.local.json— ensure.gitignorecovers both - If WandB login fails, do not proceed — guide user to fix it
- All WandB config (entity, project, queue) must be recorded in CLAUDE.md