This tackles the refactoring work that makes Terraform configs actually maintainable. It guides you through breaking monolithic configurations into proper modules with clear variable contracts, moving from repetitive subnet declarations to for_each patterns, and handling the state migration so nothing breaks in production. The skill includes moved blocks for Terraform 1.1+ or generates manual state mv commands for older versions. What I like here is the focus on encapsulation decisions, like explicitly calling out what belongs in a module versus what to keep separate based on lifecycle and coupling. If you've got a main.tf that's grown into hundreds of lines of copy-pasted resource blocks, this gives you a structured path to module-ize it without losing your existing infrastructure state.
npx skills add https://github.com/hashicorp/agent-skills --skill refactor-module