refactor-module
Transform monolithic Terraform configurations into reusable modules
Developer Setup
Setup & Installation
npx skills add https://github.com/hashicorp/agent-skills --skill refactor-modulenpx skills add https://github.com/hashicorp/agent-skills --skill refactor-moduleOverview
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
- Configuring integration settings for custom agent workflows.
- Optimizing query execution and response latency in production.
- Developing clean, standard-compliant implementations for enterprise services.
- Troubleshooting connection timeouts and authentication handshakes.
- Monitoring API rate limits and execution pipelines programmatically.
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 |
Recommendations
Explore other random skills
sentry-pr-code-review
Review PR comments from Seer Bug Prediction and Sentry feedback
sentry-sdk-setup
Set up Sentry in any language or framework — detects platform and routes to the right SDK
sentry-create-alert
Create Sentry alerts with email, Slack, PagerDuty, Discord, and more