Terraform IaC handler - centralized Terraform operations including init, validate, plan, apply, and destroy. Provides standard interface for Terraform-specific logic used by all infrastructure skills. Handles Terraform initialization, backend configuration, variable files, and execution plan management.
Centralizes all Terraform operations (init, validate, plan, apply, destroy) with environment-specific configuration and state management. Use this handler when infrastructure skills need to execute Terraform commands, as it automatically manages backend initialization, variable files, and provides standardized error handling for state locks and validation failures.
/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.
<CRITICAL_RULES> IMPORTANT: Environment-Specific Operations
IMPORTANT: State Management
LOAD CONFIGURATION:
# Source configuration loader
source "$(dirname "${BASH_SOURCE[0]}")/../devops-common/scripts/config-loader.sh"
# Load configuration for environment
load_config "${environment}"
# Set Terraform directory
cd "${TF_DIRECTORY}" || exit 1
EXECUTE OPERATION: Route to appropriate operation handler:
OUTPUT COMPLETION MESSAGE:
✅ TERRAFORM COMPLETE: {operation}
{Summary of results}
───────────────────────────────────────
IF FAILURE:
❌ TERRAFORM FAILED: {operation}
Error: {error message}
Resolution: {suggested fix}
───────────────────────────────────────
</WORKFLOW>
<OPERATIONS>
<INIT>
**Purpose:** Initialize Terraform working directory with backend and providers
Workflow:
Usage:
operation="init"
environment="test"
Output:
Workflow:
Usage:
operation="validate"
environment="test"
Output:
Workflow:
Usage:
operation="plan"
environment="test"
Output:
Workflow:
Usage:
operation="apply"
environment="test"
auto_approve="false" # true only for test with explicit flag
Output:
Workflow:
Usage:
operation="destroy"
environment="test"
confirm="yes" # Must be explicitly provided
Output:
<COMPLETION_CRITERIA> This skill is complete and successful when ALL verified:
✅ 1. Operation Execution
✅ 2. State Consistency
✅ 3. Response Format
FAILURE CONDITIONS - Stop and report if: ❌ Terraform not installed (action: return error with installation instructions) ❌ Terraform directory not found (action: return error with correct path) ❌ State locked by another operation (action: return error, wait for unlock) ❌ Validation errors (action: return validation errors) ❌ Apply/destroy errors (action: return error with Terraform output)
PARTIAL COMPLETION - Not acceptable: ⚠️ Apply started but not finished → Wait for completion or error ⚠️ State lock held after operation → Release lock before returning </COMPLETION_CRITERIA>
<OUTPUTS> After successful completion, return to calling skill:Standard Response Format:
{
"status": "success|failure",
"operation": "init|validate|plan|apply|destroy",
"environment": "test|prod",
"summary": {
"add": 5,
"change": 2,
"destroy": 0
},
"resources": [
{
"type": "aws_s3_bucket",
"name": "uploads",
"arn": "arn:aws:s3:::bucket-name"
}
],
"duration": "45s",
"message": "Operation description",
"error": "Error message if failed"
}
Return to caller: JSON response string </OUTPUTS>
<ERROR_HANDLING>
<TERRAFORM_NOT_INSTALLED> Pattern: Command 'terraform' not found Action:
<STATE_LOCKED> Pattern: "Error acquiring the state lock" Action:
<VALIDATION_ERROR> Pattern: Terraform validate returns errors Action:
<APPLY_ERROR> Pattern: Terraform apply fails Action:
</ERROR_HANDLING>
<EXAMPLES> <example> Operation: init Input: environment="test" Process: 1. Load config for test environment 2. cd to TF_DIRECTORY 3. Run: terraform init -backend-config="bucket=${TF_BACKEND_BUCKET}" 4. Verify success 5. Return status Output: {"status": "success", "operation": "init", "message": "Terraform initialized"} </example> <example> Operation: plan Input: environment="test" Process: 1. Load config for test environment 2. cd to TF_DIRECTORY 3. Run: terraform plan -var-file="test.tfvars" -out="test.tfplan" 4. Parse plan output: "Plan: 5 to add, 2 to change, 0 to destroy" 5. Return plan summary Output: { "status": "success", "operation": "plan", "summary": {"add": 5, "change": 2, "destroy": 0}, "plan_file": "test.tfplan" } </example> <example> Operation: apply Input: environment="test", auto_approve="false" Process: 1. Load config for test environment 2. cd to TF_DIRECTORY 3. Run: terraform apply "test.tfplan" 4. Parse apply output for created resources 5. Extract resource ARNs 6. Return resource information Output: { "status": "success", "operation": "apply", "summary": {"add": 5, "change": 2, "destroy": 0}, "resources": [ {"type": "aws_s3_bucket", "name": "uploads", "arn": "arn:aws:s3:::my-bucket"} ], "duration": "45s" } </example> </EXAMPLES><TERRAFORM_CLI_PATTERNS> Common Terraform commands used:
# Initialize with backend config
terraform init \
-backend-config="bucket=${TF_BACKEND_BUCKET}" \
-backend-config="key=${TF_BACKEND_KEY}" \
-backend-config="region=${AWS_REGION}"
# Validate configuration
terraform validate
# Generate plan
terraform plan \
-var-file="${environment}.tfvars" \
-out="${environment}.tfplan"
# Apply changes
terraform apply "${environment}.tfplan"
# Apply with auto-approve (test only)
terraform apply \
-var-file="${environment}.tfvars" \
-auto-approve
# Destroy infrastructure
terraform destroy \
-var-file="${environment}.tfvars" \
-auto-approve
# Show current state
terraform show
# List resources
terraform state list
# Force unlock state
terraform force-unlock {lock_id}
</TERRAFORM_CLI_PATTERNS>
<VAR_FILE_PATTERN>
Variable files follow the pattern: {environment}.tfvars
Example: test.tfvars
environment = "test"
project_name = "myproject"
subsystem = "core"
aws_region = "us-east-1"
Example: prod.tfvars
environment = "prod"
project_name = "myproject"
subsystem = "core"
aws_region = "us-east-1"
</VAR_FILE_PATTERN>
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.