experiment-log
Record a model training run — log parameters, metrics, and artifact paths, then append a structured row to the experiments ledger. Use when a training run completes, when asked to "log this experiment", or when comparing runs to decide which model to promote.
- License 许可
- MIT
- 最近更新
- 2026-11-06
- Stars
- ★ 18
- Forks
- 1
01 前言 Front Matter
- name
- experiment-log
- metadata
- { "forged-by": "cursor-agent", "last-used": "2026-06-10", "forged-from": "session-2026-03-10", "usage-count": "26", "forged-reason": "Logged 3 training runs in three days; each time the ledger entry format was different and comparison was impossible — encoded a consistent schema" }
- description
- Record a model training run — log parameters, metrics, and artifact paths, then append a structured row to the experiments ledger. Use when a training run completes, when asked to "log this experiment", or when comparing runs to decide which model to promote.
02 资源文件 1
- 脚本scripts/log-experiment.sh2.5 KB
03 SKILL.md 正文
Experiment Log
Record a training run's parameters, metrics, and artifact paths in the experiments ledger.
Inputs
- Experiment name (e.g.,
churn-v3-lgbm) - Run ID (auto-generated if omitted:
{name}-{YYYYMMDD-HHmmss}) - Parameters (key-value pairs, e.g.,
learning_rate=0.05 n_estimators=500) - Metrics (key-value pairs, e.g.,
auc=0.83 f1=0.71 precision=0.79 recall=0.64) - Artifact path (model checkpoint, serialized pipeline, etc.)
- Notes (free-form, optional)
Steps
-
Collect run metadata
import datetime, hashlib, json, os run_id = "{name}-" + datetime.datetime.utcnow().strftime("%Y%m%d-%H%M%S") git_sha = os.popen("git rev-parse --short HEAD").read().strip() dataset_version = open("data/.version").read().strip() # semver or hash -
Capture parameters and metrics If using a training script that outputs JSON:
python train.py --config config/{name}.yaml --output-metrics /tmp/metrics.jsonOtherwise, capture values directly from the trainer object:
params = model.get_params() metrics = {"auc": roc_auc_score(y_test, y_pred), "f1": f1_score(y_test, y_pred)} -
Save artifacts
import joblib artifact_path = f"artifacts/{run_id}/model.pkl" os.makedirs(os.path.dirname(artifact_path), exist_ok=True) joblib.dump(model, artifact_path) -
Append to the experiments ledger
scripts/log-experiment.sh \ --name "{name}" \ --run-id "{run_id}" \ --params '{"learning_rate": 0.05}' \ --metrics '{"auc": 0.83, "f1": 0.71}' \ --artifact "{artifact_path}" \ --notes "{notes}"The ledger is
experiments/log.csv— a flat CSV with one row per run. -
Verify the entry
tail -n 5 experiments/log.csvConfirm: run_id is unique, metrics are numeric, artifact path exists.
-
Compare with previous runs (optional)
python scripts/compare-runs.py --metric auc --top 5 -
Promote if best (invoke
pipeline-stageskill to wire the new model into serving) Only promote after peer review of the metrics and a sanity-check on the holdout set.
Conventions
- Ledger location:
experiments/log.csv— never delete rows; mark superseded runs withstatus=superseded - Artifact naming:
artifacts/{run_id}/— one directory per run - Required fields:
run_id,experiment_name,timestamp,git_sha,auc(or primary metric),artifact_path - All metrics are floats; parameters are JSON strings
- Every run references the dataset version it trained on (
dataset_versioncolumn)
Edge Cases
- Duplicate run_id: Append a counter suffix (
-2,-3) rather than overwriting; log a warning. - Training failed mid-run: Log the entry with
status=failedand the error message innotes; don't leave the ledger entry absent. - Very large artifact: Store only the path; add a
artifact_size_mbcolumn for reference. - Remote artifact store (S3/GCS): Use the full URI as
artifact_path; the log script accepts both local paths and URIs.
04 同仓库更多 Skills
skillforge
Create or update a reusable agent skill. Use when you notice a repeated pattern, when a workflow should be persisted for future sessions, or when asked to forge/create/scaffold a new skill.
skillforge
Create or update a reusable agent skill. Use when you notice a repeated pattern, when a workflow should be persisted for future sessions, or when asked to forge/create/scaffold a new skill.
deploy-preview
Deploy a preview branch to the staging environment for review. Use when a feature branch is ready for visual review, when someone asks to "deploy this for review", or before opening a PR.
component-scaffold
Create a new React component with co-located test, story, and styles. Use when creating new UI components, when asked to scaffold/generate a component, or when building new pages.
bug-triage
Triage a bug report into an actionable GitHub issue with severity, reproduction steps, and assignment. Use when a bug is reported, when error logs need investigation, or when asked to file/triage an issue.
api-endpoint
Scaffold a REST API endpoint with route, controller, validation, and tests. Use when creating new API endpoints, adding resources, or when asked to build a new backend route.