refactor-terraform

Generate a prioritized refactoring roadmap for Terraform/OpenTofu IaC.

1|Updated Aug 16, 2025
One-click install
npx skills add https://github.com/ReefBytes-Owner/Manifest --skill refactor-terraform-reefbytes-owner
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor-terraform
Source: https://github.com/ReefBytes-Owner/Manifest/tree/main/configs/claude/skills/refactor-terraform
Command: npx skills add https://github.com/ReefBytes-Owner/Manifest --skill refactor-terraform-reefbytes-owner

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Identify and resolve security, modularity, and quality issues in Terraform/OpenTofu IaC, producing a prioritized, actionable refactoring roadmap.

Core Features & Use Cases

  • Security-focused analysis against tfsec, checkov, and Sentinel patterns
  • Modularity and DRY improvements by auditing module composition and state handling
  • End-to-end refactoring roadmap with risk and effort scoring, ready for implementation
  • Drift detection and plan validation to minimize blast radius in migrations

Quick Start

Run the recommended analysis workflow to generate your refactoring roadmap for Terraform/OpenTofu codebases.

Frequently Asked Questions about refactor-terraform

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify and fix security issues in my Terraform IaC configurations?

Terraform security issues are identified by analyzing root and module configurations against tfsec, checkov, and Sentinel patterns, producing a prioritized refactoring roadmap with risk and effort scoring for clear remediation.

How do I create a refactoring roadmap for Terraform module composition and state handling?

Generating a Terraform refactoring roadmap involves auditing module composition, backend state handling, and workspace usage to improve modularity and DRY principles, yielding an executable improvement plan across multi-repo setups.

What is the best way to detect and plan around configuration drift in OpenTofu codebases?

Handling OpenTofu configuration drift requires drift detection and plan validation to minimize blast radius during migrations, providing a scored roadmap for safely resolving state discrepancies.

Can I use this to analyze Terraform provider versions and workspace usage across multiple repositories?

Yes, analyzing Terraform provider versions and workspace usage across multi-repo setups is supported, scoping root and module configurations to resolve quality and modularity issues end-to-end.

Does this refactoring approach work with both Terraform and OpenTofu infrastructure code?

Yes, this refactoring approach works with both Terraform and OpenTofu infrastructure code, auditing backend state handling and module configurations to generate a unified, actionable improvement plan for either IaC tool.

What are the limitations when refactoring large Terraform codebases with existing state drift?

A key limitation when refactoring Terraform codebases with state drift is the blast radius during state migrations, requiring careful plan validation and risk scoring to prevent unintended infrastructure changes.