akin-ozer/cc-devops-skills/terragrunt-generator
Claude Code and agent skill by akin-ozer/cc-devops-skills
- community
Checking that the SKILL.md file is still in the repository.
Generate/create/scaffold Terragrunt HCL files — root.hcl, terragrunt.hcl, child modules, stacks, multi-env layouts.
Install
npx vskill@latest install akin-ozer/cc-devops-skills/terragrunt-generatorSKILL.md
Terragrunt Generator
Overview
Generate production-ready Terragrunt configurations following current best practices, naming conventions, and security standards. All generated configurations are automatically validated.
Trigger Phrases
Use this skill when the user asks for:
- A new
root.hcl,terragrunt.hcl, orterragrunt.stack.hcl - Multi-environment Terragrunt layouts (
dev/staging/prod) - Terragrunt dependency wiring (
dependencyordependenciesblocks) - Terragrunt module source setup (local, Git, Terraform Registry via
tfr:///) - Stack catalog unit generation under
catalog/units/*
Terragrunt 2025 Features Supported:
- Stacks - Infrastructure blueprints with
terragrunt.stack.hcl(GA since v0.78.0) - Feature Flags - Runtime control via
featureblocks - Exclude Blocks - Fine-grained execution control (replaces deprecated
skip) - Errors Blocks - Advanced error handling (replaces deprecated
retryable_errors) - OpenTofu Engine - Alternative IaC engine support
Root Configuration Naming
| Approach | Root File | Include Syntax | |
|---|---|---|---|
| Modern | root.hcl | find_in_parent_folders("root.hcl") | |
| Legacy | terragrunt.hcl | find_in_parent_folders() |
Include standard: Default to find_in_parent_folders("root.hcl") in all new examples and generated configs. Use find_in_parent_folders() only when explicitly targeting a legacy root file named terragrunt.hcl.
Architecture Patterns
CRITICAL: Before generating ANY configuration, you MUST determine the architecture pattern and understand its constraints.
Pattern A: Multi-Environment with Environment-Agnostic Root
Use when: Managing multiple environments (dev/staging/prod) with shared root configuration.
Key principle: root.hcl is environment-agnostic - it does NOT read environment-specific files.
Root.hcl constraints:
- ❌ CANNOT use
read_terragrunt_config(find_in_parent_folders("env.hcl"))- env.hcl doesn't exist at root level - ❌ CANNOT reference
local.environmentorlocal.aws_regionthat come from env.hcl - ✅ CAN use static values or
get_env()for runtime configuration - ✅ CAN use
${path_relative_to_include()}for state keys (this works dynamically)
Child modules read env.hcl:
Pattern B: Single Environment or Environment-Aware Root
Use when: Single environment OR all environments share the same root with environment detection.
Root.hcl can detect environment:
Pattern C: Shared Environment Variables (_env directory)
Use when: Centralizing environment variables with symlinks or direct references.
env.hcl reads from _env:
Architecture Pattern Selection Checklist (Canonical)
MANDATORY: Before writing any files, you MUST complete this checklist and OUTPUT it to the user with checkmarks filled in. This is not optional.
Output this completed checklist before generating any files:
Example completed checklist:
Quick Variable Definition Examples
Use these starter files for Pattern B and account/region-aware setups.
env.hcl
account.hcl
region.hcl
When to Use
- Creating new Terragrunt projects or configurations
- Setting up multi-environment infrastructure (dev/staging/prod)
- Implementing DRY Terraform configurations
- Managing complex infrastructure with dependencies
- Working with custom Terraform providers or modules
Core Capabilities
1. Generate Root Configuration
Create root-level root.hcl or terragrunt.hcl with remote state, provider config, and common variables.
MANDATORY: Before generating, READ the template file:```Read: assets/templates/root/terragrunt.hcl```
Template: assets/templates/root/terragrunt.hcl Patterns: references/common-patterns.md → Root Configuration Patterns
Key placeholders to replace:
[BUCKET_NAME],[AWS_REGION],[DYNAMODB_TABLE][TERRAFORM_VERSION],[PROVIDER_NAME],[PROVIDER_SOURCE],[PROVIDER_VERSION][ENVIRONMENT],[PROJECT_NAME]
Root.hcl Design Principles:
- Environment-agnostic by default - Don't assume env.hcl exists at root level
- Use static values for provider/backend region - Or use
get_env()for runtime config - State key uses `path_relative_to_include()` - This automatically includes environment path
- Provider tags can be static - Environment-specific tags go in child modules
2. Generate Child Module Configuration
Create child modules with dependencies, mock outputs, and proper includes.
MANDATORY: Before generating, READ the template file:```Read: assets/templates/child/terragrunt.hcl```
Template: assets/templates/child/terragrunt.hcl Patterns: references/common-patterns.md → Child Module Patterns
Module source options:
- Local:
"../../modules/vpc" - Git:
"git::https://github.com/org/repo.git//path?ref=v1.0.0" - Registry:
"tfr:///terraform-aws-modules/vpc/aws?version=5.1.0"
3. Generate Standalone Module
Self-contained modules without root dependency.
MANDATORY: Before generating, READ the template file:```Read: assets/templates/module/terragrunt.hcl```
Template: assets/templates/module/terragrunt.hcl
Canonical Placeholder Replacement Map
Use this map for every generated output:
| Placeholder | Meaning | Example Replacement | Notes | |
|---|---|---|---|---|
[AWS_REGION] | AWS region | us-east-1 | Canonical region placeholder in all templates | |
[ENVIRONMENT] | Environment name | dev | Keep lowercase for directory naming | |
[PROJECT_NAME] | Project/application name | payments-platform | Use the same value in tags and names | |
[BUCKET_NAME] | Remote state S3 bucket | acme-tfstate-prod | Bucket must exist before first apply | |
[DYNAMODB_TABLE] | State lock table | acme-terraform-locks | Table must exist before first apply | |
[PROVIDER_SOURCE] | Terraform provider source | hashicorp/aws | Use fully qualified source | |
[TERRAFORM_VERSION] | Required Terraform/OpenTofu version | 1.8.5 | Used in both terraform_version_constraint and required_version. Keep compatible with module constraints. |
Legacy alias normalization: If you see [REGION] in older examples, treat it as [AWS_REGION] and replace it before validation.
4. Generate Multi-Environment Infrastructure
Complete directory structures for dev/staging/prod.
MANDATORY: Before generating:1. Determine architecture pattern (see Architecture Patterns section)2. Read relevant templates for root, env, and child modules3. Verify env.hcl placement and access patterns:```Read: assets/templates/env/env.hcl```
Patterns: references/common-patterns.md → Environment-Specific Patterns
Typical structure (Pattern A - Environment-Agnostic Root):
5. Generate Terragrunt Stacks (2025)
Infrastructure blueprints using terragrunt.stack.hcl.
MANDATORY: Before generating, READ the template files:```Read: assets/templates/stack/terragrunt.stack.hclRead: assets/templates/catalog/terragrunt.hcl```
Docs: Stacks Documentation Template: assets/templates/stack/terragrunt.stack.hcl Catalog Template: assets/templates/catalog/terragrunt.hcl Patterns: references/common-patterns.md → Stacks Patterns
Stack path rule: Keep no_dot_terragrunt_stack mode consistent across dependent units. Do not mix direct-path and .terragrunt-stack generation in the same dependency chain.
Commands:
6. Generate Feature Flags (2025)
Runtime control without code changes.
Docs: Feature Flags Documentation Patterns: references/common-patterns.md → Feature Flags Patterns
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingdevops-skills-plugin/skills/terragrunt-generator/SKILL.md
Popularity
- Repository stars
- 294
- Repository forks
- 32
- 7-day trend score
- 28
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 19 Mar 2026, 7 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/akin-ozer/cc-devops-skills/terragrunt-generator)