Agent skill · HashiCorp
Terraform Test skill for Claude Code, Codex and Cursor
Officialname: terraform-test★ 907 (repo)pushed 2026-10-05MPL-2.0SKILL.md on GitHubchecked 2026-11-07
What it does, in the publisher's words
Comprehensive guide for writing and running Terraform tests. Use when creating test files (.tftest.hcl), writing test scenarios with run blocks, validating infrastructure behavior with assertions, mocking providers and data sources, testing module outputs and resource configurations, or troubleshooting Terraform test syntax and execution.
The description field of the SKILL.md. The agent reads only this at startup and decides from it when to load the full skill.
Install Terraform Test
The skills CLI copies the skill into the folder of each agent you pick (Claude Code, Codex, Cursor, Copilot, Gemini CLI, OpenCode, Windsurf...). Add -g for all projects. Needs Node.js 22.20+. docs
npx skills add hashicorp/agent-skills --skill terraform-test
This repo is a plugin marketplace. Inside Claude Code, add it and install the plugin that holds the skill (terraform, packer), or copy only this skill into ~/.claude/skills. docs
/plugin marketplace add hashicorp/agent-skills /plugin install <plugin>@hashicorp # or only this skill: npx skills add hashicorp/agent-skills --skill terraform-test -a claude-code
Download the skill folder, zip it, then Customize > Skills > + > Create skill > Upload a skill. Code execution must be on (Settings > Capabilities). docs
git clone --depth 1 https://github.com/hashicorp/agent-skills.git /tmp/terraform-test-src cp -r /tmp/terraform-test-src/plugins/terraform/skills/terraform-test ./terraform-test zip -r terraform-test.zip terraform-test
Codex reads skills from .agents/skills in the repo or ~/.agents/skills. Type $ in Codex to use one. docs
npx skills add hashicorp/agent-skills --skill terraform-test -a codex
gh skill (GitHub CLI 2.90+, preview) installs it for Copilot in VS Code, the CLI and the cloud agent. Copilot also reads .github/skills and ~/.copilot/skills. docs
gh skill install hashicorp/agent-skills terraform-test
Cursor reads .cursor/skills, .agents/skills and ~/.cursor/skills (and .claude/skills). It does not install loose skills from a GitHub URL, so copy it in. docs
npx skills add hashicorp/agent-skills --skill terraform-test -a cursor
Installs from the GitHub repo; --path picks this skill out of the repo. Default scope is user (all projects). docs
gemini skills install https://github.com/hashicorp/agent-skills.git --path plugins/terraform/skills/terraform-test
OpenCode reads .opencode/skills, ~/.config/opencode/skills and the Claude and .agents folders. docs
npx skills add hashicorp/agent-skills --skill terraform-test -a opencode
Windsurf (now Devin Desktop) reads .devin/skills, .windsurf/skills and ~/.codeium/windsurf/skills. docs
npx skills add hashicorp/agent-skills --skill terraform-test -a windsurf
Works with
Claude Code, Claude.ai and Claude Desktop, Codex, GitHub Copilot, Cursor, Gemini CLI, OpenCode, Windsurf and other agents that read the open Agent Skills format.
What's in the SKILL.md
- Reference Files
- Core Concepts
- File Structure
- Test File Structure
- Run Block
- Common Test Patterns
- Validate outputs
- Conditional resources
- Resource counts
- Tags
- Data sources
- Validation rules
- Sequential tests with dependencies
- Plan options (refresh-only, targeted)
- Parallel modules
- State key sharing
- Cleanup ordering (S3 objects before bucket)
- Multiple aliased providers
- Complex conditions
- Cleanup
- Running Tests
- Best Practices
- Troubleshooting
- References
Bundled files
- references/CI_CD.md
- references/EXAMPLES.md
- references/MOCK_PROVIDERS.md
Loaded only when the instructions point to them.
Facts
- Skill name
- terraform-test
- Publisher
- HashiCorp (official)
- Repo
- hashicorp/agent-skills
- License
- MPL-2.0
- Version
- 0.0.2
- SKILL.md size
- 528 words, 443 lines
- Bundled files
- 3, 3 docs
- Repo stars
- 907 (as of 2026-10-24)
- SKILL.md checked
- 2026-11-07
Pairs with the Terraform MCP server: the server gives the agent the tools, the skill teaches it how to use them.
More skills from hashicorp/agent-skills
- New Terraform Provider: Scaffolds a new Terraform provider on the Plugin Framework with module and schema setup.
- Terraform Style Guide: Writes and reviews Terraform HCL following HashiCorp's official style conventions.
Related cloud & devops skills
- Deploy to Vercel · Vercel
- GitHub: Fix CI · OpenAI
- gcloud CLI · Google
- Cloudflare Platform · Cloudflare
- Next.js on Cloudflare · Cloudflare
- Workers Best Practices · Cloudflare
- Wrangler CLI · Cloudflare
- Azure Deploy · Microsoft (Azure)
FAQ
What does the terraform-test skill do?+
Writes and runs .tftest.hcl tests with run blocks, assertions and mocked providers. In its own SKILL.md, HashiCorp describes it as: "Comprehensive guide for writing and running Terraform tests. Use when creating test files (.tftest.hcl), writing test scenarios with run blocks, validating infrastructure behavior with assertions, mocking providers and data sources, testing module outputs and resource configurations, or..."
How do I install the terraform-test skill?+
Run npx skills add hashicorp/agent-skills --skill terraform-test and pick your agents, or use the tab for your agent above. In Claude Code the skill ends up in ~/.claude/skills/terraform-test/SKILL.md; in Codex and Cursor in .agents/skills/terraform-test/.
Does Terraform Test work in Codex, Cursor and Copilot, or only Claude?+
It's a standard SKILL.md, so any agent that reads the Agent Skills format can use it: Claude Code, the Claude apps, Codex, GitHub Copilot, Cursor, Gemini CLI, OpenCode, Windsurf and more.
Who maintains Terraform Test?+
HashiCorp, the company or project behind it, in the hashicorp/agent-skills repo on GitHub, last pushed 2026-10-05. License: MPL-2.0.
Read a skill's SKILL.md and scripts before you install it: skills aren't verified by any agent vendor. Claude skills marketplace · How to install skills · MCP servers