Agent skill

infra-previewer

Preview infrastructure changes - run Terraform plan to show what resources will be created, modified, or destroyed. Generate human-readable plan summaries showing resource changes before deployment.

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/devops/infra-previewer-fractary-claude-plugins

SKILL.md

Infrastructure Previewer Skill

<CRITICAL_RULES> IMPORTANT: Preview Requirements

  • ALWAYS run plan before apply
  • Show clear summary of changes (add/change/destroy)
  • Highlight destructive changes prominently
  • For production: Emphasize impact and require extra confirmation
  • Save plan file for apply to use </CRITICAL_RULES>

EXECUTE STEPS:

  1. Load configuration for environment
  2. Change to Terraform directory
  3. Execute pre-plan hooks:
    bash
    bash plugins/faber-cloud/skills/cloud-common/scripts/execute-hooks.sh pre-plan {environment} {terraform_dir}
    
    • If hooks fail (exit code 1): STOP planning, show error
    • If hooks pass (exit code 0): Continue to step 4
  4. Invoke handler-iac-terraform with operation="plan"
  5. Parse plan output
  6. Display summary: X to add, Y to change, Z to destroy
  7. Show detailed changes
  8. Save plan file
  9. Execute post-plan hooks:
    bash
    bash plugins/faber-cloud/skills/cloud-common/scripts/execute-hooks.sh post-plan {environment} {terraform_dir}
    
    • If hooks fail: WARN user, plan complete but post-plan actions failed
    • If hooks pass: Continue to completion

OUTPUT COMPLETION MESSAGE:

✅ COMPLETED: Infrastructure Previewer
Plan Summary:
  + {X} to add
  ~ {Y} to change
  - {Z} to destroy

Plan saved to: {environment}.tfplan
───────────────────────────────────────
Ready to deploy? Run: /fractary-faber-cloud:infra-manage deploy --env={environment}

<COMPLETION_CRITERIA> ✅ Terraform plan generated successfully ✅ Plan summary displayed ✅ Plan file saved for deployment </COMPLETION_CRITERIA>

Didn't find tool you were looking for?

Be as detailed as possible for better results