provider-test-patterns

provider-test-patterns is a skill for Claude Code from hashicorp/agent-skills. It costs 133 tokens per session (2,965 once invoked), scanned A, original, MPL-2.0.

A collection of patterns for writing Terraform provider acceptance tests with the Plugin Framework. These tests apply real configurations, refresh them, check for unwanted changes, and destroy the infrastructure.

In plain words
What is it for?
Use it to structure TestCase and TestStep tests, check plans and state, compare values across steps, test imports, handle sweepers, and test ephemeral resources.
Why use it?
It helps tests verify the full resource lifecycle rather than only checking isolated values.

Skill for Claude Code ✓ vendor

Written for Claude Code: shipped in a Claude Code plugin.

Part of the terraform plugin — 16 skills shipped together

Good fit Use it to structure TestCase and TestStep tests, check plans and state, compare values across steps, test imports, handle sweepers, and test ephemeral resources.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hashicorp/agent-skills/provider-test-patterns
About the project

HashiCorp Agent Skills is a collection of reusable instructions and plugins that help coding agents work with Terraform and Packer. Developers use it to add HashiCorp product workflows to supported coding-agent tools, either individually or as product bundles.

hashicorp/agent-skills · 947 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add hashicorp/agent-skills --skill provider-test-patterns
Clone the repo
git clone --depth 1 https://github.com/hashicorp/agent-skills

Made for: Claude Code.

Or install terraform, the plugin that ships this one along with the rest of its 16 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for provider-test-patterns

README.md
[![agentmods](https://agentmods.dev/badge/skills/hashicorp/agent-skills/provider-test-patterns/github.svg)](https://agentmods.dev/skills/hashicorp/agent-skills/provider-test-patterns)
Your own site
<a href="https://agentmods.dev/skills/hashicorp/agent-skills/provider-test-patterns"><img src="https://agentmods.dev/badge/skills/hashicorp/agent-skills/provider-test-patterns/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for provider-test-patterns

Your own site · 80×15
<a href="https://agentmods.dev/skills/hashicorp/agent-skills/provider-test-patterns"><img src="https://agentmods.dev/badge/skills/hashicorp/agent-skills/provider-test-patterns.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 133 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,965 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 15 Sept 2026
  • Snyk pass 15 Sept 2026
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00133 $0.02965
Opus 5.5 $0.00053 $0.01186
Sonnet 5.5 $0.00027 $0.00593
Haiku 4.5 $0.00013 $0.00297

Measured 3mo ago against content hash 9abc623c2523, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

provider-test-patterns scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/terraform/skills/provider-test-patterns/SKILL.md · 416 lines

How it starts

The opening of the file, as written. The whole thing — 416 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Provider Acceptance Test Patterns

Patterns for writing acceptance tests using terraform-plugin-testing with the Plugin Framework.

Source: HashiCorp Testing Patterns

References (load when needed):

  • references/checks.md — statecheck, plancheck, knownvalue types, tfjsonpath, comparers
  • references/sweepers.md — sweeper setup, TestMain, dependencies
  • references/ephemeral.md — ephemeral resource testing, echoprovider, multi-step patterns

Test Lifecycle

The framework runs each TestStep through: plan → apply → refresh → final plan. If the final plan shows a diff, the test fails (unless ExpectNonEmptyPlan is set). After all steps, destroy runs followed by CheckDestroy. This means every test automatically verifies that configurations apply cleanly and produce no drift — no assertions needed for that.


Test Function Structure

func TestAccExample_basic(t *testing.T) {
    var widget example.Widget
    rName := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)
    resourceName := "example_widget.test"

    resource.ParallelTest(t, resource.TestCase{
        PreCheck:                 func() { testAccPreCheck(t) },
        ProtoV6ProviderFactories: testAccProtoV6ProviderFactories,
        CheckDestroy:             testAccCheckExampleDestroy,
        Steps: []resource.TestStep{
            {
                Config: testAccExampleConfig_basic(rName),
                ConfigStateChecks: []statecheck.StateCheck{
                    stateCheckExampleExists(resourceName, &widget),
                    statecheck.ExpectKnownValue(resourceName,
                        tfjsonpath.New("name"), knownvalue.StringExact(rName)),
                    statecheck.ExpectKnownValue(resourceName,
                        tfjsonpath.New("id"), knownvalue.NotNull()),
                },
            },
        },
    })
}

Read the full file on GitHub · 416 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 416 lines · 133 tokens per session scan A 9abc623c2523

Subscribe to this mod's changes

provider-test-patterns is a skill published in the GitHub repository hashicorp/agent-skills (947 stars, last pushed 28d ago), licensed MPL-2.0. It adds 133 tokens to every session and 2,965 once invoked, about $0.0005 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

provider-test-patterns compared with skills from other repositories

provider-test-patterns next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
provider-test-patternshashicorp/agent-skillsSkill94728d agoMPL-2.0A133Claude Code
imagegenopenai/codexSkill137ktodayApache-2.0A113Codex
playwright-climicrosoft/playwrightSkill102ktodayApache-2.0A19Claude Code
browser-automationopenclaw/openclawSkill396ktodayMITA36Claude Code
free-llm-apismnfst/awesome-free-llm-apisSkill15kyesterdayCC0-1.0A113Claude Code, Codex
systematic-debuggingobra/superpowersSkill331k4d agoMITA21Claude Code
next-cache-components-adoptionvercel/next.jsSkill144ktodayMITA95Claude Code