agentleFS
kaiohenricunhakaiohenricunha/dotbabel/skills/terragrunt-specialist/SKILL.md

terragrunt-specialist

Skill0 starsChanged 2 months agoMITView on GitHub

Deep-dive Terragrunt hierarchy review, DRY pattern audits, and run-all orchestration analysis. Use for structured investigations of multi-environment Terragrunt layouts, dependency graphs, remote state config, and hook correctness. Triggers on: "Terragrunt audit", "run-all review", "dependency block", "DRY pattern review", "env hierarchy audit", "mock_outputs", "terragrunt hooks".

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    After fixes are applied:

    line 121
  2. Distinctive:

    Verify no two leaves share the same remote state key.

    line 125
  3. Very specific:

    If mock_outputs changed, confirm plan --terragrunt-non-interactive succeeds on dependent modules.

    line 126
  4. Distinctive:

    Run hooks manually to confirm they execute in the expected phase.

    line 127

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Terragrunt Specialist

Structured investigation for Terragrunt-managed Terraform codebases. Five phases: gather context, diagnose, design, recommend, verify.

Arguments

  • $0 — repo root, specific terragrunt.hcl path, or problem description. Required.

Phase 1: Context Gathering

  1. Map the full hierarchy:
    find . -name "terragrunt.hcl" | sort
  2. Identify the root terragrunt.hcl (contains remote_state, terraform_version_constraint).
  3. Check include chain:
    grep -r "include" . --include="terragrunt.hcl" -l
    grep -r "find_in_parent_folders" . --include="terragrunt.hcl" -l
  4. List all dependency blocks:
    grep -r "dependency" . --include="terragrunt.hcl" -A5

Phase 2: Diagnosis

DRY pattern health:

# Check for duplicated locals or inputs across leaves
grep -r "locals" . --include="terragrunt.hcl" -l
grep -r "inputs\s*=" . --include="terragrunt.hcl" -l

Remote state config:

grep -r "remote_state" . --include="terragrunt.hcl" -A10

run-all safety:

terragrunt run-all plan --terragrunt-non-interactive 2>&1 | head -100

Hook correctness:

grep -r "before_hook\|after_hook\|error_hook" . --include="terragrunt.hcl" -A8

Phase 3: Design / Root-Cause Analysis

Map symptoms to causes:

SymptomCommon CausesCheck
run-all applies wrong orderMissing dependency blockDependency graph via run-all plan
mock_outputs plan failsWrong type in mock (string vs list)Compare mock type to real output type
DRY violationSame inputs block in multiple leavesExtract to parent locals + read_terragrunt_config
State collisionTwo leaves share the same backend keyGrep remote_state.config.key across leaves
Hook runs unexpectedlyHook trigger is run_if on wrong commandCheck commands list in hook block

Cite file:line for every finding.


Phase 4: Recommendations

Output findings in priority order:

[CRITICAL] <title>
File: <file:line>
Issue: <one sentence>
Evidence: <config snippet>
Fix: <specific change, with HCL diff>
Trade-off: <alternative and its downside, if meaningful>

Order: CRITICAL → WARNING → INFO.


Phase 5: Verification

After fixes are applied:

  1. terragrunt validate on affected leaves.
  2. terragrunt run-all plan --terragrunt-non-interactive — confirm correct dependency order.
  3. Verify no two leaves share the same remote state key.
  4. If mock_outputs changed, confirm plan --terragrunt-non-interactive succeeds on dependent modules.
  5. Run hooks manually to confirm they execute in the expected phase.

Reference Docs

FileWhen to use
dry-patterns.mdinclude, read_terragrunt_config, locals reuse
run-all.mdrun-all orchestration, dependency graph, scoping
env-hierarchy.mdAccount → region → env → module layout patterns
hooks.mdbefore_hook, after_hook, error_hook design
dependency-blocks.mdExplicit deps, mock_outputs, cross-stack references

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.