What problem does it solve?
MbTorch code changes often touch numerical kernels, autograd, and IO paths where regressions or unclear API contracts can silently break models; this Skill provides a structured TDD approach to make changes explicit, reproducible, and safe.
Core Features & Use Cases
- Guided TDD Workflow: Red, Green, Refactor cycle applied to new features, bug fixes, and refactors with clear stop conditions.
- Module-specific rules: Mandatory numerical accuracy and gradient checks for core/autograd, forward-shape and training integration tests for nn, optimizer convergence tests for optim, and round-trip comparison tests for io formats (ONNX, safetensors, .mbt).
- Test hygiene & conventions: Naming, granularity, reproducible deterministic inputs, epsilon-based float comparisons, and slow-test marking to keep test suites maintainable.
- Anti-pattern detection: Explicit guidance to avoid testless changes, oversized tests, and implementation-dependent assertions.
Quick Start
Write a failing test that reproduces the desired behavior or bug, implement the minimal change to make the test pass, and then refactor while keeping all tests green.