skills.vishalvoidskills/vishalvoid
Technical & DevelopmentIntermediate

refactor-module

Transform monolithic Terraform configurations into reusable modules

Developer Setup

Setup & Installation

bash
npx skills add https://github.com/hashicorp/agent-skills --skill refactor-module

Overview

What This Skill Does

Transforms monolithic Terraform configurations into reusable modules following HashiCorp's module design principles. Handles interface design, encapsulation, state migration, documentation, and test scaffolding. Works with local, private, and public module registries.

Application

When to use this Skill

Documentation

Show Skills.md file

Skill: Refactor Module

Overview

This skill guides AI agents in transforming monolithic Terraform configurations into reusable, maintainable modules following HashiCorp's module design principles and community best practices.

Capability Statement

The agent will analyze existing Terraform code and systematically refactor it into well-structured modules with:

  • Clear interface contracts (variables and outputs)
  • Proper encapsulation and abstraction
  • Versioning and documentation
  • Testing frameworks
  • Migration path for existing state

Prerequisites

  • Existing Terraform configuration to refactor
  • Understanding of resource dependencies
  • Access to current state file (for migration planning)
  • Knowledge of module registry patterns

Input Parameters

Parameter Type Required Description
source_directory string Yes Path to existing Terraform configuration
module_name string Yes Name for the new module
Lines 1 - 25 of 530

Recommendations

Explore other random skills

All skillsMy patterns