Safely destroy infrastructure with state backup and verification
Safely destroys infrastructure with state backup and multi-step verification. Triggers when you request to destroy test, staging, or production environments. Production requires 3 confirmations and blocks auto-approve flags.
/plugin marketplace add fractary/claude-plugins/plugin install fractary-faber-cloud@fractaryThis skill inherits all available tools. When active, it can use any tool Claude has access to.
scripts/backup-state.shscripts/destroy.shscripts/document-teardown.shscripts/verify-removal.shYou implement a careful teardown workflow with state backup, multiple confirmations for production, and verification of complete resource removal. </CONTEXT>
<CRITICAL_RULES>
Optional:
--confirm: Skip confirmation prompts (NOT allowed for production)
</INPUTS>
Check environment is valid and determine safety level:
Source cloud-common config loader:
source plugins/faber-cloud/skills/cloud-common/scripts/config-loader.sh
load_config
Extract:
Execute backup script:
./plugins/faber-cloud/skills/infra-teardown/scripts/backup-state.sh $ENV
Creates timestamped backup:
infrastructure/backups/terraform-state-{env}-{timestamp}.tfstateIf --confirm flag NOT present:
If --confirm flag present:
IGNORE --confirm flag (reject with error if provided)
Require 3 separate confirmations:
Between confirmations, allow user to cancel at any point.
Execute pre-destroy hooks:
bash plugins/faber-cloud/skills/cloud-common/scripts/execute-hooks.sh pre-destroy {environment} {terraform_dir}
CRITICAL:
Execute destroy script:
./plugins/faber-cloud/skills/infra-teardown/scripts/destroy.sh $ENV
This script:
terraform destroy -auto-approveExecute post-destroy hooks:
bash plugins/faber-cloud/skills/cloud-common/scripts/execute-hooks.sh post-destroy {environment} {terraform_dir}
Execute verification script:
./plugins/faber-cloud/skills/infra-teardown/scripts/verify-removal.sh $ENV
This script:
Execute documentation script:
./plugins/faber-cloud/skills/infra-teardown/scripts/document-teardown.sh $ENV
Appends to deployment history (docs/infrastructure/deployments.md):
## Teardown - {env} - {timestamp}
**Destroyed by:** {user}
**Reason:** {reason or "Manual teardown"}
**Resources removed:** {count}
**Cost savings:** ${monthly_cost}/month
**State backup:** infrastructure/backups/terraform-state-{env}-{timestamp}.tfstate
### Resources Destroyed:
- {resource_type}: {resource_name}
- ...
Output summary:
✅ Infrastructure Teardown Complete
Environment: {env}
Resources destroyed: {count}
State backup: infrastructure/backups/terraform-state-{env}-{timestamp}.tfstate
Cost savings: ${monthly_cost}/month
All resources verified removed from AWS.
Deployment history updated: docs/infrastructure/deployments.md
</WORKFLOW>
<ERROR_HANDLING> State Backup Fails:
Destroy Fails (partial destruction):
Verification Finds Remaining Resources:
Production Destruction Issues:
Failure:
<COMPLETION_CRITERIA> ✅ Environment validated ✅ State backed up successfully ✅ User confirmation(s) obtained ✅ Destruction executed ✅ All resources verified removed (state empty, AWS queries return nothing) ✅ Teardown documented in deployment history ✅ Summary reported to user </COMPLETION_CRITERIA>
<PRODUCTION_SAFEGUARDS> When env=prod:
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.