loss-backprop-lenslisted
Install: claude install-skill CorvinLabs/CorvinOS
# Loss-Backprop-Lens
## Overview
Working on a codebase is **gradient descent on code**. A test / CI run / E2E is a **forward pass**. The difference between expected and actual is the **loss**. Every edit is a **step** toward lower loss. This is not a metaphor — it dictates which edits are admissible and which are noise injected into your parameters.
**Core principle:** A fix that reduces training loss (the current failing test) but raises generalization loss (future unseen inputs or sibling tests) is **overfitting** and is rejected, regardless of whether CI turns green.
This skill is a *mental frame*, not a rigid procedure. Apply it when one of the triggers below fires; combine with `root-cause-by-layer` for the mechanics of diagnosis.
## When to Use
- You have **one failing signal** and are tempted to ship a fix
- You've made **3+ small patches to the same area** in a short window
- A test is **flaky** and you want to retry / widen / skip
- A fix **works for this test** but you aren't sure about siblings
- You're deciding between a **local tweak** and a **structural change**
Do **not** use for: greenfield feature work, pure refactors with no failing signal, single-concept bug fixes where the contract is obvious.
## The Mapping
| ML concept | Code equivalent |
|---|---|
| Forward pass | Running the test / job / E2E |
| **Loss** | Difference between expected and actual output |
| Backprop | Tracing symptom → structural origin (use `root-cause-by-layer`) |
| Parameters