← ClaudeAtlas

simulink-layout-tidylisted

Tidy the layout of an already-built Simulink model — make it compact and readable, remove block overlaps and lines that cut through blocks, and honestly minimize line-line crossings without ever falsely promising zero. Quantifies block overlaps, line-through-block hits, line-line crossings, model extent, and graph planarity (K3,3/K5 detection) before and after arranging, then exports a screenshot for human sign-off. Use when a Simulink or .slx block diagram looks messy, cluttered, overlapping, or tangled; when asked to clean up, arrange, beautify, declutter, or improve the readability of a Simulink diagram; or after auto-building a model that needs visual polish. General-purpose across any domain (not motor-specific). Local MATLAB only. Skip for non-Simulink diagrams, pure simulation or numerical questions, or any request that changes model behavior or port connections.
calebzu/pmsm-control-claude-skills-for-matlab · ★ 5 · Web & Frontend · score 80
Install: claude install-skill calebzu/pmsm-control-claude-skills-for-matlab
# simulink-layout-tidy Make an already-built Simulink model compact, readable, and overlap-free — and report line crossings **honestly**, never promising a zero that the graph's topology forbids. ## Safety invariants (read first) In Simulink a block's `Position` and a line's `Points` are purely **cosmetic** and orthogonal to the port connections. That fact is the whole basis for this skill being safe. - **L1 contract (default, zero-risk).** This skill MUST only modify block `Position` and line `Points`. It MUST NOT add or remove blocks and MUST NOT change any port connection. *Why:* the compiled model is then byte-for-byte identical, so simulation results cannot change and **no functional re-test is needed**. - **L2 contract (opt-in, explicit only).** L2 additionally allows (a) replacing long-range / multi-consumer wires with `Goto`/`From` and (b) wrapping a functional cluster into a `Subsystem`. These are logically equivalent but **change the block set**, so after enabling L2 you MUST run one smoke simulation and confirm no `NaN`/`Inf` and unchanged behavior. See [references/l2_contract.md](references/l2_contract.md). - **NEVER hard-gate "zero line crossings."** A non-planar graph (one containing a `K3,3` or `K5` minor) cannot be drawn crossing-free on a plane (Kuratowski). Forcing zero would reject mathematically-valid models. Use the tiered gates below instead. ## Quick start (L1) ```matlab addpath('scripts'); load_system('my_model'); rpt = tidy_layout('my_model');