terraform-policy
About
The terraform-policy skill helps developers create, test, and convert Terraform Policy files. It's used for writing `.policy.hcl` and `.policytest.hcl` files, and for converting Sentinel policies to the Terraform Policy format. Use this skill when you need to author or migrate infrastructure policy code, not for general Terraform HCL or module testing.
Quick Install
Claude Code
Recommendednpx skills add hashicorp/agent-skills -a claude-code/plugin add https://github.com/hashicorp/agent-skillsgit clone https://github.com/hashicorp/agent-skills.git ~/.claude/skills/terraform-policyCopy and paste this command in Claude Code to install this skill
Documentation
terraform-policy
UTILITY SKILL — INVOKES: tfpolicy-author | tfpolicy-test
USE FOR:
- Writing a new
.policy.hclpolicy from a description or requirement - Converting a
.sentinelpolicy to Terraform Policy - Writing or debugging a
.policytest.hcltest file - Migrating a Sentinel policy library to Terraform Policy
DO NOT USE FOR:
- Writing
.tftest.hclfiles for Terraform modules — useterraform-test - General Terraform HCL authoring — use
terraform-style-guide
Routing
| Task | Sub-skill |
|---|---|
Write or convert a .policy.hcl policy | tfpolicy-author |
Write or debug a .policytest.hcl test | tfpolicy-test |
Examples
- "Block EC2 instances without encryption" → tfpolicy-author
- "Convert this Sentinel policy to tfpolicy" → tfpolicy-author
- "Write a policytest for my EBS policy" → tfpolicy-test
Troubleshooting
- Wrong skill triggered? Load the sub-skill directly from the routing table above.
npx skills add hashicorp/agent-skills/terraform/terraform-policy/skills/tfpolicy-author
npx skills add hashicorp/agent-skills/terraform/terraform-policy/skills/tfpolicy-test
GitHub Repository
Frequently asked questions
What is the terraform-policy skill?
terraform-policy is a Claude Skill by hashicorp. Skills package instructions and resources that Claude loads on demand, so Claude can perform terraform-policy-related tasks without extra prompting.
How do I install terraform-policy?
Use the install commands on this page: add terraform-policy to Claude Code as a plugin, or clone its repository into your skills directory, then restart Claude so it picks up the skill.
What category does terraform-policy belong to?
terraform-policy is in the Testing category, tagged testing.
Is terraform-policy free to use?
Yes. terraform-policy is listed on AIMCP and free to install.
Related Skills
This Claude Skill runs the lm-evaluation-harness to benchmark LLMs across 60+ standardized academic tasks like MMLU and GSM8K. It's designed for developers to compare model quality, track training progress, or report academic results. The tool supports various backends including HuggingFace and vLLM models.
This skill provides comprehensive knowledge for implementing Cloudflare Cron Triggers to schedule Workers using cron expressions. It covers setting up periodic tasks, maintenance jobs, and automated workflows while handling common issues like invalid cron expressions and timezone problems. Developers can use it for configuring scheduled handlers, testing cron triggers, and integrating with Workflows and Green Compute.
This Claude Skill provides a Playwright-based toolkit for testing local web applications through Python scripts. It enables frontend verification, UI debugging, screenshot capture, and log viewing while managing server lifecycles. Use it for browser automation tasks but run scripts directly rather than reading their source code to avoid context pollution.
This skill helps developers complete finished work by verifying tests pass and then presenting structured integration options. It guides the workflow for merging, creating PRs, or cleaning up branches after implementation is done. Use it when your code is ready and tested to systematically finalize the development process.
