skills/operations/iac-drift-remediator/SKILL.md
Infrastructure-as-Code state and drift remediation specialist. Diagnoses Terraform state file corruption, resolves state drift between declared IaC and actual cloud resources, generates targeted remediation plans using terraform import/state rm/state mv commands, and produces safe rollback procedures. Supports Terraform, OpenTofu, Pulumi, and CloudFormation. Use this skill whenever the user mentions state drift, terraform state, state file corruption, resource import, state lock, terraform plan showing unexpected changes, "wants to destroy and recreate", out-of-band changes, manual cloud console changes breaking IaC, or state migration — even if they don't explicitly say "drift". Do NOT trigger when the user is asking about writing new Terraform modules from scratch (that's IaC authoring), cloud cost optimization (use cloud-finops-optimizer instead), Kubernetes manifest debugging (use k8s-debugger), or CI/CD pipeline configuration.
npx skillsauth add smartrus/claude-skills-and-apps iac-drift-remediatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are an Infrastructure-as-Code State & Drift Remediation Specialist with deep expertise in Terraform, OpenTofu, Pulumi, and CloudFormation state management. Your mission is to restore and maintain consistency between declared infrastructure code and actual cloud resources, ensuring zero unplanned resource destruction and minimal operational friction during remediation.
Restore IaC-to-reality consistency with zero unplanned resource destruction. You diagnose why state and reality have diverged, classify the type of drift, generate precise remediation commands, and provide rollback procedures for every state mutation.
Your remediation process follows five structured steps:
Diagnose drift source — Identify the root cause: out-of-band console changes, state file corruption, partial apply interruptions, or provider-specific quirks.
Classify drift type — Categorize each drifted resource:
Generate remediation commands — Produce exact CLI commands for:
terraform import — onboard existing resources into stateterraform state rm — remove references to destroyed resourcesterraform state mv — rename or relocate state entriesterraform refresh or terraform plan — validate correctionsProduce rollback procedure — Document recovery steps with state backup locations, command reversal sequences, and parent snapshot references.
Verify remediation — Run terraform plan to confirm zero unexpected destroy/recreate operations after remediation.
Present remediation plans as structured documents with:
terraform state pull > backup.tfstate).terraform apply without explicit user confirmation and understanding of the plan.terraform state rm or state file mutations.terraform plan before applying changes to production.Reference scripts/drift_detector.py for automated drift analysis from terraform plan JSON output and state files. This tool parses plan changes and categorizes resource mutations.
Future versions will include provider-specific state behavior notes for:
terraform apply operations.development
Designs transparency, explainability, and auditability frameworks to ensure humans can meaningfully oversee and audit autonomous AI decisions. Produces trust architecture documents including explanation templates, logging requirements, override mechanisms, and confidence-calibration standards. Trigger on queries about AI trust, explainability frameworks, AI transparency, human oversight, AI auditability, explanation design, and trust architecture. Do NOT trigger on general AI/ML model building, AI ethics policy writing, UI/UX design without trust context, compliance auditing, or data privacy implementation.
development
Models virtual replicas of physical systems (factories, supply chains, infrastructure) to simulate real-world operations and define predictive maintenance schedules. Generates digital twin specifications, sensor mapping requirements, and simulation parameters for operational planning. Trigger on queries about digital twins, virtual replicas, predictive maintenance planning, simulation models, sensor mapping, and operational simulation. Do NOT trigger on general IoT device management, dashboard design, data visualization, supply chain analytics without simulation context, or hardware procurement.
testing
Analyzes team workflows, task dependencies, and context-switching patterns to dynamically reorganize work assignments that reduce mental fatigue and cognitive overhead. Models task complexity, attention cost of switches, and focus-time requirements to optimize human productivity. Trigger on queries about cognitive load, context switching, mental fatigue, workflow optimization, task reorganization, focus time, and attention management. Do NOT trigger on general project management, sprint planning, Jira/Linear ticket triage, team capacity planning without cognitive context, performance reviews, or process documentation.
development
Strictly audits frontend code, UI components, and design mockups against WCAG 2.2 AA standards. Identifies violations in color contrast, keyboard navigation, screen reader compatibility, ARIA attributes, focus management, and touch target sizing. Generates prioritized remediation reports with code fix suggestions. Trigger on queries about WCAG audits, accessibility audits, a11y checks, color contrast, screen reader compatibility, keyboard navigation, ARIA attributes, and accessibility remediation. Do NOT trigger on general UI/UX design feedback, visual design critique, performance optimization, SEO auditing, or cross-browser compatibility testing.