td-network-cleanup
Installation
SKILL.md
Cleanup
Organize operator networks into clean, readable layouts. Only moves, resizes, colors, and annotates — never creates functional operators or changes parameters.
Process
- Load
td-node-layoutskill — required for spacing, padding formulas, and containment checks. Do not skip this step - Survey —
list_operators(path, depth=2)for positions, sizes, overlaps, and existing annotations. Useget_connections(path, graph=true)for full signal flow topology in execution order - Delete old annotations — destroy any existing
annotateCOMPops before reorganizing - Plan layout — identify functional groups, chains, parallel branches. Independent groups go side-by-side when they have similar vertical extent (saves space vs stacking). Use actual
nodeWidth/nodeHeightto compute bounding boxes. Replace long cross-network wires with selectCHOPchopparameter references — especially for merge inputs and fan-out patterns - Apply layout — use
reposition_operatorsto batch-move operators (see Positioning below) - Check vertical spacing — ensure enough Y gap between groups for annotation headers (60px top padding) + 20px gap between annotations. If groups are too close, move ops down before annotating
- Compute annotation bounds — for each group, find min/max X/Y from actual operator positions + sizes, then add padding (25px sides/bottom, 60px top). Don't guess dimensions — calculate them
- Add annotations —
annotation(parent_path=..., comment=...)around every functional group. All groups get annotated, not just complex ones - Verify containment — for each annotation, confirm all ops in the group satisfy:
op.nodeY >= ann.nodeY + 25(bottom padding) andop.nodeY + op.nodeHeight <= ann.nodeY + ann.nodeHeight - 60(60px top padding = 25px content gap + ~35px header). If any op fails, fix the annotation or move the op - Verify no annotation overlaps — check that no two annotations share any area. For each pair:
ann1.nodeY + ann1.nodeHeight + 20 <= ann2.nodeY(vertically stacked) orann1.nodeX + ann1.nodeWidth + 20 <= ann2.nodeX(side by side). Fix before proceeding - Apply colors — only for special patterns (see Operator Colors below). Do not color by family
- Final verify —
list_operatorsone more time. Check for: ops overlapping annotation headers, excessive margins, misaligned annotations, backward wires. Fix anything found. Repeat until clean