What problem does it solve? Optimizing Python code with Microsoft Trace requires a disciplined loop: identifying the right trainable surface, securing a deterministic feedback signal, running optimization passes, and validating candidates before write-back. This Skill provides the orchestration contract for that entire loop so code targets are improved through repeatable, test-based feedback rather than ad-hoc edits. ## Core Features & Use Cases - Trainable Surface Selection: Guides the choice between trace.node, @trace.bundle, and @trace.model so only the smallest meaningful code boundary is optimized. - Feedback Signal Discipline: Enforces deterministic, rerunnable feedback (pytest suites, benchmarks, evaluators) and treats missing signals as hard blockers. - Workspace & Write-Back Governance: Initializes .trainer-workspace/ state, requires an engineering review checkpoint, and gates write-back on test pass, import hygiene, and a decision summary. - Use Case: You want to improve scripts/optimize_support.py with Trace. The skill derives the workspace, confirms pytest as the feedback signal, marks a formatting function as a @trace.bundle(trainable=True) candidate, runs optimization, and writes back only after the suite passes. ## Quick Start Ask the agent to set up the trainer loop for your Python file, naming the repository root and the test command used as the feedback signal.