EliasOulkadi/shokunin / .pack/skills/terraform
terraform
UnverifiedDesign and manage infrastructure as code with Terraform — modules, remote state (S3 + DynamoDB), Stacks (deployments), test framework, preconditions/postconditions, moved/removed blocks, and CI/CD plan/apply separation. Use when user asks to write Terraform config, set up remote state, design modules, manage state, or automate infrastructure. Do NOT use for Kubernetes (use kubernetes), Docker (use docker), or CI/CD pipeline design (use ci-cd).
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 13.4 KB |
| assets/module-template/main.tf | other | 2.6 KB |
| assets/module-template/outputs.tf | other | 1.1 KB |
| assets/module-template/variables.tf | other | 2.7 KB |
| references/migration-patterns.md | markdown | 7.8 KB |
| references/stacks.md | markdown | 5.2 KB |
| scripts/plan-env.sh | script | 2.1 KB |
| scripts/validate-all.sh | script | 2.2 KB |
scripts/validate-all.sh
View on GitHub#!/usr/bin/env bash
set -euo pipefail
# validate-all.sh
# Runs terraform fmt -check, terraform validate, and tflint
# across every directory containing Terraform files.
#
# Usage:
# ./scripts/validate-all.sh # validate all directories
# ./scripts/validate-all.sh ./envs # validate under a specific path
# SKIP_TFLINT=1 ./scripts/validate-all.sh
ROOT="${1:-.}"
SKIP_TFLINT="${SKIP_TFLINT:-0}"
# Find directories with at least one *.tf file (excluding .terraform)
mapfile -t dirs < <(find "$ROOT" -type d -name '.terraform' -prune -o -type f -name '*.tf' -print | sed 's|/[^/]*$||' | sort -u)
if [[ ${#dirs[@]} -eq 0 ]]; then
echo "No Terraform directories found under $ROOT"
exit 0
fi
fmt_errors=0
validate_errors=0
tflint_errors=0
declare -a failed_dirs
for dir in "${dirs[@]}"; do
pushd "$dir" > /dev/null
if [[ ! -f .terraform.lock.hcl ]]; then
echo " -> Skipping $dir (not initialized)"
popd > /dev/null
continue
fi
echo "==> $dir"
# terraform fmt -check
if ! terraform fmt -check -recursive -diff > /tmp/tf_fmt.log 2>&1; then
((fmt_errors++))
failed_dirs+=("$dir")
if [[ -s /tmp/tf_fmt.log ]]; then
sed 's/^/ /' /tmp/tf_fmt.log
fi
fi
# terraform validate
if ! terraform validate > /tmp/tf_validate.log 2>&1; then
((validate_errors++))
failed_dirs+=("$dir")
if [[ -s /tmp/tf_validate.log ]]; then
sed 's/^/ /' /tmp/tf_validate.log
fi
fi
# tflint
if [[ "$SKIP_TFLINT" -eq 0 ]] && command -v tflint &> /dev/null; then
if ! tflint > /tmp/tf_tflint.log 2>&1; then
((tflint_errors++))
failed_dirs+=("$dir")
if [[ -s /tmp/tf_tflint.log ]]; then
sed 's/^/ /' /tmp/tf_tflint.log
fi
fi
fi
popd > /dev/null
done
echo ""
echo "========================"
echo "Summary"
echo "========================"
echo "Directories checked: ${#dirs[@]}"
echo "Format errors: $fmt_errors"
echo "Validate errors: $validate_errors"
echo "TFLint errors: $tflint_errors"
unique_fails=($(printf "%s\n" "${failed_dirs[@]}" | sort -u))
if [[ ${#unique_fails[@]} -gt 0 ]]; then
echo "Failed directories:"
for d in "${unique_fails[@]}"; do
echo " - $d"
done
fi
if [[ ${#unique_fails[@]} -gt 0 ]]; then
exit 1
fi
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |