mcpbeat

Terraform Policy

hashicorp/terraform-policy

Write, test, or convert Terraform Policy files (.policy.hcl, .policytest.hcl, Sentinel→tfpolicy). Triggers: policy.hcl, policytest, convert sentinel, tfpolicy, write a policy.

84k tokens
context cost
the whole folder, loaded on every use
59
files
instructions only
0
copies elsewhere
how many repositories repackaged it
19 d ago
last touched
this folder, not the whole repository

Install

one command, takes just this skill from the repository
npx skills add https://github.com/hashicorp/agent-skills --skill terraform-policy

The instruction itself

6 sections, as written by the author

terraform-policy

UTILITY SKILL — INVOKES: tfpolicy-author | tfpolicy-test

USE FOR:

  • Writing a new .policy.hcl policy from a description or requirement
  • Converting a .sentinel policy to Terraform Policy
  • Writing or debugging a .policytest.hcl test file
  • Migrating a Sentinel policy library to Terraform Policy

DO NOT USE FOR:

  • Writing .tftest.hcl files for Terraform modules — use terraform-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

How to use it

Copy the folder

Take hashicorp/terraform-policy from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.

Install what it needs

The instructions reference npx. Without those the skill loads but fails at the first command.