- What's a YAML anchor?
- `&name` marks a node; `*name` references it. Anchors reduce duplication (common base config reused in multiple environments). Expansion replaces every `*name` with the content it referred to.
- Why would I expand anchors?
- To produce a flat, self-contained YAML — useful when passing to a tool that doesn't resolve anchors, or for auditing what a deep ref actually pulls in.
- Does it preserve comments?
- Comments at the anchor source are copied to each expansion site. Inline comments stay with their original positions.
- Is the expansion reversible?
- Not automatically — once expanded, you lose the dedup. Keep the anchored source as your source of truth and expand as a build artifact.