gsd-loop-engineering skill
Applies a five-phase loop-engineering methodology to manage complex machine learning and data science pipelines through structured planning and verification.
- GitHub stars
- 5
- Files
- 1
- Last commit
- Oct 13, 2026
- License
- MIT
- Allowed tools
- —
What does the gsd-loop-engineering skill do?
gsd-loop-engineering applies a five-phase loop-engineering methodology to manage complex machine learning and data science pipelines through structured planning and verification.
Summary generated from the skill's SKILL.md.
About the gsd-loop-engineering skill
Managing complex machine learning pipelines through structured planning and adversarial verification is what this skill enables for data scientists and ML engineers. It implements a five-phase loop-engineering methodology to prevent context rot and quality drift during long agentic sessions. By breaking workflows into distinct stages—discuss, plan, execute, verify, and ship—it ensures that every step of a pipeline, from feature engineering to model submission, is documented and validated.
Users employ this skill when working on end-to-end Kaggle competitions or multi-stage pipelines where maintaining focus is difficult. The methodology relies on fresh-context subagents to handle heavy computational tasks, preventing the main session from becoming cluttered. It produces structured artifacts such as .planning/phase files, research documents, and verification reports. This approach differentiates itself by using a goal-backward verification stance, where the system assumes a task is not complete until concrete evidence proves it meets all requirements.
What an agent can do with it
- 1Execute Kaggle competition pipelinesA developer can use this to manage the entire lifecycle of a competition from metric identification to final submission.
- 2Prevent context degradation in long sessionsWhen an AI session exceeds fifty turns and quality begins to drop, this skill helps maintain focus.
- 3Perform adversarial verification of ML outputsYou can use the verification phase to catch errors like incorrect submission formats or distribution shifts before they are submitted.
- 4Run heavy tasks with fresh contextDevelopers can offload intensive research or training tasks to subagents to keep the primary orchestrator clean.
Written from the skill's SKILL.md. Every use case is checked against a quote from it.
How to install the gsd-loop-engineering skill
Each command copies the skill folder into the client's skills directory. Restart the client or start a new session to load it.Install the gsd-loop-engineering skill in Claude Code
~/.claude/skills/gsd-loop-engineering/SKILL.md
$ npx degit topprismdata/cultivating-ml-agent/skills/examples/gsd-loop-engineering ~/.claude/skills/gsd-loop-engineeringInstall the gsd-loop-engineering skill in Claude Code (project)
.claude/skills/gsd-loop-engineering/SKILL.md
$ npx degit topprismdata/cultivating-ml-agent/skills/examples/gsd-loop-engineering .claude/skills/gsd-loop-engineeringInstall the gsd-loop-engineering skill in Codex
~/.agents/skills/gsd-loop-engineering/SKILL.md
$ npx degit topprismdata/cultivating-ml-agent/skills/examples/gsd-loop-engineering ~/.agents/skills/gsd-loop-engineeringInstall the gsd-loop-engineering skill in Gemini CLI
~/.gemini/skills/gsd-loop-engineering/SKILL.md
$ npx degit topprismdata/cultivating-ml-agent/skills/examples/gsd-loop-engineering ~/.gemini/skills/gsd-loop-engineeringInstall the gsd-loop-engineering skill in Claude.ai
npx degit topprismdata/cultivating-ml-agent/skills/examples/gsd-loop-engineering gsd-loop-engineering && zip -r gsd-loop-engineering.zip gsd-loop-engineering # claude.ai → Customize → Skills → + → Create skill → Upload a skill → gsd-loop-engineering.zip
SKILL.md
View on GitHubGSD Loop Engineering for ML Tasks
Problem
ML pipelines are naturally multi-stage loops:
- Plan → 2. Execute (data prep / train / generate submission) → 3. Verify (format / CV-LB gap / sanity) → 4. Fix or Ship.
Most agentic ML workflows fail because:
- Context rot: long sessions degrade model output (e.g., 0/1 submission bug in S6E2 was partly due to loss of focus)
- No verification: tasks accepted as done without adversarial checking (S6E4 submission would have been caught by a verifier)
- No shared memory: each step reinvents context from scratch
- Drift on style: best practices from start of session get forgotten by end
GSD Core (open-gsd/gsd-core) is the canonical loop-engineering framework solving exactly this. This skill adapts its patterns to ML.
Context / Trigger Conditions
Use this skill when:
- Working on a Kaggle competition end-to-end
- Designing a multi-stage ML pipeline (data → features → train → ensemble → submit)
- Session has > 50 turns and quality is degrading
- You want auditable proof each step worked (not just "looks right")
- You're tempted to use
--dangerously-skip-permissions(don't)
Don't use:
- Single-file one-off scripts
- Pure EDA with no downstream work
- Research tasks where you're just reading papers
Solution: 5-Phase ML Loop
┌────────────────────────────────────────────────────────────┐
│ Phase 1: DISCUSS (gsd-discuss-phase) │
│ - Resolve ambiguities in the task brief │
│ - Output: .planning/phases/<N>-DISCUSS.md │
├────────────────────────────────────────────────────────────┤
│ Phase 2: PLAN (gsd-plan-phase) │
│ - Research + plan, but in fresh-context subagent │
│ - Plans declare wave dependencies (DAG) │
│ - Output: .planning/phases/<N>/RESEARCH.md + PLAN-<M>.md │
├────────────────────────────────────────────────────────────┤
│ Phase 3: EXECUTE (gsd-execute-phase) │
│ - Run plans in waves (parallel where independent) │
│ - Each plan is a fresh-context subagent │
│ - Output: artifacts (models, submissions, logs) │
├────────────────────────────────────────────────────────────┤
│ Phase 4: VERIFY (gsd-verify) │
│ - Adversarial check: assume goal NOT achieved │
│ - Findings classified BLOCKER / WARNING / VERIFIED │
│ - Output: .planning/phases/<N>/VERIFICATION.md │
├────────────────────────────────────────────────────────────┤
│ Phase 5: SHIP or FIX │
│ - VERIFIED → ship submission, archive artefacts │
│ - BLOCKER → generate fix plan, re-enter Phase 2 │
│ - WARNING → decide case-by-case │
└────────────────────────────────────────────────────────────┘
Adapted to Kaggle Competitions
| GSD Phase | ML Equivalent |
|---|---|
| DISCUSS | Identify metric (AUC / RMSLE / mAP), submission format, deadline, data quirks |
| PLAN | Plan features, baseline model, ensemble strategy, verification checks |
| EXECUTE | Run feature engineering, AutoGluon baseline, blend, generate submission |
| VERIFY | Submission format check, CV-LB gap sanity, distribution check, adversarial validation |
| SHIP | Submit to Kaggle LB; archive all artefacts |
Concrete: GSD-Driven S6E2 Re-Run (validated pattern)
This is the pattern that produced Private LB 0.95510 in 15 minutes:
Phase 1: DISCUSS
- Metric: AUC (roc_auc) — binary classification
- Data: 630K train, 270K test, 14 features, label "Heart Disease"
- Submission: 1 proba column (PitNextLap or class 1) — CRITICAL
- Time budget: 15 min training
Output: .planning/01-discuss.md
Phase 2: PLAN
- Plan A: AutoGluon best_quality with time_limit=900s
- Plan B: Verify submission format matches sample_submission.csv
- Plan C: Probability file only, never thresholded
Output: .planning/02-plans/{A,B,C}.md
Phase 3: EXECUTE
- Wave 1: Plan A (training, 15 min) and Plan B (parallel — read sample)
- Wave 2: Plan C (re-generate submission using predict_proba)
Output: ag_models/, submission_autogluon_proba.csv
Phase 4: VERIFY (the moment of truth)
- Check 1: submission columns = sample columns? PASS
- Check 2: submission values in [0, 1]? PASS
- Check 3: OOF AUC > 0.95? PASS (0.95554)
- Check 4: CV-LB gap < 0.01? PASS (gap = 0.002 after probability fix)
Output: .planning/04-verify.md (all VERIFIED)
Phase 5: SHIP
- kaggle competitions submit ...
- Archive: ag_models/, leaderboard.csv, summary.json
Key GSD Patterns Applied to ML
Pattern 1: Fresh-Context Subagents
- Main session: thin orchestrator + state reads
- Subagents (one per heavy task): 200k clean context each
- Shared substrate: disk files (
.planning/,ag_models/,submission_*.csv)
Pattern 2: Goal-Backward Verification
- Default stance: assume goal NOT achieved until codebase evidence proves it
- For ML: assume submission is wrong until checks pass
- Checks must be concrete (file exists, value in range, format matches)
Pattern 3: Wave-Based DAG Execution
- Plans declare
depends_on: ["plan-A"] - Independent plans run in parallel (no human bottleneck)
- For ML: feature engineering can run while baseline is training
Pattern 4: Escalation Gate
- If verifier finds BLOCKER, stop and surface to user
- Don't silently guess — better to ask than submit a broken file
Pattern 5: Spec-Driven Artefacts
- Every phase produces structured artefacts on disk
- For ML: every step produces a CSV / model file / log
- State survives session boundaries
Anti-Patterns to Avoid
| Don't | Do |
|---|---|
| Submit without format check | Always run Plan B (verify format) before submit |
| Trust CV score as final metric | Always run Plan C (probability file) for AUC |
| Skip verification on "obvious" tasks | The 0/1 submission bug shows even simple tasks fail verification |
| Run all plans sequentially | Independent plans (data download + sample check) can run in parallel |
| Keep heavy research in main session | Spawn fresh-context subagent for data exploration |
| Train 10 models to "find the best" | Train 3-5 diverse models, ensemble is usually enough |
Implementation Status
This skill describes the GSD-driven ML pattern. To actually use GSD:
# Install (run once)
git clone https://github.com/open-gsd/gsd-core ~/projects/gsd-core
cd ~/projects/gsd-core
npm install
node bin/install.js
# Use in any project
cd ~/projects/kaggle-ps-s6e4
claude
# Inside Claude Code:
# /gsd-new-project → bootstrap .planning/
# /gsd-discuss-phase → Phase 1
# /gsd-plan-phase → Phase 2
# /gsd-execute-phase → Phase 3
# /gsd-verify → Phase 4 (THIS IS WHERE YOU CATCH THE 0/1 BUG)
# /gsd-ship → Phase 5
Real-World Validation
| Project | Without GSD | With GSD-style Verification |
|---|---|---|
| S6E2 first attempt | 0/1 submission, LB 0.884 | Caught by verification, fixed to LB 0.95357 |
| S6E4 R13 | Stacking + threshold bundled, LB worse | Controlled variable: stacking OK, threshold bad |
| Store Sales v2 | sales=0 fill, LB 2.83 (worse than v1) | mean_ratio=0.11 diagnostic, ffill fix, LB 1.90 |
The S6E2 case is the canonical example: same model, two submissions, 0.07 LB difference — verification caught it.
Related Skills
kaggle-submission-format-by-metric— format check is verification step #1autogluon-first— the "execute" phase standard recipecv-lb-gap-acknowledgment— verification step #4 (gap check)ml-sweet-spot— when to STOP iterating (loop termination condition)three-layer-wisdom-extraction— how to extract lessons from verification findings
References
- GSD Core: https://github.com/open-gsd/gsd-core (canonical)
- Original: https://github.com/gsd-build/get-shit-done (64K stars, deprecated)
- Related repos: gsd-browser, context-packet, agent-inbox (gsd-build org)
- S6E2 verification pattern: see
docs/ml-agent-memory/lessons/s6e2_submission_format.md
Files in this skill
1gsd-loop-engineering skill questions
How do I install the gsd-loop-engineering skill in Claude Code?
Run npx degit topprismdata/cultivating-ml-agent/skills/examples/gsd-loop-engineering ~/.claude/skills/gsd-loop-engineering. Claude Code loads skills from ~/.claude/skills (all projects) or .claude/skills (one project) and uses a skill when its description matches the task.
Which clients can use the gsd-loop-engineering skill?
Any client that reads the Agent Skills format: Claude Code, Codex, Gemini CLI and claude.ai (upload as a ZIP). Scripts in the skill run only where the client allows code execution.
When should I use the GSD loop-engineering skill?
Use it for multi-step ML pipelines, when session context is becoming too long and quality is drifting, or when you require auditable verification at each stage.