| name | haipipe-task-for-fit |
| description | model-fitting task-folder specialist: scaffolds {NN}_<name>/ task-folders that fit/train a model (full hyperparam config, real GPU sweep, checkpoint to _WorkSpace/5-ModelInstanceStore/). NOT algorithm dev -- see /haipipe-task-for-algo. Called by /haipipe-task when task-type=fit. Cross-references /haipipe-nn-tuner and /haipipe-nn-instance. |
| argument-hint | [project_id] [group] [task-name] |
| allowed-tools | Bash, Read, Write, Edit, Grep, Glob, Skill |
| metadata | {"version":"0.1.2","last_updated":"2026-07-04","summary":"model-fitting task-folder build specialist."} |
Skill: haipipe-task-for-fit
Scaffolds a model-training task-folder.
Full training config, heavy outputs to _WorkSpace/5-ModelInstanceStore/, designed for cross-run comparison and paper-grade results.
Invocation modes: interactive (human steers; missing fields get ASKed) OR headless (haipipe-task-creator-agent calls this skill during Phase 2: Build, then authors the <TASK>.py body).
Always end with the structured return block (status / task_folder / run_name / files).
Not the same as task-algo
See ../../2_nn/haipipe-task-for-algo/SKILL.md for the full comparison.
Short version: algo-dev = smoke test, training = real run.
What this scaffolds
tasks/A{NN}_<group_name>/ โ A-series group (model-run)
โโโ {NN}_<task_name>/
โโโ {NN}_<task_name>.py
โโโ configs/
โ โโโ 5_model_<name>.yaml seeded from ref/config-seed.yaml
โโโ runs/
โ โโโ 5_model_<name>_<variant>.sh
โโโ results/
โ โโโ <run>/ model_path.txt + metrics.json (light)
โโโ notebooks/
โโโ sbatch/ optional, for GPU-partitioned sweep
Group letter default: A (model-run).
Heavy outputs land in: _WorkSpace/5-ModelInstanceStore/.
Cross-reference to pipeline skill
/haipipe-nn-tuner defines the hyperparameter search space; /haipipe-nn-instance materializes a ModelInstance from a tuner sweep.
This skill scaffolds the example task that drives both.
/haipipe-nn-algo โ algorithm class exists.
/haipipe-nn-tuner โ author the sweep.
/haipipe-task-for-fit โ scaffold the example task.
- Run sweep โ ModelInstance โ
/haipipe-task-for-eval.
Scaffold flow
See fn/scaffold.md for the detailed step-by-step.
Summary:
- Identify project + task-group.
- Collect metadata (NN, name, type-specific extras, _meta block).
- Create skeleton (.py, configs/, runs/, results/, notebooks/).
- Seed config from
ref/config-seed.yaml.
- Copy run-script from
../../haipipe-task/ref/run-sh-template.sh.
- Suggest next via cross-skill link.
- Emit return contract.
Return contract
status: ok | blocked | failed
summary: 2-3 sentences on what was scaffolded
artifacts: [paths created]
next: suggested next command (/haipipe-nn-tuner or run.sh)
Lessons learned
Canonical lessons live in LESSON.md (same folder): L1 temporal-leak filter, L2 PID/PatientID format, L4 empty prediction_results.json = silent bug, L5 -p SKIP_TRAINING "true" fast iteration, L6 what the Step-8 reproducibility check actually tests.
Read it before building a fit task; do not restate its content here.
Quick pointers:
- ExampleFn builder lives in the same-numbered task as training (same number = same stage); builder templates at
code/scripts/haibuilder/5-instance/ (workspace-dependent path).
prediction_results.json must be non-empty after training (LESSON.md L4).
Workflow plan
When /haipipe-task plan targets an existing task-folder of this type, the generated plan-script YAML should follow the type-specific sample:
ref/workflow-plan-sample.yaml โ script-level phases for this type
../../haipipe-task/ref/workflow-template.yaml โ task-level template (Run/Gate1/Gate2)
Schema source of truth:
task/haipipe-workflow/ref/plan-schema.md