Skip to main content
skill CX Codex

terraform-stacks — Claude Code skill: what it does, how to install

Guides AI coding assistants through HashiCorp Terraform Stacks syntax, component definitions, and multi-environment deployment configs.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add hashicorp/agent-skills --skill terraform-stacks -a claude-code
Open on GitHub

What terraform-stacks does

This skill teaches coding assistants how to write HashiCorp Stacks configurations properly. Traditional Terraform modules sit beneath Stacks, which use their own HCL files named .tfcomponent.hcl and .tfdeploy.hcl. All configurations belong at the repository root. The skill clarifies how to wire components together from Git repositories, registry sources, or local module paths.

Stack syntax brings noticeable differences from standard Terraform. Providers accept a for_each argument and hold settings inside a config block, while block headers carry aliases. Variable definitions require a strict type attribute. Setting ephemeral = true prevents credentials from landing in state files.

Workload identity via OIDC is the recommended path for cloud access. Stacks CLI features fail on engines older than Terraform 1.13.x, which makes the root .terraform-version file mandatory before testing CLI runs.

What it helps with

  • write component declarations inside .tfcomponent.hcl files
  • configure multi-region deployments with .tfdeploy.hcl
  • set up ephemeral variables for cloud identity tokens
  • reference module sources across registries and Git repositories

Example prompts for the agent

  • Create a components.tfcomponent.hcl file referencing our VPC module in a private registry
  • Show how to configure an AWS provider with for_each and assume_role_with_web_identity
  • Validate this .tfdeploy.hcl setup for staging and production deployments

How to install terraform-stacks

1Skills CLI (Vercel)

npx skills add hashicorp/agent-skills --skill terraform-stacks -a claude-code

2Manually: put the files in place

~/.claude/skills/terraform-stacks/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/terraform-stacks/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about terraform-stacks

How do I install terraform-stacks in Claude Code?

Run npx skills add hashicorp/agent-skills --skill terraform-stacks -a claude-code. The skill is placed in ~/.claude/skills/terraform-stacks/SKILL.md.

What does terraform-stacks do?

It equips AI agents with syntax rules and file patterns for HashiCorp Terraform Stacks. The assistant can generate and review .tfcomponent.hcl and .tfdeploy.hcl definitions accurately.

Which Terraform release is required for Stacks?

You need Terraform 1.13.x or newer to run the Stacks CLI plugin. Set this version in your repository root inside a .terraform-version file.

Similar skills

All skills for DevOps and infrastructure →

From the same set20

terraform-style-guide A skill that generates and validates Terraform code according to HashiCorp's official standards. Ensures consistent, secure, and readable HCL across your configurations. CX Codex +1 12,600installs terraform-test Guides an agent through Terraform test files, scenarios, assertions, and plan or apply runs. Use it when checking modules, resources, and outputs. CX Codex +1 8,800installs refactor-module This skill turns a monolithic Terraform configuration into reusable modules with clear variables and outputs. Useful when one main.tf has grown too risky to touch. CX Codex +1 6,400installs terraform-search-import Discovers untracked cloud assets and sets up Terraform configuration for bulk state imports. Helpful during infrastructure migrations and audits. CX Codex +1 4,900installs provider-resources This skill guides Terraform resource and data source work with the Plugin Framework. Use it when adding resources, handling drift, or reviewing provider code. CX Codex +1 4,100installs provider-actions Guides implementation of Terraform Actions with the Plugin Framework for operations run around resource create, update, and destroy events. CX Codex +1 3,900installs new-terraform-provider A skill that walks the agent through bootstrapping a Terraform provider on the Plugin Framework, from directory layout to a passing build. CX Codex +1 3,900installs run-acceptance-tests Runs and investigates Terraform provider acceptance tests with the TestAcc prefix. Use it for missing environment variables, failed runs, or tests that pass when they should not. CX Codex +1 3,700installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor